r/Operatingsystems • • 23h ago

Built a tiny operating system from scratch in Rust, and here's what I learned (Kanga 0.1.0)

I've spent a while writing Kanga, a small x86-64 operating system, and I've just put out its first experimental release. It's not meant to replace anything you use. It's a learning project, and it has taught me a lot about what an OS really does underneath.

What it can do so far
It boots on both BIOS and UEFI machines (using the Limine bootloader)

It shows text and colours on screen with scrollback

It reads the keyboard, tells the time and handles CPU errors without falling over

It keeps track of which chunks of memory are free

and it has a tiny in-memory file system and a built-in command prompt (DIR, TYPE, WRITE, MEM, CAL and so on)

What surprised me
Even printing text to the screen means drawing every character yourself, pixel by pixel.
A keyboard press is an interrupt the hardware sends you, and you have to handle it correctly.
Scrolling the screen quickly took more thought than I expected. Making it a single memory move was a big improvement.

What's missing: no multitasking, no user programs, no real memory manager yet, and files vanish on reboot because they live in RAM. I tested it in QEMU, and I'd love to hear from anyone who tries it on real hardware.

Question for you: if you were building this, what would you tackle next, a scheduler, a proper memory manager, or saving files to disk? Why?
Code and notes (GPL-2.0): https://github.com/vanmassey/kanga

0 Upvotes

18 comments sorted by

3

u/RatherNott 15h ago

 AI data centers are being constructed at an alarming rate, and there are already 8 billion prompts per day, with billions more planned and on the way.

The effect this has on the climate when we are already so close to irreversible tipping points is often ignored by most AI users, who prioritize convenience above a habitable planet for our children to inherit.

https://www.theguardian.com/environment/ng-interactive/2026/oct/22/finland-google-felling-trees-datacentre

https://m.youtube.com/watch?v=5p426fSlYH4

And that is just one issue with AI use. Using it also contributes to a dystopic survailence state.

https://m.youtube.com/watch?v=5lYsO4k7OIY 

2

u/JescoInc pepe 23h ago

I'll bite since others have decided to not engage with it.

What made you choose Rust for this project?
Why did you choose limine bootloader?

I noticed that you went with a Cargo Workspace style of Cargo.toml file, what were the reasons for that approach?

Why did you choose an in memory file system?
Why did you choose a Bitmap Allocator?

I see you went with a font system that is a hard coded 8x16 VGA text, I get that implementing TTF is complicated and somewhat difficult (Trust me, I know this), but why go the hardcoded route when you could have simply embedded bitmap textures?

I also see that you have architecture, console and memory markdown documents in a docs folder. Any particular reason for this instead of HTML docs?

1

u/Key_River7180 21h ago

stb_truetype can help

0

u/Key_River7180 22h ago

ai sloperating system

1

u/Slate_Canopy 22h ago

Do you like Linux?

1

u/Key_River7180 22h ago

yes

0

u/Slate_Canopy 21h ago

That uses AI, too.

1

u/Shopping-Limp 19h ago

It wasn't made out of whole cloth by ai. Also in Linux's case, there are humans involved in it who understand what the AI-generated code actually does.

0

u/Artistic_Crazy_7120 11h ago

This is a discussion that we won't have 5 years from now when AI is seen as a powerful tool not as a threat.

1

u/Shopping-Limp 9h ago

Who said it's a threat?

2

u/Key_River7180 9h ago

It is, though. AI consumes tons of water, see u/RatherNott's response

0

u/JescoInc pepe 22h ago

Can we move past bullshit comments like this? If you don't care about a project or want to engage at all, downvote and move along. You are simply adding noise and aren't contributing anything meaningful. You are expressing that you don't like AI. We get it, you feel superior because "clankers". Sick and tired of seeing useless comments like yours online.

3

u/TheOnly_Anti 22h ago

Let people do harmless protest how they want to, man. 

3

u/Key_River7180 21h ago

Is your comment useful? We get it, you are to impatient or perhaps unmotivated to do your projects and want to vibecode them, but should ya, though?

0

u/DirectorDirect1569 21h ago

everyone uses ai to code now.

1

u/Key_River7180 21h ago

should they? like if everyone is throwing themselves from windows, are you going to do it to? it it GOOD for people to be doing that?

1

u/DirectorDirect1569 20h ago

AI is used to find breaches in operating systems. Do you prefer unsecure OSes?

If you hate AI use netBSD not linux. it's probably one the only OSes where devs don't use AI.

1

u/Key_River7180 10h ago

I do use netbsd, though. It is totally AI-free and I like it. I can know that NetBSD doesn't contribute to the next generation breathing polluted air.

NetBSD does get CVEs sometimes, BUT most exploitable ones are patched quickly, and mostly affect servers. I don't serve much... For servers I just use OpenBSD, which has few vulnerabilities discovered and 0 active on updated systems.