4 ms·
I'm part-way through my implementation of an x86_64 experimental OS and had to address all the issues you're facing right now. I didn't really document my proc
by bee_vik 10y ago
I'm part-way through my implementation of an x86_64 experimental OS and had to address all the issues you're facing right now. I didn't really document my process, but the code to get everything booted into x64 mode is there, including setting up the TSS.
https://github.com/beevik/MonkOS https://github.com/beevik/MonkOS
In particular, the bootloader:
https://github.com/beevik/MonkOS/blob/master/boot/loader.asm https://github.com/beevik/MonkOS/blob/master/boot/loader.asm
- steveklabnik 10y agoNeat thanks! I will check it out. It's really the context switching itself that's the trickiest part, I think. Or all of it. To me, it feels exactly like when I was learning about interrupts: while I was doing it, it was so tough... but as soon as I got something working, it made perfect sense and I wondered why I found it so hard in the first place.
- bee_vik 10y agoOne resource I found myself consulting over and over again was the Intel Architecture Software Development manuals (https://software.intel.com/en-us/articles/intel-sdm https://software.intel.com/en-us/articles/intel-sdm). They're huge and obviously a bit dry, but they had about 90% of what I needed to know about x86 memory architecture and interrupts. I included some other resources I consulted in the README. The OSDev wiki (http://wiki.osdev.org/Main_Page http://wiki.osdev.org/Main_Page) is also good, although I found some of it to be dated or incorrect. Good luck on developing your OS. Even though I'm not finished, it's been an extraordinarily valuable and educational process.
- steveklabnik 10y agoYeah, I probably need to just take a weekend day and actually read rather than skim and look for secondary sources. The OSDev wiki's pages on this particular topic are all kind of okay, but often aren't talking about long mode, only protected mode, or only have bits and pieces. Thank you! Good luck with finishing yours, as though these things are ever finished :)