UT-88. Using OS CP/M. Part 1/2.

Tags: No Tags
Comments: No Comments
Published on: 28/03/2012

Finally we reached the most exciting part – we will launch 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 as well. OS listing for “UT-88″ and detailed description were published in the “Young Technician” magazine.

This system utilise 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 traditional way of loading the system and programs from a tape.

Lets start with the first method as the most convenient. Firstly, MONITOR-F has to be launched as it was describe in one of the previous posts. Secondly, DE1 needs to be connected to a Windows machine with USB cable. Then SW[8] switch has to be turned on to transfer DE1 to USB JTAG mode. DE1_Control_Panel.exe, that can be found on CD disk that comes with DE1 board, then can be launched. Choose Open -> Open USB Port from the menu:

DE1 CONTROL PANEL (step 1)

After that go to SRAM tab, tick File Length and press the “Write a File to SRAM” button:

DE1 CONTROL PANEL (step 2)

Choose 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 switch SW[8] and perform “hot reset” of the system with GDA00 command of MONITOR-F. The following command DIR will show what programs are on the “RAM-disc”.

You can create your own memory dumps that contain any programs or files on “RAM-disc”. To do this choose “Entire Sram” option in the DE1_Control_Panel program, and press “Load SRAM Contetnt to a File” button to save a memory dump to a file for future use. Just make sure that switch SW[8] is turned on before doing this.

To launch CP/M traditionally, from a tape, a loader needs to be loaded from a tape in MONITOR-F. Then MONITOR-0 and its programms ROMs, as well as timer interrupts, have to be turned off if it hasn’t been done before (switches SW[2], SW[4] and SW[6] in “0” position). Loader can be executed with 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 a command before “ВК” button is pressed you can fix it using “←” 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 at any time and don’t require any files on connected drives. СР/М has following internal commands:

  • DIR ― file list;
  • REN ― rename 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 «СОМ» extension. They can be loaded to RAM from 100Н address and then copied to the “RAM-disk”.

To execute external commands only a name without «СОМ» extension can be used. СР/М 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 “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 following steps):

1) Load CP/M loader from a tabe and launch it with G3100 command.

2) Turn on MONITOR-0 ROM with switch SW[2].

3) Press “RESET” (ESC or KEY[0])

4) If you don’t have the extension board, 7-segment indicators on VGA display need to be turned on with switch SW[1] and PS/2 keyboard switched to keypad mode (switch SW[0] in position “1”).

5) When “11″ message is displayed on 7-segment indicators, MONITOR-F needs to be launched by (7 F800) command.

6) After that PS/2 keyboard can be switched back to full mode (switch SW[0] 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 command SAVE to copy loaded program from RAM to “RAM-disk”. The program length is 3 blocks (256 bytes each) and so the command will be:

A>SAVE 3 CH.COM

(it means that first 3 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 CH.COM program instead.

You can check that CH.COM is on the “RAM-disk” by DIR command.

Just to show how CH.COM command works, lets create a small file with SAVE command:

A>SAVE 2 EX.COM

Lets check that this file exists with DIR command:

А: СН СОМ : EX СОМ

А>

We can see that there are two files on the disk now. Lets record 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 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. “ВК” 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:

VERIFY ERROR

Otherwise a standard invitation message appears:

А>

Lets now delete the file from the disk with ERA command:

A> ERA EX.COM

If we check the file list now it will show:

А> DIR

А: СН СОМ

which means that EX.COM file has been erased.

Lets restore EX.COM file on the “RAM-disk from tape. The following command can be used:

А> СН EX.COM

If there is no such a file on the disk the following message will appear:

READY TR FOR INPUT, PRESS CR

which means that the computer awaits “ВК” button to be pressed as soon as a tape player is on. If the file is successfully read from the tape, a standard invitation message will appear: А>.

You can check that file is on the disk by 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 some other functions. Lets assume that you already have STAT.COM on the disk. If you use STAT command the following information about “RAM-disk” will be displayed:

A:R/W, SPACE : 152К

А>

It means that the disk is in read & write mode and it 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:

A>STAT A:R/0

Lets check the disk status now:

A>STAT

A:R/O, SPACE: 152K

A>

Command STAT also allows to display information about files:

A>STAT *.*

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

A>

This data means that:

  • RECS ― a quantity of records that a file occupies (one record – 128 bytes);
  • BYTES ― file size in Kbytes;
  • ЕХТ ― it is “1′ if file size is not more than 16 Kbytes;
  • АСС ― from the word ACCESS ― file access status
  • R/O ― read only.

 

Command STAT can be used for filtering files if only a part of its name is known. Unknown parts can be replaced with «*» and «?» metasymbols or its combinations.

For example:

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 metasymbols can be used as well with internal commands DIR and ERA.

In the first example above command STAT will display information about all files with the name FILE and any extensions. In the second it will display only information about files that have .COM extension. In the third – about all files which has four characters in its names and first two of them are FI and their extensions have О in the middle. In the forth example – about all files which names consists from three characters, start with F and have any extension. It is obvious that a file name cannot have more than eight “?” metasymbols and an extension more than three.

A file can be renamed with REN command. For instance:

А> REN FILE.COM = STAT.COM

You will not be able to rename a file if it has R/O status.

Command TYPE displayes text files.

As you probably remeber, command ERA erases files from disk. For instance:

А> ERA FILE. COM

А>

You can use metasymbols with ERA command. Files with R/O status cannot be erased.

In the final part we will have a look on some programs for CP/M and learn how to load programs to the “RAM-disk”.

Leave a Reply

Welcome , today is Tuesday, 02/09/2014