this commit should work but there's something VERY broken with the stack atm, all focus on this until understood better
This commit is contained in:
parent
b51fe947f0
commit
9f1c31f298
4 changed files with 2 additions and 8 deletions
|
|
@ -54,7 +54,7 @@ align 4096
|
||||||
p2_table:
|
p2_table:
|
||||||
resb 4096
|
resb 4096
|
||||||
stack_bottom:
|
stack_bottom:
|
||||||
resb 4096 * 16
|
resb 4096 * 4
|
||||||
stack_top:
|
stack_top:
|
||||||
|
|
||||||
section .gdt
|
section .gdt
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ exception_err!(general_protection, {});
|
||||||
pub extern "x86-interrupt" fn page_fault(
|
pub extern "x86-interrupt" fn page_fault(
|
||||||
stack_frame: &mut ExceptionStackFrame,
|
stack_frame: &mut ExceptionStackFrame,
|
||||||
code: PageFaultErrorCode,
|
code: PageFaultErrorCode,
|
||||||
) {
|
) {
|
||||||
println!("Exception: page_fault");
|
println!("Exception: page_fault");
|
||||||
println!("Error code: {:#b}", code);
|
println!("Error code: {:#b}", code);
|
||||||
println!("{:#?}", stack_frame);
|
println!("{:#?}", stack_frame);
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,6 @@ pub unsafe extern "C" fn x86_rust_start(multiboot_info_addr: usize) {
|
||||||
// set up virtual mapping
|
// set up virtual mapping
|
||||||
let mut active_table = paging::init(&boot_info);
|
let mut active_table = paging::init(&boot_info);
|
||||||
|
|
||||||
asm!("hlt");
|
|
||||||
|
|
||||||
// set up heap
|
// set up heap
|
||||||
::allocator::init(&mut active_table);
|
::allocator::init(&mut active_table);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,6 @@ pub fn remap_the_kernel(boot_info: &BootInformation) -> ActivePageTable {
|
||||||
InactivePageTable::new(frame, &mut active_table, &mut temporary_page)
|
InactivePageTable::new(frame, &mut active_table, &mut temporary_page)
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe {
|
|
||||||
asm!("hlt");
|
|
||||||
}
|
|
||||||
|
|
||||||
active_table.with(&mut new_table, &mut temporary_page, |mapper| {
|
active_table.with(&mut new_table, &mut temporary_page, |mapper| {
|
||||||
// id map vga buffer
|
// id map vga buffer
|
||||||
let vga_buffer_frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));
|
let vga_buffer_frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue