remix logo

Hacker Remix

Show HN: My self-written hobby OS is finally running on my vintage IBM ThinkPad

548 points by joexbayer 2 days ago | 115 comments

Finally got my hobby OS up and running on real hardware. I love the old IBM thinkpads, so thought it was the perfect machine to get it working on. Been working on it for quite some time now, but this has been a big milestone!

moon2 2 days ago

These things are way better to see than stupid AI. It’s not going to “sell”, but it’s a tech person being creative and doing their craft.

I used to study a lot of hobbyist OS development in my late teens. It was awesome, I still try doing small kernels from time to time (last one was a RISCV small kernel that printed a message to my partner).

joexbayer 2 days ago

Thanks! It’s really liberating not having to worry about selling, marketing etc. Only reinvent the wheel till new ideas come. :D

anonzzzies 1 day ago

I did that all my life: no unicorns but if you do enough things, some will sell auto (once any traction happens I sell: I don't like running a company, I like building stuff). Without all this stress and grifting. Granted, I was lucky that my hobby in 2000 turned out to be worth millions, but it still works fine 25 years later.

mvkel 1 day ago

It's weird to characterize ai categorically as "stupid" when, until it was wrapped with clever UX, it was an entirely academic pursuit (craft), with little to no money in it.

bobxmax 1 day ago

little hobby gadgets much more interesting than the most ridiculous technology in human history

sarkron 2 days ago

This is great! What would you do differently if you started again today? What are your thoughts on language suitability for the lower level parts (ie. Sticking to c or a simple subset of c++ or any of the newer languages)?

Given the myriad of resources available, how did you manage to keep the project engaging rather than copying others people code?

joexbayer 2 days ago

Thanks for the feedback! I think the biggest thing I’d do different is to have a plan. I just started out with the goal of doing the basic hello world OS, and that’s it. But then I kept adding new things, adding more and more working on multiple things at the same time. Which has lead to some technical debt I’m still trying to fix. I’d also try to be less UNIX dependent.

Regarding language, I love C for its basic syntax and “straight to the point” style. Maybe I’d consider some other languages for userspace applications.

A goal for me from the start was always that I wanted to write everything myself, no porting of any software, and for me that’s the entire point of the project. I mostly adhered to the rule of copy ideas not code.

greenavocado 2 days ago

Linus' original plan was to write Linux to learn every feature of the i386. Compatibility with other systems came later.

See the message from Linus Benedict Torvalds on 26/08/1991

https://groups.google.com/g/comp.os.minix/c/dlNtH7RRrGA/m/Sw...

zoky 1 day ago

> just a hobby, won't be big and professional like gnu

All I can say is LOL

90s_dev 2 days ago

I'm not sure it's a bad thing to not necessarily have a plan. Intuition is the hidden sister of logic, both children of reason, and we don't always see her because she's often behind the scenes doing all the work.

Technical debt is as sure as death and taxes. Good software grows over time, like a person growing up. Sometimes you have parts that are needed for a time but not permanently, like baby teeth. That's what technical debt is like.

Other times there are parts that are absolutely ideal long term, but it's a long time before they even make sense. And sometimes things only develop much later than we expect, like wisdom teeth. These are software features that won't make sense until you write the thing that you don't realize yet is only temporary.

I have the same goal of writing everything myself from scratch. It's a very important goal to me for a reason I don't fully understand yet.

Congrats on writing an entire OS, and getting it booting on real hardware! That must be such a rewarding feeling in its own right, even if no one understood how. And it looks so very cool.

You've given me more motivation to announce my project soon. Maybe next week. Thanks.

Have you played around with Zig yet? I hear that would be a good replacement for C here. Did you have any thoughts on porting your OS to that, or did you have any branches some Zig code made its way into?

joexbayer 2 days ago

I’d love to hear about you project! Seeing what other people make is a big inspiration. I have not tried Zig, for the kernel I don’t think anything will beat C for me personally. But for userspace applications I’d love to try it!

ayaros 1 day ago

Regarding a plan, I often feel the same way about my own project. There are a number of systems I've rewritten multiple times, and I can't help but think much of that would have been unnecessary if I had been more tedious about diagramming out my needs and requirements beforehand. Other times I wonder if I would have gotten this far had I planned things out... It's the age old question of "would I have started this project if I had known how much time and effort it would have taken?"

Each approach has a clear set of pros and cons, as others have explored in this thread. In the end, I think what ultimately matters is whether we're satisfied (and proud) of a project after a significant amount of progress has been made.

I also took the "I want to write everything myself" approach with my project since I wanted it to be a demonstration of my abilities. I wanted to prove to myself and others I could create a project of significant size and scope. It seems like this often means working without libraries and having to reinvent the wheel over and over again. It's tedious, but it certainly adds to the satisfaction you get as you look over your work and think "this is truly mine; I did this."

And yes, copy ideas, not code, is one of those things I do my best to adhere to. Sometimes, at least with JS, you run into problems, look into solutions, and it turns out there's really only one sensible way to do something; what you end up writing feels like a boilerplate solution to the problem. I often find myself going back and forth through search results from places like Stack Overflow and trying to siphon out the best techniques and ideas from multiple examples to mesh together into some usable code in a style I prefer.

Finally, since I failed to say this eariler, congrats on your project! I'm gonna have to try it out as soon as I get some extra time.

keyle 2 days ago

I'd like to second the mention of plan vs. no plan.

Having no plan is often better when you're facing a deep pit of work, pick at it every now and again, whatever you feel like working on that day.

vs. having a clear Todo list that is longer than a DNA chain and just giving on it after item 5 because 6 is boring.

Oh, and congrats, looks great.

stevage 2 days ago

I find it very hard to maintain enthusiasm and momentum on side projects if there is a plan. It just feels like work.

joexbayer 2 days ago

I guess yeah, a full plan would perhaps make it like work. I guess I meant more like an idea of what the goal is. So I could better plan the features.

stevage 2 days ago

Ah yeah, at least a set of design goals and non goals.

exe34 1 day ago

An anti-plan: things I will never implement.

ayaros 2 days ago

I think the default system font should be a more condensed variant; it would make the system look much more refined. There are a number of areas where it's clear you need more horizontal space for characters. Each character should have less width, and there should be as little space between the characters as possible - just a single pixel ought to be enough at the font size and resolution you're using.

I don't know anything about your font system; I'm assuming it's fixed width bitmap fonts? I don't know how hard it would be to make these changes within your codebase so if it's too much work then don't worry about it.

I've been building a web OS site from scratch for a while now (not as technically impressive as what you're doing) and I just got through a total rewrite of the font classes, so it's at the top of my mind.

joexbayer 2 days ago

I agree my current font is very sub optimal. It’s basically still the original font I got working when I started out. I have looked into rendering proper fonts, so it’s on my todo list. Just have been neglecting it.

90s_dev 2 days ago

I had the same problem, I made a 3x4 font that was just barely servicable for the initial project to show text on screen. It was my first (and only) font I ever made! Eventually I needed lower-case, so I turned those into lower-case and made a 3x5 variant for uppercase. It's still not ideal, and I'm sure when I announce my project, people will complain about it. So I've prepared to say "it's a stop-gap solution to make the OS servicable, but we can make more fonts."

I think people skimming a project often just don't quite get how much we pour into our projects, and how very much it cost us. But it's okay, they don't have to understand just how cool it is what we made. At least we know.

When I saw your video of your project, I was thinking to myself, "wow, that's incredibly cool, and I can relate to the steps he's doing!" Just trying to be the voice here of someone who thought that way, in case there are no others.

JdeBP 1 day ago

One answer to that is to ensure that you accept plugged-in font files via some well-known format like FreeBSD's "vt" font file format, BDF, or GNU UniFont's HEX format; and then just let people get on with picking their own fonts. (-:

Such as https://robey.lag.net/2010/01/23/tiny-monospace-font.html for example.

JdeBP 2 days ago

One can really get bogged down in fonts. (-:

http://jdebp.uk./Softwares/nosh/guide/terminal-resources.htm...

If you want a quick improvement over that 8by8 IBM ROM font, I suggest two things:

1. Switch to a 16by16 square.

2. For the ASCII range, go with one of the old home computer fonts, rather than IBM ROMs. Viznut has .hex files for Commodore PET and BBC Micro graphics modes squirrelled away inside Unscii.

I've done the work of upscaling the 8by8 PET font to 16by16, and it works quite nicely as a monospace square font. These old home computer fonts were of course designed to. Whereas in the world of VGA you're soon in trouble with glyphs designed for 9by16.

joexbayer 2 days ago

Appreciate your response! Will have a look at 16by16 fonts.

ahefner 2 days ago

The 8x16 font from the Atari ST's hi-res mode is pretty slick if you like something bold and a little futuristic. https://github.com/ntwk/atarist-font (or rip it directly from the ROM)

o11c 2 days ago

Supporting variable-width fonts is pretty easy on its own (if bit-packing, you might wish to store them vertically), but does complicate combining characters (remember, they go in different places and may need to make the new character larger).

For vector fonts, the interesting question is "if I render this at a different resolution and then scale it, will it line up?" which fundamentally has no answer that can satisfy everyone. Most other difficulties are merely a Small Matter of Coding (and providing appropriate APIs).

joexbayer 2 days ago

Thanks for the info! Will have to look more into.

peterfirefly 1 day ago

The old Macs had some beautiful bitmapped variable-width fonts -- and a relatively simple font file format.

throw-qqqqq 2 days ago

Tough crowd!

- “Look, I wrote an operating system!”

- “Meh the font is weak”

Peak HN IMO :D

cyberpunk2066 2 days ago

The fact that the OP built an entire hobby OS complete enough to have windowing and font rendering, and got it booting off his vintage notebook, is extremely impressive, and much more so than the ChatGPT frontends and Chrome reskins that HN usually enthusiastically updoots.

ayaros 1 day ago

I meant it as sincere constructive criticism! :) <3

throw-qqqqq 1 day ago

Yeah I thought as much. Sorry for the bad joke, it was not my intention to accuse or offend anyone. The discussion on fonts continued into cool technical areas like bitmapping!

My point was: I would not expect such a response anywhere else but HN :)

Someone in the crowd was already there and is wearing the t-shirt - that’s why I come here <3

alganet 2 days ago

The power of the crowd compells you.

The power of the crowd compells you.

The power of the crowd compells you.

7bit 2 days ago

So what? Someone is not allowed to give constructive criticism?

throw-qqqqq 2 days ago

I tried to make a joke, please don’t take it seriously :)

selimthegrim 2 days ago

They didn't say anything about fonts to Terry Davis

eggy 2 days ago

Congrats! Looks great coming from someone who had a Commodore PET 2001 in 1977. I have been toying with KolibriOS and MenuetOSx64, but I would sure like to try rolling my own OS. You did it! Keep truckin'!

joexbayer 2 days ago

Thanks! Appreciate the encouragement!