Skip to content

Commit e0c3584

Browse files
Make end page exclusive when computing the end page for the ramdisk
Co-authored-by: Philipp Oppermann <dev@phil-opp.com>
1 parent 492f75a commit e0c3584

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ where
298298
let physical_address = PhysAddr::new(ramdisk_address);
299299
let ramdisk_physical_start_page: PhysFrame<Size4KiB> =
300300
PhysFrame::containing_address(physical_address);
301-
let ramdisk_page_count = system_info.ramdisk_len / Size4KiB::SIZE;
301+
let ramdisk_page_count = (system_info.ramdisk_len - 1) / Size4KiB::SIZE;
302302
let ramdisk_physical_end_page = ramdisk_physical_start_page + ramdisk_page_count;
303303
let start_page = Page::from_start_address(ramdisk_address_start)
304304
.expect("the ramdisk start address must be page aligned");

0 commit comments

Comments
 (0)