Nitpicking but a line is missing IMHO namely The code of the program: should also suggest which file to edit, e.g potato.go. It might be obviously to anybody working with Go but for others it's not.
I'm old enough to remember UML (User Mode Linux). I don't know if it's still around, but it was a port of the Linux kernel that you would run as a standard user binary.
I took kernel device driver programming as a course in uni. They were still teaching the device driver course but not the operating system course you were supposed to take before that. Always felt like I have been systematically lacking that knowledge because of that. I'm interested!
I like the "take things appart, recombine, look what breaks" approach, same line of thought.
Btw, i think the current tech stack (CPU, initram, X/Wayland server, input handling, pam/polkit) is just shoehorned Desktop on tech made for server and a lot of historical baggage.
It's pretty cool and a nice way to discover the kernel!
Very cool, reminds me of https://jsandler18.github.io/tutorial/boot.html
FWIW makes me wonder how much work would be required to have this as a Web container, e.g. Dockerfile with
FROM debian:13
RUN apt update && apt install -y qemu-system-x86 qemu-utils
WORKDIR /linux-inside-out
then https://github.com/container2wasm/container2wasm#container-on-browser
Edit: FWIW the image of Debian 13 with QEMU and its utils is ~1.1Gb
This is amazing. Thank you!
Bookmarked 😜 Mind adding a dark mode?
Thank you! :) Sure, working on it. :)
Ah, please utilize prefers-color-scheme and just place your --color-variables in it, if possible. It's the simplest and most compatible way.
Cool! Looking forward to the next post. I'd love to learn about how the kernel and initramfs work together though. For now the magic seems to be in how qemu strings things together.
Very cool guide, got the kernel running! Looking forward to your next post!
You got a subscriber! Looking forward to more.
Are you just reverse-engineering this for fun, or are you trying to learn how qemu builds on a bootstrap?
I am writing a blog post series to make this topic more approachable for others.
Nice, and good job.
With respect:
- You are describing the init process, after the boot stuff is done. Not sure if you meant that or not.
- vmlinuz is the bootable kernel image distinct from the kernel itself. It contains the compressed bootbale ELF kernel image (which itself contains bvmlinuz) and gzip decompress function, bsetup code, bbootsect system.map, and a handful of commands for the kernel image to bootstrap itself.
- Kernel space doesn't stop once user space is allocated memory and initialized, they both run at the same time. Maybe I read that wrong, but it didn't seem right to me.
I want to be careful here not to discourage you, this is great exploration!
I realize I'm handing out unsolicited advice here, but when I was first learning about Unix/Linux kernels in the Solaris and HP/UX days, the thing that helped the process "click" for me was compiling a kernel and building an ELF. And if you're going to continue on this journey (which I hope you do), you should probably read a bit on memory segmentation and broadly about assembly instructions.
Good luck!
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0