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.
I've recently implemented the GDT from http://www.osdever.net/bkerndev. When I compile GDT.c, I get a warning that I believe is causing the renewed Virtual PC errors. Here it is:
That got rid of the warning, but I still can't boot the kernel...the full source code is on SVN at svn://svn.griffinsoft.net/grakos for anyone who wants to have a look.
Do you know exactly what is causing it not to boot? Do you think its in your gdt code? There are a number of things that can go wrong. In order you might like to try instruction tracing, or simply halting the cpu (in c: asm("hlt");) before the points you think might be causing the error - the first thing I'd try is putting one of these just before you load the new gdt.
I've commented out GDTInitialize() (where GDTPointer.Base = ... is located) in Kernel.c to stop the GDT from initializing, yet the problem is still there. The results of ConsoleInitialize(), which was before GDTInitialize(), are never printed. Based on facts, I think that the problem is in Start.asm.
GDTEntry[x] is one gdt entry (equivalent to TGDTEntry)
GDTEntry is an array of gdt entries
which is has the same type as TGDTEntry *
which is a pointer
by setting GDT.base to &GDTEntry you are setting the base as a pointer to a pointer to the GDT. (!)
The correct form is GDTPointer.base = (unsigned int) GDTEntry;
Besides, warnings are symptoms of bad code.
"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 ]
I've done that, and it just prevents warning. Also, I've added the IDT/ISR/IRQ, and it still fails to boot. All of that's on the SVN repository. Please help?
Linking to higherhalf, WITHOUT Stub, WITHOUT Paging, WITHOUT bootloader and you still expect it to work?
"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 ]
Just changing things randomly wont get you anywhere... Methinks you have no clue about the changes you just did to your linker script
What happens, your binary is loaded at some address (i dont know which - you dont use grub and your own bootloader has no sourcecode) but the code is designed to run at a different address. ATM its set to the 1MB mark, which simple bootloaders cant access as it lies outside bill gates' famous 640k. Check with whatever proprietary code you use where your kernel is actually loaded, and put the correct value into your linker script.
If that does not help, please post the bootloader's specs when you come back.
"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 ]