Skip to content

Commit 1b3a54d

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-rv64-heap-pagetable
# Conflicts: # awkernel_lib/src/arch/rv64/vm.rs
2 parents b52a912 + 12482b9 commit 1b3a54d

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

awkernel_lib/src/arch/rv64/vm.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,19 @@ impl MemorySet {
260260
None,
261261
);
262262

263+
unsafe {
264+
unsafe_puts("Mapping physical memory...\r\n");
265+
}
266+
memory_set.push(
267+
MapArea::new(
268+
VirtAddr::from_usize(ekernel as *const () as usize),
269+
VirtAddr::from_usize(super::address::MEMORY_END as usize),
270+
MapType::Identical,
271+
MapPermission::R | MapPermission::W,
272+
),
273+
None,
274+
);
275+
263276
// Note: Heap mapping is created separately in calculate_dynamic_heap_size()
264277
memory_set
265278
}

kernel/src/arch/rv64/kernel_main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ unsafe fn init_heap_allocation() {
156156
fn ekernel();
157157
}
158158

159-
let heap_start = (ekernel as usize + 0xfff) & !0xfff; // Align to 4K
159+
let heap_start = (ekernel as *const () as usize + 0xfff) & !0xfff; // Align to 4K
160160
let backup_size = BACKUP_HEAP_SIZE;
161161
let total_heap_size = awkernel_lib::arch::rv64::get_heap_size();
162162

0 commit comments

Comments
 (0)