In the ISR and IRQ handlers, we see the code
Code: Select all
%macro ISR_NOERRCODE 1 ; define a macro, taking one parameter
[GLOBAL isr%1] ; %1 accesses the first parameter.
isr%1:
cli
push byte 0
push byte %1
jmp isr_common_stub
%endmacro
%macro ISR_ERRCODE 1
[GLOBAL isr%1]
isr%1:
cli
push byte %1
jmp isr_common_stub
%endmacro
Code: Select all
typedef struct registers
{
u32int ds; // Data segment selector
u32int edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha.
u32int int_no, err_code; // Interrupt number and error code (if applicable)
u32int eip, cs, eflags, useresp, ss; // Pushed by the processor automatically.
} registers_t;
This is clearly a mistake because later in isr_common_stub, we see:
Code: Select all
add esp, 8 ; Cleans up the pushed error code and pushed ISR number
The same bug is present in the next lesson, IRQs and the PIT.
I can't add it to the Known Bugs wiki article because I'm not in the appropriate group and I don't know what group to join or how.