summaryrefslogtreecommitdiff
path: root/kernel/boot.s
diff options
context:
space:
mode:
authorJake Mannens <jake72360@gmail.com>2018-06-25 03:57:22 +1000
committerJake Mannens <jake72360@gmail.com>2018-06-25 03:57:22 +1000
commitfbbcb04f9e3197976d6ab4a79c45aa0a84e39aba (patch)
treef2512a391cf13d77e48a9ad6e02d2d251cb7088a /kernel/boot.s
parent97d3551106495fa18969e2690720b621ba5a9c0b (diff)
Added the header asm/interrupt.h which includes a prototype for the
assembly function register_isr making it usable within the C portions of the source. Added a new file panic.s with the function panic that will print a panic message, disable interrupts and halt the system. Created the skeleton framework for paging in the new file page.s. The new function paging_init (called in kboot) will setup a simple page directory with two tables covering all addresses 0-8MB. It will also mark pages from 0-1MB as 'supervisor-only' to protect the kernel. NOTE: The function paging_init must be called before initialising the IDT as it does not disable interrupts! Modified the page fault handler to print the offending linear address along with the supplied error code. Following that, the handler will initiate a kernel panic. This function (along with panic) assumes console I/O to be operational. Modified the userspace test code to deliberately intiate a page fault by accessing an unmapped page.
Diffstat (limited to 'kernel/boot.s')
-rw-r--r--kernel/boot.s2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/boot.s b/kernel/boot.s
index bc42a5d..80f8be9 100644
--- a/kernel/boot.s
+++ b/kernel/boot.s
@@ -4,6 +4,7 @@ global kboot
global register_isr
global tss
extern kmain
+extern paging_init
extern syscall_init
extern timer_init
extern traps_init
@@ -24,6 +25,7 @@ kboot:
mov esp, 0x80000
; setup descriptor tables
call flush_gdt
+ call paging_init
call flush_idt
; last minute setup, then transfer to kmain
call timer_init