master
E. Almqvist 3 years ago
parent b45ed4263f
commit d3e8ff9d1c
  1. 3
      kernel/idt.c
  2. 13
      kernel/isr.asm
  3. 2
      kernel/kernel.c

@ -21,14 +21,13 @@ void exception_handler() {
uint* irq_ptr = 0xe222;
uint8 irq = *irq_ptr;
pic_send_eoi(irq);
char* buf;
print("[exc] ", EXC_COLOR);
buf = itoa(irq, buf, 10);
print(buf, 0x0c);
new_line();
pic_send_eoi(irq);
}
void idt_set_desc(uint8 idx, void* isr, uint8 flags) {

@ -2,22 +2,25 @@ isr_debug_ptr equ 0xe222
%macro isr_err_stub 1
isr_stub_%+%1:
; Save exception vec
mov [isr_debug_ptr], byte %1
; Handle the exception
pusha
call exception_handler
sti
cli
hlt
iret
;hlt
popa
iret
%endmacro
%macro isr_no_err_stub 1
isr_stub_%+%1:
mov [isr_debug_ptr], byte %1
pusha
call exception_handler
sti
cli
;hlt
popa
iret
%endmacro

@ -66,6 +66,7 @@ void kernel_init() {
clear_screen();
print_kernel_motd();
/*
print_kernel_stats();
char* buf;
@ -78,6 +79,7 @@ void kernel_init() {
printalign(buf, 0x0f, MIDDLE);
++i;
}
*/
while(true) { __asm__("hlt"); } // never escape this function
}

Loading…
Cancel
Save