IDT
Re:IDT
Hi, I've just looked at the source code but (If I am not wrong) I could not see where interrupts are set after ints are remapped, I don't know id this is causing problem but in your init_pic function you should enable interrupts... (Am I wrong?) Also Do you have to send disable interrupts to both PICs? I think one is master and one is slave so only disabling master solves disabling both... I might be wrong about this. But a good question, isnt it? Good luck...
Re:IDT
Sure...
[tt]
_int60:
cli
push eax
push ebx
push ecx
push edx
push ebp
push edi
push esi
push es
push ds
push fs
push gs
mov eax, 0
mov gs, eax
mov fs, eax
mov eax, _LINEAR_DATA_SEL
mov es, eax
mov ds, eax
extern _c_int60
call _c_int60
pop gs
pop fs
pop ds
pop es
pop esi
pop edi
pop ebp
pop edx
pop ecx
pop ebx
pop eax
sti
iretd
void c_int60()
{
//do whatever
};
[/tt]
Hope that helps,
K.J.
[tt]
_int60:
cli
push eax
push ebx
push ecx
push edx
push ebp
push edi
push esi
push es
push ds
push fs
push gs
mov eax, 0
mov gs, eax
mov fs, eax
mov eax, _LINEAR_DATA_SEL
mov es, eax
mov ds, eax
extern _c_int60
call _c_int60
pop gs
pop fs
pop ds
pop es
pop esi
pop edi
pop ebp
pop edx
pop ecx
pop ebx
pop eax
sti
iretd
void c_int60()
{
//do whatever
};
[/tt]
Hope that helps,
K.J.
Re:IDT
Here I am again.
I've tried the ISR, but it doesn't works.
the asm file:
global irq1
extern key_press
irq1:
cli
pusha
call key_press
popa
sti
iretd
the C file:
extern void irq1();
void key_press(void)
{
printf("IRQ1_WORKS!\n");
outportb(0x20, 0x20);
}
void start()
{
dir_reg idt;
int ai;
textmode();
ClrScr();
Ini_pic();
asm("sti");
printf("Booting a my OS\n");
idt.limit=8*256-1;
idt.base=0x00000600;
set_idt(&idt);
set_irq(1,irq1);
asm("hlt");
}
the rest of the C file is the same..
K.J. I've tried the one that you have posted too, with the same results.
Ozguxxx sorry, but I'm afraid i dont understand you.
Thanks once again.
I've tried the ISR, but it doesn't works.
the asm file:
global irq1
extern key_press
irq1:
cli
pusha
call key_press
popa
sti
iretd
the C file:
extern void irq1();
void key_press(void)
{
printf("IRQ1_WORKS!\n");
outportb(0x20, 0x20);
}
void start()
{
dir_reg idt;
int ai;
textmode();
ClrScr();
Ini_pic();
asm("sti");
printf("Booting a my OS\n");
idt.limit=8*256-1;
idt.base=0x00000600;
set_idt(&idt);
set_irq(1,irq1);
asm("hlt");
}
the rest of the C file is the same..
K.J. I've tried the one that you have posted too, with the same results.
Ozguxxx sorry, but I'm afraid i dont understand you.
Thanks once again.
Re:IDT
Hi. I have a suggestion (only suggestion ): It would be easier to write all stuff in asm first. I mean KJ's first code which has an assembly stub calling a C function is (I think) the best way to get things work for beginning.
I want to ask a question: Which #ed isr routine are you trying to handle for getting keyboard keys?
BTW your ints.h file is fairly complicated for me...
I want to ask a question: Which #ed isr routine are you trying to handle for getting keyboard keys?
BTW your ints.h file is fairly complicated for me...
Re:IDT
Hi,
I've tried this too, without any result.
The function that the IRQ1 should call is Key_press(); a simple printf function that show on the screen "Key Press".
Has anyone a complete working code about the IDT??? can you post it please??. I think it has to be something simple.. but I don't know what.
I spended so meny weeks with this.. and i'm becoming crazy.
I've tried this too, without any result.
The function that the IRQ1 should call is Key_press(); a simple printf function that show on the screen "Key Press".
Has anyone a complete working code about the IDT??? can you post it please??. I think it has to be something simple.. but I don't know what.
I spended so meny weeks with this.. and i'm becoming crazy.