Kernel: Write isr handler for x86_32 and cleanup x86_64

This commit is contained in:
2024-03-26 16:36:51 +02:00
parent 1943c3e7a1
commit d7bf34ecd0
3 changed files with 97 additions and 43 deletions

View File

@@ -1,15 +1,42 @@
isr_stub:
ud2
pusha
movl %cr0, %eax; pushl %eax
movl %cr2, %eax; pushl %eax
movl %cr3, %eax; pushl %eax
movl %cr4, %eax; pushl %eax
movl %esp, %eax // register ptr
leal 56(%esp), %ebx // interrupt stack ptr
movl 52(%esp), %ecx // error code
movl 48(%esp), %edx // isr number
subl $12, %esp
pushl %eax
pushl %ebx
pushl %ecx
pushl %edx
call cpp_isr_handler
addl $44, %esp
popa
addl $8, %esp
iret
irq_stub:
ud2
pusha
leal 40(%esp), %eax // interrupt stack ptr
movl 32(%esp), %ebx // irq number
subl $12, %esp
pushl %eax
pushl %ebx
call cpp_irq_handler
addl $20, %esp
popa
addl $8, %esp
iret
// arguments in EAX, EBX, ECX, EDX, ESI, EDI