Skip to content

Commit 9a39818

Browse files
committed
Subtract 1 from ramdisk end address to get an inclusive address
1 parent 0b4a415 commit 9a39818

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bios/stage-4/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub extern "C" fn _start(info: &mut BiosInfo) -> ! {
5858
let kernel_size = info.kernel.len;
5959
let next_free_frame = match info.ramdisk.len {
6060
0 => PhysFrame::containing_address(kernel_start + kernel_size - 1u64) + 1,
61-
_ => PhysFrame::containing_address(PhysAddr::new(info.ramdisk.start + info.ramdisk.len)) + 1
61+
_ => PhysFrame::containing_address(PhysAddr::new(info.ramdisk.start + info.ramdisk.len - 1u64)) + 1
6262
};
6363
let mut frame_allocator = LegacyFrameAllocator::new_starting_at(
6464
next_free_frame,

0 commit comments

Comments
 (0)