Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
CP/M
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Components == While running, the CP/M operating system loaded into memory has three components:<ref name="CPM.NYT83"/><ref name="CPM-system-manual" />{{rp|page=2}}<ref name="CPM-86-system-guide" />{{rp|page=1}}<ref name="CPM-68k-system-guide" />{{rp|pages=3,4-5}}<ref name="CPM-8000-system-guide" />{{rp|pages=1{{hyp}}4-1{{hyp}}6}} * ''Basic Input/Output System'' (BIOS), * ''Basic Disk Operating System'' (BDOS), * ''Console Command Processor'' (CCP). The BIOS and BDOS are memory-resident, while the CCP is memory-resident unless overwritten by an application, in which case it is automatically reloaded after the application finished running. A number of transient commands for standard utilities are also provided. The transient commands reside in [[Computer file|file]]s with the [[filename extension|extension]] .COM on disk. The BIOS directly controls hardware components other than the CPU and main memory. It contains functions such as character input and output and the reading and writing of disk sectors. The BDOS implements the CP/M [[file system]] and some input/output abstractions (such as redirection) on top of the BIOS. The CCP takes user commands and either executes them directly (internal commands such as DIR to show a directory or ERA to delete a file) or loads and starts an executable file of the given name (transient commands such as PIP.COM to copy files or STAT.COM to show various file and system information). Third-party applications for CP/M are also essentially transient commands. The BDOS, CCP and standard transient commands are the same in all installations of a particular revision of CP/M, but the BIOS portion is always adapted to the particular hardware. Adding memory to a computer, for example, means that the CP/M system must be reinstalled to allow transient programs to use the additional memory space. A utility program (MOVCPM) is provided with system distribution that allows relocating the object code to different memory areas. The utility program adjusts the addresses in absolute jump and subroutine call instructions to new addresses required by the new location of the operating system in processor memory. This newly patched version can then be saved on a new disk, allowing application programs to access the additional memory made available by moving the system components. Once installed, the operating system (BIOS, BDOS and CCP) is stored in reserved areas at the beginning of any disk which can be used to boot the system. On start-up, the bootloader (usually contained in a ROM firmware chip) loads the operating system from the disk in drive <code>A:</code>. By modern standards CP/M is primitive, owing to the extreme constraints on program size. With version 1.0 there is no provision for detecting a changed disk. If a user changes disks without manually rereading the disk directory the system writes on the new disk using the old disk's directory information, ruining the data stored on the disk. From version 1.1 or 1.2 onwards, changing a disk then trying to write to it before its directory is read will cause a fatal error to be signalled. This avoids overwriting the disk but requires a reboot and loss of the data to be stored on disk. The majority of the complexity in CP/M is isolated in the BDOS, and to a lesser extent, the CCP and transient commands. This meant that by porting the limited number of simple routines 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 (a [[hardware abstraction layer]]), 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. === Console Command Processor === [[File:Commodore C128 CPM Screenshot 2 full.jpg|thumb|Screenshot showing a CP/M 3.0 directory listing using the <code>[[dir (command)|DIR]]</code> command on a Commodore 128 home computer]] The Console Command Processor, or CCP, accepts input from the keyboard and conveys results to the terminal. CP/M itself works with either a printing terminal or a video terminal. All CP/M commands have to be typed in on the [[command line]]. The console most often displays the <code>A></code> prompt, to indicate the current default disk drive. When used with a video terminal, this is usually followed by a blinking [[Cursor (user interface)|cursor]] supplied by the terminal. The CCP awaits input from the user. A CCP internal command, of the form drive letter followed by a colon, can be used to select the default drive. For example, typing <code>B:</code> and pressing enter at the command prompt changes the default drive to B, and the command prompt then becomes <code>B></code> to indicate this change. CP/M's command-line interface was patterned after the [[Concise Command Language]] used in operating systems from [[Digital Equipment Corporation|Digital Equipment]], such as [[RT-11]] for the [[PDP-11]] and [[OS/8]] for the [[PDP-8]].{{citation needed|date=May 2021}} Commands take the form of a keyword followed by a list of parameters separated by spaces or special characters. Similar to a Unix [[shell builtin]], if an internal command is recognized, it is carried out by the CCP itself. Otherwise it attempts to find an executable file on the currently logged disk drive and (in later versions) user area, loads it, and passes it any additional parameters from the command line. These are referred to as "transient" programs. On completion, BDOS will reload the CCP if it has been overwritten by application programs β this allows transient programs a larger memory space. The commands themselves can sometimes be obscure. For instance, the [[Command (computing)|command]] to duplicate files is named <code>[[Peripheral Interchange Program|PIP]]</code> (Peripheral-Interchange-Program), the name of the old DEC utility used for that purpose. The format of parameters given to a program was not standardized, so that there is no single option character that differentiated options from file names. Different programs can and do use different characters. The CP/M Console Command Processor includes [[dir (command)|DIR]], [[ERA (CP/M command)|ERA]], [[ren (command)|REN]], [[SAVE (CP/M command)|SAVE]], [[TYPE (CP/M command)|TYPE]], and [[USER (CP/M command)|USER]] as [[Shell builtin|built-in]] commands.<ref name="CPM22"/> Transient commands in CP/M include [[Assembler (computing)|ASM]], [[DDT (CP/M command)|DDT]], [[DUMP (CP/M command)|DUMP]], [[ED (CP/M command)|ED]], [[LOAD (CP/M command)|LOAD]], {{ill|MOVCPM|pl|MOVCPM (CP/M)}}, [[Peripheral Interchange Program|PIP]], [[STAT (CP/M command)|STAT]], [[SUBMIT (CP/M command)|SUBMIT]], and [[SYSGEN (CP/M command)|SYSGEN]].<ref name="CPM22"/> CP/M Plus (CP/M Version 3) includes DIR (display list of files from a directory except those marked with the SYS attribute), [[DIRSYS (CP/M command)|DIRSYS]] / [[DIRS (CP/M command)|DIRS]] (list files marked with the SYS attribute in the directory), [[ERASE (CP/M command)|ERASE]] / ERA (delete a file), [[RENAME (CP/M command)|RENAME]] / REN (rename a file), TYPE / [[TYP (CP/M command)|TYP]] (display contents of an ASCII character file), and USER / [[USE (CP/M command)|USE]] (change user number) as built-in commands:<ref name="CPM3_1983_PG"/> CP/M 3 allows the user to abbreviate the built-in commands.<ref name="DRI_1983_CPM3"/> Transient commands in CP/M 3 include [[SYSGEN (CP/M command)|COPYSYS]], [[DATE (CP/M command)|DATE]], [[DEVICE (CP/M command)|DEVICE]], [[DUMP (CP/M command)|DUMP]], [[ED (CP/M command)|ED]], [[GET (CP/M command)|GET]], [[help (command)|HELP]], [[HEXCOM (CP/M command)|HEXCOM]], [[INITDIR (CP/M command)|INITDIR]], [[LINK (CP/M command)|LINK]], [[MAC (CP/M command)|MAC]], PIP, [[PUT (CP/M command)|PUT]], [[RMAC (CP/M command)|RMAC]], [[SET (CP/M command)|SET]], [[SETDEF (CP/M command)|SETDEF]], [[SHOW (CP/M command)|SHOW]], [[SID (CP/M command)|SID]], [[SUBMIT (CP/M command)|SUBMIT]], and [[XREF (CP/M command)|XREF]].<ref name="DRI_1983_CPM3"/> === Basic Disk Operating System === The Basic Disk Operating System,<ref name="Kildall_1975_BDOS"/><ref name="Kildall_1980_CPM"/> or BDOS,<ref name="Kildall_1975_BDOS"/><ref name="Kildall_1980_CPM"/> provides access to such operations as opening a file, output to the console, or printing. Application programs load processor registers with a function code for the operation, and addresses for parameters or [[memory buffer]]s, and call a fixed address in memory. Since the address is the same independent of the amount of memory in the system, application programs run the same way for any type or configuration of hardware. === Basic Input Output System === [[File:CPβM Ad, Dec 11, 1978.png|thumb|CP/M advertisement in the 11 December 1978 issue of ''[[InfoWorld]]'' magazine]] The Basic Input Output System or BIOS,<ref name="Kildall_1975_BDOS"/><ref name="Kildall_1980_CPM"/> provides the lowest level functions required by the operating system. These include reading or writing single characters to the system console and reading or writing a sector of data from the disk. The BDOS handles some of the buffering of data from the diskette, but before CP/M 3.0 it assumes a disk sector size fixed at 128 bytes, as used on [[single-density]] 8-inch floppy disks. Since most 5.25-inch disk formats use larger sectors, the blocking and deblocking and the management of a disk buffer area is handled by model-specific code in the BIOS. Customization is required because hardware choices are not constrained by compatibility with any one popular standard. For example, some manufacturers designed built-in integrated video display systems, while others relied on separate computer terminals. Serial ports for printers and modems can use different types of [[UART]] chips, and port addresses are not fixed. Some machines use memory-mapped I/O instead of the 8080 I/O address space. All of these variations in the hardware are concealed from other modules of the system by use of the BIOS, which uses standard entry points for the services required to run CP/M such as character I/O or accessing a disk block. Since support for serial communication to a modem is very rudimentary in the BIOS or may be absent altogether, it is common practice for CP/M programs that use modems to have a user-installed overlay containing all the code required to access a particular machine's serial port.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)