# GXemul: CATS emulation

Back to the index.

The CATS emulation mode is working well enough to run old versions of NetBSD/cats and OpenBSD/cats.

Debian GNU/Linux could perhaps run in the future.

Known issue: Clocks inside the emulated guest OS run at the wrong pace. For example, typing "`date; sleep 10; date`" inside NetBSD/cats takes 10 seconds to run, but outputs dates that are over 2 minute apart (!) on my machine.

### NetBSD/cats:

It is possible to install and run NetBSD/cats in GXemul.

To install NetBSD/cats onto a disk image, follow these instructions:

1. Create an empty harddisk image, which will be the root disk that you will install NetBSD/cats onto:

       	dd if=/dev/zero of=nbsd_cats.img bs=1024 count=1 seek=6000000

2. Download the NetBSD/cats ISO image and the generic and install kernels:

       	ftp://ftp.de.netbsd.org/pub/NetBSD/iso/8.1/NetBSD-8.1-cats.iso
       	ftp://ftp.de.netbsd.org/pub/NetBSD/NetBSD-8.1/cats/binary/kernel/netbsd-GENERIC.aout.gz
       	ftp://ftp.de.netbsd.org/pub/NetBSD/NetBSD-8.1/cats/binary/kernel/netbsd-INSTALL.aout.gz

3. Start the installation like this:

       	gxemul -X -E cats -d nbsd_cats.img -d NetBSD-8.1-cats.iso netbsd-INSTALL.aout.gz

   and proceed like you would do if you were installing NetBSD on a real CATS from CDROM.

Note that there may be some long delays during bootup.

(NOTE: Older versions of NetBSD could install via FTP in older versions of GXemul. Right now, that seems to not be possible, resulting in ethernet timeouts etc. Whether it is due to bit rot in the emulator, or due to NetBSD having changed over time, has not been debugged. If you want to try an FTP install anyway, start the install without `-d xxxxx.iso` and use IPv4 address 10.0.0.1, gateway/default route 10.0.0.254, netmask 255.0.0.0, and nameserver 10.0.0.254, when asked to configure the network.)

If everything worked, NetBSD should now be installed on the disk image. Use the following command line to boot the emulated CATS machine:

    	gxemul -XEcats -d nbsd_cats.img netbsd-GENERIC.aout.gz

### OpenBSD/cats:

It is possible to install and run OpenBSD/cats in GXemul. Unfortunately, "The OpenBSD/cats port was discontinued after the 4.0 release" according to http://www.openbsd.org/cats.html, so from a security perspective it is not up to date, but it is still possible to run for experimental purposes.

To install OpenBSD/cats onto an emulated harddisk image, follow these instructions:

1. Create an empty harddisk image, which will be the root disk that OpenBSD installs itself onto:

       	dd if=/dev/zero of=obsd_cats.img bs=1024 count=1 seek=1900000

2. Download the entire cats directory from the ftp server:

       	wget -np -l 0 -r https://ftp.nluug.nl/OpenBSD/4.0/cats/
       	cp ftp.nluug.nl/OpenBSD/4.0/cats/bsd .
       	cp ftp.nluug.nl/OpenBSD/4.0/cats/bsd.rd .

3. You now need to make an ISO image of the entire directory you downloaded. (I recommend using `mkisofs` for that purpose. If you don't already have `mkisofs` installed on your system, you need to install it in order to do this.)

       	mkisofs -allow-lowercase -o openbsd_cats_4.0.iso ftp.nluug.nl/OpenBSD/
       	rm -rf ftp.nluug.nl      (this directory is not needed anymore)

4. Start the emulator using this command line:

       	gxemul -XEcats -d obsd_cats.img -d openbsd_cats_4.0.iso bsd.rd

   and proceed like you would do if you were installing OpenBSD on a real CATS. (Install onto `wd0`, don't configure the network, install from CD.)

(Although it is possible to configure the network, IPv4 address 10.0.0.1, netmask 255.0.0.0, gateway/default route 10.0.0.254, and nameserver 10.0.0.254, the userland NAT-like networking layer is not stable enough yet to support a full install via ftp.)

NOTE: Make sure that you `sync` and `reboot` correctly once the installation is finished, or the `/dev` nodes may not have been written correctly to disk.

Once the install has finished, the following command should let you boot from the harddisk image:

    	gxemul -XEcats -d obsd_cats.img bsd

### Debian GNU/Linux for CATS:

Debian GNU/Linux for CATS (ARM) could potentially run in GXemul, however:

- The DEC 21143 NIC is not emulated well enough for Linux to accept it.
- Development of Debian for CATS seems to have died? The latest install kernel is quite old.

THIS DOES NOT WORK YET!

The following installation instructions would theoretically work:

1. Create an empty harddisk image, which will be the root disk that Debian installs itself onto:

       	dd if=/dev/zero of=debian_cats.img bs=1024 count=1 seek=3300000

2. Download the tftpboot install kernel:

       	http://ftp.debian.org/debian/dists/oldstable/main/disks-arm/current/cats/tftpboot.img

3. Start the installation using the following command line:

       	gxemul -XEcats -d debian_cats.img tftpboot.img

It doesn't work, though, because the NIC isn't working well enough.

The only use of Debian/CATS in the emulator right now is as a way to manipulate Linux disk images, if you are on a non-Linux host. By choosing "Execute a shell" in the installer's menu, you can have access to tools such as fdisk and mke2fs, which are useful for creating Linux paritions on disk images.