Getting into Protected Mode from GRUB

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.
Crazed123

Re:Getting into Protected Mode from GRUB

Post by Crazed123 »

I checked the FPC website. It says that I've got everything needed for a custom RTL.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Getting into Protected Mode from GRUB

Post by Pype.Clicker »

might it just be that your .BSS section is not filled with zeroes by the loader ? such strange things occur in that case.
Crazed123

Re:Getting into Protected Mode from GRUB

Post by Crazed123 »

OK, here's something. After the code goes through the initialization of units that is inserted by the compiler, it for some reason goes straight into the finalization included by the compiler, skipping my actual OS code completely. Thus, SYSTEM_FINALIZE calls FPC_FINALIZE, which for some reason calls SYSTEM_VARIANT_CLEAR passing nil as the only parameter on eax. It then moves the nil into edx and does a call edx, resulting in a jump to address 0 and the lock prefix crap.

By the way, how do I make it zero out my stack in the .bss section?
Post Reply