Skip to content

Commit 027b413

Browse files
committed
Adding ext4 filesystem instructions
1 parent 6de92a9 commit 027b413

File tree

2 files changed

+217
-1
lines changed

2 files changed

+217
-1
lines changed

bsp/xuantie/virt64/c906/README.md

Lines changed: 109 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ English | [中文](./README_cn.md)
1616
- [3.1. Installing QEMU](#31-installing-qemu)
1717
- [3.2. Running QEMU](#32-running-qemu)
1818
- [3.2.1. Running RT-Thread Smart version](#321-running-rt-thread-smart-version)
19+
- [3.2.2. Running RT-Thread Smart Edition + Root File System](#322-running-rt-thread-smart-edition--root-file-system)
20+
- [4. Contact Information](#4-contact-information)
1921

2022
<!-- /TOC -->
2123

@@ -227,4 +229,110 @@ Hello RISC-V
227229
msh />
228230
```
229231

230-
For inquiries, please contact: <[email protected]>
232+
### 3.2.2. Running RT-Thread Smart Edition + Root File System
233+
234+
For the Smart kernel, you can also mount the root filesystem during the boot process by specifying the path to the root filesystem image when executing the `run.sh` script.
235+
236+
Note that the kernel supports fat by default, and if you want to mount an ext4 filesystem, you need to install the lwext4 package, even if you can `PKG_USING_LWEXT4`
237+
> the menuconfig path is (Top) -> RT-Thread online packages -> system). packages -> lwext4: an excellent choice of ext2/3/4 filesystem for microcontrollers.
238+
239+
If you can't find the package in the menu, you can exit menuconfig and run `pkgs --upgrade` to update the package index before trying to enable the package.
240+
After checking this option, you will also need to update the software and install the source code into the packages directory of bsp as follows (you only need to do this once):
241+
242+
```shell
243+
source ~/.env/env.sh
244+
pkgs --update
245+
```
246+
247+
Save and recompile the kernel.
248+
249+
For more information on how to make a root filesystem, please refer to <https://github.com/RT-Thread/userapps/blob/main/README.md>, which will not be repeated here.
250+
251+
The example is as follows:
252+
253+
```shell
254+
$ bash run.sh ext4.img
255+
256+
OpenSBI v1.4
257+
____ _____ ____ _____
258+
/ __ \ / ____| _ \_ _|
259+
| | | |_ __ ___ _ __ | (___ | |_) || |
260+
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
261+
| |__| | |_) | __/ | | |____) | |_) || |_
262+
\____/| .__/ \___|_| |_|_____/|____/_____|
263+
| |
264+
|_|
265+
266+
Platform Name : riscv-virtio,qemu
267+
Platform Features : medeleg
268+
Platform HART Count : 1
269+
Platform IPI Device : aclint-mswi
270+
Platform Timer Device : aclint-mtimer @ 10000000Hz
271+
Platform Console Device : uart8250
272+
Platform HSM Device : ---
273+
Platform PMU Device : ---
274+
Platform Reboot Device : syscon-reboot
275+
Platform Shutdown Device : syscon-poweroff
276+
Platform Suspend Device : ---
277+
Platform CPPC Device : ---
278+
Firmware Base : 0x80000000
279+
Firmware Size : 323 KB
280+
Firmware RW Offset : 0x40000
281+
Firmware RW Size : 67 KB
282+
Firmware Heap Offset : 0x48000
283+
Firmware Heap Size : 35 KB (total), 2 KB (reserved), 9 KB (used), 23 KB (free)
284+
Firmware Scratch Size : 4096 B (total), 328 B (used), 3768 B (free)
285+
Runtime SBI Version : 2.0
286+
287+
Domain0 Name : root
288+
Domain0 Boot HART : 0
289+
Domain0 HARTs : 0*
290+
Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W)
291+
Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
292+
Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
293+
Domain0 Region03 : 0x0000000080040000-0x000000008005ffff M: (R,W) S/U: ()
294+
Domain0 Region04 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: ()
295+
Domain0 Region05 : 0x000000000c400000-0x000000000c5fffff M: (I,R,W) S/U: (R,W)
296+
Domain0 Region06 : 0x000000000c000000-0x000000000c3fffff M: (I,R,W) S/U: (R,W)
297+
Domain0 Region07 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
298+
Domain0 Next Address : 0x0000000080200000
299+
Domain0 Next Arg1 : 0x000000008fe00000
300+
Domain0 Next Mode : S-mode
301+
Domain0 SysReset : yes
302+
Domain0 SysSuspend : yes
303+
304+
Boot HART ID : 0
305+
Boot HART Domain : root
306+
Boot HART Priv Version : v1.10
307+
Boot HART Base ISA : rv64imafdc
308+
Boot HART ISA Extensions : zicntr,zihpm
309+
Boot HART PMP Count : 16
310+
Boot HART PMP Granularity : 2 bits
311+
Boot HART PMP Address Bits: 54
312+
Boot HART MHPM Info : 16 (0x0007fff8)
313+
Boot HART MIDELEG : 0x0000000000000222
314+
Boot HART MEDELEG : 0x000000000000b109
315+
heap: [0x003404c0 - 0x043404c0]
316+
317+
\ | /
318+
- RT - Thread Smart Operating System
319+
/ | \ 5.2.1 build Jun 13 2025 09:43:35
320+
2006 - 2024 Copyright by RT-Thread team
321+
[I/utest] utest is initialize success.
322+
[I/utest] total utest testcase num: (1)
323+
[I/drivers.serial] Using /dev/ttyS0 as default console
324+
[W/DFS.fs] mount / failed with file system type: elm
325+
file system initialization done!
326+
Hello RISC-V
327+
msh />/ #
328+
/ #
329+
/ # ls
330+
bin lib proc sbin usr
331+
dev lost+found root services var
332+
etc mnt run tmp
333+
/ #
334+
```
335+
336+
## 4. Contact Information
337+
338+
If you are interested in making an inquiry, please contact: <[email protected]>

bsp/xuantie/virt64/c906/README_cn.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
- [3.1. 安装 QEMU](#31-安装-qemu)
1818
- [3.2. 运行 QEMU](#32-运行-qemu)
1919
- [3.2.1. 运行 RT-Thread Smart 版](#321-运行-rt-thread-smart-版)
20+
- [3.2.2. 运行 RT-Thread Smart 版 + 根文件系统](#322-运行-rt-thread-smart-版--根文件系统)
21+
- [4. 联系人信息](#4-联系人信息)
2022

2123
<!-- /TOC -->
2224

@@ -229,4 +231,110 @@ Hello RISC-V
229231
msh />
230232
```
231233

234+
### 3.2.2. 运行 RT-Thread Smart 版 + 根文件系统
235+
236+
对于 Smart 版本的内核,也可以在执行 `run.sh` 脚本时指定根文件系统镜像文件的路径在启动过程中挂载根文件系统。
237+
238+
需要注意的是,内核默认支持 fat, 如果要挂载 ext4 的文件系统,则还需要额外安装 lwext4 软件包,即使能 `PKG_USING_LWEXT4`
239+
>具体 menuconfig 路径是 (Top) -> RT-Thread online packages -> system packages -> lwext4: an excellent choice of ext2/3/4 filesystem for microcontrollers
240+
241+
如果在菜单中找不到该软件包,可以退出 menuconfig 并执行 `pkgs --upgrade` 更新软件包索引后再尝试使能软件包。
242+
勾选该选项后还需要执行如下操作更新软件并安装源码到 bsp 的 packages 目录下(该操作只要执行一次即可):
243+
244+
```shell
245+
source ~/.env/env.sh
246+
pkgs --update
247+
```
248+
249+
保存后重新编译内核。
250+
251+
有关如何制作根文件系统,请参考 <https://github.com/RT-Thread/userapps/blob/main/README.md>,这里不再赘述。
252+
253+
示例如下:
254+
255+
```shell
256+
$ bash run.sh ext4.img
257+
258+
OpenSBI v1.4
259+
____ _____ ____ _____
260+
/ __ \ / ____| _ \_ _|
261+
| | | |_ __ ___ _ __ | (___ | |_) || |
262+
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
263+
| |__| | |_) | __/ | | |____) | |_) || |_
264+
\____/| .__/ \___|_| |_|_____/|____/_____|
265+
| |
266+
|_|
267+
268+
Platform Name : riscv-virtio,qemu
269+
Platform Features : medeleg
270+
Platform HART Count : 1
271+
Platform IPI Device : aclint-mswi
272+
Platform Timer Device : aclint-mtimer @ 10000000Hz
273+
Platform Console Device : uart8250
274+
Platform HSM Device : ---
275+
Platform PMU Device : ---
276+
Platform Reboot Device : syscon-reboot
277+
Platform Shutdown Device : syscon-poweroff
278+
Platform Suspend Device : ---
279+
Platform CPPC Device : ---
280+
Firmware Base : 0x80000000
281+
Firmware Size : 323 KB
282+
Firmware RW Offset : 0x40000
283+
Firmware RW Size : 67 KB
284+
Firmware Heap Offset : 0x48000
285+
Firmware Heap Size : 35 KB (total), 2 KB (reserved), 9 KB (used), 23 KB (free)
286+
Firmware Scratch Size : 4096 B (total), 328 B (used), 3768 B (free)
287+
Runtime SBI Version : 2.0
288+
289+
Domain0 Name : root
290+
Domain0 Boot HART : 0
291+
Domain0 HARTs : 0*
292+
Domain0 Region00 : 0x0000000000100000-0x0000000000100fff M: (I,R,W) S/U: (R,W)
293+
Domain0 Region01 : 0x0000000010000000-0x0000000010000fff M: (I,R,W) S/U: (R,W)
294+
Domain0 Region02 : 0x0000000002000000-0x000000000200ffff M: (I,R,W) S/U: ()
295+
Domain0 Region03 : 0x0000000080040000-0x000000008005ffff M: (R,W) S/U: ()
296+
Domain0 Region04 : 0x0000000080000000-0x000000008003ffff M: (R,X) S/U: ()
297+
Domain0 Region05 : 0x000000000c400000-0x000000000c5fffff M: (I,R,W) S/U: (R,W)
298+
Domain0 Region06 : 0x000000000c000000-0x000000000c3fffff M: (I,R,W) S/U: (R,W)
299+
Domain0 Region07 : 0x0000000000000000-0xffffffffffffffff M: () S/U: (R,W,X)
300+
Domain0 Next Address : 0x0000000080200000
301+
Domain0 Next Arg1 : 0x000000008fe00000
302+
Domain0 Next Mode : S-mode
303+
Domain0 SysReset : yes
304+
Domain0 SysSuspend : yes
305+
306+
Boot HART ID : 0
307+
Boot HART Domain : root
308+
Boot HART Priv Version : v1.10
309+
Boot HART Base ISA : rv64imafdc
310+
Boot HART ISA Extensions : zicntr,zihpm
311+
Boot HART PMP Count : 16
312+
Boot HART PMP Granularity : 2 bits
313+
Boot HART PMP Address Bits: 54
314+
Boot HART MHPM Info : 16 (0x0007fff8)
315+
Boot HART MIDELEG : 0x0000000000000222
316+
Boot HART MEDELEG : 0x000000000000b109
317+
heap: [0x003404c0 - 0x043404c0]
318+
319+
\ | /
320+
- RT - Thread Smart Operating System
321+
/ | \ 5.2.1 build Jun 13 2025 09:43:35
322+
2006 - 2024 Copyright by RT-Thread team
323+
[I/utest] utest is initialize success.
324+
[I/utest] total utest testcase num: (1)
325+
[I/drivers.serial] Using /dev/ttyS0 as default console
326+
[W/DFS.fs] mount / failed with file system type: elm
327+
file system initialization done!
328+
Hello RISC-V
329+
msh />/ #
330+
/ #
331+
/ # ls
332+
bin lib proc sbin usr
333+
dev lost+found root services var
334+
etc mnt run tmp
335+
/ #
336+
```
337+
338+
## 4. 联系人信息
339+
232340
如有意向咨询请联系:<[email protected]>

0 commit comments

Comments
 (0)