Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global isr0
- ; rest of the globals go here
- global isr31
- extern fault_handler
- ; Divide By Zero Exception
- isr0:
- cli
- push byte 0 ; a normal ISR stub that pushes a dummy error code to keep a uniform stack frame
- push byte 0
- jmp isr_common_stub
- ; rest of the ISRs go here
- ; Reserved
- isr31:
- cli
- push byte 0
- push byte 31
- jmp isr_common_stub
- isr_common_stub:
- pusha
- push ds
- push es
- push fs
- push gs
- mov ax, 0x10 ; load the kernel data segment descriptor
- mov ds, ax
- mov es, ax
- mov fs, ax
- mov gs, ax
- push eax
- call fault_handler
- pop eax
- pop gs
- pop fs
- pop es
- pop ds
- popa
- add esp, 8 ; cleans up the pushed error code and ISR number
- iret ; pop CS, EIP, EFLAGS, SS, ESP
Advertisement
Add Comment
Please, Sign In to add comment