Jump to content

CP/M

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RexNL (talk | contribs) at 19:03, 13 January 2006 (Reverted edits by 204.113.114.213 (talk) to last version by Wtshymanski). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
CP/M
File:No Screenshot Available
DeveloperDigital Research, Inc.
OS familyNot Applicable
Working stateHistoric
Source modelClosed source
Latest release3.1 / date unknown
Kernel typeNot Applicable
Default
user interface
Command line interface
LicenseProprietary
Official websiteNot Applicable

CP/M is an operating system originally created for Intel 8080/85 and Zilog Z80 based microcomputers by Gary Kildall of Digital Research, Inc.. Initially confined to single tasking on 8-bit processors and no more than 64,000 bytes of memory, later versions of CP/M added multi-user variations, and were migrated to 16-bit processors.

CP/M stood for either Control Program for Microcomputers or Control Program/Monitor. The name echos the prevailing naming scheme of its time, as in Kildall's/Intel's PL/M, Programming Language for Microcomputers, and in Prime Computer's PL/P, Programming Language for Prime. Gary Kildall himself renamed CP/M in word form as part of the maturation of CP/M from personal project in 1974 to commercial enterprise in 1976.

The combination of CP/M and S-100 bus computers patterned on the MITS Altair was an early "industry standard" for microcomputers, and was widely used through the late 1970s and into the mid-80s. By greatly reducing the amount of programming required to install an application on a new manufacturer's computer, CP/M increased the market size for both hardware and software.

Hardware model

A minimal 8-bit CP/M system would contain the following components:

  • A computer terminal using the ASCII character set
  • An Intel 8080 microprocessor
  • At least 16 kilobytes of random access memory
  • At least one diskette drive.

The only hardware system that CP/M as sold by Digital Research would support was the Intel 8080 Development System. Every manufacturer of CP/M compatible systems would customize portions of the operating system for its combination of installed memory, disk drives, and console devices.

Components of the operating system

In the 8-bit versions, CP/M's software was separated into three components

  • command processor or CCP,
  • basic disk operating system or BDOS, and
  • basic input/output system or BIOS.

The CCP and BDOS were the same in all installations of a particular revision of CP/M, but the BIOS portion was always adapted to the particular hardware. Adding memory to a computer, for example, meant that the CP/M system had to be reinstalled. Once installed, the operating system was stored in reserved areas at the beginning of each floppy disk. On power-up the hardware would look for a floppy disk in drive A: and load from it the operating system.

By modern standards CP/M was primitive owing to the extreme constraints on program size. With version 1.0 there was no provision for detecting a changed disk. If a user changed disks without manually rereading the disk directory the system would write on the new disk using the old disk's data, ruining the data stored on the disk. Starting with 1.1 or 1.2 this danger was reduced: if one changed disks without without reading the new disk's directory, and tried to write to it, the operating system would signal a fatal error, avoiding overwriting but requiring a reboot.

The majority of the complexity in CP/M was isolated in the BDOS, and to a lesser extent, the CCP. This meant that by porting the limited number of simple commands in the BIOS to a particular hardware platform, the entire OS would work. This significantly reduced the development time needed to support new machines, and was one of the main reasons for CP/M's widespread use. Today this sort of abstraction is common to most OSs, but at the time of CP/M's birth, OSs were typically intended to run on only one machine platform, and multilayer designs were considered unnecessary.

Command processor

The command processor or CCP accepted input from the keyboard. If an internal command was recognized, it was carried out by the command processor iteslf. If the command entered was not one of the internal commands, the CCP would attempt to find an executable file on the currently logged disk drive and user area, load it, and pass it any additional parameters from the command line. ON completion of a transient program, CP/M would reload the part of the CCP that had been overwritten by application programs - this allowed transient programs a larger memory space.

CP/M's command line interface was patterned after the operating systems from Digital Equipment, such as RSTS/E for the PDP-11.

All CP/M commands had to be typed in on the "command line" - the screen would show most often a:> and would await input from the user.

Commands generally took the form of a keyword followed by a list of parameters separated by spaces or special characters. If the command was not one of the internal commands built into the CCP, the currently-logged disk directory would be searched for a program file with the same name, and, if found, the program would be loaded and the rest of the command line passed to it.

The commands themselves could sometimes be obscure. For instance, the command to duplicate files was named PIP (Peripheral-Interchange-Program), the name of the old DEC utility used for that purpose.

Basic disk operating system

The basic disk operating system (BDOS) provided access to such operations as opening a file, output to the console, or printing. Application programs would load processor registers with a function code for the operation, and addresses for parameters or memory buffers, and call a fixed address in memory. Since the address was the same independent of the amount of memory in the system, application programs would run the same way for any type or configuration of hardware.

Basic input output system

The basic input output system or BIOS provided the lowest level functions required by the operating sytem. These included reading or writing single characters to the system consoles and reading or writing a sector of data from the disk. The BDOS handled some of the buffering of data from the diskette but usually management of a disk buffer area was handled by code in the BIOS.

File system

File names consisted of up to 8 characters, a period, then up to three characters as a file name extension. The extension usually identified the type of the file, for example, .COM indicated a binary executable program file, and .TXT might indicate a file full of ASCII text.

CP/M 2.2 had no sub-directories in the file structure but provided 16 "user areas" to organize files on a disk. The user area concept was to make the single-user version of CP/M somewhat compatible with multi-user MP/M systems. A common patch for the CP/M and derivative operating systems was to make one user area accessible to the user independent of the currently set user area. A supported command was "USER x" where x is a value from 0 to 15. User 0 was the default. If one changed to another user, such as USER 1, the material saved on the disk for this user would only be available to USER 1; USER 2 would not be able to see it or access it. Since CP/M was a single-user operating system no security was provided for the user command; nothing would prevent any user from logging in successively as any of the 16 users. The user area feature arguably had little utility on small floppy disks, though it was more useful for organizing files on machines equipped with large hard drives.

History

The beginning and CP/M's heyday

In 1974 CP/M was a private project of Gary Kildall, under the name "Control Program/Monitor". During the conversion of CP/M to a commerical product, trademark registration documents filed in November 1977 gave the product's name as "Control Program for Microcomputers".

This renaming of CP/M was part of a larger effort by Kildall and his business-partner wife to convert Kildall's personal project of CP/M and the Intel-contracted PL/M compiler into a commercial enterprise. The Kildalls astutely intended to establish the Digital Research brand and its product lines as synonymous with "microcomputer" in the consumer's mind, similar to what IBM and Microsoft together later successfully accomplished in making "personal computer" synonymous with IBM and Microsoft product offerings. Intergalactic Digital Research, Inc. was later renamed via a corporation change-of-name filing to Digital Research, Inc..

CP/M used the 7-bit ASCII set. The other 128 characters made possible by the 8-bit byte were not standardized. For example, one Kaypro used them for Greek characters, and Osborne machines used the 8th bit set to indicate an underlined character.

There were no operating system support for graphics (images) with 8-bit versions of CP/M. While graphics-capable S100 systems existed from the commercialization of the S100 bus, CP/M did not provide any standardized graphics support until the release of CP/M 3.0 with GEM graphics extensions. Owing to the small memory available, graphics was never a common feature associated with 8-bit CP/M operating systems.

While the 8-inch single density format (so-called "distribution fomrat" was standardized, various 5 1/4 inch formats were used depending on the characteristics of particular systems and to some degree the choices of the designers. No single manufacturer prevailed in the 5 1/4 inch era of CP/M use. A software manufacturer had to prepare a separate version of the program for each brand of hardware on which it was to run. With some manufacturers (Kaypro is an example), there was not even standardization across the company's different models. Because of this situation, disk format translation programs, which allowed a machine to read many different formats, became popular and reduced the confusion. The fragmented CP/M market, requiring distributors either to stock multiple formats of disks or to invest in multiformat duplication equipment, compared with the more standardized IBM PC disk formats, was a contributing factor to the rapid obsolescence of CP/M after 1981.


CP/M was described as a "software bus", allowing multiple programs to interact with different hardware in a standardized way. Programs written for CP/M were typically portable between different machines, usually only requiring specification of the escape sequence for control of the screen and printer. This portability made CP/M popular, and much more software was written for CP/M than for operating systems that only ran on one brand of hardware. One restriction on portability was that certain programs used the extended instruction set of the Z80 processor and would not operate on an 8080 or 8085 processor.

Hundreds of different brands of machines ran CP/M, some notable examples being the Altair, the IMSAI 8080, the Osborne 1 and Kaypro portables, and even the Apple II when an extra Z80-card was installed. The best selling CP/M capable system of all time was probably the Commodore 128, although few people actually used its CP/M abilities. In the UK, CP/M was also available for the BBC Micro— which could also be equipped with a Z80 co-processor. Furthermore, it powered the popular Amstrad PCW word-processing system.

WordStar, one of the first widely used word processors, and dBASE, an early and popular database program for small computers, were originally written for CP/M. The first "outline processor", KAMAS (Knowledge and Mind Amplification System) was also written for CP/M, though later rewritten for MS/DOS. Various character or text-based games were written; in their level of sophistication they resembled most those currently available for cell phones. Lifeboat Associates started collecting and distributing user-written "free" software. One of the first was XMODEM, which allowed communication via modem and phone line.

The 16-bit world

Versions of CP/M were later completed for some 16-bit CPUs as well, although they required the application programs to be re-compiled for the new CPUs -- or, if they were written in assembly language, to be largely rewritten from scratch.

One of the first was CP/M-86 for the Intel 8086, which was soon followed by CP/M-68k for the Motorola 68000. At this point the original 8-bit CP/M became known as CP/M-80 to avoid confusion.

CP/M-68k was widely used only in one application: it formed the basis of the Atari ST computer. CP/M-86 had the potential of becoming the standard operating system of the new IBM PCs, but minor legal issues made IBM turn to Microsoft instead (although it was still offered on the original IBM PC). Microsoft purchased a CP/M clone known as QDOS, and used it to create PC-DOS/MS-DOS which went on to become the "official" PC operating system. CP/M-86 never became popular.

MS-DOS takes over

Many of the basic concepts and internal mechanisms of early versions of MS-DOS were patterned after those of CP/M. Internals like file-handling data structures were identical, and both referred to disk drives with a letter (A:, B:, etc.). The main innovation was MS-DOS's FAT file system. This intentional similarity made it easier to port popular CP/M software like WordStar and dBase. However, CP/M's concept of separate user areas for files on the same disk was never ported to MS-DOS. Since MS-DOS had access to more memory, more commands were built-in, most usefully the file COPY command. This made the command-line user interface of MS-DOS somewhat easier to use.

CP/M rapidly lost market share as the microcomputing world moved to the PC platform, and it never regained its former popularity. Byte Magazine, at the time one of the leading industry magazines for microcomputers, essentially ceased coverage of CP/M products within a couple of years of the introduction of the IBM PC. For example, in 1983 there were still a few advertisements for S100 boards and articles on CP/M software, but by 1987 these were no longer found in the magazine.

Later versions of CP/M-86 made significant strides in terms of performance and usability however, and for some time in the 1980s was considered to be a better x86 OS than MS-DOS. To reflect this compatibility the name was changed, and CP/M-86 became DOS Plus, which in turn became DR-DOS.

ZCPR

A late replacement for the standard Digital Research command processor was available for Z80 based computers. Called "ZCPR" for "Zilog Command Processor Replacment", use of Z80 opcodes to save space and a suite of Z80-code utilities allowed complete functional replacement of the DR code, with considerably extended user friendliness. While enthusiastically supported by hobbyists and small firms, ZCPR alone was insufficient to slow the advent of MS DOS computers as the main body of personal and small business computing.


See also

References

  • Zaks, Rodnay (1980). The CP/M Handbook With MP/M. SYBEX Inc. ISBN 089588-048-2.