master
E. Almqvist 3 years ago
parent fce0dcc801
commit 8a01d3c75d
  1. 2
      Makefile
  2. 4
      kernel/idt.c
  3. 7
      kernel/isr.asm

@ -10,7 +10,7 @@ LDFLAGS = -Wl,--oformat=binary -ffreestanding -nostdlib -shared -Ttext 0x1000 -
# VM/Debug settings # VM/Debug settings
VM = qemu-system-x86_64 VM = qemu-system-x86_64
VMFLAGS = VMFLAGS = -usb
# Do not touch these. # Do not touch these.

@ -23,12 +23,12 @@ void exception_handler() {
char* buf; char* buf;
print("[E] ", INT_COLOR); print("[exc] ", INT_COLOR);
buf = itoa(debug, buf, 10); buf = itoa(debug, buf, 10);
println(buf, 0x0f); println(buf, 0x0f);
__asm__ __volatile__("cli; iret"); __asm__ __volatile__("cli; hlt");
} }
void idt_set_desc(uint8 idx, void* isr, uint8 flags) { void idt_set_desc(uint8 idx, void* isr, uint8 flags) {

@ -10,20 +10,21 @@ isr_stub_%+%1:
%macro isr_no_err_stub 1 %macro isr_no_err_stub 1
isr_stub_%+%1: isr_stub_%+%1:
mov [isr_debug_ptr], byte %1 mov [isr_debug_ptr], byte %1
call exception_handler ;call exception_handler
iret iret
%endmacro %endmacro
extern exception_handler extern exception_handler
isr_no_err_stub 0 isr_no_err_stub 0
isr_no_err_stub 1 ; TODO: make keeb drivers
isr_err_stub 1 ; keyboard : noerr
isr_no_err_stub 2 isr_no_err_stub 2
isr_no_err_stub 3 isr_no_err_stub 3
isr_no_err_stub 4 isr_no_err_stub 4
isr_no_err_stub 5 isr_no_err_stub 5
isr_no_err_stub 6 isr_no_err_stub 6
isr_no_err_stub 7 isr_no_err_stub 7
isr_err_stub 8 isr_no_err_stub 8 ; err
isr_no_err_stub 9 isr_no_err_stub 9
isr_err_stub 10 isr_err_stub 10
isr_err_stub 11 isr_err_stub 11

Loading…
Cancel
Save