I am a graduate student, currently working on building a x86_64 unix like preemptive kernel from scratch, as part of a course. Most of the OS dev guides and books focus on 32 bit arch and I haven't found a single guide so far that is based on 64 bit arch.
Since this this guide seems to be in its inception, I hope someone (hopefully me) will send a pull request for a 64 bit tutorial.<p>Building an OS has been in my bucket list for long and it has been one heck of an experience so far.<p>Here are some good step-by-step OS-from-scratch programming guides<p><a href="http://jamesmolloy.co.uk/tutorial_html/index.html" rel="nofollow">http://jamesmolloy.co.uk/tutorial_html/index.html</a><p><a href="http://www.osdever.net/bkerndev/Docs/title.htm" rel="nofollow">http://www.osdever.net/bkerndev/Docs/title.htm</a><p><a href="http://www.ijack.org.uk/" rel="nofollow">http://www.ijack.org.uk/</a><p><a href="http://www.brokenthorn.com/Resources/OSDevIndex.html" rel="nofollow">http://www.brokenthorn.com/Resources/OSDevIndex.html</a><p><a href="http://viralpatel.net/taj/operating-system-tutorial.php" rel="nofollow">http://viralpatel.net/taj/operating-system-tutorial.php</a><p>and here's a good wiki for reference<p><a href="http://wiki.osdev.org/Expanded_Main_Page" rel="nofollow">http://wiki.osdev.org/Expanded_Main_Page</a>
It's not C/C++. C/C++ is not a language. The project's goal is to write a very simple UNIX-based operating system in C++ (does anyone else smell a contradiction?). The code is predominantly C++.
A hobby operating system project - everyone's gotta have one, right?<p>There are many like it but this one is mine: <a href="https://github.com/rikusalminen/danjeros" rel="nofollow">https://github.com/rikusalminen/danjeros</a><p>It's an x86_64 bare bones kernel project, doesn't do much except for boot and handle some interrupts. There's a little multitasking and some related stuff.<p>Unfortunately there's only a finite amount of time in the world, and not too much of it is available for me to dedicate to this project.
Who remembers Nachos?<p><a href="https://en.wikipedia.org/wiki/Not_Another_Completely_Heuristic_Operating_System" rel="nofollow">https://en.wikipedia.org/wiki/Not_Another_Completely_Heurist...</a><p>3rd year OS class we had to use Nachos as our base OS and build your usual file management, pipes etc. functionality on top of it.<p>Really taught you how an OS works.
Fyi, at least at first, this looks like it will be very similar to a few wonderful tutorials and projects I have been going through lately:<p>* <a href="http://www.jamesmolloy.co.uk/tutorial_html/index.html" rel="nofollow">http://www.jamesmolloy.co.uk/tutorial_html/index.html</a><p>* <a href="http://www.osdever.net/tutorials/view/brans-kernel-development-tutorial" rel="nofollow">http://www.osdever.net/tutorials/view/brans-kernel-developme...</a><p>* <a href="https://github.com/klange/toaruos" rel="nofollow">https://github.com/klange/toaruos</a><p>...and just in case anyone is curious, my own project (about half way through James M's tutorial - working on virtual memory management):<p><a href="https://github.com/slunk/Hobbyos" rel="nofollow">https://github.com/slunk/Hobbyos</a><p>Oh, and btw, this looks AWESOME. I am looking through the finished chapters right now!
Might also be worth looking at xv6, which is a rewrite of Unix v6 in modern C, and comes with an exegesis modelled on the classic Lions book:<p><a href="http://pdos.csail.mit.edu/6.828/2012/xv6.html" rel="nofollow">http://pdos.csail.mit.edu/6.828/2012/xv6.html</a><p>(Although if you want to run the original Unix v6, written in a now-archaic proto-C --- unsigned integer variables are declared as pointers because "unsigned" itself wasn't directly supported in the language yet --- PDP-11 emulators and system images are readily available.)
For those who are interested in developing a realistically useful small OS in C++ (or even C++ 11), you may probably want to check out OSv <a href="https://github.com/cloudius-systems/osv/" rel="nofollow">https://github.com/cloudius-systems/osv/</a> developed by previous KVM guys.
Been reading Massalin's Thesis on Synthesis OS (partially evaluated, dynamically generated kernel code), it's a refreshing and very inspiring read:<p><a href="http://valerieaurora.org/synthesis/SynthesisOS/" rel="nofollow">http://valerieaurora.org/synthesis/SynthesisOS/</a>
Maybe a little irationally, the idea of programming an os in c++ strikes me as very opaque. I think the vipri[1] approach of layering dsls, or the smalltalk idea of a relatively simple vm to <i>seem</i> more understandable than an os that embeds a c++ runtime...<p>As a side note, when looking up [1] I also ran across [2].<p>[1] <a href="http://piumarta.com/software/cola/" rel="nofollow">http://piumarta.com/software/cola/</a>
[2] <a href="http://www.acm.uiuc.edu/sigops/roll_your_own/1.helloworld.html" rel="nofollow">http://www.acm.uiuc.edu/sigops/roll_your_own/1.helloworld.ht...</a>
How about making a language, compiler, OS and applications and not use C or C++ ?<p><a href="https://news.ycombinator.com/item?id=6829464" rel="nofollow">https://news.ycombinator.com/item?id=6829464</a>
Another very complete tutorial :
<a href="http://www.brokenthorn.com/Resources/OSDevIndex.html" rel="nofollow">http://www.brokenthorn.com/Resources/OSDevIndex.html</a>
This is great. I am just jumping into open source from an academic background. I had assumed that open source was great for directly practical website creating and hosting (back-end, client side etc...) but weaker in terms of learning for OS / compilers. This post and its comments (with linked resources) are making me unsure about this assumption. What do you think?
Here [1] you can find another example of writing OS from scratch. Going through chapters progress is made iteratively by making limited changes in each step. This OS is intended to be (RT)OS for embedded computers, but example arch-level is implemented for x86.<p>[1] <a href="https://github.com/l30nard0/Benu" rel="nofollow">https://github.com/l30nard0/Benu</a>
Obviously this is still in its very early stages, but I can see this becoming a very informative and practical course.<p>I'll definitely be keeping an eye on this. Do you intend on turning this into a book and perhaps publishing physical copies?
"It was written several years ago as one of my first projects when I was in High School"
High school? Really? Are there any proper highschools like these? I am jealous now.
Very interesting. A friend and I tried creating our own OS back in 2002 using interrupts to write the boot program. I wish I had this tutorial back then.