frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I wrote an OS in 1000 lines of Zig

https://github.com/botirk38/OS-1000-lines-zig
84•botirk•3d ago

Comments

botirk•3d ago
I wanted to understand what the bare minimum of an operating system looks like.

So I built one in Zig, keeping the whole thing under 1000 lines of code.

It can: → Boot from GRUB → Manage memory → Schedule simple tasks → Output text to VGA

The point was not to make it feature-rich, but to show how much is possible with just a few hundred lines if you strip everything down to the essentials.

noone_youknow•2h ago
Nice work! Looks like most of the basics are covered, and meanwhile in my current kernel the RISC-V entrypoint is >700 lines (of C) just to get to the arch-independent entrypoint!

I was just looking around for your input/output code, I don’t know zig but I expected to find putChar in kernel.zig based on the import in common.zig, but I don’t see it, should I be looking somewhere else? I didn’t see any simple command line processing either as mentioned in the README?

Mostly just looking around since your README mentioned VGA (and you seem to have a BIOS boot) which struck me as interesting on a RISC-V project, I was curious if you were actually using the SBI routines or had actually mapped in a VGA text mode buffer?

cyberclimb•2h ago
Hi botirk, really interesting project!

If I build the project what is the output format and how could configure things to boot it?

I know how to this with IMG and ISO files of course but not sure what to do with the build output if it's an executable?

Also any insights into whether this would also boot on an ARM machine? Thanks!

coffeeri•1h ago
Check the build.zig file. It defines the arguments for QEMU to run the OS.

You should be able to run zig build run.

hdjxjdjdkshsb•56m ago
Curious: is it 1k lines of zig total with no libraries or 1k lines of zig with libraries?
mcny•38m ago
I don't know zig but the only import I see here is std so my guess is there are no libraries here?
tjpnz•28m ago
Nice project! I'm more accustomed to building and running these using QEMU/VirtualBox (which I understand you can do with here). But what's going on when I build and execute it under the host OS? Is it also running in userspace?

Why is Venus hell and Earth an Eden?

https://www.quantamagazine.org/why-is-venus-hell-and-earth-an-eden-20250915/
34•pseudolus•1h ago•32 comments

Sj.h: A tiny little JSON parsing library in ~150 lines of C99

https://github.com/rxi/sj.h
280•simonpure•7h ago•147 comments

Be Careful with Go Struct Embedding

https://mattjhall.co.uk/posts/be-careful-with-go-struct-embedding.html
22•mattjhall•1h ago•16 comments

Show HN: I wrote an OS in 1000 lines of Zig

https://github.com/botirk38/OS-1000-lines-zig
84•botirk•3d ago•7 comments

Lightweight, highly accurate line and paragraph detection

https://arxiv.org/abs/2203.09638
33•colonCapitalDee•3h ago•3 comments

Calculator Forensics (2002)

https://www.rskey.org/~mwsebastian/miscprj/results.htm
57•ColinWright•3d ago•25 comments

40k-Year-Old Symbols in Caves Worldwide May Be the Earliest Written Language

https://www.openculture.com/2025/09/40000-year-old-symbols-found-in-caves-worldwide-may-be-the-ea...
89•mdp2021•3d ago•50 comments

DXGI debugging: Microsoft put me on a list

https://slugcat.systems/post/25-09-21-dxgi-debugging-microsoft-put-me-on-a-list/
194•todsacerdoti•9h ago•62 comments

Procedural Island Generation (VI)

https://brashandplucky.com/2025/09/28/procedural-island-generation-vi.html
21•ibobev•3h ago•2 comments

Timesketch: Collaborative forensic timeline analysis

https://github.com/google/timesketch
98•apachepig•7h ago•10 comments

I forced myself to spend a week in Instagram instead of Xcode

https://www.pixelpusher.club/p/i-forced-myself-to-spend-a-week-in
176•wallflower•10h ago•64 comments

Why your outdoorsy friend suddenly has a gummy bear power bank

https://www.theverge.com/tech/781387/backpacking-ultralight-haribo-power-bank
150•arnon•12h ago•162 comments

Zig got a new ELF linker and it's fast

https://github.com/ziglang/zig/pull/25299
40•Retro_Dev•1h ago•4 comments

INapGPU: Text-mode graphics card, using only TTL gates

https://github.com/Leoneq/iNapGPU
28•userbinator•3d ago•4 comments

My new Git utility `what-changed-twice` needs a new name

https://blog.plover.com/2025/09/21/#what-changed-twice
7•jamesbowman•2h ago•1 comments

Unified Line and Paragraph Detection by Graph Convolutional Networks (2022)

https://arxiv.org/abs/2503.05136
85•Qision•10h ago•12 comments

Node 20 will be deprecated on GitHub Actions runners

https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/
55•redbell•1d ago•14 comments

Discovering new solutions to century-old problems in fluid dynamics

https://deepmind.google/discover/blog/discovering-new-solutions-to-century-old-problems-in-fluid-...
22•roboboffin•3d ago•0 comments

How Isaac Newton discovered the binomial power series (2022)

https://www.quantamagazine.org/how-isaac-newton-discovered-the-binomial-power-series-20220831/
46•FromTheArchives•3d ago•8 comments

Apple Silicon GPU Support in Mojo

https://forum.modular.com/t/apple-silicon-gpu-support-in-mojo/2295
80•mpweiher•3h ago•22 comments

LaLiga's Anti-Piracy Crackdown Triggers Widespread Internet Disruptions in Spain

https://reclaimthenet.org/laligas-anti-piracy-crackdown-triggers-widespread-internet-disruptions
304•akyuu•8h ago•124 comments

Oxford loses top 3 university ranking in the UK

https://hotminute.co.uk/2025/09/19/oxford-loses-top-3-university-ranking-for-the-first-time/
226•ilamont•8h ago•333 comments

Show HN: Tips to stay safe from NPM supply chain attacks

https://github.com/bodadotsh/npm-security-best-practices
8•bodash•3h ago•2 comments

A coin flip by any other name (2023)

https://cgad.ski/blog/a-coin-flip-by-any-other-name.html
42•lawrenceyan•3d ago•4 comments

EU to block Big Tech from new financial data sharing system

https://www.ft.com/content/6596876f-c831-482c-878c-78c1499ef543
14•1vuio0pswjnm7•1h ago•3 comments

Bringing Observability to Claude Code: OpenTelemetry in Action

https://signoz.io/blog/claude-code-monitoring-with-opentelemetry/
18•pranay01•5h ago•6 comments

The Counterclockwise Experiment

https://domofutu.substack.com/p/the-counterclockwise-experiment
35•domofutu•1d ago•9 comments

Show HN: Freeing GPUs stuck by runaway jobs

https://github.com/kagehq/gpu-kill
23•lexokoh•8h ago•0 comments

Tiny reactors could one day power towns, campuses; community input will be key

https://theconversation.com/nuclear-in-your-backyard-tiny-reactors-could-one-day-power-towns-and-...
16•rntn•2h ago•2 comments

Why, as a responsible adult, SimCity 2000 hits differently

https://arstechnica.com/gaming/2025/09/thirty-years-later-simcity-2000-hasnt-changed-but-i-have/
209•doppp•3d ago•269 comments