ive tried for at lest 5 months how? to get a working idt table, i have failed in all attempts, it gets an error and reboots. basicly what i want it to setup all the traps, and have it run my code what i will put in it to clean up say a divide by 0. then all the irq's, then after those i want to use the rest of my ints to use for whatever software code i need to make avalible to the system.
heres what i have now.


MOV EAX, CR0
OR AL, 1
MOV CR0, EAX ; enter protected mode
; at this point every thing works fine.
;after here i am unsure of where the error is.
call rerouteirqs

mov edi,0
mov esi,offset sys_int
setidtl1:
mov ecx,[esi]
mov [edi+idts+ 8 +0], cx
mov word ptr [edi+idts+ 8 +2], 10h
mov cx,8f00h ; D_TRAP
mov dword ptr [edi+idts+ 8 +4], ecx
add esi,4
add edi,8
cmp edi,8*256 ; 256 entries
jb setidtl1


; LOAD IDT
lidt fWORD PTR [cs:idts]; load idt with 16:32 pointer to IDT
mov ax,0010h ; #2 segment descriptor=data r/w 4G
nop
nop
nop
;
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax
mov ss,ax
mov esp,(2*1024*1024)
cli
sti
int 0FFh; should jmp then return
halt1:
hlt
jmp halt1

;;;;;;;;;;;;;;;;;;;;;;;
rerouteirqs:

cli
in al,21h
mov ah,al
in al,0A1h
mov cx,ax

mov al,11h ; edge, cascade, icw4
out 20h,al
out 0EBh,al
out 0A0h,al
out 0EBh,al

mov al,20h
out 21h,al
out 0EBh,al

add al,8h
out 0A1h,al
out 0EBh,al

mov al,04h
out 21h,al
out 0EBh,al
shr al,1h
out 0A1h,al
out 0EBh,al
shr al,1
out 21h,al
out 0EBh,al
out 0A1h,al
out 0EBh,al

mov ax,cx
out 0A1h,al
mov al,ah
out 21h,al
mov ecx,1000h
cld
picl1: out 0EBh,al
loop picl1

cli
mov al,255 ; mask all irqs
out 0a1h,al
out 21h,al

ret

; ======================
; interupt handlers
; ======================
idts:
dw idte-$-1
dd idts+8
dw 0

dd 8*256 dup(0)

idte:

sys_int:

dd s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,sa,sb,sc,sd,se,sf

dd s10 ,s11 ,i_unknown12,i_unknown13
dd i_unknown14,i_unknown15,i_unknown16,i_unknown17
dd i_unknown18,i_unknown19,i_unknown1a,i_unknown1b
dd i_unknown1c,i_unknown1d,i_unknown1e,i_unknown1f

dd irq0 ,irq1 ,p_irq2 ,p_irq3 ,p_irq4 ,p_irq5,p_irq6 ,p_irq7
dd p_irq8,p_irq9,p_irq10,p_irq11,p_irq12,irqD ,p_irq14,p_irq15

dd i_unknown30,i_unknown31,i_unknown32,i_unknown33
dd i_unknown34,i_unknown35,i_unknown36,i_unknown37
dd i_unknown38,i_unknown39,i_unknown3a,i_unknown3b
dd i_unknown3c,i_unknown3d,i_unknown3e,i_unknown3f

dd i_unknown40 ,i_unknown41,i_unknown42,i_unknown43
dd i_unknown44,i_unknown45,i_unknown46,i_unknown47
dd i_unknown48,i_unknown49,i_unknown4a,i_unknown4b
dd i_unknown4c,i_unknown4d,i_unknown4e,i_unknown4f

dd i_unknown50,i_unknown51,i_unknown52,i_unknown53
dd i_unknown54,i_unknown55,i_unknown56,i_unknown57
dd i_unknown58,i_unknown59,i_unknown5a,i_unknown5b
dd i_unknown5c,i_unknown5d,i_unknown5e,i_unknown5f

dd i_unknown60,i_unknown61,i_unknown62,i_unknown63
dd i_unknown64,i_unknown65,i_unknown66,i_unknown67
dd i_unknown68,i_unknown69,i_unknown6a,i_unknown6b
dd i_unknown6c,i_unknown6d,i_unknown6e,i_unknown6f

dd i_unknown70,i_unknown71,i_unknown72,i_unknown73
dd i_unknown74,i_unknown75,i_unknown76,i_unknown77
dd i_unknown78,i_unknown79,i_unknown7a,i_unknown7b
dd i_unknown7c,i_unknown7d,i_unknown7e,i_unknown7f

dd i_unknown80,i_unknown81,i_unknown82,i_unknown83
dd i_unknown84,i_unknown85,i_unknown86,i_unknown87
dd i_unknown88,i_unknown89,i_unknown8a,i_unknown8b
dd i_unknown8c,i_unknown8d,i_unknown8e,i_unknown8f

dd i_unknown90,i_unknown91,i_unknown92,i_unknown93
dd i_unknown94,i_unknown95,i_unknown96,i_unknown97
dd i_unknown98,i_unknown99,i_unknown9a,i_unknown9b
dd i_unknown9c,i_unknown9d,i_unknown9e,i_unknown9f

dd i_unknowna0,i_unknowna1,i_unknowna2,i_unknowna3
dd i_unknowna4,i_unknowna5,i_unknowna6,i_unknowna7
dd i_unknowna8,i_unknowna9,i_unknownaa,i_unknownab
dd i_unknownac,i_unknownad,i_unknownae,i_unknownaf

dd i_unknownb0,i_unknownb1,i_unknownb2,i_unknownb3
dd i_unknownb4,i_unknownb5,i_unknownb6,i_unknownb7
dd i_unknownb8,i_unknownb9,i_unknownba,i_unknownbb
dd i_unknownbc,i_unknownbd,i_unknownbe,i_unknownbf

dd i_unknownc0,i_unknownc1,i_unknownc2,i_unknownc3
dd i_unknownc4,i_unknownc5,i_unknownc6,i_unknownc7
dd i_unknownc8,i_unknownc9,i_unknownca,i_unknowncb
dd i_unknowncc,i_unknowncd,i_unknownce,i_unknowncf

dd i_unknownd0,i_unknownd1,i_unknownd2,i_unknownd3
dd i_unknownd4,i_unknownd5,i_unknownd6,i_unknownd7
dd i_unknownd8,i_unknownd9,i_unknownda,i_unknowndb
dd i_unknowndc,i_unknowndd,i_unknownde,i_unknowndf

dd i_unknowne0,i_unknowne1,i_unknowne2,i_unknowne3
dd i_unknowne4,i_unknowne5,i_unknowne6,i_unknowne7
dd i_unknowne8,i_unknowne9,i_unknownea,i_unknowneb
dd i_unknownec,i_unknowned,i_unknownee,i_unknownef

dd i_unknownf0,i_unknownf1,i_unknownf2,i_unknownf3
dd i_unknownf4,i_unknownf5,i_unknownf6,i_unknownf7
dd i_unknownf8,i_unknownf9,i_unknownfa,i_unknownfb
dd i_unknownfc,i_unknownfd,i_unknownfe,i_unknownff

s0:
push 0
jmp errorhandle
s1:
push 1
jmp errorhandle
s2:
push 2
jmp errorhandle
s3:
push 3
mov eax,3
jmp errorhandle
s4:
push 4
mov eax,4
jmp errorhandle
s5:
push 5
jmp errorhandle
s6:
push 6
jmp errorhandle
s7:
push 7
jmp errorhandle
s8:
push 8
jmp errorhandle
s9:
push 9
jmp errorhandle
sa:
push 0Ah
jmp errorhandle
sb:
push 0bh
jmp errorhandle
sc:
push 0ch
jmp errorhandle
sd:
push 0dh
jmp errorhandle
se:
push 0eh
jmp errorhandle
sf:
push 0fh
jmp errorhandle
s10:
push 10h
jmp errorhandle
s11:
push 11h
jmp errorhandle
irqD:

cli
pusha

mov cx,ds
mov ax,10h
mov ds,ax
mov es,ax
mov fs,ax
mov gs,ax

mov dx,0f0h
mov al,0
out dx,al

mov dx,0a0h
mov al,20h
out dx,al
mov dx,20h
out dx,al

mov ds,cx
mov es,cx
mov fs,cx
mov gs,cx

popa
iret
irq0:
cli ; 6-9
pusha ; 5
mov edi,0 ; 1
call irqhandler ; 2/5
popa ; 5-9
iret ; 5/8
irq1:
cli ; 6-9
pusha ; 5
mov edi,1 ; 1
call irqhandler ; 2/5
popa ; 5-9
iret ; 5/8

p_irq2:
cli ; 6-9
pusha ; 5
mov edi,2 ; 1
call irqhandler ; 2/5
popa ; 5-9
iret ; 5/8

p_irq3:
cli
pusha
mov edi,3
call irqhandler
popa
iret

p_irq4:
cli
pusha
mov edi,4
call irqhandler
popa
iret

p_irq5:
cli
pusha
mov edi,5
call irqhandler
popa
iret

p_irq6:
cli
pusha
mov edi,6
call irqhandler
popa
iret

p_irq7:
cli
pusha
mov edi,7
call irqhandler
popa
iret

p_irq8:
cli
pusha
mov edi,8
call irqhandler
popa
iret

p_irq9:
cli
pusha
mov edi,9
call irqhandler
popa
iret

p_irq10:
cli
pusha
mov edi,10
call irqhandler
popa
iret

p_irq11:
cli
pusha
mov edi,11
call irqhandler
popa
iret

p_irq12:
cli
pusha
mov edi,12
call irqhandler
popa
iret

p_irq13:
cli
pusha
mov edi,13
call irqhandler
popa
iret

p_irq14:
cli
pusha
mov edi,14
call irqhandler
popa
iret

p_irq15:
cli
pusha
mov edi,15
call irqhandler
popa
iret

irqhandler:

push edi

mov cx,ds ; 1
mov ax,10h ; 1
mov ds,ax ; 1
mov es,ax ; 1
mov fs,ax ; 1
mov gs,ax ; 1

mov esi,edi ; 1
shl esi,6 ; 1
add esi,irq00read ; 1
shl edi,12 ; 1
add edi,2E0000h

irqnewread:

mov dx,[esi] ; 2+

cmp dx,0 ; 1
jz irqover
cmp BYTE PTR [esi+3], 1 ; 2 ; byte read
jne noirqbyte ; 4-11

in al,dx

mov edx,[edi]
cmp edx,4000
je irqfull
mov ebx,edi
add ebx,10h
add ebx,edx
mov [ebx],al
add edx,1
mov [edi],edx

add esi,4
jmp irqnewread

noirqbyte:


cmp BYTE PTR [esi+3], 2 ; word read
jne noirqword

in ax,dx

mov edx,[edi]
cmp edx,4000
je irqfull
mov ebx,edi
add ebx,10h
add ebx,edx
mov [ebx],al
add edx,2
mov [edi],edx
add esi,4
jmp irqnewread

noirqword:
irqfull:
irqover:

mov ds,cx
mov es,cx
mov fs,cx
mov gs,cx

mov al,20h ; ready for next irq
out 20h,al

pop ebx
cmp ebx,7
jbe noa0
out 0a0h,al
noa0:

ret

i_unknown10:
push $
jmp i_u_errorhandle
i_unknown11:
push $
jmp i_u_errorhandle
i_unknown12:
push $
jmp i_u_errorhandle
i_unknown13:
push $
jmp i_u_errorhandle
i_unknown14:
push $
jmp i_u_errorhandle
i_unknown15:
push $
jmp i_u_errorhandle
i_unknown16:
push $
jmp i_u_errorhandle
i_unknown17:
push $
jmp i_u_errorhandle
i_unknown18:
push $
jmp i_u_errorhandle
i_unknown19:
push $
jmp i_u_errorhandle
i_unknown1a:
push $
jmp i_u_errorhandle
i_unknown1b:
push $
jmp i_u_errorhandle
i_unknown1c:
push $
jmp i_u_errorhandle
i_unknown1d:
push $
jmp i_u_errorhandle
i_unknown1e:
push $
jmp i_u_errorhandle
i_unknown1f:
push $
jmp i_u_errorhandle


i_unknown20:
push $
jmp i_u_errorhandle
i_unknown21:
push $
jmp i_u_errorhandle
i_unknown22:
push $
jmp i_u_errorhandle
i_unknown23:
push $
jmp i_u_errorhandle
i_unknown24:
push $
jmp i_u_errorhandle
i_unknown25:
push $
jmp i_u_errorhandle
i_unknown26:
push $
jmp i_u_errorhandle
i_unknown27:
push $
jmp i_u_errorhandle
i_unknown28:
push $
jmp i_u_errorhandle
i_unknown29:
push $
jmp i_u_errorhandle
i_unknown2a:
push $
jmp i_u_errorhandle
i_unknown2b:
push $
jmp i_u_errorhandle
i_unknown2c:
push $
jmp i_u_errorhandle
i_unknown2d:
push $
jmp i_u_errorhandle
i_unknown2e:
push $
jmp i_u_errorhandle
i_unknown2f:
push $
jmp i_u_errorhandle


i_unknown30:
push $
jmp i_u_errorhandle
i_unknown31:
push $
jmp i_u_errorhandle
i_unknown32:
push $
jmp i_u_errorhandle
i_unknown33:
push $
jmp i_u_errorhandle
i_unknown34:
push $
jmp i_u_errorhandle
i_unknown35:
push $
jmp i_u_errorhandle
i_unknown36:
push $
jmp i_u_errorhandle
i_unknown37:
push $
jmp i_u_errorhandle
i_unknown38:
push $
jmp i_u_errorhandle
i_unknown39:
push $
jmp i_u_errorhandle
i_unknown3a:
push $
jmp i_u_errorhandle
i_unknown3b:
push $
jmp i_u_errorhandle
i_unknown3c:
push $
jmp i_u_errorhandle
i_unknown3d:
push $
jmp i_u_errorhandle
i_unknown3e:
push $
jmp i_u_errorhandle
i_unknown3f:
push $
jmp i_u_errorhandle


i_unknown40:
push $
jmp i_u_errorhandle
i_unknown41:
push $
jmp i_u_errorhandle
i_unknown42:
push $
jmp i_u_errorhandle
i_unknown43:
push $
jmp i_u_errorhandle
i_unknown44:
push $
jmp i_u_errorhandle
i_unknown45:
push $
jmp i_u_errorhandle
i_unknown46:
push $
jmp i_u_errorhandle
i_unknown47:
push $
jmp i_u_errorhandle
i_unknown48:
push $
jmp i_u_errorhandle
i_unknown49:
push $
jmp i_u_errorhandle
i_unknown4a:
push $
jmp i_u_errorhandle
i_unknown4b:
push $
jmp i_u_errorhandle
i_unknown4c:
push $
jmp i_u_errorhandle
i_unknown4d:
push $
jmp i_u_errorhandle
i_unknown4e:
push $
jmp i_u_errorhandle
i_unknown4f:
push $
jmp i_u_errorhandle



i_unknown50:
push $
jmp i_u_errorhandle
i_unknown51:
push $
jmp i_u_errorhandle
i_unknown52:
push $
jmp i_u_errorhandle
i_unknown53:
push $
jmp i_u_errorhandle
i_unknown54:
push $
jmp i_u_errorhandle
i_unknown55:
push $
jmp i_u_errorhandle
i_unknown56:
push $
jmp i_u_errorhandle
i_unknown57:
push $
jmp i_u_errorhandle
i_unknown58:
push $
jmp i_u_errorhandle
i_unknown59:
push $
jmp i_u_errorhandle
i_unknown5a:
push $
jmp i_u_errorhandle
i_unknown5b:
push $
jmp i_u_errorhandle
i_unknown5c:
push $
jmp i_u_errorhandle
i_unknown5d:
push $
jmp i_u_errorhandle
i_unknown5e:
push $
jmp i_u_errorhandle
i_unknown5f:
push $
jmp i_u_errorhandle


i_unknown60:
push $
jmp i_u_errorhandle
i_unknown61:
push $
jmp i_u_errorhandle
i_unknown62:
push $
jmp i_u_errorhandle
i_unknown63:
push $
jmp i_u_errorhandle
i_unknown64:
push $
jmp i_u_errorhandle
i_unknown65:
push $
jmp i_u_errorhandle
i_unknown66:
push $
jmp i_u_errorhandle
i_unknown67:
push $
jmp i_u_errorhandle
i_unknown68:
push $
jmp i_u_errorhandle
i_unknown69:
push $
jmp i_u_errorhandle
i_unknown6a:
push $
jmp i_u_errorhandle
i_unknown6b:
push $
jmp i_u_errorhandle
i_unknown6c:
push $
jmp i_u_errorhandle
i_unknown6d:
push $
jmp i_u_errorhandle
i_unknown6e:
push $
jmp i_u_errorhandle
i_unknown6f:
push $
jmp i_u_errorhandle


i_unknown70:
push $
jmp i_u_errorhandle
i_unknown71:
push $
jmp i_u_errorhandle
i_unknown72:
push $
jmp i_u_errorhandle
i_unknown73:
push $
jmp i_u_errorhandle
i_unknown74:
push $
jmp i_u_errorhandle
i_unknown75:
push $
jmp i_u_errorhandle
i_unknown76:
push $
jmp i_u_errorhandle
i_unknown77:
push $
jmp i_u_errorhandle
i_unknown78:
push $
jmp i_u_errorhandle
i_unknown79:
push $
jmp i_u_errorhandle
i_unknown7a:
push $
jmp i_u_errorhandle
i_unknown7b:
push $
jmp i_u_errorhandle
i_unknown7c:
push $
jmp i_u_errorhandle
i_unknown7d:
push $
jmp i_u_errorhandle
i_unknown7e:
push $
jmp i_u_errorhandle
i_unknown7f:
push $
jmp i_u_errorhandle


i_unknown80:
push $
jmp i_u_errorhandle
i_unknown81:
push $
jmp i_u_errorhandle
i_unknown82:
push $
jmp i_u_errorhandle
i_unknown83:
push $
jmp i_u_errorhandle
i_unknown84:
push $
jmp i_u_errorhandle
i_unknown85:
push $
jmp i_u_errorhandle
i_unknown86:
push $
jmp i_u_errorhandle
i_unknown87:
push $
jmp i_u_errorhandle
i_unknown88:
push $
jmp i_u_errorhandle
i_unknown89:
push $
jmp i_u_errorhandle
i_unknown8a:
push $
jmp i_u_errorhandle
i_unknown8b:
push $
jmp i_u_errorhandle
i_unknown8c:
push $
jmp i_u_errorhandle
i_unknown8d:
push $
jmp i_u_errorhandle
i_unknown8e:
push $
jmp i_u_errorhandle
i_unknown8f:
push $
jmp i_u_errorhandle


i_unknown90:
push $
jmp i_u_errorhandle
i_unknown91:
push $
jmp i_u_errorhandle
i_unknown92:
push $
jmp i_u_errorhandle
i_unknown93:
push $
jmp i_u_errorhandle
i_unknown94:
push $
jmp i_u_errorhandle
i_unknown95:
push $
jmp i_u_errorhandle
i_unknown96:
push $
jmp i_u_errorhandle
i_unknown97:
push $
jmp i_u_errorhandle
i_unknown98:
push $
jmp i_u_errorhandle
i_unknown99:
push $
jmp i_u_errorhandle
i_unknown9a:
push $
jmp i_u_errorhandle
i_unknown9b:
push $
jmp i_u_errorhandle
i_unknown9c:
push $
jmp i_u_errorhandle
i_unknown9d:
push $
jmp i_u_errorhandle
i_unknown9e:
push $
jmp i_u_errorhandle
i_unknown9f:
push $
jmp i_u_errorhandle


i_unknowna0:
push $
jmp i_u_errorhandle
i_unknowna1:
push $
jmp i_u_errorhandle
i_unknowna2:
push $
jmp i_u_errorhandle
i_unknowna3:
push $
jmp i_u_errorhandle
i_unknowna4:
push $
jmp i_u_errorhandle
i_unknowna5:
push $
jmp i_u_errorhandle
i_unknowna6:
push $
jmp i_u_errorhandle
i_unknowna7:
push $
jmp i_u_errorhandle
i_unknowna8:
push $
jmp i_u_errorhandle
i_unknowna9:
push $
jmp i_u_errorhandle
i_unknownaa:
push $
jmp i_u_errorhandle
i_unknownab:
push $
jmp i_u_errorhandle
i_unknownac:
push $
jmp i_u_errorhandle
i_unknownad:
push $
jmp i_u_errorhandle
i_unknownae:
push $
jmp i_u_errorhandle
i_unknownaf:
push $
jmp i_u_errorhandle


i_unknownb0:
push $
jmp i_u_errorhandle
i_unknownb1:
push $
jmp i_u_errorhandle
i_unknownb2:
push $
jmp i_u_errorhandle
i_unknownb3:
push $
jmp i_u_errorhandle
i_unknownb4:
push $
jmp i_u_errorhandle
i_unknownb5:
push $
jmp i_u_errorhandle
i_unknownb6:
push $
jmp i_u_errorhandle
i_unknownb7:
push $
jmp i_u_errorhandle
i_unknownb8:
push $
jmp i_u_errorhandle
i_unknownb9:
push $
jmp i_u_errorhandle
i_unknownba:
push $
jmp i_u_errorhandle
i_unknownbb:
push $
jmp i_u_errorhandle
i_unknownbc:
push $
jmp i_u_errorhandle
i_unknownbd:
push $
jmp i_u_errorhandle
i_unknownbe:
push $
jmp i_u_errorhandle
i_unknownbf:
push $
jmp i_u_errorhandle


i_unknownc0:
push $
jmp i_u_errorhandle
i_unknownc1:
push $
jmp i_u_errorhandle
i_unknownc2:
push $
jmp i_u_errorhandle
i_unknownc3:
push $
jmp i_u_errorhandle
i_unknownc4:
push $
jmp i_u_errorhandle
i_unknownc5:
push $
jmp i_u_errorhandle
i_unknownc6:
push $
jmp i_u_errorhandle
i_unknownc7:
push $
jmp i_u_errorhandle
i_unknownc8:
push $
jmp i_u_errorhandle
i_unknownc9:
push $
jmp i_u_errorhandle
i_unknownca:
push $
jmp i_u_errorhandle
i_unknowncb:
push $
jmp i_u_errorhandle
i_unknowncc:
push $
jmp i_u_errorhandle
i_unknowncd:
push $
jmp i_u_errorhandle
i_unknownce:
push $
jmp i_u_errorhandle
i_unknowncf:
push $
jmp i_u_errorhandle


i_unknownd0:
push $
jmp i_u_errorhandle
i_unknownd1:
push $
jmp i_u_errorhandle
i_unknownd2:
push $
jmp i_u_errorhandle
i_unknownd3:
push $
jmp i_u_errorhandle
i_unknownd4:
push $
jmp i_u_errorhandle
i_unknownd5:
push $
jmp i_u_errorhandle
i_unknownd6:
push $
jmp i_u_errorhandle
i_unknownd7:
push $
jmp i_u_errorhandle
i_unknownd8:
push $
jmp i_u_errorhandle
i_unknownd9:
push $
jmp i_u_errorhandle
i_unknownda:
push $
jmp i_u_errorhandle
i_unknowndb:
push $
jmp i_u_errorhandle
i_unknowndc:
push $
jmp i_u_errorhandle
i_unknowndd:
push $
jmp i_u_errorhandle
i_unknownde:
push $
jmp i_u_errorhandle
i_unknowndf:
push $
jmp i_u_errorhandle


i_unknowne0:
push $
jmp i_u_errorhandle
i_unknowne1:
push $
jmp i_u_errorhandle
i_unknowne2:
push $
jmp i_u_errorhandle
i_unknowne3:
push $
jmp i_u_errorhandle
i_unknowne4:
push $
jmp i_u_errorhandle
i_unknowne5:
push $
jmp i_u_errorhandle
i_unknowne6:
push $
jmp i_u_errorhandle
i_unknowne7:
push $
jmp i_u_errorhandle
i_unknowne8:
push $
jmp i_u_errorhandle
i_unknowne9:
push $
jmp i_u_errorhandle
i_unknownea:
push $
jmp i_u_errorhandle
i_unknowneb:
push $
jmp i_u_errorhandle
i_unknownec:
push $
jmp i_u_errorhandle
i_unknowned:
push $
jmp i_u_errorhandle
i_unknownee:
push $
jmp i_u_errorhandle
i_unknownef:
push $
jmp i_u_errorhandle



i_unknownf0:
push $
jmp i_u_errorhandle
i_unknownf1:
push $
jmp i_u_errorhandle
i_unknownf2:
push $
jmp i_u_errorhandle
i_unknownf3:
push $
jmp i_u_errorhandle
i_unknownf4:
push $
jmp i_u_errorhandle
i_unknownf5:
push $
jmp i_u_errorhandle
i_unknownf6:
push $
jmp i_u_errorhandle
i_unknownf7:
push $
jmp i_u_errorhandle
i_unknownf8:
push $
jmp i_u_errorhandle
i_unknownf9:
push $
jmp i_u_errorhandle
i_unknownfa:
push $
jmp i_u_errorhandle
i_unknownfb:
push $
jmp i_u_errorhandle
i_unknownfc:
push $
jmp i_u_errorhandle
i_unknownfd:
push $
jmp i_u_errorhandle
i_unknownfe:
push $
jmp i_u_errorhandle
i_unknownff:
jmp f
f:
iret


i_u_errorhandle:
errorhandle:

iret



irq_owner: ; process id

dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0
dd 0


; on irq read ports

irq00read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq01read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq02read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq03read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq04read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq05read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq06read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq07read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq08read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq09read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq10read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq11read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq12read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq13read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq14read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
irq15read dd 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
Posted on 2003-02-14 15:30:27 by Qages
Qages ckeck my SOL OS source code

at www.hostileencounter.com main page choose SOL OS link then download source :)

I do what you want to do ...

i will comment on your code a little but honestly i do not know where the error is and i have no time to check your code as corectly as i should ... please excuse, below are just some tips:


Call rerouteirqs just after touching CR0 and switching to protected mode from real mode... most likely will fail! you should intercalate an absoloute jump there to clear CPU prefetch queue... also after switching to protected mode depending on your GDT Table addresses of procedures and labels might change :)

SO i suggest you test GDT first and print some simple message on screen from protected mode code (after that jump stuff) to check out that everything is ok

You should do this with Interupts Disabled! (the switch to protected mode also)...

What is this : dd 8*256 dup(0) right after idts ? are you setting up Interupt Gates in other code...otherwise it looks like to me you have a lot of zero there... and you should not.

Besides i dont find where you use the push 0 , push 1 etc in s0: s1: etc.. this could corupt your stack ...

My advise : make very very simple tests and steeps, never asumme anything is working until you have some certain way of testing it... besides until you get into GFX mode you could test all in text mode and AFAIK this will work under Bochs or WMVare ... helping you debug it

I will try to check it out more closely latter...but read my source code...it might not be as advanced as yours (aka ports array to be read/written on interupts :) i detect some Meuet style here?) but i works and uses GDT and IDT and deals with IRQ's for mouse,timer,keyboard,FDD ... so at least that could be used
Posted on 2003-02-15 01:56:20 by BogdanOntanu
thanks, ill check it out.
Posted on 2003-02-15 18:02:25 by Qages
oh btw yes i was "inspired" from menuet code, i had to change most of it to work in nasm. btw how much time do you have to work on yer own os. i was thinking, wild question, but maby we could team up?, but for mine at least i was planning implementing the main os(features) first insted of gui etc.
heres a attachment of how an os project might start out off, feel free to comment on its design.
Posted on 2003-02-15 19:39:42 by Qages