diff --git a/kernel/src/arch/mipsel/board/thinpad/consts.rs b/kernel/src/arch/mipsel/board/thinpad/consts.rs index b59309a..db1971f 100644 --- a/kernel/src/arch/mipsel/board/thinpad/consts.rs +++ b/kernel/src/arch/mipsel/board/thinpad/consts.rs @@ -1,3 +1,3 @@ /// board specific constants pub const MEMORY_END: usize = 0x8080_0000; -pub const KERNEL_HEAP_SIZE: usize = 0x0020_0000; +pub const KERNEL_HEAP_SIZE: usize = 0x0038_0000; diff --git a/kernel/src/arch/mipsel/interrupt.rs b/kernel/src/arch/mipsel/interrupt.rs index 56757c4..60abde3 100644 --- a/kernel/src/arch/mipsel/interrupt.rs +++ b/kernel/src/arch/mipsel/interrupt.rs @@ -29,6 +29,9 @@ pub fn init() { status.enable_soft_int1(); // Enable clock interrupt status.enable_hard_int5(); + // Enable serial interrupt + #[cfg(feature = "board_thinpad")] + status.enable_hard_int0(); cp0::status::write(status); } @@ -209,6 +212,11 @@ fn reserved_inst(tf: &mut TrapFrame) -> bool { let sel = (inst >> 6) & 0b111; let format = inst & 0b111111; + if inst == 0x42000020 { + // ignore WAIT + return true; + } + if opcode == 0b011111 && format == 0b111011 { // RDHWR if rd == 29 && sel == 0 { diff --git a/kernel/src/shell.rs b/kernel/src/shell.rs index 000ad63..74b6330 100644 --- a/kernel/src/shell.rs +++ b/kernel/src/shell.rs @@ -6,7 +6,7 @@ use crate::process::*; use alloc::string::String; use alloc::vec::Vec; -#[cfg(not(feature = "run_cmdline"))] +#[cfg(not(any(feature = "run_cmdline", feature = "board_thinpad")))] pub fn run_user_shell() { if let Ok(inode) = ROOT_INODE.lookup("busybox") { let data = inode.read_as_vec().unwrap(); @@ -21,6 +21,21 @@ pub fn run_user_shell() { } } +#[cfg(feature = "board_thinpad")] +pub fn run_user_shell() { + if let Ok(inode) = ROOT_INODE.lookup("sh") { + let data = inode.read_as_vec().unwrap(); + processor().manager().add(Thread::new_user( + data.as_slice(), + "sh", + vec!["sh".into()], + Vec::new(), + )); + } else { + processor().manager().add(Thread::new_kernel(shell, 0)); + } +} + #[cfg(feature = "run_cmdline")] pub fn run_user_shell() { let cmdline = CMDLINE.read();