I have successfully booted into a NetBSD kernel with a custom ramdisk that has a statically linked init that does nothing.
Baby steps!
Discussion
I have successfully booted into a NetBSD kernel with a custom ramdisk that has a statically linked init that does nothing.
Baby steps!
New distribution name dropped!
fuck as the org on my forgeMeanwhile, the ramdisk is 1.8GiB, because of all the static stuff. Urgh. That's not going to fly longterm.
Hrm. There's something funky going on with the ramdisk. It gets loaded on boot, but netbsd continues booting from ld0 instead of the ramdisk.
Even with boot -m, it fails. Hm.
Oh. I guess I will need a /dev.
Oh. Maybe I need a new kernel?
It's weird, because my static init booted from ramdisk, but if I put dinit there, it boots from the real system, and I see no indicaton of the ramdisk even being tried.
Booting with -a asks for the rootfs, md0 is not an option. Allright. Lets do this the hard way then.
When booting my tiny static initd that does nothing, root is on md0a. Hmm.
Looks like this has to do with the size of the ramdisk. a 21.6MiB disk works fine.
Interesting... MEMORY_DISK_DYNAMIC is enabled, so the ramdisk size shouldn't matter, as far as I understand things.
Nevertheless, I'll try a new approach: I'll write a very small init that bootstraps things, and execs dinit.
I need to figure out how to write to the console during early boot.
The solution is populating /dev.
Nice. I wrote a small C program that mounts /, and execs the NetBSD init. This is fine short-term. All I really need from the ramdisk's init is to mount / and the store (name tbd, not /store, perhaps /polyamory, or /fuckery?), and then execs the real init.
It will need to do a lot more long term, but I'm very far from that.