1
0
Fork 0
forked from AbleOS/ableos

Formatting, LF and RISC-V kmain

This commit is contained in:
Erin 2023-03-19 13:40:08 +01:00 committed by ondra05
parent e3ce700295
commit cef19a8fe4
3 changed files with 388 additions and 396 deletions

View file

@ -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 .global RODATA_START
TEXT_END: .quad _text_end .global RODATA_END
.global DATA_START
.global DATA_END
.global SDATA_START
.global SDATA_END
.global BSS_START
.global BSS_END
.global INITIAL_KERNEL_HEAP_START
.global INITIAL_KERNEL_HEAP_SIZE
.global USABLE_MEMORY_START
.global USABLE_MEMORY_SIZE
.global RODATA_START TEXT_START: .quad _text_start
RODATA_START: .quad _rodata_start TEXT_END: .quad _text_end
.global RODATA_END RODATA_START: .quad _rodata_start
RODATA_END: .quad _rodata_end RODATA_END: .quad _rodata_end
DATA_START: .quad _data_start
.global DATA_START DATA_END: .quad _data_end
DATA_START: .quad _data_start SDATA_START: .quad _sdata_start
.global DATA_END SDATA_END: .quad _sdata_end
DATA_END: .quad _data_end BSS_START: .quad _bss_start
BSS_END: .quad _bss_end
.global SDATA_START INITIAL_KERNEL_HEAP_START: .quad _initial_kernel_heap_start
SDATA_START: .quad _sdata_start INITIAL_KERNEL_HEAP_SIZE: .quad _initial_kernel_heap_size
.global SDATA_END USABLE_MEMORY_START: .quad _usable_memory_start
SDATA_END: .quad _sdata_end USABLE_MEMORY_SIZE: .quad _usable_memory_size
.global BSS_START
BSS_START: .quad _bss_start
.global BSS_END
BSS_END: .quad _bss_end
.global INITIAL_KERNEL_HEAP_START
INITIAL_KERNEL_HEAP_START: .quad _initial_kernel_heap_start
.global INITIAL_KERNEL_HEAP_SIZE
INITIAL_KERNEL_HEAP_SIZE: .quad _initial_kernel_heap_size
.global USABLE_MEMORY_START
USABLE_MEMORY_START: .quad _usable_memory_start
.global USABLE_MEMORY_SIZE
USABLE_MEMORY_SIZE: .quad _usable_memory_size

View file

@ -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