I have installed an IDT and got handlers working for all 256 interrupts, but i keep getting Double fault all the time.
What are some possible causes for this ?
Getting double fault !
-
- Member
- Posts: 5588
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Getting double fault !
you are absoulotly right ! forgot to remap IRQ's
but now im facing a different problem:
getting an IRQ0 im sending end of interrupt like:
if (r->int_no >= 40) // sending end of interrupt to slave PIC
{
out(0xA0, 0x20);
}
out(0x20, 0x20); // sending end of interrupt to master PIC
but it immediately crashes with qemu:
Trying to execute code outside RAM or ROM at 0x2badb002
im getting suspicious because it is grub's magic number.
how the hell can this happen if in my kernel_init(unsigned int magic , unsigned int adrr)
im popping it off the stack ?
but now im facing a different problem:
getting an IRQ0 im sending end of interrupt like:
if (r->int_no >= 40) // sending end of interrupt to slave PIC
{
out(0xA0, 0x20);
}
out(0x20, 0x20); // sending end of interrupt to master PIC
but it immediately crashes with qemu:
Trying to execute code outside RAM or ROM at 0x2badb002
im getting suspicious because it is grub's magic number.
how the hell can this happen if in my kernel_init(unsigned int magic , unsigned int adrr)
im popping it off the stack ?
Re: Getting double fault !
Could you provide the code, that pushes the arguments? What compiler options do you use?
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Getting double fault !
Considering tutorials push the signature and boot info onto the stack before calling the kernel main, you could see it reappear when the stack gets smashed.
For the actual stack smash, this could very likely be because the interrupt handler does not treat SP properly (like mismatched numbers of pops and pushes) which in the end uses some random part of the stack for the interrupt return instead of the actual interrupted address.
For the actual stack smash, this could very likely be because the interrupt handler does not treat SP properly (like mismatched numbers of pops and pushes) which in the end uses some random part of the stack for the interrupt return instead of the actual interrupted address.
Re: Getting double fault !
Run your code in a debugger. Watch the stack during an interrupt. The problem should be fairly self-evident.