hos/idt.inc

118 lines
1.3 KiB
PHP

;idt.inc
;Author: Josh Holtrop
;for HOS
;Modified: 10/30/03
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
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:
cmp eax, 0x30
jz isr_syscall
pusha
push ds
push es
push eax
call _isr
pop eax
pop es
pop ds
popa
pop eax
iret
isr_syscall:
pop eax ;syscall function number
pusha
push ds
push es
sc1:
cmp eax, 1 ;syscall 1 - putc
jnz sc2
push ebx
call _putc
add esp, 4
jmp scdone
sc2:
scdone:
pop es
pop ds
popa
iret