summaryrefslogtreecommitdiff
path: root/asm
diff options
context:
space:
mode:
Diffstat (limited to 'asm')
-rw-r--r--asm/asm.h5
-rw-r--r--asm/int_clock_handler.asm11
-rw-r--r--asm/int_default_handler.asm9
-rw-r--r--asm/int_irq0.asm9
-rw-r--r--asm/int_kb_handler.asm28
5 files changed, 54 insertions, 8 deletions
diff --git a/asm/asm.h b/asm/asm.h
index 6be89ca..c9a1fa3 100644
--- a/asm/asm.h
+++ b/asm/asm.h
@@ -1 +1,6 @@
void pic_setup();
+void int_kb_handler();
+void int_default_handler();
+void int_clock_handler();
+void int_syscall_handler();
+void int_irq0();
diff --git a/asm/int_clock_handler.asm b/asm/int_clock_handler.asm
index 03685fd..c6c91fc 100644
--- a/asm/int_clock_handler.asm
+++ b/asm/int_clock_handler.asm
@@ -19,13 +19,12 @@ int_clock_handler:
; mov byte [CLOCK_COUNTER], 0x00
- pusha ;Push all standard registers
-
+pusha ;Push all standard registers
push esp ;Push pointer to all the stuff we just pushed
call task_switch_next ;Call C code
- pop ebx
+ ;pop ebx
;compare:
;cmp eax,ebx
@@ -34,12 +33,12 @@ int_clock_handler:
mov esp, eax ;Replace the stack with what the C code gave us
- popa ;Put the standard registers back
; skip_clock:
-
mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
- out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+ out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+
+ popa ;Put the standard registers back
;We didn't push an error code or IRQ number, so we don't have to edit esp now
sti
diff --git a/asm/int_default_handler.asm b/asm/int_default_handler.asm
index 4515482..b86eeae 100644
--- a/asm/int_default_handler.asm
+++ b/asm/int_default_handler.asm
@@ -5,12 +5,17 @@ global int_default_handler
[bits 32]
int_default_handler:
+
cli
-
+ pusha
+
call int_default
mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
- out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+ out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+ popa
sti
+
+
iret ;Interrupt-Return
diff --git a/asm/int_irq0.asm b/asm/int_irq0.asm
new file mode 100644
index 0000000..a713774
--- /dev/null
+++ b/asm/int_irq0.asm
@@ -0,0 +1,9 @@
+global int_irq0
+[extern exception_handle]
+
+[bits 32]
+int_irq0:
+
+ cli
+ call exception_handle ;this will never return due to panic!
+ jmp $
diff --git a/asm/int_kb_handler.asm b/asm/int_kb_handler.asm
new file mode 100644
index 0000000..f2e33bf
--- /dev/null
+++ b/asm/int_kb_handler.asm
@@ -0,0 +1,28 @@
+global int_kb_handler
+[extern keyboard_handle]
+[extern int_default]
+
+[bits 32]
+
+int_kb_handler:
+cli
+
+pusha
+
+ mov eax,0x0
+ in al,0x60
+
+ push eax
+ call keyboard_handle
+
+ pop eax
+; call int_default
+
+ mov al, 0x20 ;Port number AND command number to Acknowledge IRQ
+ out 0x20, al ;Acknowledge IRQ, so we keep getting interrupts
+
+popa
+
+sti
+
+iretd ;Interrupt-Return