Show where frame allocator ran out
This commit is contained in:
parent
024b0d8a22
commit
7ace92c60c
|
@ -59,11 +59,11 @@ pub fn init_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
|
||||||
|
|
||||||
// Allocate a stack
|
// Allocate a stack
|
||||||
// TODO: Allocate contiguous
|
// 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 {
|
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_ready = TRAMPOLINE as *mut u64;
|
||||||
let ap_stack_start = unsafe { ap_ready.offset(1) };
|
let ap_stack_start = unsafe { ap_ready.offset(1) };
|
||||||
|
|
|
@ -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 temporary_page = TemporaryPage::new(Page::containing_address(VirtualAddress::new(0x8_0000_0000)));
|
||||||
|
|
||||||
let mut new_table = {
|
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)
|
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 start = & __tdata_start as *const _ as usize;
|
||||||
let end = & __tdata_end as *const _ as usize;
|
let end = & __tdata_end as *const _ as usize;
|
||||||
if end > start {
|
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 start_page = Page::containing_address(VirtualAddress::new(start));
|
||||||
let end_page = Page::containing_address(VirtualAddress::new(end - 1));
|
let end_page = Page::containing_address(VirtualAddress::new(end - 1));
|
||||||
|
|
Loading…
Reference in a new issue