Author: | Charles Childers |
---|
Retro originally ran directly on x86-based computers. Support for this was maintained through nine major releases, spanning four complete rewrites. With the tenth major release, this was dropped in favor of a hosted solution using a virtual machine and memory image.
It is now possible to build a static binary of the virtual machine, and run Retro directly over a Linux kernel, with no standard userland.
You may need to be root for this:
mkdir retro-on-linux cd retro-on-linux dd if=/dev/zero of=rootfs bs=1k count=20k yes y|mkfs.ext2 rootfs
mkdir /mount/retro mount -o loop rootfs /retro cd /mount/retro
cp -a /dev dev mkdir etc sbin
cat >etc/fstab <<EOF /dev/ubd0 / ext2 defaults 0 1 EOF
The first path should be adjusted to point to the directory where you have the Retro sources.
cd ~/retro gcc -static vm/retro.c -o /mount/retro/sbin/init cp retroImage /mount/retro
cd ~/retro-on-linux umount /mount/retro rm -rf /mount/retro
At this point you should have a rootfs file that's ready to be booted. This can be booted as an initrd, or via user mode linux (recommended):
wget http://user-mode-linux.sourceforge.net/linux-2.6.24-rc7.bz2 bunzip2 linux-2.6.24-rc7.bz2 chmod +x linux-2.6.24-rc7.bz2 ./linux-2.6.24-rc7 ubd0=rootfs
Alternately, if you're somewhat crazy, this could be done on a real partition instead of a rootfs image, and add it to your grub or lilo configuration. (Being that I'm somewhat crazy, and have a bit of a soft spot for OS development, I'm going to look into building a bootable ISO for playing with on real hardware.)
Buildroot based rootfs: https://unix.stackexchange.com/questions/73203/how-to-create-rootfs-for-user-mode-linux-on-fedora-18/372207#372207