Show where frame allocator ran out

This commit is contained in:
Jeremy Soller 2016-09-10 16:28:01 -06:00
parent 024b0d8a22
commit 7ace92c60c
2 changed files with 5 additions and 5 deletions

View file

@ -59,11 +59,11 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
// Allocate a stack
// TODO: Allocate contiguous
let stack_start = allocate_frame().expect("no more frames").start_address().get();
let stack_start = allocate_frame().expect("no more frames in acpi stack_start").start_address().get();
for _i in 0..62 {
allocate_frame().expect("no more frames");
allocate_frame().expect("no more frames in acpi stack");
}
let stack_end = allocate_frame().expect("no more frames").start_address().get() + 4096;
let stack_end = allocate_frame().expect("no more frames in acpi stack_end").start_address().get() + 4096;
let ap_ready = TRAMPOLINE as *mut u64;
let ap_stack_start = unsafe { ap_ready.offset(1) };

View file

@ -58,7 +58,7 @@ pub unsafe fn init(stack_start: usize, stack_end: usize) -> ActivePageTable {
let mut temporary_page = TemporaryPage::new(Page::containing_address(VirtualAddress::new(0x8_0000_0000)));
let mut new_table = {
let frame = allocate_frame().expect("no more frames");
let frame = allocate_frame().expect("no more frames in paging::init new_table");
InactivePageTable::new(frame, &mut active_table, &mut temporary_page)
};
@ -122,7 +122,7 @@ pub unsafe fn init(stack_start: usize, stack_end: usize) -> ActivePageTable {
let start = & __tdata_start as *const _ as usize;
let end = & __tdata_end as *const _ as usize;
if end > start {
temporary_page.map(allocate_frame().expect("no more frames"), PRESENT | NO_EXECUTE | WRITABLE, &mut active_table);
temporary_page.map(allocate_frame().expect("no more frames in paging::init TDATA"), PRESENT | NO_EXECUTE | WRITABLE, &mut active_table);
let start_page = Page::containing_address(VirtualAddress::new(start));
let end_page = Page::containing_address(VirtualAddress::new(end - 1));