diff --git a/kernel/src/arch/riscv32/cpu.rs b/kernel/src/arch/riscv32/cpu.rs index b0a4836..f519e6f 100644 --- a/kernel/src/arch/riscv32/cpu.rs +++ b/kernel/src/arch/riscv32/cpu.rs @@ -24,7 +24,7 @@ pub unsafe fn has_started(cpu_id: usize) -> bool { } pub unsafe fn start_others(hart_mask: usize) { - for cpu_id in 0..MAX_CPU_NUM { + for cpu_id in 0..32 { if (hart_mask >> cpu_id) & 1 != 0 { write_volatile(&mut STARTED[cpu_id], true); } diff --git a/kernel/src/fs/stdio.rs b/kernel/src/fs/stdio.rs index 2595926..3fc6062 100644 --- a/kernel/src/fs/stdio.rs +++ b/kernel/src/fs/stdio.rs @@ -43,6 +43,11 @@ lazy_static! { pub static ref STDOUT: Arc = Arc::new(Stdout::default()); } +const TCGETS: u32 = 0x5401; +const TIOCGPGRP: u32 = 0x540F; +const TIOCSPGRP: u32 = 0x5410; +const TIOCGWINSZ: u32 = 0x5413; + // TODO: better way to provide default impl? macro_rules! impl_inode { () => { @@ -59,7 +64,7 @@ macro_rules! impl_inode { fn get_entry(&self, _id: usize) -> Result { Err(FsError::NotDir) } fn io_control(&self, cmd: u32, data: u32) -> Result<()> { match cmd { - TIOCGWINSZ => { + TCGETS | TIOCGWINSZ | TIOCGPGRP | TIOCSPGRP => { // pretend to be tty Ok(()) },