File tree 4 files changed +11
-6
lines changed
4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ edition = "2018"
7
7
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8
8
9
9
[dependencies ]
10
- riscv = { git = " https://github.com/rcore-os/riscv" , features = [ " inline-asm " ] }
10
+ riscv = { git = " https://github.com/rcore-os/riscv" , rev = " 21e32ee " }
11
11
spin = " 0.5.2"
12
12
buddy_system_allocator = " 0.3"
13
13
xmas-elf = " 0.6"
Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ qemu: build
34
34
-machine virt \
35
35
-nographic \
36
36
-bios default \
37
- -device loader,file= $(bin ) ,addr=0x80200000
37
+ -kernel $(bin )
38
38
39
39
run : build qemu
Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ pub fn init() {
32
32
}
33
33
34
34
pub unsafe fn init_external_interrupt ( ) {
35
+ let hart0_s_mode_interrupt_mth: * mut u32 = access_pa_via_va ( 0x0c20_1000 ) as * mut u32 ;
36
+ hart0_s_mode_interrupt_mth. write_volatile ( 0 ) ;
37
+
38
+ let hart0_s_mode_interrupt_priority_serial_irq: * mut u32 = access_pa_via_va ( 0x0c00_0000 +4 * 0xa ) as * mut u32 ;
39
+ hart0_s_mode_interrupt_priority_serial_irq. write_volatile ( 1 ) ;
40
+
35
41
let hart0_s_mode_interrupt_enables: * mut u32 = access_pa_via_va ( 0x0c00_2080 ) as * mut u32 ;
36
- const SERIAL : u32 = 0xa ;
37
- hart0_s_mode_interrupt_enables. write_volatile ( 1 << SERIAL ) ;
42
+ hart0_s_mode_interrupt_enables. write_volatile ( 1 << 0xa ) ;
38
43
}
39
44
40
45
pub unsafe fn enable_serial_interrupt ( ) {
Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ pub fn kernel_remap() {
55
55
None ,
56
56
) ;
57
57
memory_set. push (
58
- access_pa_via_va ( 0x0c00_2000 ) ,
59
- access_pa_via_va ( 0x0c00_3000 ) ,
58
+ access_pa_via_va ( 0x0c00_0000 ) ,
59
+ access_pa_via_va ( 0x0c20_2000 ) ,
60
60
MemoryAttr :: default ( ) ,
61
61
Linear :: new ( PHYSICAL_MEMORY_OFFSET ) ,
62
62
None ,
You can’t perform that action at this time.
0 commit comments