set correct virtio-blk irq num --> 8, now exec syscall can read file correctly, and shell can work again
This commit is contained in:
parent
c348cbdbfa
commit
45c2caf564
2 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
pub const CLOCK_FREQ: usize = 12500000;
|
||||
|
||||
pub const MMIO: &[(usize, usize)] = &[
|
||||
// (0x0010_0000, 0x00_2000), // VIRT_TEST/RTC in virt machine
|
||||
// (0x0010_0000, 0x00_2000), // VIRT_TEST/RTC in virt machine
|
||||
(0x2000000, 0x10000),
|
||||
(0xc000000, 0x210000), // VIRT_PLIC in virt machine
|
||||
(0x10000000, 0x9000), // VIRT_UART0 with GPU in virt machine
|
||||
|
@ -25,7 +25,7 @@ pub fn device_init() {
|
|||
let machine = IntrTargetPriority::Machine;
|
||||
plic.set_threshold(hart_id, supervisor, 0);
|
||||
plic.set_threshold(hart_id, machine, 1);
|
||||
for intr_src_id in [1usize, 10] {
|
||||
for intr_src_id in [8usize, 10] {
|
||||
plic.enable(hart_id, supervisor, intr_src_id);
|
||||
plic.set_priority(intr_src_id, 1);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ pub fn irq_handler() {
|
|||
let mut plic = unsafe { PLIC::new(VIRT_PLIC) };
|
||||
let intr_src_id = plic.claim(0, IntrTargetPriority::Supervisor);
|
||||
match intr_src_id {
|
||||
1 => BLOCK_DEVICE.handle_irq(),
|
||||
8 => BLOCK_DEVICE.handle_irq(),
|
||||
10 => UART.handle_irq(),
|
||||
_ => panic!("unsupported IRQ {}", intr_src_id),
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ mod task;
|
|||
mod timer;
|
||||
mod trap;
|
||||
|
||||
use syscall::create_desktop;
|
||||
// use syscall::create_desktop; //for test
|
||||
|
||||
core::arch::global_asm!(include_str!("entry.asm"));
|
||||
|
||||
|
@ -71,7 +71,7 @@ pub fn rust_main() -> ! {
|
|||
timer::set_next_trigger();
|
||||
board::device_init();
|
||||
fs::list_apps();
|
||||
syscall::create_desktop();
|
||||
//syscall::create_desktop(); //for test
|
||||
task::add_initproc();
|
||||
*DEV_NON_BLOCKING_ACCESS.exclusive_access() = true;
|
||||
task::run_tasks();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue