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!
Idea is turning out to be harder than anticipated, because I have to figure out how to mount mfs on /, and mfs_args has a caddr_t base member, and what's that, and how does that and size relate to the parameters given to mount_mfs?
And where's the source of mount_mfs? Because I can't find it in /usr/src/sbin/...
Aha! It's /sbin/newfs.
Yeah, well, I'm not gonna do that from C, and /rescue/mount_mfs is big. But perhaps it fits.
Buut, there's mount_tmpfs! And I suppose I actually want that, not mfs, so lets see how hard it is to do in C.
Nice. That works. So the next step then is:
tmpfs as /altroot/dev/dk0 as /altroot/tbd/altroot/tbd to /altroot/altroot/usr/pkg/sbin/dinit