parent
9ab4fd40ea
commit
8529d9fe4e
@ -0,0 +1,49 @@
|
||||
/* Copy from bbl-ucore : https://ring00.github.io/bbl-ucore */
|
||||
|
||||
/* Simple linker script for the ucore kernel.
|
||||
See the GNU ld 'info' manual ("info ld") to learn the syntax. */
|
||||
|
||||
OUTPUT_ARCH(riscv)
|
||||
ENTRY(_start)
|
||||
|
||||
BASE_ADDRESS = 0x40000000;
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
/* Load the kernel at this address: "." means the current address */
|
||||
. = BASE_ADDRESS;
|
||||
start = .;
|
||||
|
||||
.text : {
|
||||
stext = .;
|
||||
KEEP(*(.text.boot))
|
||||
*(.text .text.*)
|
||||
. = ALIGN(4K);
|
||||
etext = .;
|
||||
}
|
||||
|
||||
.rodata : {
|
||||
srodata = .;
|
||||
*(.rodata .rodata.*)
|
||||
. = ALIGN(4K);
|
||||
erodata = .;
|
||||
}
|
||||
|
||||
.data : {
|
||||
sdata = .;
|
||||
*(.data .data.*)
|
||||
edata = .;
|
||||
}
|
||||
|
||||
.stack : {
|
||||
*(.bss.stack)
|
||||
}
|
||||
|
||||
.bss : {
|
||||
sbss = .;
|
||||
*(.bss .bss.*)
|
||||
ebss = .;
|
||||
}
|
||||
|
||||
PROVIDE(end = .);
|
||||
}
|
@ -1,13 +1,19 @@
|
||||
// Physical address available on THINPAD:
|
||||
// [0x80000000, 0x80800000]
|
||||
const P2_SIZE: usize = 1 << 22;
|
||||
const P2_MASK: usize = 0x3ff << 22;
|
||||
pub const RECURSIVE_INDEX: usize = 0x3fe;
|
||||
pub const KERNEL_OFFSET: usize = 0;
|
||||
pub const KERNEL_P2_INDEX: usize = 0x8000_0000 >> 22;
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub const KERNEL_HEAP_SIZE: usize = 0x0010_0000;
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
pub const KERNEL_HEAP_SIZE: usize = 0x00a0_0000;
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub const MEMORY_OFFSET: usize = 0x4000_0000;
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
pub const MEMORY_OFFSET: usize = 0x8000_0000;
|
||||
//pub const MEMORY_END: usize = 0x8080_0000; //for thinpad not enough now
|
||||
#[cfg(feature = "board_k210")]
|
||||
pub const MEMORY_END: usize = 0x4060_0000;
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
pub const MEMORY_END: usize = 0x8100_0000;
|
||||
pub const USER_STACK_OFFSET: usize = 0x70000000;
|
||||
pub const USER_STACK_SIZE: usize = 0x10000;
|
||||
|
Loading…
Reference in new issue