Hi all, I am looking for a way to emulate with gem5 in FS (Full System) mode simple C executables, compiled in RISC-V, even containing a single infinite while loop. Could someone please point me to how to do this?
Hi,
Generally, firstly you need to boot the linux on RISCV model successfully. And then you need to develop your own c application program and compile it with cross-compiler statically, then you copy the test executable to the mounted disk(The riscv OS disk, let's assume you put it on /tmp/test). Then after you re-boot the OS on RISCV, you can find the file test under /tmp/ folder.
Then just execute it by /tmp/test.
That's the general flow we can use.
Leizu
At 2024-02-01 23:15:26, "elio.vinciguerra--- via gem5-users" gem5-users@gem5.org wrote:
Hi all, I am looking for a way to emulate with gem5 in FS (Full System) mode simple C executables, compiled in RISC-V, even containing a single infinite while loop. Could someone please point me to how to do this?
Is it possible to simulate with only the C program, without linux underneath?
I recently saw that you should use the bare-metal option, but I don't really understand how to use it.
Elio
Then you can use SE mode to run every standalone executables without OS in FS mode.
S2K23
At 2024-02-02 15:21:03, "elio.vinciguerra--- via gem5-users" gem5-users@gem5.org wrote:
Is it possible to simulate with only the C program, without linux underneath?
I recently saw that you should use the bare-metal option, but I don't really understand how to use it.
Elio