I'm most confident about the boot loader changes (though the arbitrary limit likely needs some help)
I need review and ideally testing of the md.
Also, I'm not at all sure that we reserve the area, so maybe kernel allocations overwrite the ram disk? How do I prevent that?
To test this out (once in the tree, freebsd-bootable-image.img could be mini-rootdisk.img):
% sudo pkg install ipxe qemu
% mkdir testdir
% cd testdir
% fetch https://bapt.nours.eu/memdisk
% cp ~/mumble/freebsd-bootable-image.img .
% cat freebsd.ixp < __EOF__
#!ipxe
initrd tftp://10.0.2.2/freebsd-bootable-image.img
chain tftp://10.0.2.2/memdisk harddisk raw
__EOF__
% qemu-system-x86_64 -boot n -m 4g -cdrom /usr/local/share/ipxe/ipxe.iso -device virtio-net,netdev=n1 -netdev user,id=n1,tftp=$(pwd),bootfile=/freebsd.ipxe
(thanks to bapt for that recipe)