UT-88. Using OS CP/M. Part 1/2.
Finally, we reached the most exciting part – we will launch the CP/M operation system on “UT-88”.
This system was initially developed in 1975 by Gary Kildall of Digital Research, Inc. for Intel 8080-based computers. “UT-88” is based on the Soviet analog of this processor (KR580VM80A), so it was possible to adapt it for this computer. OS listing for “UT-88” and detailed description was published in the “Young Technician” magazine.
This system utilises a 256Kb “RAM disk” of the computer.
There are two methods to load the system to my computer: using memory dump with the system and some programs already recorded on “RAM-disk”, and the traditional way of loading the system and programs from a tape.
Let’s start with the first method as the most convenient. Firstly, MONITOR-F has to be launched as described in one of the previous posts. Secondly, DE1 must be connected to a Windows machine with a USB cable. Then SW switch has to be turned on to transfer DE1 to USB JTAG mode. DE1_Control_Panel.exe, found on the CD with the DE1 board, can then be launched. Choose Open -> Open USB Port from the menu:
After that, go to the SRAM tab, tick File Length and press the “Write a File to SRAM” button:
Choose a memory dump file to load. For instance, it can be the file that I used: Memory dump with CP/M (it needs to be unarchived before).
When a memory dump is loaded, turn off the switch SW and perform a “hot reset” of the system with the GDA00 command of MONITOR-F. The following command DIR will show the programs on the “RAM-disc”.
You can create your memory dumps that contain any programs or files on “RAM-disc”. To do this, choose the “Entire Sram” option in the DE1_Control_Panel program, and press the “Load SRAM Content to a File” button to save a memory dump to a file for future use. Ensure the switch SW is turned on before doing this.
To launch CP/M traditionally from a tape, a loader must be loaded from a tape in MONITOR-F. Then MONITOR-0 and its programs ROMs, as well as timer interrupts, have to be turned off if it hasn’t been done before (switches SW, SW and SW in the “0” position). The loader can be executed with the G3100 command. It will perform a memory initialisation and launch CP/M. The following message will appear:
СРМ V―2,2 DISK RAM 256 К
An invitation message А> means that OS СР/М is waiting for a command. If you notice a mistake in the command before the “ВК” button is pressed, you can fix it using the”←”button.
СР/М has some useful shortcuts:
- УС + X deletes the last string;
- УС + М equals to «ВК» button;
- УС + J equals to return string command;
- УС + S pauses output to display. To continue, press this combination again.
There are two types of commands in СР/М: internal and external.
Internal commands are a part of the operation system. They can be launched anytime without requiring files on connected drives. СР/М has the following internal commands:
- DIR ― file list;
- REN ― rename the file;
- ERA ― erase file;
- TYPE ― display file on screen;
- SAVE ― save RAM range on a disk as a file.
External commands are programs stored on a disc. Their files have the «СОМ» extension. They can be loaded to RAM from the 100Н address and then copied to the “RAM disk”.
Only a name without the «СОМ» extension can be used to execute external commands. СР/М will find the file on “RAM-disk” and launch a corresponding program.
The main external command is CH.COM. This program reads and writes files from/to a tape to/from “RAM-disk”. It is the simplest way to fill the “RAM disk” with files.
To write this program to the “RAM-disk”, the following steps need to be done (if you’ve loaded CP/M from the memory dump, this program is already recorded on the “RAM-disk”, and you don’t need to do the following steps):
1) Load the CP/M loader from a tape and launch it with the G3100 command.
2) Turn on MONITOR-0 ROM with switch SW.
3) Press “RESET” (ESC or KEY)
4) If you don’t have the extension board, 7-segment indicators on the VGA display need to be turned on with switch SW and PS/2 keyboard switched to keypad mode (switch SW in position “1”).
5) When the “11” message is displayed on 7-segment indicators, MONITOR-F needs to be launched by the (7 F800) command.
6) After that PS/2 keyboard can be switched back to full mode (switch SW in “0” position). Now the CH.COM program can be loaded from address 0100 from tape. The program can be downloaded from here.
7) Now CP/M “hot start” command can be entered – GDA00.
8) When CP/M invitation message A> appears, we can use the command SAVE to copy the loaded program from RAM to “RAM-disk”. The program length is three blocks (256 bytes each), so the command will be:
A>SAVE 3 CH.COM
(it means that the first three blocks starting from the address 0100 will be saved on disk into a file named CH.COM).
You can use steps 2-8 to load any other programs to the “RAM disk”, but it is much quicker to use the CH.COM program instead.
You can check that CH.COM is on the “RAM disk” by the DIR command.
To show how the CH.COM command works, let’s create a small file with the SAVE command:
A>SAVE 2 EX.COM
Let’s check that this file exists with the DIR command:
А: СН СОМ : EX СОМ
We can see that there are two files on the disk now. Let’s record the EX.COM file on tape. To do this, the following command can be used:
The following message will appear:
CHANGER VERS1.1 READY TR FOR OUTPUT, PRESS CR
It means that “ВК” needs to be pressed as soon as a tape recorder is turned on. When the file is recorded, the following message appears:
READY TR FOR VERIFY, PRESS CR
The system is waiting to verify the record. The “ВК” button needs to be pressed as soon as the record from a tape starts to play. If any errors are discovered, the following message appears:
Otherwise, a standard invitation message appears:
Let’s now delete the file from the disk with the ERA command:
A> ERA EX.COM
If we check the file list now, it will show the following:
А: СН СОМ
which means that the EX.COM file has been erased.
Let’s restore the EX.COM file on the “RAM disk from the tape. The following command can be used:
А> СН EX.COM
If there is no such file on the disk, the following message will appear:
READY TR FOR INPUT, PRESS CR
This means the computer awaits the “ВК” button to be pressed as soon as a tape player is on. A standard invitation message will appear if the file is successfully read from the tape: А>.
You can check that file is on the disk by the DIR command.
Another useful external command is STAT.COM. It can be used for file list generation, getting a file size, checking free space on a disk and other functions. Let’s assume that you already have STAT.COM on the disk. If you use the STAT command, the following information about “RAM-disk” will be displayed:
A:R/W, SPACE : 152К
It means the disk is in read & write mode and has 152 Kbytes of free space.
Command STAT can change disk status by turning on write protection. It can be done with the following command:
Let’s check the disk status now:
A:R/O, SPACE: 152K
Command STAT also allows displaying information about files:
As a result, information about all files on the disk will be displayed:
RECS BYTES EXT АСС
41 6К 1 R/O A:STAT.COM
BYTES REMAINING ON A:152K
This data means that:
- RECS ― the number of records that a file occupies (one record – 128 bytes);
- BYTES ― file size in Kbytes;
- ЕХТ ― it is “1′ if the file size is not more than 16 Kbytes;
- АСС ― from the word ACCESS ― file access status
- R/O ― read-only.
Command STAT can filter files if only a part of its name is known. Unknown parts can be replaced with «*» and «?» meta symbols or combinations.
STAT FILE. *
STAT *. COM
STAT FI??. ?0?
STAT F??. *
To replace a group of characters, “*” is used. To replace only one character ― “?” is used.
These meta symbols can also be used with internal commands DIR and ERA.
In the first example above command, STAT will display information about all files named FILE and any extensions. In the second, it will display only information about files that have .COM extension. In the third, all files have four characters in their names; the first two are FI, and their extensions have О in the middle. In the fourth example – about all files whose names consist of three characters, start with F and have any extension. A file name cannot have more than eight “?” meta symbols and an extension of more than three.
A file can be renamed with the REN command. For instance:
А> REN FILE.COM = STAT.COM
You cannot rename a file if it has R/O status.
Command TYPE displays text files.
As you probably remember, command ERA erases files from disk. For instance:
А> ERA FILE. COM
You can use meta symbols with the ERA command. Files with R/O status cannot be erased.
In the final part, we will look at some programs for CP/M and learn how to load programs to the “RAM disk”.