LGDT crashing bootloader

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.
mrnoob
Member
Member
Posts: 26
Joined: Thu Sep 18, 2008 11:45 am

Re: LGDT crashing bootloader

Post by mrnoob »

also if this was a PEBCAK then someone else would have surely noticed my mistake.
User avatar
Combuster
Member
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: LGDT crashing bootloader

Post by Combuster »

Claiming
bochs doesnt work on my pc
Is almost PEBCAK by definition.

P.S. Try to follow these guidelines: http://www.catb.org/~esr/faqs/smart-questions.html - especially the part about bugs
"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 ]
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: LGDT crashing bootloader

Post by neon »

I dont see any indication between 16 bit and 32 bit code sections (bits 16 and bits 32)...although this would not cause your problem. However, if your INT 0x10 call re-enables hardware interrupts it will triple fault as soon as you enter protected mode.

I recommend insuring its disabled before the jump into protected mode. Also, posting your Bochs log file will be helpful in finding the problem. If Bochs displays PANIC errors, then post them here so that we can guide you in fixing them.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
tantrikwizard
Member
Member
Posts: 153
Joined: Sun Jan 07, 2007 9:40 am
Contact:

Re: LGDT crashing bootloader

Post by tantrikwizard »

mrnoob wrote:lgdt[cs:gdtr], i get a syntax error and i cant seem to get any kind of segment:offset links working
What assembler are you using? Some assemblers will require some extra info: lgdt [fword ptr cs:gdtr]
mrnoob
Member
Member
Posts: 26
Joined: Thu Sep 18, 2008 11:45 am

Re: LGDT crashing bootloader

Post by mrnoob »

as86. I have since realised that it isnt supported by any kind of forum and is basically made of fail. Ill be converting the code to nasm to be in with a better chance.
mrnoob
Member
Member
Posts: 26
Joined: Thu Sep 18, 2008 11:45 am

Re: LGDT crashing bootloader

Post by mrnoob »

alright ive fixed it and have just completed a small multi-os bootloader for use with my OS!
Thanks for the help
Post Reply