10 mov eax, [ebp+8] ; Get the pointer to the IDT, passed as a parameter.
11 lidt [eax] ; Load the IDT pointer.
20%macro ISR_NO_ERROR_CODE 1 ; define a macro, taking one parameter
21 global isr%1 ; %1 accesses the first parameter.
28%macro ISR_ERROR_CODE 1
105; This is our common ISR stub. It saves the processor state, sets
106; up for kernel mode segments, calls the C-level fault handler,
107; and finally restores the stack frame.
109 pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
111 mov ax, ds ; Lower 16-bits of eax = ds.
112 push eax ; save the data segment descriptor
114 mov ax, 0x10 ; load the kernel data segment descriptor
126 pop eax ; reload the original data segment descriptor
132 popa ; Pops edi,esi,ebp...
133 add esp, 8 ; Cleans up the pushed error code and pushed ISR number
134 iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP
138; This is our common IRQ stub. It saves the processor state, sets
139; up for kernel mode segments, calls the C-level fault handler,
140; and finally restores the stack frame.
142 pusha ; Pushes edi,esi,ebp,esp,ebx,edx,ecx,eax
144 mov ax, ds ; Lower 16-bits of eax = ds.
145 push eax ; save the data segment descriptor
147 mov ax, 0x10 ; load the kernel data segment descriptor
159 pop ebx ; reload the original data segment descriptor
165 popa ; Pops edi,esi,ebp...
166 add esp, 8 ; Cleans up the pushed error code and pushed ISR number
167 iret ; pops 5 things at once: CS, EIP, EFLAGS, SS, and ESP