BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / commit / c738dbb1e7e7a46a98436326234826eef71083e2 / kernel / isr.S

// Related

Nucleus

Barry CPU specific segment c738dbb (3 years, 2 months ago)
diff --git a/kernel/isr.S b/kernel/isr.S
index c807e7b..914d855 100644
--- a/kernel/isr.S
+++ b/kernel/isr.S
@@ -1,6 +1,8 @@
 /*
  * This file contains the interrupt service routine stubs.  For the most part
- * they just call into the generic handlers after setting up the stack for them.
+ * they just call into the generic handler after setting up the stack for it.
+ * It pushes the interrupt number and saved registers onto the stack for the
+ * handler to access.
  */
 
 .extern isr_handler
@@ -9,7 +11,6 @@
 .macro exc_err num
 .globl exc\num
 exc\num:
-	cli
 	push $\num
 	jmp isr_stub
 .endm
@@ -17,7 +18,6 @@ exc\num:
 .macro exc_noerr num
 .globl exc\num
 exc\num:
-	cli
 	push $0
 	push $\num
 	jmp isr_stub
@@ -76,7 +76,9 @@ isr_stub:
 	mov $0x10, %ax
 	mov %ax, %ds
 	mov %ax, %es
+	mov $0x28, %ax
 	mov %ax, %fs
+	mov $0x30, %ax
 	mov %ax, %gs
 
 	call isr_handler
@@ -85,10 +87,11 @@ isr_stub:
 	popl %ebx
 	mov %bx, %ds
 	mov %bx, %es
+	mov $0x28, %bx
 	mov %bx, %fs
+	mov $0x30, %bx
 	mov %bx, %gs
 
 	popa
 	addl $8, %esp
-	sti
 	iret