UsingTheDiskDrive - pkimpel/retro-1620 GitHub Wiki
Using the 1311 Disk Drive
The IBM 1311 was the first disk storage system to feature removable storage. The removable unit, known as a "disk pack," consisted of six platters having ten recording surfaces, which were mounted on an axial hub. When mounted in the drive mechanism, five hydraulically-powered arms, arranged like the tines of a comb and holding the read/write heads, moved radially between the platters. These arms could be positioned to any of 100 points along the radius of the disk pack platters.
Data was stored on the surface of the disk platters in units of "sectors" of 100 digits each. The 20 sectors that passed under one head at one arm position are termed a "track." The ten tracks accessible at one arm position are termed a "cylinder." With 100 cylinders of 10 tracks each and 20 100-digit sectors per track, the total storage on a disk pack was 2,000,000 digits.
A 1620 system could support up to four 1311 drive units, termed "modules." Module 0, which contained the circuitry to interface with the 1620, was a Model-3 unit. Up to three Model-2 extension units, numbered 1 to 3, could be attached through module 0, for a total storage capacity of 8,000,000 digits.
The drives spun at 1500 RPM, yielding an average sector access time within a cylinder of 22ms. Moving the access arm, termed a "seek," was a separate operation, and took 75-392ms depending on the starting and ending cylinder numbers. A seek always returned the arm to its home position before moving out to the new cylinder number.
For more information on the 1311, see the IBM 1311 Disk Storage Drive manual.
The window for the disk subsystem in the emulator looks like this:
Each of the numbered rows in this window represents one storage module. Module 0 is always present when disk storage is enabled; any combination of extension modules may be included in the configuration.
The emulator will automatically size the height of the disk drive window to accommodate the number of modules included in the configuration. If you change the width of the window, the width of the Cylinder Position meter bar (see below) for each module will change accordingly.
In the emulator, the disk data is stored and accessed using a browser facility known as IndexedDB. The data is stored on your workstation's local disk, but the only practical way to access it is in a browser through the IndexedDB API. Each browser handles this storage in its own way. For example, Firefox uses SQLite and Chrome uses LevelDB, which is a derivative of Google's BigTable technology.
The 1311 stored 1620 digits as 7-bit characters to allow for interchangeability among a number of IBM systems. The retro-1620 implementation does not do any translation. Instead, it stores the digits as unsigned 8-bit integers in the same form as they are stored in 1620 memory. The disk ignores parity, but proper parity is set when data read from the disk is stored in memory.
Configuring Disk Storage
The retro-1620 emulator does not include disk storage in its default configuration. In order to use disk, you must first enable it in the system configuration. To do so, click the Configure System button on the emulator's home page. This button is enabled only when the emulator is powered off.
The portion of the configuration window that applies to disk storage looks like this:
Clicking the "Exists" check box includes a module in the configuration. Including Module 0 enables disk storage in the emulator, as module 0 must be present for any of the other modules to work.
The "Started" and "Enabled" check boxes echo the state of the START/STOP and ENABLE switches, respectively, on the disk control panel described in the next section. The state of those check boxes will determine the state of the switches when the emulator is initialized. In return, changing the state of the switches while the emulator is running will update the state of the check boxes in the configuration and persist across an emulator restart.
The "Image" item is the last node of the disk image file name that was most recently loaded to the module's storage.
When a module is included in the configuration for the first time, the image file name will be blank and the module storage will be empty. The next time the emulator is initialized after a module is first included, the emulator will initialize the module's storage as described for the Initialize button in the next section. The module's START/STOP switch will not light and the module will not go ready until this initialization has completed, which may take up to 30 seconds per module. On subsequent emulator initializations the modules will become ready much more quickly.
If you remove a module from the system configuration, its storage is retained and remains unaffected. If the module is included again later, it will be in the same state it was previously.
Disk Drive Controls and Lamps
The Model-3 unit used for module 0 had two controls that applied to all of the modules. These were used only when doing full-track writes to the disk, which were normally done only to initialize a disk pack:
COMPARE DISABLE – This toggle switch disables the checking of sector addresses when writing a full track on the disk. Full-track writes are normally done only to initialize a disk pack and write sector addresses on it. This switch should be left in the off (down) position for normal disk operations. The emulator does not persist the setting of this switch across emulator restarts and always initializes it in the off position.
WRITE ADDRESS – This push-push toggle switch enables full-track writes. The switch is on when its yellow lamp is lit. The switch must be off in order to do sector-oriented writes, and should be left off for normal disk operations. The emulator does not persist the setting of this switch across emulator restarts and always initializes it in the off state.
The remaining controls are associated with each module individually, and with one exception mentioned below, affect just that module.
Module Status – This lamp shows the module number. It is lit green when the module is started (powered on) and enabled, indicating it is ready for use by the 1620.
Sector Address – This text field did not appear on a real 1311 unit and is present in the emulator to give a sense of where on the disk I/O activity is taking place. It shows the sector address last acted upon by the module.
Cylinder Position – This meter bar shows the relative position of the module's access arm, which was visible through the clear cover on the module. It also animates the arm motion. When the bar is all the way to the left, the arm is at cylinder 0. When it is all the way to the right, it is at cylinder 99. A seek operation always begins by returning the access arm to cylinder 0 before moving to its new position. Seeking to a cylinder is a separate operation that must be completed before a read or write can take place, although a seek can be overlapped by CPU processing or other non-disk I/O activity.
ENABLE – This switch controls the on-line status of the module and whether the 1620 can send commands to it. Note, however, that module 0 must be enabled for any of the other modules to be usable. The state of this switch is stored in the system configuration and preserved across emulator restarts. It should be in the on (up) position for normal disk operations.
START/STOP – This push-push switch controls power to the module's drive spindle. The switch is on when its white lamp is lit. If module 0 is enabled, then the other modules can be used regardless whether module 0 is started or stopped. The state of this switch is stored in the system configuration and preserved across emulator restarts. It should be in the on (lit) state for normal disk operations.
A module had to be stopped in order to mount or remove a disk pack. In order to support a similar capability in the emulator, clicking the START/STOP button works as follows:
-
If the module is in the stopped state when the switch is clicked, it will be started, the switch will be lit, and if the module is enabled, it will become ready and its status lamp will turn green.
-
If the module is in the started state when the switch is clicked, it will be stopped, and the switch and status lamps will go out. A panel with additional controls will open over the disk drive window, with the window expanding temporarily if necessary to make room for it.
This panel allows you to manage the disk pack itself. Its controls work as follows:
Close – Clicking this button will close the panel and return to the disk drive window. The module will be left in the stopped state.
Extract – Clicking the button will convert the entire contents of the module's storage to ASCII text, open a temporary window on your screen, and insert that text into the window. You can then save or copy/paste that text elsewhere. This is the equivalent of "unmounting" a disk pack, although the module's storage is not actually removed and is not affected by this operation. Thus, this button is one way to create a backup of the module's contents. The button was formerly labeled "Dump."
At the conclusion of the extract, the module will remain stopped and the panel will remain open. Click Close to close the panel, and if desired, then click the module's START/STOP switch to restart the module and make it ready.
The ASCII text, if saved in a file, can be used later to reload the module's storage, as discussed next. The format of the disk image file is described in the section "Format of Disk Image Files," below.
Save – Clicking this button works the same as the Extract button, except that instead of displaying the disk image in a temporary window, it opens a standard save-file dialog to save the image as an ASCII text file on your local file system. The default name for the file is retro-1620-Disk-Image.pack
but can be changed on the save-file dialog.
Browse or Select File (depends on the browser) – Clicking this button will allow you to "mount" a new disk pack on the module by selecting a disk image file from your local file system. The emulator will require you to confirm that you want to overwrite the existing contents of the module's storage. In most cases you will want to have backed up the module's existing data to a separate image file before doing this.
The emulator will verify that the selected file meets the format required of disk image files and will reject any non-conforming files with an error without modifying the existing module storage.
After a successful image file load, the panel will close and the module will be started.
Initialize – Clicking this button will erase the contents of the module's storage and completely rewrite the module with sector addresses 00000-19999. The data in each sector will be filled with zero digits. The emulator will require you to confirm that you want to destroy the existing contents of the module's storage. You may want to back up the module's existing data before doing this. On successful conclusion, the panel will close and the module will be started.
The Initialize operation effectively does full-track writes, but it is not necessary to turn on the COMPARE DISABLE or WRITE ADDRESS switches when using this button.
Note that the emulator does not have an exact equivalent of unmounting a disk pack and leaving the module empty. An Extract or Save operation does not remove the existing storage from a module, and if the module is restarted, it will be in the same state as before the dump. The closest analogy to a true unmount would be to do a Dump followed by an Initialize.
Also note that loading or initializing a disk module may take some seconds to complete. Under current versions of Mozilla Firefox and Apple Safari, this usually takes 3-4 seconds. Under Google Chrome, it often takes 20-30 seconds per module.
Recovering from Disk System Hangs
When a 1620 system would hang during I/O due to an invalid instruction, non-ready device, or a non-existent device, the operator could regain control by pressing the RELEASE button on the Control Panel. For hangs involving the disk subsystem, however, that approach does not work. Instead, you need to use a special disk release. Similarly, the RESET and CHECK RESET buttons do not turn off the disk check indicators, and the special disk release must be used to clear those as well.
On a physical 1620, that disk release was accomplished by pressing RESET and RELEASE simultaneously. In the emulator, simultaneous button presses are not possible, so the following technique must be used instead:
- Click and hold the RESET button. Its caption will turn gray.
- Continue holding the click down while dragging across to the RELEASE button. Its caption will then also turn gray.
- Release the click.
- To cancel the click and abandon the reset, simply release it anywhere other than over the RESET or RELEASE buttons.
This technique will release any hung disk I/O operation and reset the disk check indicators ADR CHK (36), WLR RBC (37), and CYL OFLO (38), plus the Any Disk Error pseudo-indicator (39) which tests true if any of the other three are on. It will not reset any other indicators or processor state, however. Therefore you may need to follow the RESET-RELEASE gesture by pressing just the RESET button to clear any remaining state.
1620 Disk Software
The 1311 could be used without an operating system, but most 1620 sites with disk used a simple batch job control system known as Monitor. This had two versions, Monitor I, and an enhanced version, Monitor II for the 1620 Model-2.
Monitor provided three primary facilities:
- A simple, fixed-field control card syntax to allow jobs to be stacked in the card reader and run without pause unless operator intervention was necessary. Most of the card handling involved with multiple passes during assembly and compilation of programs was avoided, since the source deck and intermediate data could be stored temporarily on the disk.
- A memory-resident Input/Output API that supported all devices, but in particular handled the details of disk access and storage allocation. For all devices it provided centralized error handling, some primitive device independence, and where appropriate, retry when errors occurred.
- A program loader, which supported both core-image and relocatable programs, as well as the linking of separately-compiled subroutines into a main program.
Monitor also included three important applications:
- The SPS II-D assembler, which was extended with additional instruction mnemonics and macros to support disk devices and the I/O API.
- FORTRAN II-D and its subroutine library.
- The Disk Utility Program (DUP), which could load, copy, and remove files on the disk modules, and otherwise manage files and their space allocation on the disk packs.
Monitor and its associated applications easily fit on one disk pack with plenty of storage space to spare. Unless you are planning to store a significant number of additional programs or data files on disk, only one disk storage module needs to be configured for the system.
Monitor was generally distributed to 1620 sites and loaded from a large (more than 5000 card) deck, or even more tryingly, from paper tape. The 1620 Jr. project at the Computer History Museum has recovered the Monitor I build deck from the Maniotes collection.
A more convenient approach to loading Monitor I, though, is to download a zipped disk image file from the project hosting site, unzip the file, and then load the unzipped image to a disk module by clicking the module's START/STOP button and selecting the image file. There are two versions of the Monitor I disk image, differing only in the library routines used by FORTRAN II-D:
- Disk Image for systems with hardware floating point
- Disk Image for systems without hardware floating point
Both versions require the 1443 printer to be part of the system configuration. Copies of these files are also in the project repository under the software/monitor directory.
Once Monitor I is loaded to disk, it can be booted into memory by a 1620 Model 2 system loading and executing this sequence of digits from the typewriter or a punched card:
34000480070136000480070260000365100060024025100911963611300102
Note that Monitor I will not function properly on a Model 2 system (including retro-1620) that has indirect addressing disabled, or index registers enabled and either band 1 or 2 selected. The problem is that (a) Monitor I requires indirect addressing and (b) it allows some of its instructions to have flags over the middle address digits, which indicate to a Model 2 that the address should be indexed, something Monitor I would not intend to happen. A 1620 Model 2 powers on with indirect addressing enabled no index register band selected, so as long as programs running under Monitor I do not exit with one of the bands selected, any flags over address digits will not affect Monitor I's operation.
If a program terminates or is aborted with indirect addressing disabled or an index register band enabled, you will probably see MOD ERR
messages on the Typewriter. You can disable index registers by pressing INSERT on the Control Panel or Typewriter and entering this sequence on the Typewriter keyboard:
60000120000048 [Release/Start]
You can enable indirect addressing by pressing INSERT and entering this sequence:
60000120000948 [Release/Start]
For additional information on Monitor, SPS II-D, and FORTRAN II-D, see the collection of 1620 documents at bitsavers.org and especially the Monitor-related documents.
Format of Disk Image Files
A disk image file is an ordinary ASCII line-delimited text file, formatted as a limited type of CSV (Comma-Separated Value) file. The lines in the file may be delimited by carriage-return/line-feed (Windows convention), line-feed only (Unix convention), or carriage-return only.
Each sector on the disk is represented in the text file as one line with two fields separated by a comma:
-
The decimal sector key in the range 00000-19999. Leading zeroes need not be present in the values. This is the physical location of the sector on the disk pack, not the sector address. They are usually the same, but need not be.
-
105 digits of sector content. The first five digits are the sector address, followed by 100 digits of sector data. If there are fewer than 105 digits, the sector is padded with zeroes; if there are more than 105 digits, the extraneous ones at the end are ignored. If the first digit of the sector address is flagged, that sector will be read-only.
Blank lines are not permitted in the file. Neither field on a line may be enclosed in quotes. A double-quote ("
), representing a flagged Group Mark (hex F digit), may validly occur in the sector data. A brief example of the format, for sectors 05000-05005, is this:
5000,05000N35647460000]010M56757460000]011M35662460000]021O24955460000]022M16341554600]023O25859634600]024M142
5001,0500162460000]025N35647000000]010M56757000000]011M35662000000]021O24955000000]022M16341550000]023O2585963
5002,050020000]024M14262000000]025R999999999999999R999999999999999R999999999999999R999999999999999R99999999999
5003,050039999R999999999999999R999999999999999R999999999999999R999999999999999R999999999999999R999999999999999
5004,05004R999999999999999R999999999999999R999999999999999R999999999999999R999999999999999R999999999999999R999
5005,05005999999999999R999999999999999R999999999999999R999999999999999R999999999999999R999999999999999R9999999
The sector keys must be numeric, in the range 0-19999, and in monotonically-ascending order. They do not need to be incremental, however – you can use this format to load only a portion of the disk pack. Only the sectors that have keys in the image file will be overwritten on the pack.
The sector data uses the same codes as are output by the Card Punch, except that numeric blank is represented as "@":
hex digit: 0 1 2 3 4 5 6 7 8 9 A B C D E F
- - - - - - - - - - - - - - - -
non-flagged: 0 1 2 3 4 5 6 7 8 9 | = @ ? ? }
flagged: ] J K L M N O P Q R ! $ - ? ? "
During a load of an image file to a disk module, ?
codes (resulting from the output of hex D and E digits) will be stored as unflagged hex D.
No other character codes are allowed. If any others are present, the image will be rejected and the existing storage will be unaffected.