User:Johnburger/Demo/Exec/Ints/BadTSS
From OSDev Wiki
< User:Johnburger | Demo
There are two aspects of the Invalid TSS 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/BadTSS.inc
; ; Exec/Ints/BadTSS.inc ; ; Ths module installs a Bad TSS Fault handler. It's mostly a stub, leaving the ; hard work to the generic .Fault handler. Exec.Ints.BadTSS: MOV EAX,IDT.BadTSS ; This is the IDT Entry MOV EBX,Exec.LDT.BadTSS ; This is the LDT triple MOV EDX,.Handler ; This is the handler CALL Exec.Ints.Fault ; Set it up RET .Handler: ; PUSH DWORD 0 ; Pseudo-fault code (not required) PUSH 10 ; Interrupt number MOV EBX,Exec.LDT.BadTSS.TSS ; For TSS Backlink CALL Exec.Ints.Fault.Handler ADD ESP,8 ; Get rid of above IRETD ; Return, but resumes here, so... JMP .Handler ; ...go back for more