General steps:
1. Prepare a P112 Disk Image by writing it to a blank floppy diskette.
2. Run the SIMH/AltairZ80 Simulator
3. Mount the floppy diskette in the SIMH/AltairZ80 Simulator
4. Alternatively, mount the raw disk image file, and then later copied to a real floppy. This is much faster if you are going to manipulate the disk image extensively.
5. You can also use SIMH/AltairZ80’s R.COM and W.COM to read and write files into and out of the simulator to a file on the local hard drive.
Step 1: - Prepare P112 Floppy Disk
Download zs113005.img.gz Z-System boot disk image. Dated November 30, 2005. from http://frotz.homeunix.org/p112/
The file says it’s a .gz file, but on my system, when I downloaded this, it was not gzipped, but rather a raw floppy disk image. I just renamed it, removing the .gz extension. Write this image to a blank formatted 1.44MB 3.5″ floppy disk using NTrawrite as follows:
C:\>ntrawrite -d b: -f zs113005.img
NTRawrite v1.0.1 by Blake Ramsdell
Please insert a diskette and press any key.
Copying image file zs113005.img to floppy drive B.
****************************************]
Verifying image file zs113005.img with floppy drive B.
****************************************]
Completed!
C:\>
Step 2: - Run the SIMH/AltairZ80 Simulator.
You can download and install a pre-built package that is part of the eZ80SBC distribution. This is the exact one that I am using for this tutorial, or you can try getting SIMH/AltairZ80 from Peter Schorn’s web site:
If you install the eZ80SBC package, you can start the simulator by going to the Start Menu:
Start->All Programs->ez80sbc->AltairZ80 Simulator
The eZ80SBC package already has a startup script and disk image files for a complete running CP/M 3.0 system. This is the system I use to import and export files to SD Memory cards I use with the eZ80SBC.
Altair8800 (Z80) simulator V3.7-0 (scp created Jun 25 2007 at 22:27:48)
HDSK0, 8388KB, attached to cpm3_c.dsk, HDSK, WRTENB, QUIET, T:2048/N:32/S:128
HDSK1, 8388KB, attached to cpm3_d.dsk, HDSK, WRTENB, QUIET, T:2048/N:32/S:128
HDSK2, 131KB, attached to 128k.dsk, EZ80FL, WRTENB, QUIET, T:32/N:8/S:512
LDRBIOS3 v1.06 16-Jan-2007
CP/M V3.0 Loader V1.00 18-Jan-2002
Copyright (C) 1982, Digital Research
BNKBIOS3 SPR ED00 0A00
BNKBIOS3 SPR AD00 1300
RESBDOS3 SPR E700 0600
BNKBDOS3 SPR 7F00 2E00
57K TPA
BIOS3 Banked for SIMH Altair V-1.24, 4 HD, 15-Jan-2007
A>
3. Mount the floppy diskette in the SIMH/AltairZ80 Simulator
[press ^E to get to the sim> prompt.]
Simulation stopped, PC: EF54 (RRA)
sim> attach hdsk1 \\.\B: [Type this exactly, where B: is your physical floppy drive. It must be uppercase. In my case I was using a Q-Stor USB Floppy Drive]
sim> show hdsk
HDSK, 8 units
HDSK0, 8388KB, attached to cpm3_c.dsk, HDSK, WRTENB, QUIET, T:2048/N:32/S:128
HDSK1, 8388KB, attached to \\.\B:, HDSK, WRTENB, QUIET, T:2048/N:32/S:128
HDSK2, 131KB, attached to 128k.dsk, EZ80FL, WRTENB, QUIET, T:32/N:8/S:512
HDSK3, 8388KB, not attached, HDSK, WRTENB, QUIET, T:0/N:0/S:0
HDSK4, 8388KB, not attached, HDSK, WRTENB, QUIET, T:0/N:0/S:0
HDSK5, 8388KB, not attached, HDSK, WRTENB, QUIET, T:0/N:0/S:0
HDSK6, 8388KB, not attached, HDSK, WRTENB, QUIET, T:0/N:0/S:0
HDSK7, 8388KB, not attached, HDSK, WRTENB, QUIET, T:0/N:0/S:0
Note that SIMH/AltairZ80 cannot determine (or at least doesn’t at this point) the size of the raw floppy device, so it assumes that it is a HDSK (8MB.) If you were attaching to a disk image file stored on a local hard drive, SIMH would automatically infer the format type based on the image size.
You need to change the format type manually:
sim> set hdsk1 format=p112
sim> show hdsk1
HDSK1, 1474KB, attached to \\.\B:, P112, WRTENB, QUIET, T:160/N:18/S:512
sim> go [Start the simulator running again… ]
A>^C [ Warm boot CP/M to force disk change ]
A>j:
J>dir
J: -README 1ST : LICENSE TXT : NOTE TXT : TCSELECT COM : VT100 Z3T
J: VT525 Z3T : Z3TCAP TCP
SYSTEM FILE(S) EXIST
J>type -readme.1st
10 August 1996
This source is a modification of the initial minimal BIOS for the
P112. It contains changes to allow different disk formats, including:
…
4. Alternatively, mount the raw disk image file
You can also mount a raw P112 disk image stored on a local hard drive. This example assumes that the image file, zs113005.img, is in the AltairZ80 default directory, which is:
C:\Program Files\HarteTec\ez80sbc\Media if you use the default options when installing the eZ80SBC setup package.
Now, to mount the disk image:
sim> attach hdsk1 zs113005.img
sim> show hdsk1
HDSK1, 1474KB, attached to zs113005.img, P112, WRTENB, QUIET, T:160/N:18/S:512
sim> go
J>
J>^C [ Warm boot CP/M ]
J>dir
J: -README 1ST : LICENSE TXT : NOTE TXT : TCSELECT COM : VT100 Z3T
J: VT525 Z3T : Z3TCAP TCP
SYSTEM FILE(S) EXIST
J>type -readme.1st
10 August 1996
This source is a modification of the initial minimal BIOS for the
P112. It contains changes to allow different disk formats, including:
Ampro 800kB (also called DSQD) 80-track double-sided, double-density;
B/P Bios 1.76 MB “High-Density” formats, as well as the initial two
formats.
5. Use SIMH/AltairZ80’s R.COM and W.COM to import/export files.
From within SIMH/AltairZ80 CP/M 3.0, run the R.COM program to read a file from the host operating system into CP/M disk image. In this example, I read in the file “local” which is the startup script for SIMH/AltairZ80:
J>a:r [ Here is the usage information for R.COM ]
READ V-2.21 (03-Dec-06) SIMH Interface V003
Usage: READ [L]
Binary copy from host environment. L = use lower case for name.
Examples
READ bdos.mac copy BDOS.MAC to BDOS.MAC
READ bdos.mac L copy bdos.mac to BDOS.MAC
READ *.mac copy all files ending with .MAC
READ a:bdos.mac copy BDOS.MAC to A:
READ a:*.com copy all .COM files to A:
READ src\bdos.mac copy SRC\BDOS.MAC to BDOS.MAC
READ src\a:bdos.mac copy SRC\BDOS.MAC to BDOS.MAC on A:
READ src\*.mac copy all .MAC files from directory SRC
READ src\*.MAC L copy all .mac files from directory src
READ src\a:test.* copy all TEST.* files from directory SRC to A:
J>
J>a:r local
READ V-2.21 (03-Dec-06) SIMH Interface V003
Read from “LOCAL” and write to “LOCAL”.
PTR: unit is read only
0.5kB written.
J>type local
d tracks[0-7] 254
attach dsk cpm3.dsk
attach dsk1 app.dsk
;set hdsk0 geom=2048/32/128
;set hdsk1 geom=2048/32/128
;set hdsk2 geom=32/32/128
;set hdsk3 geom=32/32/512
;set hdsk0 verbose
;set hdsk1 verbose
;set hdsk2 verbose
;set hdsk3 verbose
attach hdsk0 cpm3_c.dsk
attach hdsk1 cpm3_d.dsk
attach hdsk2 128k.dsk
show hdsk0
show hdsk1
show hdsk2
Press RETURN to Continue
^C
Now, to write a file from CP/M to the local host’s filesystem do the following:
J>a:w [ Here is the usage information for W.COM. Note that you can specify Binary file transfer ]
WRITE V-1.15 (17-Dec-06) SIMH Interface V003
Usage: WRITE [B|T]
Copy to host environment. Default is text, B for binary, T for Text
Examples
WRITE BDOS.MAC copy BDOS.MAC as text file
WRITE PIP.COM B copy PIP.COM as binary file
WRITE PIP.COM copy PIP.COM as binary file [.COM .REL .DAT imply B]
WRITE TEST.DAT T copy TEST.DAT as text file
WRITE *.COM copy all files matching *.COM as binary files
WRITE SRC\BDOS.MAC copy BDOS.MAC to directory SRC as a text file
WRITE COM\*.COM B copy *.COM to directory COM as binary files
J>
J>a:w -readme.1st
WRITE V-1.15 (17-Dec-06) SIMH Interface V003
Write “-README.1ST” to “-README.1ST”.
PTP: creating new file
3.5kB written (Text).
J> ^E [ get back to the sim> prompt ]
Simulation stopped, PC: EF54 (RRA)
sim> ! [ shell to DOS prompt ]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Program Files\HarteTec\ez80sbc\Media>type -README.1ST
10 August 1996
This source is a modification of the initial minimal BIOS for the
P112. It contains changes to allow different disk formats, including:
Ampro 800kB (also called DSQD) 80-track double-sided, double-density;
B/P Bios 1.76 MB “High-Density” formats, as well as the initial two
formats.
…
That’s all there is to it.
-Howard