Show HN: My from-scratch OS kernel that runs DOOM
319 UnmappedStack 81 4/24/2025, 12:15:22 AM github.com ↗
Hi there! I've been on-and-off working on TacOS for a few months, which follows some UNIX-derived concepts (exec/fork, unix-style VFS, etc) and is now able to run a port of Doom, with a fairly small amount of modifications, using my from-scratch libc. The performance is actually decent compared to what I expected. Very interested to hear your thoughts. Thank you!
Sorry to disappoint you but all I have are some noob questions.
What would be the steps to run this on a laptop? I take it that after building it there would be a process similar to, say, setting up dual-boot in a Windows PC? (Whoa I'm asking a stranger on the Internet how to run dangerous software on my computer...)
If one wanted to undertake such a project, do you have any recommendations of textbooks or other reading material? I had some OS & related courses in university (I'm EE, so computer-adjacent), but they were all very abstract / high level / conceptually-focused. I'd love something more concrete. It doesn't have to be x64.
I would recommend checking out https://osdev.wiki to start out if you want to write a kernel, as well as reading relevant specifications (such as Intel Developer Manual and the specs for any drivers you write). I don't really know much about non-x86 kernel dev but most of the concepts are the same as far as I know, just different technical implementations. There's a link to a discord server on the project's readme, there are some very smart people in there who I'm sure would be more than happy to help you out.
I kid I kid ;) That's a commendable effort and nice job! Question though: was it an effort to make TacOS using DOOM as a "standard" or was it an effort to make an OS dedicated to running DOOM run from scratch?
And I don't ask from any place but actual curiosity. I made an absolute bare-bones-cant-do-anything-but-boot type OS way back "in the day" (like almost 30 years ago, ack!!!) just for my own education/fun, but the idea of having a dedicated OS that can basically only run DOOM, yet be ported to anything would just make the "can it run DOOM" meme so much more ironic and fun!
Nice stuff! Keep it up!!
The big limits if you don't want to get into disk IO, is 512 bytes or less since you're basically running your program as a master boot record. To get more you'll need to load some LBAs from disk which yes there is an interrupt for and osdev has even better stuff.
Other than that, the difference between a .com file (usual limit 64kb single segment) and an MBR style bootable program is pretty minimal
One silly question you may know: Imagine you wanted to use GPU acceleration, even in the smallest form. How hard would it be to build a driver for the GPU? Do you think there is good documentation about it?
I was also thinking about integrated GPUs like the one in a RPi or other SoCs
I get that this is an hobby project, but still why not deprecate unsafe languages where there are much better alternatives?
https://jakobbr.eu/2024/08/19/writing-my-own-x86_64-operatin...
Not so much about security but stability. If a program enters an infinite loop then it never yields and the entire system is hung. Hopefully you have an interrupt you can fire off (like ctl-alt-del) that can wake up the kernel and allow you to take action.
Read the intro : https://pages.cs.wisc.edu/~remzi/OSTEP/dialogue-virtualizati...
https://wiki.osdev.org/ has platform details and other resources.
what is potatOS in this context?
But here's a wacky idea. Just set it up so that the OS only runs DOOM as default. Boots directly into Qemu and runs DOOM, nothing to select or change. Maybe something you could fold other games into so that they can run off a USB boot loader. Might be appealing to people who don't want to install or compromise their base setup.
It's a known quantity, and doom has been ported to everything, so it shouldn't be too hard to make work either (he says, not having done it).
An OS that can run Doom is clearly capable of graphical interfaces with user interactivity, and maybe sound (although sound would be easy to leave out).
Imagine what you could accomplish given 35 years.
It is no way capable than Hurd. It is a cool project though. Have you used Hurd recently? It can run a modern desktop.
No videos of Hurd running Doom either, but anyone is welcome to create one and share.
Hurd is sure not a successful project, but it is a capable operating system. Linux comes with a lot of device drivers for all sorts of hardware, so Linux nowadays can run almost everywhere. But that is not the case with Hurd because only a small number of people are contributing to this project and it is largely eclipsed by success of Linux. But it is an extensible system so if you want support for a hardware, you can develop a driver for it. But nobody is interested.
If you haven't seen Hurd running a desktop, I will introduce you to Debian Hurd (https://www.reddit.com/r/linuxmasterrace/comments/18i6e94/de...). It is a Debian distribution with Hurd as the kernel instead of Linux. It comes with Xorg and you can install XFCE, OpenBox. Basically, you can install any desktop that render on CPU. Desktops like GNOME and KDE need more infrastructure. They relay on modern GPUs and uses direct rendering. In Linux, we have DRI and Mesa for this. As of now, Hurd doesn't have any such infrastructure. As I have already said before, a lot of people are contributing to Linux and only a handful of people are contributing to Hurd.
There's been a few problems with nodejs, as libfuse compatibility isn't the latest yet. Some libraries work fine. Some explode. So you'll have to compile it yourself.
Python and Go, however, should run out of the box just fine.
https://www.debian.org/ports/hurd/
Set up yourself.
And as someone who portedgor Doom working on GNU/Hurd decades ago … I’m going to wager that the GP has never used it. :-)
that's true, you've only shipped to one computer, while they've shipped to dozens!