diff --git a/kernel-rs/src/arch/x86/boot.asm b/kernel-rs/src/arch/x86/boot.asm index f2fab7b6..4da50748 100644 --- a/kernel-rs/src/arch/x86/boot.asm +++ b/kernel-rs/src/arch/x86/boot.asm @@ -31,9 +31,9 @@ set_up_page_tables: or eax, 0b11 ; present + writable mov [p2_table + 1023 * 4], eax - ; map ecx-th P2 entry to a huge page that starts at address 2MiB*ecx + ; identity map first P2 entry to a huge page mov eax, 0b10000011 ; huge + present + writable - mov [p2_table], eax ; map ecx-th entry + mov [p2_table], eax ; map first entry mov eax, p2_table mov cr3, eax @@ -54,7 +54,7 @@ align 4096 p2_table: resb 4096 stack_bottom: - resb 4096 * 8 + resb 4096 * 16 stack_top: section .gdt diff --git a/kernel-rs/src/arch/x86/gdt.rs b/kernel-rs/src/arch/x86/gdt.rs index ff682cba..2aae8e3c 100644 --- a/kernel-rs/src/arch/x86/gdt.rs +++ b/kernel-rs/src/arch/x86/gdt.rs @@ -2,7 +2,7 @@ use x86::structures::gdt; use x86::structures::tss; use x86::instructions::segmentation::set_cs; use x86::instructions::tables::load_tss; -use spin::Once; +// use spin::Once; // static GDT: Once = Once::new(); // static TSS: Once = Once::new(); diff --git a/kernel-rs/src/arch/x86/paging/mod.rs b/kernel-rs/src/arch/x86/paging/mod.rs index 39e87944..3f4809cb 100644 --- a/kernel-rs/src/arch/x86/paging/mod.rs +++ b/kernel-rs/src/arch/x86/paging/mod.rs @@ -122,6 +122,7 @@ pub fn remap_the_kernel(boot_info: &BootInformation) -> ActivePageTable { let frame = ::memory::allocate_frames(1).expect("no more frames"); InactivePageTable::new(frame, &mut active_table, &mut temporary_page) }; + unsafe { asm!("hlt"); }