GCC LGDT
Posted: Mon Nov 21, 2005 10:29 am
I was using a simple method to test the GDT functions I've made. First I compiled the application and ran it on an emulator, it didn't crash. So it must be working? Maybe, maybe not.
After a lot of messing around with the code, I finally figured out that using the lgdt command with _any_ value allowed the program to run fine. My best bet is I have to reload the CS register - that's what happened before in that protected mode jump. But unfortunately GCC doesn't seem to support the most simple command of "jmp Segment:Label".
Does anyone know how I can solve this problem?
The LGDT command is __asm volatile("lgdt (%0)" :: "r" (value));
(I'm using the GCC compiler, the code is in the kernel which is loaded in protected mode with A20 enabled, a basic GDT set up earlier and yes, it works, yes it can print output, yes there are no other problems anywhere and yes I have looked on google, manuals and tried a few days fixing the problem or else I wouldn't have started this topic.)
After a lot of messing around with the code, I finally figured out that using the lgdt command with _any_ value allowed the program to run fine. My best bet is I have to reload the CS register - that's what happened before in that protected mode jump. But unfortunately GCC doesn't seem to support the most simple command of "jmp Segment:Label".
Does anyone know how I can solve this problem?
The LGDT command is __asm volatile("lgdt (%0)" :: "r" (value));
(I'm using the GCC compiler, the code is in the kernel which is loaded in protected mode with A20 enabled, a basic GDT set up earlier and yes, it works, yes it can print output, yes there are no other problems anywhere and yes I have looked on google, manuals and tried a few days fixing the problem or else I wouldn't have started this topic.)