Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Maybe I bother you again with my problems and my bad English so I apologise
I've verified all my code and it must theoretically work, but after compiling creating the floppy image on Windows ( using Cygwin with a cross gcc ), Bochs boots fine, but, my isr_handler receives an infinit number of interruptions 13 ( GPF ) .
Question : It's a problem with my development environnement or there's a code error ?
Another question : Does someone would kindly to test my code in Linux? Remember to change the name of the GCC compiler, LD and OBJCOPY in Makefile.
PS : I'm using my own bootloader which loads a correct ( at least, I think it does ) GDT instead of using Grub and reloading the GDT .
Thanks !
Last edited by White-spirit on Tue Apr 22, 2008 8:06 am, edited 1 time in total.
Yes, it compiles fine on Linux. Debugging with for(;;); statements, you GPF happens before you kernel.c file even does anything. If I put the loop at the very top of the function it still GPF's.
Did you try putting the while(1) at the top? idk about you, but when theres a loop at the beginning of the function, I assume that the problem is before the function.....
Are you sure the bootloader works? Try booting with grub, and see if it still happens.
Yes, thats where it is.
And before figuring out why something doesn't work you first have to verify that it in fact doesn't work.
And you can download a grub floppy from osdever.net, and there are utilities for mounting images on Windows.
piranha wrote:Yes, thats where it is.
And before figuring out why something doesn't work you first have to verify that it in fact doesn't work.
And you can download a grub floppy from osdever.net, and there are utilities for mounting images on Windows.
I've used GRUB, redefined the GDT in the C code, and compiled the whole code on Linux ( Ubuntu Dapper Drake on an emulated Virtualbox machine ), but it's still the same, so it's not the boot loader ...
Please help me, I've done all my best to find the source of the error but I was not successfull =/
get the bochs debugger, and use that to pinpoint the instruction causing the GPF, then trace all possible causes of that generating said GPF.
Also, check the error code pushed to see if it has anything to do with an external interrupt.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Thanks, the error code is 0x0 and I don't have any idea on what it does mean, I'ill debug the kernel after building a bochs debugger ( but I think it bugs in iret ) .
Having just gone through a problem with identical symptoms, I will share my fix with you. It turned out that the interrupts were actually caused by the PIT firing and my IDT was not properly set up for this. Try adding code to remap the PIC and handle the hardware interrupts, then see if you still get the GPFs.
JamesM isn't getting GPF's with his code ( only software interrupts, no PIC or PIT remapping ), there's probably a little mistake somewhere but thanks I'ill try to remap the PIC .
If you're using floating point numbers you might need to make sure the FPU unit is operation by issuing an FINIT command. I don't know that it'd cause a GPF, but it's worth checking out.