[Solved] Development environnement problem or code errors ?
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
[Solved] Development environnement problem or code errors ?
Hello all,
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 !
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.
Working on multi-tasking support ...
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
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.
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
Thanks, I'm confused, if I debug with while(1), it seems that the GPF happens after .
Edit : Thanks JamesM, I will do my best !
Edit 2 : I debugged idt.s with jmp $ and it seems that's a problem with iret .
Code: Select all
asm volatile ("int $0x4");
Edit : Thanks JamesM, I will do my best !
Edit 2 : I debugged idt.s with jmp $ and it seems that's a problem with iret .
Working on multi-tasking support ...
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
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.
-JL
Are you sure the bootloader works? Try booting with grub, and see if it still happens.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
Yes and it doesn't give me GPF's .piranha wrote:Did you try putting the while(1) at the top?
Thanks but I prefer to know why it's not working before trying grub ( and again, I don't have Linux, so I can't build a grub floppy image ) .piranha wrote: Are you sure the bootloader works? Try booting with grub, and see if it still happens.
PS : are you sure you are puting your for( ; ; ) at kernel.c ?
Working on multi-tasking support ...
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
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.
-JL
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.
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
Okay thanks =)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.
-JL
Working on multi-tasking support ...
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
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 =/
Please help me, I've done all my best to find the source of the error but I was not successfull =/
Working on multi-tasking support ...
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
-
- Posts: 14
- Joined: Wed Apr 16, 2008 5:12 pm
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.
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]
-
- Member
- Posts: 89
- Joined: Sun Mar 23, 2008 2:23 pm
- Location: [0x8:0x1000]