OS/8
OS/8 is the primary operating system used on the Digital Equipment Corporation's PDP-8 minicomputer.
PDP-8 operating systems which precede OS/8 include:
- R-L Monitor, also referred to as MS/8.
- P?S/8, requiring only 4K of memory.
- PDP-8 4K Disk Monitor System
- PS/8, requiring 8K. This is what became OS/8 in 1971.
Digital released OS/8 images for non-commercial purposes which can be emulated through SIMH.
Overview
OS/8 provides a simple operating environment that is commensurate in complexity and scale with the PDP-8 computers on which it ran. I/O is supported via a series of supplied drivers which uses polled techniques. The device drivers have to be cleverly written as they can occupy only one or two memory pages of 128 12-bit words, and have to be able to run in any page in field 0. This often requires considerable cleverness, such as the use of the OPR instruction for small negative constants.The memory-resident "footprint" of OS/8 is only 256 words; 128 words at the top of Field 0 and 128 words at the top of Field 1. The rest of the operating system swaps in and out of memory transparently as needed. This disk-resident part of OS/8 is the first 14K words of the SYS: device, including swap space.
The remaining memory contents are preserved between some of the basic user commands. This is exploited by the process by which executable programs are built: for example, an assembly language program is first assembled into a.BN file. Then one or more.BN files are loaded into memory using the LOAD command. You could then execute the loaded program with the START command, debug it with ODT, or SAVE it to a.SV file which can be later retrieved with the GET command or executed immediately with R or RUN commands. Information about the currently loaded program is maintained in the CCB, which is located on the SYS: device. This information includes which parts of memory are used by the program and the program's starting address.
This concept of preserved memory being associated with a user or job also appears in other DEC operating systems, including TOPS-10 for the PDP-10, where such memory is known as a context.
OS/8 can boot from a hard disk and present the command prompt in under half a second.
The Concise Command Language
Early versions of OS/8 have a very rudimentary command-line interpreter with very few basic commands:,,,,, and. With version 3 they add a more sophisticated overlay called CCL that implements many more commands. OS/8's CCL is directly patterned after the CCL found on Digital's PDP-10 systems running TOPS-10. In fact, much of the OS/8 software system is deliberately designed to mimic, as closely as possible, the TOPS-10 operating environment.The basic OS and CCL implements many rather sophisticated commands, many of which still do not exist in modern command languages, not even in MS-DOS, Windows, or Unix-like operating systems.
For example, the command automatically finds the right compiler for a given source file and starts the compile/assemble/link cycle.
The and commands permit the use of logical device names in a program instead of physical names. For example, a program can write to device, and with an initial "" then the file is created on physical device RXA2. VAX/VMS and the Amiga's operating system AmigaOS make considerable use of this feature.
The command is capable of setting many system options by patching locations in the system binary code. One of them, a command under OS-78, is, which re-enables the MONITOR commands that are not part of OS-78.
The command can reconfigure the OS on the fly, even adding device drivers, often without having to reboot the OS.
The OS/8 Filesystem
OS/8 supports a simple, flat file system on a variety of mass storage devices including:- TU56 DECtapes
- DF32 32KW fixed-head disks
- RF08 256KW fixed-head disks
- RK01/02/03/04/05 cartridge disk drives
- RL01/02 cartridge disk drives
- RX01/02 floppy diskette drives
- .PA : Assembly language
- .SV : saved core-images
- .FT : Fortran source files
- .DA : Data files
PIP includes an option to compress the filesystem, so that all unallocated space is moved to a single extent at the end of the disk. This can be invoked by the SQuish CCL command, much as MUNG can be used to run a TECO macro.
OS/8 volumes have a limited maximum storage size and the RK05 moving-head disk exceeds this size: "1.6 million words of storage". Because of this, RK05 cartridges are divided into two partitions. For example, the first RK05 on a system is known as both RKA0: and RKB0:. This division refers to "the outer cylinders" and "the inner cylinders".
ASCII
There are two systems for handling ASCII text. ASCII files are stored as three 8-bit characters per pair of 12-bit words. The first two characters are stored whole in their words, while the third character is stored with half of its bits in word 1 and the other half in word 2.- WORD 1: c0 c1 c2 c3 | a0 a1 a2 a3 a4 a5 a6 a7
- WORD 2: c4 c5 c6 c7 | b0 b1 b2 b3 b4 b5 b6 b7
6-bits per character uppercase only ASCII strings are also used. In this case, two characters efficiently fit in each word. This is used for filenames in directory entries, but also for strings in BASIC. In BASIC, even though strings use 6-bit characters, you may print any 8-bit code by using the PNT function within PRINT, for example use PNT to print an ASCII ESC character.
OS/8 date format
OS/8 allocates the PDP-8's 12 bit words for storing dates per:- 4 bits for the month
- 5 bits for the date therein
- 3 bits for the year.
OS/8 CUSPs (Utility Programs)
The CUSPs supplied with OS/8 include:- BUILD
- DIR
- EDIT
- MACREL
- FLAP
- FORTRAN-II.
- FOTP
- PAL
- PIP
- PIP10
- RALF
- TECO. The MUNG command runs TECO macros.
- CCL, the command line interpreter, supplied in source form and user-extensible.
Programming languages
BASIC
A single-user BASIC and two multi-user versions of BASIC are available as options.The single-user BASIC uses several overlays to provide the full functionality of the language; when OS/8 is booted from a DECtape, a noticeable delay occurred each time BASIC is required to switch overlays as they need to be read from tape.
The multi-user versions of BASIC differ only in whether or not they support block-replaceable devices. Due to cost constraints, many PDP-8s have punched paper tape readers as their only mass-storage I/O device. EDU20 loads from paper tape and can do output to a paper tape writer if the machine has one, whereas EDU25 understands the structure of a filesystem, can load from DECtape or disk, and can create files on DECtape or disk. Both can run multiple BASIC programs simultaneously using a primitive task-scheduler that round-robins among the attached terminals. Memory is always tight because the PDP-8 uses core memory, which was extremely expensive compared to RAM technology. In 8K of 12-bit words EDU20 can support up to 4 terminals at once, although more memory was recommended. EDU25 requires an additional 4K memory bank because the code contains a disk device driver and a filesystem handler. While running, EDU20 and EDU25 are self-contained programs that don't use any OS/8 system calls. Immediately upon being invoked from the OS/8 command interpreter, they overwrite OS/8's entire resident portion – all 256 words of it. Upon startup, EDU25 saves the contents of memory to DECtape or disk and restores it upon exit. But EDU20 cannot do this as it is targeted at hardware configurations without any block-replaceable device.
FORTRAN
In addition to a freely available [|FORTRAN II] compiler, there is also a rather complete FORTRAN IV compiler available. This compiler generates code for the optional FPP-8 floating-point processor, which is essentially a separate CPU, only sharing memory with the PDP-8 CPU. With the FPP-8 option installed, the FORTRAN runtime code detects it and uses the FPP-8 to run the main program code, and the PDP-8 CPU runs as an I/O processor. Lacking the FPP-8, the runtime code instead calls an FPP-8 interpreter running on the PDP-8 CPU, so the program runs at reduced speed.This FORTRAN IV compiler in version 1 has the interesting bug that DO loops counted incorrectly: DO loops would count 1,2,3,5,6,7,…. A quick patch was released to fix this.