-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
16-bit real mode for the x86 code #1
Comments
Hello @indigoparadox, Also note that the Thank you! |
Thank you! And sorry for not noticing this sooner! It's been a little while, but I believe I had realized that syslinux or grub would leave me in protected mode after flailing around for a bit, and then the realization that I wouldn't be able to quickly or easily "cheat" by using multiboot caused me to drop it for the moment. Returning from protected mode seemed a bit more complicated than I was prepared to deal with. Your code is a bullseye, though! I dropped it into boot.s and put everything together, started it with bochs and it just worked. I'll be sure to study it thoroughly. I truly appreciate it! Ultimately, I would like to write my own 16-bit bootloader so I could run this on an 8086. Though that might be a ways off. Thank you again! |
Hello @indigoparadox,
Thank you, and you are welcome. 🙂 A quick explanation of my code: for switching to protected mode to real mode, it is normally necessary to at least
Without these, the processor will likely end up in a weird state (e.g. real mode but with code in 32-bit mode), which will not be very conducive to interfacing with the ROM BIOS. If you are interested, there is a more complete procedure and sample code for the mode switch at the OSDev wiki. Thank you! |
Hello @indigoparadox,
It seems to me you wish to get the
kmain ()
routine to run in real mode on an x86.One way you can do this is to get the startup code to return from 32-bit protected mode to real mode (because the Multiboot mechanism in
/mboot.c32
will put the machine in 32-bit protected mode). E.g.Alternatively, a more direct way might be to modify your
src/syslinux.cfg
to not use/mboot.c32
. If I understand things correctly, this should directly load your binary code as a 16-bit program.I hope the above helps. Thank you!
The text was updated successfully, but these errors were encountered: