1
0
mirror of https://github.com/rcore-os/rCore.git synced 2024-11-23 00:16:17 +04:00

Add thinpad settings.

This commit is contained in:
Yuhao Zhou 2019-04-30 06:34:34 +08:00
parent b45d75c168
commit 2140ec6bef
3 changed files with 25 additions and 2 deletions

View File

@ -1,3 +1,3 @@
/// board specific constants /// board specific constants
pub const MEMORY_END: usize = 0x8080_0000; pub const MEMORY_END: usize = 0x8080_0000;
pub const KERNEL_HEAP_SIZE: usize = 0x0020_0000; pub const KERNEL_HEAP_SIZE: usize = 0x0038_0000;

View File

@ -29,6 +29,9 @@ pub fn init() {
status.enable_soft_int1(); status.enable_soft_int1();
// Enable clock interrupt // Enable clock interrupt
status.enable_hard_int5(); status.enable_hard_int5();
// Enable serial interrupt
#[cfg(feature = "board_thinpad")]
status.enable_hard_int0();
cp0::status::write(status); cp0::status::write(status);
} }
@ -209,6 +212,11 @@ fn reserved_inst(tf: &mut TrapFrame) -> bool {
let sel = (inst >> 6) & 0b111; let sel = (inst >> 6) & 0b111;
let format = inst & 0b111111; let format = inst & 0b111111;
if inst == 0x42000020 {
// ignore WAIT
return true;
}
if opcode == 0b011111 && format == 0b111011 { if opcode == 0b011111 && format == 0b111011 {
// RDHWR // RDHWR
if rd == 29 && sel == 0 { if rd == 29 && sel == 0 {

View File

@ -6,7 +6,7 @@ use crate::process::*;
use alloc::string::String; use alloc::string::String;
use alloc::vec::Vec; use alloc::vec::Vec;
#[cfg(not(feature = "run_cmdline"))] #[cfg(not(any(feature = "run_cmdline", feature = "board_thinpad")))]
pub fn run_user_shell() { pub fn run_user_shell() {
if let Ok(inode) = ROOT_INODE.lookup("busybox") { if let Ok(inode) = ROOT_INODE.lookup("busybox") {
let data = inode.read_as_vec().unwrap(); 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")] #[cfg(feature = "run_cmdline")]
pub fn run_user_shell() { pub fn run_user_shell() {
let cmdline = CMDLINE.read(); let cmdline = CMDLINE.read();