From 1e4a254674f668839e5de273916024c16814b045 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 13 Sep 2020 03:19:57 -0400 Subject: (basic, not much tested) keyboard, better panic --- src/kernel/isrs.asm | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'src/kernel/isrs.asm') diff --git a/src/kernel/isrs.asm b/src/kernel/isrs.asm index 82c17fe..9a9600c 100644 --- a/src/kernel/isrs.asm +++ b/src/kernel/isrs.asm @@ -4,12 +4,15 @@ global syscall_isr global quit_isr global yield_isr global _start_user_mode +global kbd_isr extern syscall_table extern active_task extern delete_task extern advance_active_task +extern on_kbd_isr +extern make_sure_tasks n_syscalls equ 0x9 @@ -39,6 +42,7 @@ syscall_isr: quit_isr: push dword [active_task] call delete_task + call make_sure_tasks mov dword [esp], yield_isr.return_to_task jmp advance_active_task @@ -59,7 +63,7 @@ yield_isr: mov dword [eax + 4], edx mov edx, dword [esp + 12] - mov dword [eax + 4], edx + mov dword [eax + 32], edx call advance_active_task @@ -72,8 +76,8 @@ yield_isr: mov edx, dword [eax + 4] mov cr3, edx - mov edx, dword [eax + 4] - mov dword [esp + 24], edx + mov edx, dword [eax + 32] + mov dword [esp + 12], edx mov ebx, dword [eax + 8] mov ecx, dword [eax + 12] @@ -94,4 +98,19 @@ _start_user_mode: push dword 0x00000200;interrupt flag push dword 0x23 sub esp, 4 - jmp yield_isr.return_to_task \ No newline at end of file + jmp yield_isr.return_to_task + +kbd_isr: + push eax + push ecx + push edx + + call on_kbd_isr + + mov al, 0x20 + out 0x0020, al + + pop edx + pop ecx + pop eax + iret \ No newline at end of file -- cgit v1.2.3