From 9f1c31f298bdc79c012ccfd6047c0a1644a192e4 Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 9 Apr 2018 17:11:46 +0200 Subject: [PATCH] this commit should work but there's something VERY broken with the stack atm, all focus on this until understood better --- kernel-rs/src/arch/x86/boot.asm | 2 +- kernel-rs/src/arch/x86/interrupt/exception.rs | 2 +- kernel-rs/src/arch/x86/mod.rs | 2 -- kernel-rs/src/arch/x86/paging/mod.rs | 4 ---- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/kernel-rs/src/arch/x86/boot.asm b/kernel-rs/src/arch/x86/boot.asm index 4da50748..2f0402b6 100644 --- a/kernel-rs/src/arch/x86/boot.asm +++ b/kernel-rs/src/arch/x86/boot.asm @@ -54,7 +54,7 @@ align 4096 p2_table: resb 4096 stack_bottom: - resb 4096 * 16 + resb 4096 * 4 stack_top: section .gdt diff --git a/kernel-rs/src/arch/x86/interrupt/exception.rs b/kernel-rs/src/arch/x86/interrupt/exception.rs index 88bd80c5..48bc6028 100644 --- a/kernel-rs/src/arch/x86/interrupt/exception.rs +++ b/kernel-rs/src/arch/x86/interrupt/exception.rs @@ -64,7 +64,7 @@ exception_err!(general_protection, {}); pub extern "x86-interrupt" fn page_fault( stack_frame: &mut ExceptionStackFrame, code: PageFaultErrorCode, -) { + ) { println!("Exception: page_fault"); println!("Error code: {:#b}", code); println!("{:#?}", stack_frame); diff --git a/kernel-rs/src/arch/x86/mod.rs b/kernel-rs/src/arch/x86/mod.rs index 9f32c21d..6fb594eb 100644 --- a/kernel-rs/src/arch/x86/mod.rs +++ b/kernel-rs/src/arch/x86/mod.rs @@ -35,8 +35,6 @@ pub unsafe extern "C" fn x86_rust_start(multiboot_info_addr: usize) { // set up virtual mapping let mut active_table = paging::init(&boot_info); - asm!("hlt"); - // set up heap ::allocator::init(&mut active_table); diff --git a/kernel-rs/src/arch/x86/paging/mod.rs b/kernel-rs/src/arch/x86/paging/mod.rs index 3f4809cb..698d2cf9 100644 --- a/kernel-rs/src/arch/x86/paging/mod.rs +++ b/kernel-rs/src/arch/x86/paging/mod.rs @@ -123,10 +123,6 @@ pub fn remap_the_kernel(boot_info: &BootInformation) -> ActivePageTable { InactivePageTable::new(frame, &mut active_table, &mut temporary_page) }; - unsafe { - asm!("hlt"); - } - active_table.with(&mut new_table, &mut temporary_page, |mapper| { // id map vga buffer let vga_buffer_frame = PhysFrame::containing_address(PhysAddr::new(0xb8000));