logoalt Hacker News

Minimal x86 Kernel Zig

125 pointsby lopespmtoday at 12:02 AM42 commentsview on HN

Comments

WD-42today at 6:08 AM

Here's one for Risc-V that's a little more fleshed out, also in Zig: https://github.com/Fingel/aeros-v/blob/main/src/kernel.zig

kunleytoday at 7:48 AM

Why to spread confusion and call it bare metal when it's run under QEMU? Then it's not bare metal at all.

In order to be run on bare metal it's needing another bootloader which the documentation only barely mentions.

More on the naming: why to call it kernel?

show 1 reply
6r17today at 5:00 AM

I'm very surprised it's *that* short - handling one in rust i'm surprised by the very low amount of code to get that up. Thanks or sharing that was a first time reading some Zig for me !

show 1 reply
csensetoday at 2:22 AM

Very neat. To clarify, Qemu can boot it, but I'm pretty sure you need some bootloader (e.g. Grub) to boot it on a physical system.

show 3 replies
boricjtoday at 8:40 AM

I wrote something similar a while ago: https://github.com/boricj/hang-os

It handles interrupts/traps and targets the aarch64 QEMU virt platform. It also features a HAL.

aryalaaditoday at 5:23 AM

thats not a kernel

show 1 reply
ajxstoday at 1:50 AM

See also: https://wiki.osdev.org/Zig_Bare_Bones

show 2 replies
drnick1today at 4:31 AM

What's the point of doing this in "Zig" instead of C, the traditional choice for this kind of thing?

show 9 replies
gethlytoday at 7:28 AM

wtf? 10 lines of hello world code is not a kernel.

messetoday at 5:24 AM

Minimal slop.

throwaway27448today at 3:25 AM

Why choose intel? Let's build bootable software in 2026

show 1 reply
xx__yytoday at 3:41 AM

Gold! I see Zig, I upvote!

show 1 reply