[prev in list] [next in list] [prev in thread] [next in thread] 

List:       qemu-discuss
Subject:    Re: Using QEMU for running RISC-V programs
From:       Alex =?utf-8?Q?Benn=C3=A9e?= <alex.bennee () linaro ! org>
Date:       2021-11-12 10:07:46
Message-ID: 87ilwxhee2.fsf () linaro ! org
[Download RAW message or body]


Vincent Abraham <vincent.ahm@gmail.com> writes:

> I have installed the QEMU emulator for running a 32-bit RISC-V machine. But now I'm \
> not sure how to compile and run my own programs (C or Assembly) using QEMU. Could I \
> get some easy to understand documentation regarding this?

Installing and cross building binaries is a bit out of scope for QEMU
(although QEMU is often used to run a guest userspace with "native"
compilers if the cross compilers are hard to get hold of). The riscv32
compilers themselves are a bit of a pain to get hold of as not many
distros package them up.

Assuming you just want to run userspace code it's as simple as:

  ./qemu-riscv32 <program>

although you might want to setup binfmt_misc to automatically run your
riscv32 binaries.

-- 
Alex Bennée


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic