HNHacker News
TopNewBestAskShowJobs

UnmappedStack

263 karma · joined April 24, 2025

Personal website: unmappedstack.dev
submissionscomments
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Given that pregnancy tests can now run Doom, I have to agree with you. It was more of a symbolic thing than a technical difficulty at this point lol.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Well, it can do a little more than run Doom, that's just the latest milestone as to what was ported last. It wasn't a huge effort, maybe took a week or so to get Doom itself running including adding libc requirements for Doom, but what came before that was a fair bit more groundwork. I used DoomGeneric, which is basically a fork of Doom which is made to be very portable. I hope I answered your question, I might have misunderstood.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
I use paging for virtual memory, which gives each process it's own address space. I have a round-robin scheduler connected to the PIT driver, so every 10ms the PIT fires an interrupt which triggers the scheduler, which selects the next task, saves the current state of the previous task, switches to the new address space, switches the stack, restores registers of the task, then uses the iretq instruction to switch to ring 3 user mode and jump to the instruction pointer.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Very nice!i
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Haha not quite at the point Hurd has gotten. I'd be very happy if I could last that long on one project though, I have a tendency to get bored after a few months sadly.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
I could probably do that. The init program, which is a userspace program called by the kernel which spawns everything else, currently enters the shell but it'd be quite simple to make it just boot into Doom immediately. It's still not quite stable enough for actual usage, but it is able to boot off a USB at the moment, yes.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Well, the LibC is still quite small, and the syscalls aren't really compatible with Linux. A lot of things to port, for example Vim, require system libraries such as ncurses which need syscalls that aren't in the LibC. I don't really need many #ifdefs, at least not for most things, as it's a more or less posix-based libc.
UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Not disappointed at all to answer! Running it on my laptop was literally just formatting a USB with the ISO and booting from the USB.

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.

UnmappedStack··on Show HN: My from-scratch OS kernel that runs DOOM
Yeah definitely an achievement I'm happy with. I've got a bit of refactoring to do, ANSI parsing etc then I'd like to port more - perhaps even Vim (or another portable Vim-like editor called Dim)
← PreviousPage 2 of 2