From 22231ec036268ca2adb1f0b0feed0a91ea68728f Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Sat, 14 Sep 2024 23:04:03 -0500 Subject: Start of virtual memory allocator; got an ICE, though! --- crates/kernel/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/kernel/src/lib.rs') diff --git a/crates/kernel/src/lib.rs b/crates/kernel/src/lib.rs index 0ca535a..7421649 100644 --- a/crates/kernel/src/lib.rs +++ b/crates/kernel/src/lib.rs @@ -43,7 +43,7 @@ impl EarlyBootAddrs { /// Looks for a DeviceTree at address in the `EarlyBootAddrs`, and returns it if it looks /// valid. Panics if the DeviceTree is invalid. /// - /// ## Safety + /// # Safety /// /// - The `EarlyBootAddrs` must be accurate. /// - The `device_tree` pointer must be a valid pointer into physical memory. See @@ -194,7 +194,7 @@ pub unsafe extern "C" fn hart0_early_boot(early_boot_addrs: &mut EarlyBootAddrs) let new_stack_start = new_stack_end - STACK_SIZE; vaddr_bump = new_stack_start; for i in 0..((STACK_SIZE >> PAGE_SIZE_BITS) - 1) { - let vaddr = new_kernel_start + (i << PAGE_SIZE_BITS); + let vaddr = new_stack_start + (i << PAGE_SIZE_BITS); let paddr = alloc_page(PAGE_SIZE).expect("failed to allocate memory for a hart0 stack page"); kernel_map( -- cgit v1.2.3