User:Johnburger/Demo/Ints/Ints

From OSDev Wiki
Jump to: navigation, search

It turned out that the interrupt handler section had more code, and took longer, than the rest of the Demonstrator. That's indicative of how much effort I suggest you should put into handling faults, especially early on while you're getting your startup code finalised.

Displaying the fault code and the register contents is very helpful, so getting that done first proved useful. But then I wanted to be able to see the in-memory tables, to prove to myself that I'd set them up correctly. To that end I decided to write a "debugger" - not for code, but to display the memory contents. It turned out that simply working out what the data was showing me helped me understand how Protected Mode operates - and how Expand Down Segments work!

Demo/Ints/Ints.inc

;
; Ints/Ints.inc
;
 
;-------------------------------------------------------------------------------
%include        "Ints/IDT.inc"          ; First, define an IDT
;-------------------------------------------------------------------------------
%include        "Ints/Vectors.inc"      ; Vectors for each interupt
;-------------------------------------------------------------------------------
%include        "Ints/Fault.inc"        ; Default Fault handling code
;-------------------------------------------------------------------------------
%include        "Ints/Single.inc"       ; Example single-step handler
;-------------------------------------------------------------------------------
%include        "Ints/Debug/Debug.inc"  ; Example debug handler
;-------------------------------------------------------------------------------
%include        "Ints/NoSeg.inc"        ; Example No Segment handler
;-------------------------------------------------------------------------------
%include        "Ints/User.inc"         ; Demonstrate User System Services
;-------------------------------------------------------------------------------
%include        "Ints/IRQs.inc"         ; Vectors for each IRQ
;-------------------------------------------------------------------------------
%include        "Ints/Timer.inc"        ; Example Timer interrupt handler
;-------------------------------------------------------------------------------
%include        "Ints/Key.inc"          ; Example Keyboard interrupt handler
;-------------------------------------------------------------------------------
%include        "Ints/Util.inc"         ; Utility functions
Personal tools
Namespaces
Variants
Actions
Navigation
About
Toolbox