From 2c429f6e1ac51ea27f203005eeef20d2b05c759e Mon Sep 17 00:00:00 2001 From: Jake Mannens Date: Sat, 23 Jun 2018 08:28:19 +1000 Subject: Re-wrote interrupt handling. Now, flush_idt only initializes IDT entries 32-255. A separate routine in the new file traps.s initializes the first 32 entries with addresses pointing to exception handlers within said file. Modified the register_isr function to now accept a descriptor privilege level which it will assign to the modified IDT entry. Added a task state segment and corresponding entry to the GDT. The TSS will store the kernel's stack pointer and stack segment when switching to userspace. NOTE: The stack pointer MUST be saved manually before switching to userspace! Added the framework for a system call interface at interrupt vector 0x80 (128). --- kernel/timer.s | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'kernel/timer.s') diff --git a/kernel/timer.s b/kernel/timer.s index de01ea6..53c81ed 100644 --- a/kernel/timer.s +++ b/kernel/timer.s @@ -17,9 +17,10 @@ timer_init: mov ebp, esp ; register the tick_handler push tick_handler + push dword 0 push dword 0x20 call register_isr - add esp, 8 + add esp, 12 ; initialize the pit mov ax, 0x36 out 0x43, al -- cgit v1.3