summaryrefslogtreecommitdiff
path: root/arch/i386/boot/isr.s
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.xyz>2021-09-28 09:08:38 -0500
committerDanny Holman <dholman@gymli.xyz>2021-09-28 09:28:33 -0500
commitc0019e9d0bd2059351dc7d0274ee0479a71192fc (patch)
tree99a9ee22a5e8a102e719d6710226b9c181fae74a /arch/i386/boot/isr.s
parent0ec9e9824e32d3d54d2ad43c3f2743d52127aa92 (diff)
arch: i386: fix IDT exception handler
Fix the i386's general exception handler to actually work. Fix provided by Jon Sanderson (jjs295356@gmail.com). Signed-off-by: Danny Holman <dholman@gymli.xyz>
Diffstat (limited to 'arch/i386/boot/isr.s')
-rw-r--r--arch/i386/boot/isr.s36
1 files changed, 24 insertions, 12 deletions
diff --git a/arch/i386/boot/isr.s b/arch/i386/boot/isr.s
index 0f2640f..43ef3be 100644
--- a/arch/i386/boot/isr.s
+++ b/arch/i386/boot/isr.s
@@ -4,18 +4,40 @@
.global isr_stub_\num
.type isr_stub_\num, @function
isr_stub_\num:
- movl $\num, %eax
+ cli
pushl %eax
+ pushl %ecx
+ pushl %edx
+ pushl %ds
+ pushl %esp
+ pushl $\num
call exception_handler
+ popl %esp
+ popl %ds
+ popl %edx
+ popl %ecx
+ popl %eax
+ addl $8, %esp
iret
.endm
.macro isr_no_err_stub num
.global isr_stub_\num
.type isr_stub_\num, @function
isr_stub_\num:
- movl $\num, %eax
+ cli
pushl %eax
+ pushl %ecx
+ pushl %edx
+ pushl %ds
+ pushl %esp
+ pushl $\num
call exception_handler
+ popl %esp
+ popl %ds
+ popl %edx
+ popl %ecx
+ popl %eax
+ addl $8, %esp
iret
.endm
@@ -51,13 +73,3 @@ isr_no_err_stub 28
isr_no_err_stub 29
isr_err_stub 30
isr_no_err_stub 31
-
-.section .data
-
-.global isr_stub_table
-isr_stub_table:
- .set i, 0
- .rept
- 32 dd isr_stub_i
- .set i i+0
- .endr