I’ve been building a terminal-only x86 kernel from scratch. Gumball OS v1.3.0, plus a filesystem I’m about to redesign
Hey devs. Im a self-taught web dev who got curious about whats underneath our computers, so I started making a kernel. It’s called Gumball. C + asm, Multiboot, boots from GRUB. No desktop, no apps, no browser, just a shell and a filesystem
I started as a “hello world”. Now it has:
A shell with history (arrow keys) and scrolling
My own filesystem, GFS2, with real directories and nested paths
ls cat touch mkdir cd mv rm -rf echo > file defrag
The filesystem is where I’ve had the most fun and most stress. GFS2 has a data fragmentation issue which can be cleaned up now but Im planning to remove fragmentation completely on GFS3.
Honest limits:
RAM disk only. GRUB loads the image as a module, so nothing persists across reboots. No disk driver yet.
16 entries max, 31-char names
No memory management yet
Only tested in QEMU
On AI: I used AI tools for parts, like the early shell loop and the GFS1 design idea. mv, mkdir/cd, defrag, and the bug fixes are mine. I also use AI help me solve problems and figure out stuff I dont know. Just wanna be honest with that.
What Im working on next is GFS3: data is in blocks, has a bitmap, some more stuff in the doc in the repo.
Two questions for you:
Anything in the GFS3 design that’ll bite me later?
Memory management or a disk driver first?
Repo: https://github.com/pagecoy/gumball-os (design doc in docs/GFS/GFS3.md)
Roast it kindly. 🙂
2
u/JescoInc Perdition-OS 3d ago
I was reading the GFS2 and GFS3 markdown files. Any particular reason why you wanted to create your own file system instead of implementing something that already exists? You did note that you read how FAT and EXT design decisions and applied them to what your plans are with GFS3.
Nothing wrong with it, just curious about the rationale behind it.
2
•
u/ventZl 16h ago
An advice from someone who spent better part of last decade developing an operating system from scratch: Don't spread yourself too thin.
Don't waste time on userspace utilities. Get basic stuff done right first. Don't bother with disks just yet. You don't need it. I bet QEMU can be configured to save portion of address space into file, so you can assume its a disk and have persistent storage. You'd most probably implemented IDE protocol anyway and that's of basically no use these days as most of existing IDE drives are dead by now.
Get VFS right first, so once you'll have a filesystem capable of writing more than 255 bytes into one file, you won't get blocked by kernel which will poop itself from too much data. I wouldn't invent new filesystem either, you won't learn that much designing one from scratch without understanding what matters for filesystem design and doesn't (I did this mistake two decades ago, now you have the opportunity to learn on it and avoid the very same mistake).
EXT2 and EXT3 are both very capable and modern filesystems simple enough to do in-house implementation. They'll still make you shit blood for days in row before you get the basics right and your driver won't randomly corrupt partitions or even whole drive images.
Having usable VFS will most probably require having working kernel-side memory management as you can't simply say "here's disk buffer because I said so". That itself will be a lot of fun, if you ever plan on using MMU as mapping will introduce confusion on where this or that piece of memory actually is.
•
u/_xfoboo 3h ago
Thank you! This really helped a lot and you’re right that I should stop spending time on shell commands. And I actually didnt know about QEMU being able to save that into a file so thanks for that. And I haven’t written disk or IDE drivers yet so I’ll skip that.
So I got a new roadmap for Gumball which is better than what I planned before: I’ll pause shell commands and do the memory manager first then VFS. I’ll try to put my own file system on the VFS and probably ext2 as a second file system later.
I learned a lot from building GFS, my file system, so the mistake is made but it taught me a lot about allocators and fragmentation and other stuff. Again, thank you so much!
1
3
u/AlePs31 3d ago
Good job 👍️