Switching to real mode
Posted: Thu Jan 25, 2007 10:29 pm
This question is not about how to switch to real mode, per se. The process involves jumping to code that is below the 64K mark, or FFFF. I wrote a little routine to copy all the bytes from a routine inside the kernel into a location below the 64k mark but this isn't very satisfactory. I am using nasm as my compiler, and Grub as the boot loader. Is there a good way of getting code below the 64k mark? I would prefer not to use modules, and of course the code needs to be 16 bit. Copying the bytes of the routine to low memory worked, but when I switched instructions to 16 bit and tried to do a far jump to set CS to a proper 16 bit segment, I got an error from nasm similar, can't align .text section to 16 bit, I'm sorry I can't remember the exact error. Any insight would be appreciated. Thanks