TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Very basic Unix-like operating system built when I was younger

150 pointsby SamyPesseover 11 years ago

20 comments

bitwizeover 11 years ago
&quot;This code was written several years ago as one of my first projects when I was in High School so it&#x27;s normal if some parts of the code looks like &quot;crap&quot;.&quot;<p>In other words: &quot;I&#x27;m doing a (free) operating system (just a hobby, won&#x27;t be big and professional like gnu)...&quot;
nobodysfoolover 11 years ago
Please don&#x27;t insult yourself by writing &#x27;not great&#x27; on things that you wrote. You know it&#x27;s not great, I know it&#x27;s not great, but you made an effort and have a basic workable system. Don&#x27;t kid yourself, and don&#x27;t put yourself down. Not everyone can be a &#x27;great programmer&#x27;. 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&#x27;t compare your code to the top 0.01% - no way any of us can be that good.
评论 #6324775 未加载
评论 #6323185 未加载
评论 #6322813 未加载
alexjeffreyover 11 years ago
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&#x27;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:&#x2F;&#x2F;wiki.osdev.org&#x2F;Main_Page</a><p>- <a href="http://forum.osdev.org/" rel="nofollow">http:&#x2F;&#x2F;forum.osdev.org&#x2F;</a><p>- <a href="http://en.wikipedia.org/wiki/Master_boot_record" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Master_boot_record</a> (MBR layout)<p>- <a href="http://en.wikipedia.org/wiki/File_Allocation_Table" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;File_Allocation_Table</a><p>- <a href="http://www.ctyme.com/rbrown.htm" rel="nofollow">http:&#x2F;&#x2F;www.ctyme.com&#x2F;rbrown.htm</a> (full BIOS interrupts list)<p>- <a href="http://www.emu8086.com/interrupts.html" rel="nofollow">http:&#x2F;&#x2F;www.emu8086.com&#x2F;interrupts.html</a> (much friendlier BIOS interrupts)
aidosover 11 years ago
What an amazing achievement. If only I hadn&#x27;t wasted all those years at high school when I actually had a lot of time to spare....
评论 #6321576 未加载
programminggeekover 11 years ago
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&#x27;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...
ancardaover 11 years ago
I can barely do the most basic tasks in programming and you wrote an OS in high school? Bravo.
quaunautover 11 years ago
And thus begins the successor to Linux.
Elzairover 11 years ago
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!
评论 #6321148 未加载
AaronOover 11 years ago
The OP (SamyPesse), is my co-cofounder and we&#x27;re currently building our own Startup together (<a href="https://friendco.de" rel="nofollow">https:&#x2F;&#x2F;friendco.de</a>).<p>I thought you might be interested in seeing what he&#x27;s (and I are) working on now. (We&#x27;ve got some cool open source components here: <a href="https://github.com/FriendCode/" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;FriendCode&#x2F;</a>, that you might want to check out).
评论 #6324608 未加载
kadderover 11 years ago
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:&#x2F;&#x2F;www.cs.berkeley.edu&#x2F;~kubitron&#x2F;courses&#x2F;cs194-24-S13&#x2F;</a><p>Its pretty cool. Unfortunately the Linux VM used for development does not exist any more. But Still cool.
FreeFullover 11 years ago
I&#x27;m having trouble compiling this.<p><pre><code> freefull@freefull-hp ~&#x2F;c&#x2F;o&#x2F;devos&gt; make all Building Kernel make -C .&#x2F;kernel make[1]: Entering directory `&#x2F;home&#x2F;freefull&#x2F;code&#x2F;other&#x2F;devos&#x2F;kernel&#x27; makefile:9: runtime&#x2F;Makefile: No such file or directory makefile:10: core&#x2F;Makefile: No such file or directory makefile:11: modules&#x2F;Makefile: No such file or directory makefile:12: arch&#x2F;x86&#x2F;Makefile: No such file or directory make[1]: *** No rule to make target `arch&#x2F;x86&#x2F;Makefile&#x27;. Stop. make[1]: Leaving directory `&#x2F;home&#x2F;freefull&#x2F;code&#x2F;other&#x2F;devos&#x2F;kernel&#x27; make: *** [all] Error 2</code></pre>
评论 #6321183 未加载
评论 #6324086 未加载
rajeevkover 11 years ago
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:&#x2F;&#x2F;www.avabodh.com&#x2F;cxxin&#x2F;cxx.html</a>, <a href="http://www.avabodh.com/cin/cin.html" rel="nofollow">http:&#x2F;&#x2F;www.avabodh.com&#x2F;cin&#x2F;cin.html</a>)
rsmaniakover 11 years ago
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 &quot;I&#x27;m going to write an OS form scratch&quot;, what&#x27;s the first step, what&#x27;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&#x27;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.
TimFogartyover 11 years ago
I thought this was pretty cool. It would be fun to do something like this and I&#x27;m sure I&#x27;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:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;1224617&#x2F;how-can-i-build-a...</a>
r4phaover 11 years ago
Nice! And I wouldn&#x27;t call it &quot;very basic&quot;. It&#x27;s inspiring to see how far you&#x27;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:&#x2F;&#x2F;github.com&#x2F;raaapha&#x2F;sos</a>), and I&#x27;m in college. Now _that_ is &quot;very basic&quot;!
eksithover 11 years ago
Suddenly, everything I&#x27;ve done thus far seems rather inadequate. However, kudos for doing this! I hope you haven&#x27;t stopped working on it.<p>Looks like you&#x27;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:&#x2F;&#x2F;github.com&#x2F;SamyPesse&#x2F;devos&#x2F;blob&#x2F;master&#x2F;kernel&#x2F;arch&#x2F;x...</a>
评论 #6320842 未加载
评论 #6323812 未加载
AaronOover 11 years ago
I&#x27;m adding support for Vagrant.<p>So you can boot the whole thing with Vagrant. Check out the latest commits.
1angryhackerover 11 years ago
How long did this take? What would you estimate your C++ proficiency was when you wrote it?
评论 #6320923 未加载
girvoover 11 years ago
Hey! I wrote a kernel in Highschool too, after being inspired by Linus&#x27; &quot;Just For Fun&quot;. Amazing experience, although mine was in C and nowhere near as complete as yours. Well done!
Moral_over 11 years ago
Why did you decide to do it in C++ and not C?