need roto filesystem in memory, initrd / initramfs . init process just in cpio archive, can just be hello world
need initrd, initramfs , RAM disk block device, ELF binary support. 889KB bzimage (up 50kb)
Now boots, use “rdinit=/hello” option in qemu , just prints out hello world
Transition to userspace
initrd loads some modules etc, runs pivot_root , run startup scripts
Userspace
Why are you doing this? Single purpose system, usb stick (rescue, puppy linix, Damn Small Linux) , tiny memory, tiny storage usage, fast power on. Trade-off of options
We have to run something, need some binaries, shared libraries, large binaries with multiple purposes (busybox)
Busybox – one binary – acts differently depending on calling name, installed as symlinks
Busybox: fairly small, default utilities, 2MB without networking, easy to test
C libraries – glibc (probably not a good idea), eglibc (easier to build, binary compatible with glibc, can take things out), uClibc (alternative, very small, some overlap with busybox, source code compatible with glibc)
Device and Proc mngt will need: procfs, sysfs, tmpfs, udev, cgroups
Build environments: you are cross compiling (build root), binutils, C libraries & cross compiling, Test, x86 instead x86 is harder