@@ -18,55 +18,100 @@ cargo qemu
18
18
19
19
When running ` cargo qemu ` , the test kernel will build and run. Expected output should be:
20
20
21
- ```
22
- [rustsbi] RustSBI version 0.2.2 , adapting to RISC-V SBI v1.0.0
21
+ ``` plaintext
22
+ [rustsbi] RustSBI version 0.4.0-alpha.1 , adapting to RISC-V SBI v1.0.0
23
23
.______ __ __ _______.___________. _______..______ __
24
24
| _ \ | | | | / | | / || _ \ | |
25
25
| |_) | | | | | | (----`---| |----`| (----`| |_) || |
26
26
| / | | | | \ \ | | \ \ | _ < | |
27
27
| |\ \----.| `--' |.----) | | | .----) | | |_) || |
28
28
| _| `._____| \______/ |_______/ |__| |_______/ |______/ |__|
29
-
30
- [rustsbi] Implementation: RustSBI-QEMU Version 0.1.1
31
- [rustsbi-dtb] Hart count: cluster0 with 8 cores
32
- [rustsbi] misa: RV64ACDFIMSU
33
- [rustsbi] mideleg: ssoft, stimer, sext (0x222)
34
- [rustsbi] medeleg: ima, ia, bkpt, la, sa, uecall, ipage, lpage, spage (0xb1ab)
35
- [rustsbi] pmp0: 0x10000000 ..= 0x10001fff (rw-)
36
- [rustsbi] pmp1: 0x2000000 ..= 0x200ffff (rw-)
37
- [rustsbi] pmp2: 0xc000000 ..= 0xc3fffff (rw-)
38
- [rustsbi] pmp3: 0x80000000 ..= 0x8fffffff (rwx)
39
- [rustsbi] enter supervisor 0x80200000
40
- << Test-kernel: Hart id = 0, DTB physical address = 0x87000000
41
- >> Test-kernel: Testing base extension
42
- << Test-kernel: Base extension version: 1
43
- << Test-kernel: SBI specification version: 1.0
44
- << Test-kernel: SBI implementation Id: 4
45
- << Test-kernel: SBI implementation version: 202
46
- << Test-kernel: Device mvendorid: 0
47
- << Test-kernel: Device marchid: 0
48
- << Test-kernel: Device mimpid: 0
49
- >> Test-kernel: Testing SBI instruction emulation
50
- << Test-kernel: Current time: d78c9
51
- << Test-kernel: Time after operation: da00f
52
- >> Test-kernel: Trigger illegal exception
53
- << Test-kernel: Value of scause: Exception(IllegalInstruction)
54
- << Test-kernel: Illegal exception delegate success
55
- >> Stop hart 3, return value 0
56
- >> Hart 0 state return value: 0
57
- >> Hart 1 state return value: 4
58
- >> Hart 2 state return value: 4
59
- >> Hart 3 state return value: 1
60
- >> Hart 4 state return value: 0
61
- << Test-kernel: test for hart 0 success, wake another hart
62
- >> Wake hart 1, sbi return value 0
63
- >> Start test for hart 1, retentive suspend return value 0
64
- >> Wake hart 2, sbi return value 0
65
- << The parameter passed to hart 2 resume is: 0x4567890a
66
- >> Start hart 3 with parameter 0x12345678
67
- >> SBI return value: 0
68
- << The parameter passed to hart 3 start is: 0x12345678
69
- << Test-kernel: All hart SBI test SUCCESS, shutdown
29
+ [rustsbi] Implementation : RustSBI-QEMU Version 0.2.0-alpha.2
30
+ [rustsbi] Platform Name : riscv-virtio,qemu
31
+ [rustsbi] Platform SMP : 8
32
+ [rustsbi] Platform Memory : 0x80000000..0x88000000
33
+ [rustsbi] Boot HART : 6
34
+ [rustsbi] Device Tree Region : 0x87e00000..0x87e01a8e
35
+ [rustsbi] Firmware Address : 0x80000000
36
+ [rustsbi] Supervisor Address : 0x80200000
37
+ [rustsbi] pmp01: 0x00000000..0x80000000 (-wr)
38
+ [rustsbi] pmp02: 0x80000000..0x80200000 (---)
39
+ [rustsbi] pmp03: 0x80200000..0x88000000 (xwr)
40
+ [rustsbi] pmp04: 0x88000000..0x00000000 (-wr)
41
+
42
+ _____ _ _ __ _
43
+ |_ _|__ ___| |_ | |/ /___ _ __ _ __ ___| |
44
+ | |/ _ \/ __| __| | ' // _ \ '__| '_ \ / _ \ |
45
+ | | __/\__ \ |_ | . \ __/ | | | | | __/ |
46
+ |_|\___||___/\__| |_|\_\___|_| |_| |_|\___|_|
47
+ ================================================
48
+ | boot hart id | 6 |
49
+ | smp | 8 |
50
+ | timebase frequency | 10000000 Hz |
51
+ | dtb physical address | 0x87e00000 |
52
+ ------------------------------------------------
53
+ [ INFO] Testing `Base`
54
+ [ INFO] sbi spec version = 2.0
55
+ [ INFO] sbi impl = RustSBI
56
+ [ INFO] sbi impl version = 0x400
57
+ [ INFO] sbi extensions = [Base, TIME, sPI, HSM, SRST]
58
+ [ INFO] mvendor id = 0x0
59
+ [ INFO] march id = 0x70200
60
+ [ INFO] mimp id = 0x70200
61
+ [ INFO] Sbi `Base` test pass
62
+ [ INFO] Testing `TIME`
63
+ [ INFO] read time register successfuly, set timer +1s
64
+ [ INFO] timer interrupt delegate successfuly
65
+ [ INFO] Sbi `TIME` test pass
66
+ [ INFO] Testing `sPI`
67
+ [ INFO] send ipi successfuly
68
+ [ INFO] Sbi `sPI` test pass
69
+ [ INFO] Testing `HSM`
70
+ [ INFO] Testing harts: [0, 1, 2, 3]
71
+ [DEBUG] hart 0 started
72
+ [DEBUG] hart 0 suspended nonretentive
73
+ [DEBUG] hart 1 started
74
+ [DEBUG] hart 1 suspended nonretentive
75
+ [DEBUG] hart 2 started
76
+ [DEBUG] hart 2 suspended nonretentive
77
+ [DEBUG] hart 3 started
78
+ [DEBUG] hart 3 suspended nonretentive
79
+ [DEBUG] hart 0 resumed
80
+ [DEBUG] hart 0 suspended retentive
81
+ [DEBUG] hart 0 stopped
82
+ [DEBUG] hart 1 resumed
83
+ [DEBUG] hart 1 suspended retentive
84
+ [DEBUG] hart 1 stopped
85
+ [DEBUG] hart 2 resumed
86
+ [DEBUG] hart 2 suspended retentive
87
+ [DEBUG] hart 2 stopped
88
+ [DEBUG] hart 3 resumed
89
+ [DEBUG] hart 3 suspended retentive
90
+ [DEBUG] hart 3 stopped
91
+ [ INFO] Testing Pass: [0, 1, 2, 3]
92
+ [ INFO] Testing harts: [4, 5, 7]
93
+ [DEBUG] hart 4 started
94
+ [DEBUG] hart 4 suspended nonretentive
95
+ [DEBUG] hart 5 started
96
+ [DEBUG] hart 5 suspended nonretentive
97
+ [DEBUG] hart 7 started
98
+ [DEBUG] hart 7 suspended nonretentive
99
+ [DEBUG] hart 4 resumed
100
+ [DEBUG] hart 4 suspended retentive
101
+ [DEBUG] hart 4 stopped
102
+ [DEBUG] hart 5 resumed
103
+ [DEBUG] hart 5 suspended retentive
104
+ [DEBUG] hart 5 stopped
105
+ [DEBUG] hart 7 resumed
106
+ [DEBUG] hart 7 suspended retentive
107
+ [DEBUG] hart 7 stopped
108
+ [ INFO] Testing Pass: [4, 5, 7]
109
+ [ INFO] Sbi `HSM` test pass
110
+ [ INFO] Testing `DBCN`
111
+ Hello, world!
112
+ [ INFO] writing slice successfuly
113
+ [ INFO] reading 0 bytes from console
114
+ [ INFO] Sbi `DBCN` test pass
70
115
```
71
116
72
117
## Run test kernel
@@ -75,7 +120,7 @@ When running `cargo qemu`, the test kernel will build and run. Expected output s
75
120
76
121
You should have ` cargo-binutils ` installed.
77
122
78
- ```
123
+ ``` shell
79
124
cargo install cargo-binutils
80
125
```
81
126
@@ -87,10 +132,10 @@ Run with:
87
132
cargo test
88
133
```
89
134
90
- It will run RustSBI-QEMU with a test kernel. The test kernel will test all SBI functions,
135
+ It will run RustSBI-QEMU with a test kernel. The test kernel will test all SBI functions,
91
136
its command emulation and other features. If it succeeds, there would be output like:
92
137
93
- ```
138
+ ``` plaintext
94
139
running 1 test
95
140
Finished dev [unoptimized + debuginfo] target(s) in 0.14s
96
141
Compiling test-kernel v0.1.0 (D:\RustProjects\rustsbi-qemu\test-kernel)
@@ -104,32 +149,32 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; fini
104
149
105
150
1 . What kind of kernel does this project support?
106
151
107
- The rustsbi-qemu project supports raw binary kernels for educational or
108
- competition use. This project itself is only a showcase example illustrating how
109
- implementations should use RustSBI, it does not include a Linux boot support.
110
- You may visit downstream bootloader projects for a Linux capable bootloader.
152
+ The rustsbi-qemu project supports raw binary kernels for educational or
153
+ competition use. This project itself is only a showcase example illustrating how
154
+ implementations should use RustSBI, it does not include a Linux boot support.
155
+ You may visit downstream bootloader projects for a Linux capable bootloader.
111
156
112
157
2 . How to enable hypervisor H extension on QEMU?
113
158
114
- You should use these following line of parameters:
159
+ You should use these following line of parameters:
115
160
116
- ``` rust
117
- command . args (& [" -cpu" , " rv64,x-h=true" ]);
118
- ```
161
+ ``` rust
162
+ command . args (& [" -cpu" , " rv64,x-h=true" ]);
163
+ ```
164
+
165
+ ... to enable H extension on QEMU software.
119
166
120
- ... to enable H extension on QEMU software.
121
-
122
- The H extension is enabled by default when QEMU version >= 7.0.0.
167
+ The H extension is enabled by default when QEMU version >= 7.0.0.
123
168
124
169
3 . What is the minimum supported Rust version of this package?
125
170
126
- You should build RustSBI-QEMU on nightly at least ` rustc 1.66.0-nightly (a24a020e6 2022-10-18) ` .
171
+ You should build RustSBI-QEMU on nightly at least ` rustc 1.66.0-nightly (a24a020e6 2022-10-18) ` .
127
172
128
- ## License
173
+ ## License
129
174
130
175
This project is licensed under Mulan PSL v2.
131
176
132
- ``` text
177
+ ``` plaintext
133
178
Copyright (c) 2021-2023 RustSBI Team
134
179
RustSBI-QEMU is licensed under Mulan PSL v2.
135
180
You can use this software according to the terms and conditions of the Mulan PSL v2.
0 commit comments