Skip to content

Commit 4a9a94d

Browse files
committed
Update README
Mention experimental system emulation and explains how to build custom Linux image.
1 parent 35587c9 commit 4a9a94d

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

README.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,34 @@ If you don't want the JIT compilation feature, simply build with the following:
5858
$ make
5959
```
6060

61+
### Experimental system emulation
62+
Device Tree compiler (dtc) is required. To install it on Debian/Ubuntu Linux, enter the following command:
63+
```
64+
$ sudo apt install device-tree-compiler
65+
```
66+
For macOS, use the following command:
67+
```
68+
$ brew install dtc
69+
```
70+
71+
#### Build and run system emulation
72+
Build and run using default images (the default images will be fetched from [rv32emu-prebuilt](https://github.com/sysprog21/rv32emu-prebuilt) before running):
73+
```shell
74+
$ make ENABLE_SYSTEM=1 system
75+
```
76+
77+
Build using run using specified images:
78+
```shell
79+
$ make ENABLE_SYSTEM=1
80+
$ build/rv32emu -k <kernel_img_path> -i <rootfs_img_path> -b <dtb_path>
81+
```
82+
83+
#### Build Linux image
84+
An automated build script is provided to compile the RISC-V cross-compiler, Busybox, and Linux kernel from source. Please note that it only supports the Linux host environment. It can be found at tools/build-linux-image.sh.
85+
```
86+
$ make build-linux-img
87+
```
88+
6189
### Verify with prebuilt RISC-V ELF files
6290

6391
Run sample RV32I[M] programs:
@@ -98,7 +126,7 @@ The image containing all the necessary tools for development and testing can be
98126
* `ENABLE_FULL4G` : Full access to 4 GiB address space
99127
* `ENABLE_SDL` : Experimental Display and Event System Calls
100128
* `ENABLE_JIT` : Experimental JIT compiler
101-
* `ENABLE_SYSTEM` : Experimental system emulation, allowing booting Linux kernel
129+
* `ENABLE_SYSTEM` : Experimental system emulation, allowing booting Linux kernel. To enable this feature, additional features must also be enabled, such as `ENABLE_Zicsr`, `ENABLE_Zifencei`, `ENABLE_EXT_M`, and `ENABLE_EXT_A`. However, by default, when `ENABLE_SYSTEM` is enabled, `ENABLE_Zicsr`, `ENABLE_Zifencei`, `ENABLE_EXT_M`, and `ENABLE_EXT_A` are automatically enabled.
102130

103131
e.g., run `make ENABLE_EXT_F=0` for the build without floating-point support.
104132

@@ -145,7 +173,7 @@ For macOS users, installing `sdiff` might be required:
145173
$ brew install diffutils
146174
```
147175

148-
To run the tests for specific extension, set the environmental variable `RISCV_DEVICE` to one of `I`, `M`, `A`, `F`, `C`, `Zifencei`, `privilege`.
176+
To run the tests for specific extension, set the environmental variable `RISCV_DEVICE` to one of `I`, `M`, `A`, `F`, `C`, `Zifencei`, `privilege`, `SYSTEM`.
149177
```shell
150178
$ make arch-test RISCV_DEVICE=I
151179
```

0 commit comments

Comments
 (0)