"This code was written several years ago as one of my first projects when I was in High School so it's normal if some parts of the code looks like "crap"."<p>In other words: "I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu)..."
Please don't insult yourself by writing 'not great' on things that you wrote. You know it's not great, I know it's not great, but you made an effort and have a basic workable system. Don't kid yourself, and don't put yourself down. Not everyone can be a 'great programmer'. If there are maybe 20 great programmers in the world that you look up to, there are 200,000 programmers who are average at best. So don't compare your code to the top 0.01% - no way any of us can be that good.
I attempted the very same in my first year of college (in the UK, so about the same age). I only got as far as a memory manager, FAT16 filesystem driver and basic bootloader though so congratulations for making it so far!<p>Here's some great resources for OS dev, if you wanted to take this further (or if anyone else in this thread fancies a shot):<p>- <a href="http://wiki.osdev.org/Main_Page" rel="nofollow">http://wiki.osdev.org/Main_Page</a><p>- <a href="http://forum.osdev.org/" rel="nofollow">http://forum.osdev.org/</a><p>- <a href="http://en.wikipedia.org/wiki/Master_boot_record" rel="nofollow">http://en.wikipedia.org/wiki/Master_boot_record</a> (MBR layout)<p>- <a href="http://en.wikipedia.org/wiki/File_Allocation_Table" rel="nofollow">http://en.wikipedia.org/wiki/File_Allocation_Table</a><p>- <a href="http://www.ctyme.com/rbrown.htm" rel="nofollow">http://www.ctyme.com/rbrown.htm</a> (full BIOS interrupts list)<p>- <a href="http://www.emu8086.com/interrupts.html" rel="nofollow">http://www.emu8086.com/interrupts.html</a> (much friendlier BIOS interrupts)
This is the reason I learned Assembly in high school. I wanted to write my own OS and well it seemed at the time (around 2000) that I would need to know ASM to a bunch of the low level stuff. I didn't really have anyone to tell me I could write a whole OS in C or C++.<p>I got a floppy to boot into my os and print hello world and I learned a ton about how to program a processor. It was fun. Oh the crazy things you do as a teenager...
Bravo indeed! I only started programming in my senior year of high school. I wanted to write an operating system for my senior project, but I thought that was WAY too ambitious. Kudos!
The OP (SamyPesse), is my co-cofounder and we're currently building our own Startup together (<a href="https://friendco.de" rel="nofollow">https://friendco.de</a>).<p>I thought you might be interested in seeing what he's (and I are) working on now. (We've got some cool open source components here: <a href="https://github.com/FriendCode/" rel="nofollow">https://github.com/FriendCode/</a>, that you might want to check out).
Check out: (CS194-24) Advanced Operating Systems Structures and Implementation<p><a href="http://www.cs.berkeley.edu/~kubitron/courses/cs194-24-S13/" rel="nofollow">http://www.cs.berkeley.edu/~kubitron/courses/cs194-24-S13/</a><p>Its pretty cool. Unfortunately the Linux VM used for development does not exist any more. But Still cool.
I'm having trouble compiling this.<p><pre><code> freefull@freefull-hp ~/c/o/devos> make all
Building Kernel
make -C ./kernel
make[1]: Entering directory `/home/freefull/code/other/devos/kernel'
makefile:9: runtime/Makefile: No such file or directory
makefile:10: core/Makefile: No such file or directory
makefile:11: modules/Makefile: No such file or directory
makefile:12: arch/x86/Makefile: No such file or directory
make[1]: *** No rule to make target `arch/x86/Makefile'. Stop.
make[1]: Leaving directory `/home/freefull/code/other/devos/kernel'
make: *** [all] Error 2</code></pre>
I too wrote unix like kernel when I was student (around 8-9 years ago). My kernel was also in C++ and and little bit of asm (nasm)<p>It was very fun experience. Probably that was my most enjoyable time in programming. I learned a lot about many things: OS internals, compilers, device drives, software engineering etc. Also spent good amount of time in exploring C++ object mode. Much later I wrote an online (short) article on C++ object model and how C code is translated into assembly (<a href="http://www.avabodh.com/cxxin/cxx.html" rel="nofollow">http://www.avabodh.com/cxxin/cxx.html</a>, <a href="http://www.avabodh.com/cin/cin.html" rel="nofollow">http://www.avabodh.com/cin/cin.html</a>)
This just makes me feel inadequate...you wrote this in highschool? How old where you back then if I may ask and what made you take the challenge?<p>Also, how does one even start to write their own OS, I mean after you say "I'm going to write an OS form scratch", what's the first step, what's the first line of code and how do you figure out which components you need to implement and how? This is what really boggles me as a 30 year old crud guy, how do you design these sort of systems from scratch (OS's, emulators, compilers, etc)? It just makes me feel...completely useless compared to guys like you, you are so far ahead of the curve its not even funny, I could never reach your level.<p>Congratulations.
I thought this was pretty cool. It would be fun to do something like this and I'm sure I'd learn a lot. I found a lot of helpful information, books, and websites on this Stack Overflow question: <a href="http://stackoverflow.com/questions/1224617/how-can-i-build-a-small-operating-system-on-an-old-desktop-computer" rel="nofollow">http://stackoverflow.com/questions/1224617/how-can-i-build-a...</a>
Nice! And I wouldn't call it "very basic". It's inspiring to see how far you've gone, even at such a young age.<p>I took a shot at os development and it took me almost a month of reading to get something that boots and handles interrupts (<a href="https://github.com/raaapha/sos" rel="nofollow">https://github.com/raaapha/sos</a>), and I'm in college. Now _that_ is "very basic"!
Suddenly, everything I've done thus far seems rather inadequate. However, kudos for doing this! I hope you haven't stopped working on it.<p>Looks like you've worked on the expected base functionality.<p><a href="https://github.com/SamyPesse/devos/blob/master/kernel/arch/x86/architecture.h" rel="nofollow">https://github.com/SamyPesse/devos/blob/master/kernel/arch/x...</a>
Hey! I wrote a kernel in Highschool too, after being inspired by Linus' "Just For Fun". Amazing experience, although mine was in C and nowhere near as complete as yours. Well done!