;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; From PMODE.asm - not entire file, but what is necessary, the CPU is in ;; protected mode from this point forward... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; . . . ;----------------; ; remap PICs ; ;----------------; mov cl, 0x20 ; PIC 1, irq0-irq7 -> int 0x20-27. mov ch, 0x28 ; PIC 2, irq8-irq15 -> int 0x28-30. ;---------; ; IWC1 ; ;---------; mov al, 0x11 out 0x20, al out 0xA0, al ;---------; ; IWC2 ; ;---------; mov al, cl out 0x21, al mov al, ch out 0xA1, al ;---------; ; IWC3 ; ;---------; mov al, 0x04 out 0x21, al mov al, 0x02 out 0xA1, al ;---------; ; IWC4 ; ;---------; mov al, 0x01 out 0x21, al out 0xA1, al ; ;----------------------; ; ; disable all IRQs. ; ; ;----------------------; mov al, 0xFF out 0x21, al out 0xA1, al lidt [IDT_Pointer] ; load IDT with 16:32 pointer to IDT nop sti int 32h ; Call internal interrupt call DisplayBootTime ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Interrupt Descriptor Table (IDT) and associated OS API ;; ;; IDT is broken out like so: ;; ;; It is 8 bytes long. ;; ;; +--------+--------+ ;; 0 | | | 1 - Linear Offset A0 - A15 ;; +--------+--------+ ;; 2 | | | 3 - Segment Selector (All set to GDT_CODE_SELECTOR) ;; +--------+--------+ ;; 4 |PDL01110|00000000| 5 - P is the present bit; ;; +--------+--------+ DL is actually DPL or describe priveledge level ;; 6 | | | 7 - Linear Offset A16 - A31 ;; +--------+--------+ ;; ;; I have intentionally setup this IDT without offset data so that it can be ;; done by the corresponding device drivers, through an OS API call to snag ;; an IRQ/interrupt for an offending device. In theory, the OS will load ;; default device drivers if there isn't an OS configuration file present. ;; These defaults are for the keyboard and floppy as a minimum. Video is text ;; mode (3) and is done internally to the OS. The timer may be done ;; internally, but is TBD at this time. ;; ;; After I have managed to install a memory manager, then I will work on ;; loading device drivers and associated routines. ;; ;; April 6, 2005. ;; ;; Updated this table with IRQ places and the rest of the reserved areas up ;; to 255. ;; ;; June 7, 2005. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IDT_Pointer: dw IDTLAST - IDT - 1 ; IDT size - 1 dd IDT ; IDT base IDT: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 0 - Divide Error ;; Occurs whenever the result of a division overflows or whenever ;; an attempt is made to divide by zero. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Initialize dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 1 - Single Step or Trap ;; Occurs after the execution of each instruction if the trap (TF) ;; flag bit is set. Upon accepting the interrupt, the TF bit is ;; cleared so that the interrupt service procedure executes at full ;; speed. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 2 - Non-Maskable Hardware Interrupt ;; A result of placing a logic 1 on the NMI input pin to the ;; microprocessor. This input is non-maskable, which means that it ;; cannot be disabled. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 3 - One-Byte Interrupt ;; A special one-byte instruction (INT 3) that uses this vector to ;; access its interrupt-service procedure. The INT 3 instruction is ;; often used to store a breakpoint in a program for debugging. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 4 - Overflow ;; A special vector used with INTO instruction. The INTO instruction ;; interrupts the program if an overflow condition exists, as ;; reflected by the overflow flag (OF). ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 5 - BOUND ;; An instruction that compares a register with boundaries stored in ;; the memory. If the contents of the register are greater than or ;; equal to the first word in memory and less than or equal to the ;; second word, no interrupt occurs because the contents of the ;; register is within bounds. If the contents of the register are ;; out-of-bounds, a type 5 interrupt ensues. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 6 - Invalid Opcode ;; Occurs whenever an undefined opcode is encountered in a program. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 7 - Coprocessor not Available ;; Occurs when the coprocessor is not found in the system, as ;; dictated by the machine status word (MSW) coprocessor control ;; bits. If an ESC or WAIT instruction executes and the coprocessor ;; is not found, a type 7 exception or interrupt occurs. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 8 - Double Fault ;; Activated whenever two seperate interrupts occur during the same ;; instruction. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 9 - Coprocessor Segment Overrun ;; Occurs if ESC instruction (coprocessor opcode) memory operand ;; extends beyond FFFFh. (need to verify for PM) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 10 - Invalid Task State Segment ;; Occurs if the TSS is invalid because the segment limit field is ;; not 002Bh or higher. In most cases, this is caused because the ;; TSS is not initialized. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 11 - Segment not Present ;; Occurs when the P bit (P = 0) in a descriptor indicates that the ;; segment is not present or not valid. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 12 - Stack Segment Overrun ;; Occurs if the stack segment is not present (P = 0) or if the ;; limit of the stack segment is exceeded. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 13 - General Protection ;; Occurs for most protection violations in the protected mode ;; system. ;; a. Descriptor table limit exceeded ;; b. Privilege rules violated ;; c. Invalid descriptor segment type loaded ;; d. Write to code segment that is protected ;; e. Read from execute-only code segment ;; f. Write to read-only data segment ;; g. Segment limit exceeded ;; h. CPL = IOPL when executing CTS, HLT, LGDT, LIDT, LLDT, LMSW, or ;; LTR ;; i. CPL > IOPL when executing CLI, IN, INS, LOCK, OUT, OUTS, and ;; STI ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 14 - Page Fault ;; Occurs for any page fault memory or code access in the 80386, ;; 80486, and Pentium-Pentium 4 microprocessor. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 16 - Coprocessor Error ;; Takes effect whenever a coprocessor error (!ERROR = 0) occurs for ;; the ESCape or WAIT instructions for the 80386, 80486, Pentium- ;; Pentium 4 microprocessor. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 17 - Alignment Check ;; Indicates that word and doubleword data are addressed at an odd ;; memory location (or an incorrect location, in the case of a ;; doubleword). This interrupt is active in the 80486 and Pentium- ;; Pentium 4 microprocessors. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Type 18 - Machine Check ;; Activates a system memory management mode interrupt in the ;; Pentium-Pentium 4 microprocessors. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledINT ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 0 - Timer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset (should be considered otherwise) dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 1 - Keyboard ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 2 - Reserved (8259A) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 3 - COM 1 and/or 3 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 4 - COM 2 and/or 4 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 5 - Usually LPT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 6 - Usaually floppy drive ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 7 - Ussually IDE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 8 - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ 9 - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ A - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ B - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ C - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ D - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ E - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; IRQ F - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw UnhandledIRQ ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw 0 ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; 48 INT 30h - reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw (UnhandledINT and 0ffffh) ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw (UnhandledINT shr 16); Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw (UnhandledINT and 0ffffh) ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw (UnhandledINT shr 16) ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; reserved ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; dw (UnhandledINT and 0ffffh) ; Offset not initialized dw GDT_CODE_SELECTOR ; Code segment selector db 00000000b ; Reserved db 10001110b ; P=1,DPL=00 dw (UnhandledINT shr 16) ; Offset not initialized ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End of IDT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; IDTLAST: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ISR.ASM - Contains the unhandled interrupt routines as well as the ;; exceptions. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; TopRowMessage db 214,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,196,183,13,10,0 SideRowMessage db 186,' ',186,13,10,0 BottomRowMessage db 200,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,205,188,13,10,0 UnhandledIRQMessage db 186,' Unhandled IRQ! ',186,13,10,0 UnhandledINTMessage db 186,' Unhandled INT! ',186,13,10,0 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; UnhandledIRQ - Displays a message about the unhandled IRQ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UnhandledIRQ: pushad push es mov esi,TopRowMessage call PrintString mov esi,SideRowMessage call PrintString mov esi,UnhandledINTMessage call PrintString mov esi,SideRowMessage call PrintString mov esi,BottomRowMessage call PrintString ; ;-------------------------- ; mov al, 0x20 ; out 0xa0, al ; out 0x20,al ; ;call irq_clear ; ;----------------------- pop es popad iret ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; UnhandledINT - Displays a message about the unhandled INT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; UnhandledINT: pushad push es mov esi,TopRowMessage call PrintString mov esi,SideRowMessage call PrintString mov esi,UnhandledINTMessage call PrintString mov esi,SideRowMessage call PrintString mov esi,BottomRowMessage call PrintString pop es popad iret