Formatting, LF and RISC-V kmain
This commit is contained in:
parent
e3ce700295
commit
cef19a8fe4
|
@ -1,35 +1,30 @@
|
||||||
.section .rodata
|
.section .rodata
|
||||||
.global TEXT_START
|
.global TEXT_START
|
||||||
TEXT_START: .quad _text_start
|
|
||||||
.global TEXT_END
|
.global TEXT_END
|
||||||
TEXT_END: .quad _text_end
|
|
||||||
|
|
||||||
.global RODATA_START
|
.global RODATA_START
|
||||||
RODATA_START: .quad _rodata_start
|
|
||||||
.global RODATA_END
|
.global RODATA_END
|
||||||
RODATA_END: .quad _rodata_end
|
|
||||||
|
|
||||||
.global DATA_START
|
.global DATA_START
|
||||||
DATA_START: .quad _data_start
|
|
||||||
.global DATA_END
|
.global DATA_END
|
||||||
DATA_END: .quad _data_end
|
|
||||||
|
|
||||||
.global SDATA_START
|
.global SDATA_START
|
||||||
SDATA_START: .quad _sdata_start
|
|
||||||
.global SDATA_END
|
.global SDATA_END
|
||||||
SDATA_END: .quad _sdata_end
|
|
||||||
|
|
||||||
.global BSS_START
|
.global BSS_START
|
||||||
BSS_START: .quad _bss_start
|
|
||||||
.global BSS_END
|
.global BSS_END
|
||||||
BSS_END: .quad _bss_end
|
|
||||||
|
|
||||||
.global INITIAL_KERNEL_HEAP_START
|
.global INITIAL_KERNEL_HEAP_START
|
||||||
INITIAL_KERNEL_HEAP_START: .quad _initial_kernel_heap_start
|
|
||||||
.global INITIAL_KERNEL_HEAP_SIZE
|
.global INITIAL_KERNEL_HEAP_SIZE
|
||||||
INITIAL_KERNEL_HEAP_SIZE: .quad _initial_kernel_heap_size
|
|
||||||
|
|
||||||
.global USABLE_MEMORY_START
|
.global USABLE_MEMORY_START
|
||||||
USABLE_MEMORY_START: .quad _usable_memory_start
|
|
||||||
.global USABLE_MEMORY_SIZE
|
.global USABLE_MEMORY_SIZE
|
||||||
|
|
||||||
|
TEXT_START: .quad _text_start
|
||||||
|
TEXT_END: .quad _text_end
|
||||||
|
RODATA_START: .quad _rodata_start
|
||||||
|
RODATA_END: .quad _rodata_end
|
||||||
|
DATA_START: .quad _data_start
|
||||||
|
DATA_END: .quad _data_end
|
||||||
|
SDATA_START: .quad _sdata_start
|
||||||
|
SDATA_END: .quad _sdata_end
|
||||||
|
BSS_START: .quad _bss_start
|
||||||
|
BSS_END: .quad _bss_end
|
||||||
|
INITIAL_KERNEL_HEAP_START: .quad _initial_kernel_heap_start
|
||||||
|
INITIAL_KERNEL_HEAP_SIZE: .quad _initial_kernel_heap_size
|
||||||
|
USABLE_MEMORY_START: .quad _usable_memory_start
|
||||||
USABLE_MEMORY_SIZE: .quad _usable_memory_size
|
USABLE_MEMORY_SIZE: .quad _usable_memory_size
|
||||||
|
|
|
@ -67,7 +67,7 @@ unsafe extern fn _kernel_start() -> ! {
|
||||||
|
|
||||||
let table_ppn = page_table_addr.as_addr() as usize >> 12;
|
let table_ppn = page_table_addr.as_addr() as usize >> 12;
|
||||||
let satp_value = 8 << 60 | table_ppn;
|
let satp_value = 8 << 60 | table_ppn;
|
||||||
log::info!("Enabling the MMU...");
|
log::info!("Enabling MMU");
|
||||||
|
|
||||||
asm!(
|
asm!(
|
||||||
"csrw satp, {}",
|
"csrw satp, {}",
|
||||||
|
@ -75,10 +75,7 @@ unsafe extern fn _kernel_start() -> ! {
|
||||||
in(reg) satp_value,
|
in(reg) satp_value,
|
||||||
);
|
);
|
||||||
|
|
||||||
log::info!("We're in PAGING LAND!");
|
crate::kmain::kmain("baka=9", None);
|
||||||
|
|
||||||
#[allow(unreachable_code)]
|
|
||||||
match system_reset(ResetType::Shutdown, ResetReason::NoReason).unwrap() {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Spin loop
|
/// Spin loop
|
||||||
|
|
Loading…
Reference in a new issue