Virtualise, Wipe and Reinstall

My home PC had been getting slower over time ... over the years I have installed a lot of software that I don't really use anymore, and there were still a bunch of Lenovo tools on there from when it was new. So it was time for a clean reinstall - a reformatted disk with a fresh copy of Windows can work wonders. But I still wanted a full backup of the old machine, just in case. So I thought that it would be good to virtualise the whole machine before I wiped it. Then I could always go back to the old version if I needed anything. Which is normally the case...

Anyway, I used the excellent Disk2VHD tool which can virtualise a hard disk whilst it is still running. So you can create the VHD on the machine that you're virtualising. Very cool.

So I'm now using VirtualBox to boot up the Virtual Hard Disk which has been created. It was a very nice way to achieve a clean install without losing anything, and it was pretty painless. I might do the same thing on my laptop actually...

Blank floppy image for VirtualBox

Here is a way to make a blank floppy disk image that you can use in Oracle VirtualBox.  It's a hacked around version of this.  You just make a batch file with these DOS commands in:

if exist blank.img del blank.img
for /l %%i in (0,1,31) do echo 01234567890123456789012345678 >>blank1.img
for /l %%i in (0,1,35) do type blank1.img >>blank2.img
for /l %%i in (0,1,39) do type blank2.img >>blank.img
del blank1.img
del blank2.img

After running it, you end up with a working disk image, and here is a version that I then reformatted inside a virtual machine.  I've since found that you can use these images in Windows VirtualPC too, although there is no UI to attach them, you have to edit the xml files of your virtual machine manually.

Another winchester drive

So I bought a second Seagate ST-225 "winchester" disk off ebay.  I got it for the starting bid, nobody else made a bid!  Result.  I have connected it to my PDP-11 and used my "XXDP booting from ODT" trick to format it.  Here are the results:

Second disk formatted

This is good news, the drive seems to be in good shape.  Since then I have copied some RT-11 files to it and made it bootable.  So I have a spare.

XXDP booting via ODT

So I needed to format the Winchester Disk in my PDP, and since RT-11 cannot format these types of fixed disk I needed to use the disk formatting program in XXDP.  XXDP is a small operating system made by DEC for diagnostics.

There is a good tutorial on how to make an RX50 XXDP boot disk here.  That is what I've used anyway.  However, I found that the resulting disk image was bootable in the SIMH emulator, but a real disk would not boot in my uPDP-11/53.  I don't know why yet, the disk starts the boot process, but then the machine halts.

An alternative is to boot the machine from a tape image and use the vtsever program on another machine to pretend it is a tape over a serial line.  Unfortunately, I have not managed to get vtserver to work at all.  Maybe it doesn't like Windows 7.  I'll come back to vtserver another time...

Still, this page got me to thinking there may be another way.  Maybe I could boot my working disk image of XXDP in SIMH and then dump the memory to disk.  Perhaps, this memory dump could be restored to a real PDP and then I could use XXDP from there...

Indeed you can... if you want the file I created, it's here.  But here are some notes about how to do it yourself:

- Boot an XXDP disk image in SIMH
- When the OS is running, type "R ZRQCH0" at the command prompt
- You should now see something like this:

DRSSM-G2
ZRQC-H-0
RQDX3 Disk Formatter Utility
UNIT IS Formattable Winchester (RDnn) or Floppy (RX33) Drives
RSTRT ADR 145702
DR>

- We'll need the RSTRT ADR (restart address).  Make a note of it, for me it was 145702
- Press <CTRL>+E, to halt the simulator, you should then get a "sim>" prompt
- Enter this command: "ex @dump.txt 0-157777"
- That will save the first 56k of memory to the file called dump.txt (in the folder where SIMH was running from)
- Close SIMH, we've got what we needed
- The memory dump now needs to be converted, so that it can be loaded via ODT
- Here is a quick and dirty C# program that will convert the file to ODT format:

static void Main(string[] args)
{
    StreamReader sr = new StreamReader("dump.txt");
    StreamWriter sw = new StreamWriter("odt.txt");

    string line;
    char[] sep = { ':' };
    sw.Write("0/");
    for (; ; )
    {
        line = sr.ReadLine();
        string[] split = line.Split(sep);
        sw.Write(split[1].TrimStart() + (char)10);
        if (sr.EndOfStream) break;
    }

    sw.Write((char)13);
    sr.Close();
    sw.Close();
}

- Use the above program, after that you should now have a converted file called "odt.txt"
- Boot the real PDP and go into ODT.  Send "odt.txt" over the console serial line
  NOTE: to be safe, I used Tera Term Pro to send the file and set some delays:
     100ms delay after each line
     25ms delay after each character
- Be patient.  It took me about 1.5 hours to send this file via ODT!
- When the whole file has been sent, enter the Restart Address followed by 'G', eg:
  145702G
- You should now be in XXDP, with the disk formatter loaded.  You should see a DR> prompt.
- Now just use the ZRQCH0 program.  I followed the formatting procedure here.

There are many improvements that I could make to this, but it worked first time; so I'm leaving it alone.