User:Johnburger/Demo/Exec/Ints/Double
From OSDev Wiki
< User:Johnburger | Demo
Jump to navigation
Jump to search
There are two aspects of the Double Fault handler: the installer, and the handler itself. The generic routines have been written, it's just a matter of calling them.
Note that when a Task does an IRET, it picks up again from the next instruction! I don't know about you, but it looks weird to me...
Demo/Exec/Ints/Double.inc
; ; Exec/Ints/Double.inc ; ; Ths module installs a Double Fault handler. It's mostly a stub, leaving the ; hard work to the generic .Fault handler. Exec.Ints.Double: MOVEAX,IDT.Double; This is the IDT Entry MOVEBX,Exec.LDT.Double; This is the LDT triple MOVEDX,.Handler; This is the handler CALLExec.Ints.Fault; Set it up RET .Handler: ; PUSH DWORD 0 ; Pseudo-fault code (not required) PUSH8; Interrupt number MOVEBX,Exec.LDT.Double.TSS; For TSS Backlink CALLExec.Ints.Fault.Handler ADDESP,8; Get rid of above IRETD; Return, but resumes here, so... JMP.Handler; ...go back for more