# GXemul: NetWinder emulation

Back to the index.

The NetWinder emulation mode is working well enough to run NetBSD/netwinder.

### NetBSD/netwinder:

It is possible to run NetBSD/netwinder in GXemul.

There is no INSTALL ramdisk kernel, so one way to install the NetBSD/netwinder distribution onto a disk image is to install the files using another (emulated) machine. The following instructions will let you install the NetBSD/netwinder distribution onto a disk image, from an emulated DECstation 3MAX machine:

1. Download a NetBSD/pmax (DECstation) install RAMDISK kernel:

       	ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/pmax/binary/kernel/netbsd-INSTALL.gz

2. Create an empty harddisk image, which will be the disk image that you will install NetBSD onto:

       	dd if=/dev/zero of=nbsd_netwinder.img bs=1024 count=1 seek=999000

3. Download the generic kernel and the 3.1 ISO image:

       	ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-3.1/netwinder/binary/kernel/netbsd-GENERIC.gz
       	ftp://ftp.netbsd.org/pub/NetBSD/iso/3.1/netwindercd-3.1.iso

4. Start the emulated DECstation machine like this:

       	gxemul -e 3max -d nbsd_netwinder.img -d netwindercd-3.1.iso netbsd-INSTALL.gz

5. At the `Terminal type? [rcons]` prompt, type CTRL-B to simulate a CTRL-C sent to NetBSD/pmax. Then execute the following commands:

   `` |
       newfs /dev/sd0c
       mount /dev/cd0c /mnt
       mkdir /mnt2; mount /dev/sd0c /mnt2
       cd /mnt2; sh
       for a in /mnt/*/binary/sets/*.tgz; do echo $a; tar zxfp $a; done
       exit
       cd dev; sh ./MAKEDEV all; cd ../etc
       echo rc_configured=YES >> rc.conf
       echo "/dev/wd0c / ffs rw 1 1" > fstab
       cd /; umount /mnt; umount /mnt2; halt

NetBSD/netwinder is now installed on the disk image. The following command line can be used to start NetBSD/netwinder:

    	gxemul -X -E netwinder -d nbsd_netwinder.img netbsd-GENERIC.gz

This will result in a 1024x768 framebuffer. Add `-Y2` to the command line if you want to scale it down to 512x384.

Note: The installation instructions above create a filesystem without a disklabel, so there is only one ffs partition and no swap. You will need to enter the following things when booting with the generic kernel:

    	root device (default wd0a): wd0c
    	dump device (default wd0b): (just press enter)
    	file system (default generic):    (just press enter)
    	init path (default /sbin/init):   (just press enter)

Known bugs/problems:

- There is a long delay when starting up NetBSD/netwinder (several seconds even on a very fast host machine), so you need to be patient.
- There is a minor bug in the keyboard device, so you need to press a key (any key) before typing wd0c.
- When halting/rebooting NetBSD/netwinder, the emulator prints a message saying something about an internal error. This doesn't matter; ignore the message.