Emulating from DR-DOS on a memory stick

I decided that it would be cool to have an emulated PDP that was bootable from a memory stick.  Then I could simply boot from a USB pen drive straight into a PDP-11.  To do this, I decided  to use a different emulator than SIMH - Ersatz-11.  It's free for hobbyist use.  Not only does Ersatz-11 have a good DOS based emulator (meaning that you don't have to boot into Windows first) but I believe that it will give access to the physical COM ports, althought I have not tried that feature yet.  I tried to get it to run under FreeDOS, but whilst Ersatz-11 would start; I could not get it to read any disk images.  So in the end I switched to DR-DOS, which was harder to install... but ran the emulator without any errors.

Here are some brief notes on how I got it working (from a Windows 7 machine):

- Make an empty FAT formatted USB pen drive bootable into FreeDOS with unetbootin
  Just select FreeDOS 1.0 under 'Distribution', and then select your pen drive at the bottom and click OK.
  This was the easiest way I found to make a DOS type boot disk, but we don't actually want FreeDOS.
- Now, make a DRDOS folder on your pen drive and save the DR-DOS binaries in there
  [I'm using version 7.01.06]
- Make a DRSYS folder on the pen drive and save the DR-DOS varant of FreeDOS SYS binaries in there
- Download and copy the Ersatz-11 DOS files onto an E11 folder on the pen drive
- Copy your own PDP-11 boot disk image to your pen drive

Now we can reboot and start FreeDOS from the pen drive.  When asked, boot into FreeDOS as a simple LiveCD, we don't need more than that.  It should boot to drive A: and your pen drive will appear as another drive (for me, it was drive C).  Now try the following (WARNING! this assumes your pen drive is now C, change the drive letter if your one is different, don't blame me if you mess up your hard disk):

 C:
 cd DRSYS
 sys C:\DRDOS C:\
 cd \

 copy C:\DRDOS\*.* C:\
 del C:\*.img
 del C:\ub*.*
 del C:\*.cfg
 del C:\*.c32

The pen drive should now be bootable in DR-DOS rather than FreeDOS, so reboot and start from the pen drive again.  [There will be a LDLINUX.SYS file left over from FreeDOS that we can't delete right now.  If you want to, come back and delete this file by plugging your pen drive into another machine with a better OS.]

You should now be able to start Ersatz-11, with something like this:

cd E11
E11
MOUNT DU0: C:\boot.dsk
BOOT DU0:

That's it!  You should be able to emulate a PDP-11 under DR-DOS.  In Ersatz-11, hit <SHIFT>+<ENTER> twice to stop emulating, then type 'exit' and press enter to quit to DOS.  If you put the 'mount' and 'boot' commands into a file called E11.ini inside the E11 folder and create an autoexec.bat file in the root of the pen drive to start the emulator, the pen drive should automatically boot into the emulation from now on.