Hacker News new | ask | show | jobs
I'm building an OS, and blogging about it. Here is Day 1
24 points by shabbushambles 1348 days ago
Day 1 of building an OS: In what is sure to be the absolute craziest endeavor undertaken by a less blissful and youthful version of myself than started college all those years ago, I intend to build my own OS from scratch. Almost certain to drive me up a wall, I am almost there simply from my repeated abjest failures looking for a job in software engineering. In the spirit of that movie about that 30-something woman who cooked her way through Julia Childs cookbook just to say she did, as well as I guess the guys who did the Everest Doc from the early 2000's, I have decided to blog about it daily until I am done. So saddle up cowpoke, you might be listening to me whine for a while. Today I sat down and began to read. What began as a naive and infantile hope slowly turned sour and then grim as the enormity of the undertaking loomed before me. I stumbled upon a book, "Linux From Scratch", that seemed as though it might serve as a good building block towards the project. I have made it about halfway through Chapter One and spent the remainder of the night downloading and updating various tools I will have to use to build a custom Linux implementation. Please note, this Linux implementation is not actually the OS but only a toy example to get a grip on the levers and buttons I wanna be working with during the actual project. This seems to me a useful stepping stone because there is a very clear target: Linux implementation. I know what that is, what it does, how it works, etc. Thus, if I can build a THING that does that THING I will have hit my mark and gained requisite knowledge. Anyway, this feels like a logical stopping point for day 1. Tomorrow I intend to start to make my way through the book proper. This journey is going to be certainly very interesting. Pray for me.

If you would care to follow along as I lose my sanity, but hopefully gain a sanity's worth of knowledge: https://rschmollinger.wixsite.com/bashing-my-head-agai

9 comments

What is it with this recent trend of people posting their projects before they've done any work whatsoever on them?

Last week we had libsql with a disparaging blog post about sqlite but zero code written, this week we have someone who says he's going to build a Linux distribution but has only penned a single blog post that says just that, nothing else.

Can we get back to posting and upvoting things where some actual work of interest has been completed? Doesn't have to be a finished product, but like, anything at all would be nice. Thanks.

>What is it with this recent trend of people posting their projects before they've done any work whatsoever on them?

Because the opposite is a waste of time. If you build code, and it gets totally ignored, what was the point? Do you think the Time Cube^H^H^H^H^H^H^H^H^, ok... maybe he would have anyway... but if nobody is going to reward the effort, why waste it?

Besides... it's always been done this way

  Hello everybody out there using minix -
  I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things).

  I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-)

  Linus (torv...@kruuna.helsinki.fi)

  PS. Yes - it's free of any minix code, and it has a multi-threaded fs.
  It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(.
That sounds like he did a lot of work before he posted it. It wasn't complete, but it had work done.

Day 1 of I'm going to work on X is not really interesting, unless it's part of a series where we know there's a bunch of days.

I would recommend NOT using "Linux from Scratch". LfS is great if you want to understand how Linux is configured and built. But as a general OS reference work it is lacking.

Instead look at XV6 (https://pdos.csail.mit.edu/6.828/2012/xv6.html), IMHO opinion it is a cleaner, simpler work and has some excellent educational materials as well.

Is this a rite of passage? Seems there are hundreds of OS's out there, most of which remain the creator's pet.

BTW: your linked web address doesn't seem to work.

I'll check it out! I'm not sure about a rite of passage but it is a challenge and builds new skills and knowledge. I think I am going to learn alot through this process and have a really cool portfolio piece at the end of it!
xv6 is still my favourite:

- The codebase is very small. Study the PDF references a few days, and eventually you'll start to understand how things work.

- No convoluted build system. Just "make xv6.img". Done.

- No need to build a custom compiler from source. On Linux systems: GCC supplied by your favourite package manager is sufficient. On Mac: install i386-elf-toolchain via Homebrew.

- Plenty of folks customizing it, like adding their own syscalls or a custom scheduler or a file system integrity check (Github is your friend).

Agreed. Linux from scratch pretty much has zero to do with writing an an os from scratch.
Interesting. I would like to build an OS or just a kernel myself, as a means to demystify, learn and have fun.

Where does one start? Any resources to recommend? Another comment suggests xv6, is that sufficient or do I need complementary stuff (e.g. I started reading "Code: The Hidden Language of Computer Hardware and Software")?

FWIW I have systems (Linux) experience as I worked in DevOps before.

It would be awesome if the guys who did From Nand to Tetris [0] would do something similar for operating systems. For those who have never heard of Nand to Tetris, it's an informal course that takes you from low-level gates (NAND gates) to build up a processor/memory/computer, assembler, compiler, and then be able to program and run games like Tetris on it. It's outstanding and highly recommended.

[0] https://www.nand2tetris.org

I've read other people praising this here on HN. Thanks for reminding me that, I'll give it a go!
Same. I'm looking for challenging projects to improve my skills. I've learned a lot from implementing language interpreters. I'm guessing OS implementation can be equally rewarding.

I've looked at the Minix and Xinu books, which are probably the most practical books available. But these appear to be describing existing code instead of guiding you to code along. Anyone knows good resources that guide you from scratch?

Check "Operating System Design Book Series": https://www.fysnet.net/osdesign_book_series.htm

Just remember I own the first 2 books, and haven't finished studying it. Oh well :p

Lots of books on operating systems and concepts. Check your local library. Otherwise https://wiki.osdev.org/Main_Page
Thanks. That seems as a good resource and would probably stumble on that when I learn more specific things to search for.
FYI I've created an Ask HN thread about this: https://news.ycombinator.com/item?id=33174341
Thanks. Hopefully some hidden gems show up. :-)
Take an emulator of a platform of your choice and work your way to have it display something that you like it to display without booting any existing image before
I don't know if this helps or not, but I actively don't follow any blogs/vlogs that claim to be doing a grandiose undertaking (building an os, making a game, building an mmorpg, etc).

These projects all end up the same-- 1~30 entries and then stale with no updates for several years (or ever again). I don't want to commit to something that will never be finished.

How can you make content like this that I would be engaged in? Perhaps finish the project first, and then blog/vlog the steps. If I knew there was an end (even if it ended up not being "completed"), I would be much more willing to commit to it.

I understand this completely. And I intend to do so when the project is complete, don't you worry. But I also think that by putting the project out into the world it will maybe push me towards completion. But I will be vlogging and blogging and coding my little heart out and then upon completion, I'll make an updated post for SURE
I understand _why_ people post things like this. In my experience very few people follow through with the projects because accountability and internet points are not a very strong force.

I have fallen into the same trap myself (I have dozens of half-baked projects).

New Github blog: https://shabbyshambles.github.io/ Youtube vlog channel: https://www.youtube.com/channel/UCG3NbVuE8sfp3sFbQnj73nQ Day 2 update goin up asap! Just finishing up getting Qemu setup
For those of you saying Wix is shit: I agree Have a github https://shabbyshambles.github.io/OS/

Also, vlogging this project on my youtube channel: https://www.youtube.com/channel/UCG3NbVuE8sfp3sFbQnj73nQ

I don't want to nitpick, but consider using multiple paragraphs and headings to make your writing clearer.

Instead of a readme, possibly use Github pages for the project blog (if you don't want to host/pay for your own site).

Yes! I didn't even know Github offered this. Exactly what I was looking for.
See also "Write your own Operating System". 34 videos, 29 hours.

https://youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5Hhgs...

Are you building a distro of linux or will you write a kernel too?
Looks to be a distro.
No, you worthless-trash! ;-) He wrote that he thinks it'll be a good place to get an idea of how to build and os from scratch (with which I disagree).
From my limited experience, building a kernel is much different than assembling the parts from existing tooling.

(I agree with you).

Absolutely, this is also why I don't think lfs is suitable. Something more general on operating system design (not that I know of any recent books) and the specifics of your target platform is going to be a much better start.
it is yet another Linux distro.
can you move to github blog instead of this wixsite?
Ask and ye shall recieve: Shabbyshambles.github.io Also, vlogs! https://www.youtube.com/channel/UCG3NbVuE8sfp3sFbQnj73nQ
Damn Wix looks so bad.