IBM XT MFM Emulator

IBM XT MFM Emulator
Photo by Sam Pak / Unsplash

Emulating an MFM drive using David Gesswein's MFM Emulator and installing MS-DOS 3.30.

Required Equipment

  • IBM XT
  • MFM Controller Card
  • MFM Emulator
  • GoTek with FlashFloppy
  • DOS 3.30 Installation Images (download link)
  • Appropriate MFM and Floppy Ribbon Cables

MFM Cables

Both cables have identical construction, and both have no twists. Pin 1 of the card edge connector is directly attached to pin 1 of the IDC connector, and so forth.

Connecting the MFM Emulator to the PC

Correctly identifying the orientation of the MFM cables can be a little bit daunting. Fortunately, there is a simple trick.

If we examine the MFM Emulator we see that on one side of the J2 edge connector, all the pins are connected to ground, we simply have to match these pins to their counterparts on the MFM controller.

To identify the correct orientation of the MFM drive cable you can simply check for continuity using a digital multimeter. On the MFM controller check both rows of pins on the connector, one of the rows will have all of the pins connected together.

Simply connect the MFM Emulator to the MFM controller such that the two rows that have their pin connected in common are linked via the cable.

Emulating a Blank MFM Drive

I am going to assume that you have GoTek connected and set up with MS-DOS 3.30 install images. With your MFM Emulator connected power on the system and log into the Beaglebone, with the user name "root" with no password.

Enter these commands:

cd emu
./setup_emu
./mfm_emu  --drive 1 --file ../IBM_EMU --initialize --cylinders 306  --heads 4

You should see something like this:

Board revision C detected
Emulated drive RPM 3600
Drive 0 num cyl 306 num head 4 track len 20836 begin_time 0
PRU clock 200000000
  Waiting, seek time 0.0 ms max 0.0 min free buffers 75
bad pattern count 0
Read queue underrun 0
Write queue overrun 0
Ecapture overrun 0
glitch count 0
glitch value 0
0:test 0 0
0:test 1 0
0:test 2 0
0:test 3 0
0:test 4 0
1:test 0 0
1:test 1 0
1:test 2 0
1:test 3 0
1:test 4 0
select 0 head 0

This will create and emulate a new blank MFM drive and save the image to the IBM_EMU file in the home directory (~/ or /root)

With the MFM emulator running you can now power cycle the IBM so the MFM controller can find and initialize the MFM drive.

Formatting an MFM Drive

Boot into MS-DOS from the floppy drive installation images. We will be using several utilities to format the MFM drive and later install DOS. For more info on the format used by IBM have a look at this page.

Low-Level Format

First, we need to perform a low-level format of the drive, writing the track format used by the IBM XT. This is done by the MFM controller, which contains a small ROM with a utility to format the disk appropriately. To do this we jump to the address of the MFM controller's ROM, this of course is dependent on the controller you are using. See this page to find your address.

From DOS run the DEBUG utility and enter in the appropriate command for your controller, In my case "g=C800:5" and press Enter.

This will bring up the controller's format utility. Following the instructions on the screen, format the MFM drive. You should see activity in the console of the Beaglebone something like this:

It may take a minute or two for this process to complete, once done the system should return back to DOS.

Create an MS-DOS Partition

Next, we need to create a DOS Partition. To do so we are going to use the FDISK utility. From the prompt start run FDISK.

Select 1 to "Create DOS Partition" and 1 once more to create a primary partition. Once the partition is written reboot the IBM XT.

Forming the DOS Partition

Finally, we need to format the newly created DOS partition so we can install and boot DOS from it. To do this we use the FORMAT utility with the /S flag to denote the partition is bootable. From the DOS prompt enter the following command: "FORMAT  C: /S"

This can take a couple of minutes but once done we are ready to install and set up MS-DOS 3.30.

Installing MS-DOS

These instructions assume you're installing MS-DOS 3.30 from two installation discs.

Copying DOS files

Boot DOS from floppy image one and run the following commands:

sys c:
md c:\dos
copy a:\ c:\dos
copy a:\command.com c:\

Switch to floppy image two and run the following commands:

copy a:\ c:\dos

Creating AUTOEXEC.BAT

The final step is to create the AUTOEXEC.BAT file on the C: drive, you can read about the AUTOEXEC.BAT file here.

To create and write to the AUTOEXEC.BAT we can use the EDLIN line editor. Switch to the first floppy image and run "EDLIN C:\AUTOEXEC.BAT". This will bring you to a command prompt. To enter insert mode enter "i". Type in the following

@ECHO OFF
CLS
DATE
TIME
VER
PROMPT $P$G
PATH=C:\DOS

To save the file press Ctrl+c to exit insert mode and bring up the prompt. Enter "w" then "e" to write and exit. You can verify the file by opening it again with EDLIN and using the "l" command to list the file.

With that MS-DOS 3.30 has been installed and you can remove the install floppy image and reboot the system. When you want to boot this MFM image again use the following command "./mfm_emu  --drive 1 --file ../IBM_EMU"

Conclusion

If all has gone well you should now have a clean install of MS-DOS 3.30! I recommend that you backup this image so you don't have to go through all the trouble again.

Also, don't forget to run the image with "./mfm_emu  --drive 1 --file ../IBM_EMU". If you wish to have the image autostart check out David Gesswein's site, and the section "Starting Emulation on Power On".

References

Rev B & C Board Assembly, testing, and usage
MS-DOS 3.30
Originally 86-DOS, written by Tim Paterson of Seattle Computer Products, DOS was a rough clone of CP/M for 8086 based hardware. Microsoft purchased it and licensed it to IBM for use with Microsoft’s IBM PC language products. In 1982, Microsoft began licensing DOS to other OEMs that ported it to the…
Hard Disk Controller / DEBUG / Low Level Format // retrocmp / retro computing
Hard Disk Controller, DEBUG, HDC, LLF, low level format, MFM, SCSI
Hard Disk Controller / DEBUG / Low Level Format // retrocmp / retro computing
Hard Disk Controller, DEBUG, HDC, LLF, low level format, MFM, SCSI
AUTOEXEC.BAT - Wikipedia
Commands to Install DOS 3.30a? - BetaArchive
Books | The FreeDOS Project

Comments