Exceptions crash the system
Posted: Sun Aug 16, 2020 12:46 pm
Hi.
I decided to rewrite the core code that works with GDT and IDT.
Now when I try to generate an exception using int my system crashes.
In the kmain() function, I configure GDT and IDT using the init_descriptor_tables()
The init_gdt() and init_idt() functions are used to configure GDT and IDT.
This file describes the functions that update GDT and LDT.
In the interrupt.S file macros describe handlers for the first 32 interrupts(except reserved ones)
All of them should call isr_common_stub() which calls isr_handler(), as a result I expect the handler to print the interrupt number in serial. log, but during the interrupt the system crashes(qemu restarts the kernel).
What might be the problem? GDT and IDT are configured correctly, but the isr_common_stub handler is not called.
I decided to rewrite the core code that works with GDT and IDT.
Now when I try to generate an exception using int my system crashes.
In the kmain() function, I configure GDT and IDT using the init_descriptor_tables()
The init_gdt() and init_idt() functions are used to configure GDT and IDT.
This file describes the functions that update GDT and LDT.
In the interrupt.S file macros describe handlers for the first 32 interrupts(except reserved ones)
All of them should call isr_common_stub() which calls isr_handler(), as a result I expect the handler to print the interrupt number in serial. log, but during the interrupt the system crashes(qemu restarts the kernel).
What might be the problem? GDT and IDT are configured correctly, but the isr_common_stub handler is not called.