Page 1 of 1

Problem with GDT, ISR and IRQ

Posted: Mon Sep 08, 2025 1:42 am
by artinel
Hello
I hope you all doing well
I'm writing a 32 bit kernel for x86 and i have setup gdt, idt, isr, irq, pic and such.
The problem is that the isr handler does not get called when a exception occurs(Divide by zero for example). The same thing for irq as well. I searched a lot about this but i couldn't figure out what the problem is. I don't know if the problem is gdt, idt, isr or something else like my linker script.
I really appreciate it if you could look at my project (https://github.com/artinel/artik)(idt branch) and tell me what the problem is.
Thank you for your time.

Re: Problem with GDT, ISR and IRQ

Posted: Mon Sep 08, 2025 6:06 am
by MichaelPetch
uint8_t base_high should be 'uint16_t base_high'. As a result your IDT entries are 7 bytes in size rather than 8.

Re: Problem with GDT, ISR and IRQ

Posted: Mon Sep 08, 2025 9:16 am
by artinel
MichaelPetch wrote: ↑Mon Sep 08, 2025 6:06 am uint8_t base_high should be 'uint16_t base_high'. As a result your IDT entries are 7 bytes in size rather than 8.
Thank you so much.
I don't know why i didn't notice it but you really saved me there.