File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ edition = "2018"
77# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
88
99[dependencies ]
10- riscv = { git = " https://github.com/rcore-os/riscv" , features = [ " inline-asm " ] }
10+ riscv = { git = " https://github.com/rcore-os/riscv" , rev = " 21e32ee " }
1111spin = " 0.5.2"
1212buddy_system_allocator = " 0.3"
1313xmas-elf = " 0.6"
Original file line number Diff line number Diff line change @@ -34,6 +34,6 @@ qemu: build
3434 -machine virt \
3535 -nographic \
3636 -bios default \
37- -device loader,file= $(bin ) ,addr=0x80200000
37+ -kernel $(bin )
3838
3939run : build qemu
Original file line number Diff line number Diff line change @@ -32,9 +32,14 @@ pub fn init() {
3232}
3333
3434pub 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+
3541 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 ) ;
3843}
3944
4045pub unsafe fn enable_serial_interrupt ( ) {
Original file line number Diff line number Diff line change @@ -55,8 +55,8 @@ pub fn kernel_remap() {
5555 None ,
5656 ) ;
5757 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 ) ,
6060 MemoryAttr :: default ( ) ,
6161 Linear :: new ( PHYSICAL_MEMORY_OFFSET ) ,
6262 None ,
You can’t perform that action at this time.
0 commit comments