This is fun!
Continuing my saga of trying to get this running under Ubuntu 14.04 LTS on a MacBook Pro, if you find that enabling long paging causes an infinite reboot cycle (triple fault?) in QEMU, then you might want to check your qemu-system-x86_64 version. Version 2.0 will reboot infinitely as soon as you try to turn on paging. Version 2.1.2, however, works fine.
Is this perhaps a problem with huge pages? Would it help to add another feature test?
In order to prevent more debugging fun, I've downloaded and built your blog_os repo, and I can now see it print "Hello world", so it should be smooth sailing from here. :-)
Once again, thank you for a cool series of blog posts! Are there any OS development books that you recommend for ideas on further enhancing this basic system?
Hi, thank you for the blog posts, finding them really accessible and interesting.
The
test_long_modefunction doesn't look quite right:^ should probaly be (according to your linked OSDEV page):
You're right, thank you! I created an Github issue and will fix it soon: https://github.com/phil-opp...
Thank you! For any further issues I run into would you prefer I posted to the github page?
I ran into another snag, at the end of the paging setup section (just before the GDT section) you state:
"To test it we execute make run. If the green OK is still printed, we have successfully enabled paging!"
I'm assuming (based on trying it out) it would not be bootable at that stage, though it may in some way be down to the specifics of my setup or mistakes on my part.
When run with qemu it repeatedly restarts and doesn't reach an 'OK' boot.
Removing the `enable_paging` call allows the OS to boot properly, though the paging will not be set up. Further forwards, once the GDT is implemented, the OS once more boots without a hitch.
I checked out the repo and stripped out the later steps to compensate for any errors I made in copying.
Thanks again for these posts.
Post issues wherever you want (and thank you for doing it).
Hmm, I can't reproduce it on my machine. I checked out commit 457a613 (see link below) and it ran without problems. Could you try the code from this commit?
Link to 457a613: https://github.com/phil-opp...
Apologies, I did a quick diff against that commit (which runs fine) and found I missed the `align 4096` in `section .bss`. Putting that in fixed it (you did include it in this post), fault is all mine.
Thanks again!