C code
Re:C code
Some code that partialy works...and hey, code slasher! help! or someone!
http://www.mega-tokyo.com/forum/attachments/uploaded_files/tmpcodenotworking.txt
In that code, at least the GPF works.
http://www.mega-tokyo.com/forum/attachments/uploaded_files/tmpcodenotworking.txt
In that code, at least the GPF works.
Re:C code
Hi Tom,
thanks for answer.
I do not want a fully IDT set. If you test the code, it halts the PC. I only load a functio for the IRQ1 that prints a text on screen. But it don't I don't know why.
Can post the code you have please?
I don't want you lose time with my problems
thanks.
thanks for answer.
I do not want a fully IDT set. If you test the code, it halts the PC. I only load a functio for the IRQ1 that prints a text on screen. But it don't I don't know why.
Can post the code you have please?
I don't want you lose time with my problems
thanks.
Re:C code
Here is my LoadIDT (setidt) and remap ints functions...they are in asm:
; For remapping the PIC so the IDT will work correctly in Protected Mode.
; NOTE: This is not enabled to be called in the C++ Kernel.
;REMAP INTERRUPTS 0-15 --> 0x20 - 0x2f
RemapInts:
in al,0x21
mov ah,al
in al,0xA1
mov cx,ax
mov al,0x11
out 0x20,al
out 0xEB,al
out 0xA0,al
out 0xEB,al
mov al,0x20
out 0x21,al
out 0xEB,al
add al,0x8
out 0xA1,al
out 0xEB,al
mov al,0x04
out 0x21,al
out 0xEB,al
shr al,1
out 0xA1,al
out 0xEB,al
shr al,1
out 0x21,al
out 0xEB,al
out 0xA1,al
out 0xEB,al
mov ax,cx
out 0xA1,al
mov al,ah
out 0x21,al
mov ecx,0x1000
cld
picl1: out 0xEB,al
loop picl1
; Exit
ret
; For loading the IDT in the C++ Kernel module.
; C Definition:
; void loadidt(descriptor_reg *idt_ptr);
loadidt:
push ebp ; Get the descriptor_reg argument
mov ebp,esp
lidt [ebp+8] ; Load the IDT
mov esp,ebp
pop ebp
; Exit
ret
; For remapping the PIC so the IDT will work correctly in Protected Mode.
; NOTE: This is not enabled to be called in the C++ Kernel.
;REMAP INTERRUPTS 0-15 --> 0x20 - 0x2f
RemapInts:
in al,0x21
mov ah,al
in al,0xA1
mov cx,ax
mov al,0x11
out 0x20,al
out 0xEB,al
out 0xA0,al
out 0xEB,al
mov al,0x20
out 0x21,al
out 0xEB,al
add al,0x8
out 0xA1,al
out 0xEB,al
mov al,0x04
out 0x21,al
out 0xEB,al
shr al,1
out 0xA1,al
out 0xEB,al
shr al,1
out 0x21,al
out 0xEB,al
out 0xA1,al
out 0xEB,al
mov ax,cx
out 0xA1,al
mov al,ah
out 0x21,al
mov ecx,0x1000
cld
picl1: out 0xEB,al
loop picl1
; Exit
ret
; For loading the IDT in the C++ Kernel module.
; C Definition:
; void loadidt(descriptor_reg *idt_ptr);
loadidt:
push ebp ; Get the descriptor_reg argument
mov ebp,esp
lidt [ebp+8] ; Load the IDT
mov esp,ebp
pop ebp
; Exit
ret