diff --git a/.gitignore b/.gitignore index 021a5078..b2b77488 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ build target /kernel/src/arch/x86_64/interrupt/vector.asm +/kernel/src/arch/mipsel/boot/linker.ld *.gen.s *.dtb diff --git a/kernel/Makefile b/kernel/Makefile index 275d0b7f..b6620a4b 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -348,6 +348,7 @@ else ifeq ($(arch), mipsel) @for file in context entry trap ; do \ $(hostcc) -Dboard_$(board) -E src/arch/$(arch)/boot/$${file}.S -o src/arch/$(arch)/boot/$${file}.gen.s ; \ done + $(hostcc) -Dboard_$(board) -E src/arch/$(arch)/boot/linker.ld.S -o src/arch/$(arch)/boot/linker.ld @cargo xbuild $(build_args) endif diff --git a/kernel/src/arch/mipsel/board/thinpad/consts.rs b/kernel/src/arch/mipsel/board/thinpad/consts.rs index 98f0a5ec..db1971f7 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 = 0x0044_0000; +pub const KERNEL_HEAP_SIZE: usize = 0x0038_0000; diff --git a/kernel/src/arch/mipsel/boot/linker.ld b/kernel/src/arch/mipsel/boot/linker.ld.S similarity index 92% rename from kernel/src/arch/mipsel/boot/linker.ld rename to kernel/src/arch/mipsel/boot/linker.ld.S index 420430da..331b5954 100644 --- a/kernel/src/arch/mipsel/boot/linker.ld +++ b/kernel/src/arch/mipsel/boot/linker.ld.S @@ -4,7 +4,11 @@ OUTPUT_ARCH(riscv) ENTRY(_start) +#ifdef board_thinpad +BASE_ADDRESS = 0x80000000; +#else BASE_ADDRESS = 0x80100000; +#endif SECTIONS { diff --git a/kernel/src/arch/mipsel/consts.rs b/kernel/src/arch/mipsel/consts.rs index 48a48d3f..e1e5a284 100644 --- a/kernel/src/arch/mipsel/consts.rs +++ b/kernel/src/arch/mipsel/consts.rs @@ -2,11 +2,16 @@ /// pub use super::board::consts::*; -pub const MEMORY_OFFSET: usize = 0x80000000; -pub const KERNEL_OFFSET: usize = 0x80100000; -pub const PHYSICAL_MEMORY_OFFSET: usize = 0x80000000; +pub const MEMORY_OFFSET: usize = 0x8000_0000; -pub const USER_STACK_OFFSET: usize = 0x70000000 - USER_STACK_SIZE; +#[cfg(feature = "board_thinpad")] +pub const KERNEL_OFFSET: usize = 0x8000_0000; +#[cfg(feature = "board_malta")] +pub const KERNEL_OFFSET: usize = 0x8010_0000; + +pub const PHYSICAL_MEMORY_OFFSET: usize = 0x8000_0000; + +pub const USER_STACK_OFFSET: usize = 0x7000_0000 - USER_STACK_SIZE; pub const USER_STACK_SIZE: usize = 0x10000; pub const MAX_DTB_SIZE: usize = 0x2000; diff --git a/kernel/src/arch/mipsel/driver/mod.rs b/kernel/src/arch/mipsel/driver/mod.rs index 206d6010..071142bf 100644 --- a/kernel/src/arch/mipsel/driver/mod.rs +++ b/kernel/src/arch/mipsel/driver/mod.rs @@ -10,7 +10,7 @@ pub mod console; /// Initialize common drivers pub fn init() { board::init_driver(); - // console::init(); + console::init(); if let Some(con) = console::CONSOLE.lock().as_mut() { con.clear(); }