hos/kernel/idt.inc

115 lines
1.3 KiB
PHP

;idt.inc
;Author: Josh Holtrop
;Date: 10/30/03
;Modified: 07/06/04
idtr:
dw 50*8-1 ;size of idt
dd IDT_V ;address of idt
%macro isr_label 1
isr_%1:
push eax
mov eax, %1
push eax
push esp
push msg
call _kprintf
add esp, 12
; hlt
jmp isr_main
%endmacro
isr_label 0
isr_label 1
isr_label 2
isr_label 3
isr_label 4
isr_label 5
isr_label 6
isr_label 7
isr_label 8
isr_label 9
isr_label 10
isr_label 11
isr_label 12
isr_label 13
isr_label 14
isr_label 15
isr_label 16
isr_label 17
isr_label 18
isr_label 19
isr_label 20
isr_label 21
isr_label 22
isr_label 23
isr_label 24
isr_label 25
isr_label 26
isr_label 27
isr_label 28
isr_label 29
isr_label 30
isr_label 31
isr_label 32
isr_label 33
isr_label 34
isr_label 35
isr_label 36
isr_label 37
isr_label 38
isr_label 39
isr_label 40
isr_label 41
isr_label 42
isr_label 43
isr_label 44
isr_label 45
isr_label 46
isr_label 47
isr_label 48
isr_label 49
isr_main:
push ebx
push ecx
push edx
push edi
push esi
push ebp
push ds
push es
push fs
push gs
push esp
push eax ;interrupt number
call _isr
add esp, 8
mov eax, [_proc_new_ss]
mov ebx, [_proc_new_esp]
mov ss, ax
mov esp, ebx
pop gs
pop fs
pop es
pop ds
pop ebp
pop esi
pop edi
pop edx
pop ecx
pop ebx
pop eax ;original saved eax
iret
msg:
db "esp is 0x%x after int %d", 10, 0