CMD file (CP/M)

Last updated

In CP/M-86, Concurrent CP/M-86, Personal CP/M-86, S5-DOS, DOS Plus, Concurrent DOS, FlexOS, Multiuser DOS, System Manager and REAL/32 as well as by SCP1700, [1] CP/K [1] and K8918-OS, [1] CMD is the filename extension used by CP/M-style executable programs. It corresponds to COM in CP/M-80 and EXE in DOS. The same extension is used by the command-line interpreter CMD.EXE in OS/2 and Windows for batch files.

Contents

Binary format

A CMD file has a 128-byte header, followed by 1–8 groups of code or data. [2] Each group can be up to 1 megabyte in size. In later versions of the format, CMD files can also contain relocation information and Resident System Extensions (RSXs). [2]

The start of the header lists the groups present in the file, and their types. Each type can be used at most once. They are:

  1. Code
  2. Data
  3. Extra
  4. Stack
  5. User 1
  6. User 2
  7. User 3
  8. User 4
  9. Shared Code (Code and Shared Code cannot be present in the same file). [3] [2]

The first 256 bytes of the data group must be zero. They will be populated by CP/M-86 with the zero page (comparable to the Program Segment Prefix in DOS). If there is no data group, then the first 256 bytes of the code group will be used instead. [3]

Name conflict

Under OS/2 and Windows NT, the .CMD file extension is associated with batch scripts for their command processor CMD.EXE. Since binary code will not be executed this way, attempting to run CP/M-86 CMD files under the CMD command processor will not work, but typically only cause mild inconvenience to users. The executable loader and relocator in CP/M-86 and related operating systems can test the first byte in the file, which happens to be the type byte of the first table entry in a CP/M CMD file, to have a value of 1 to 9 before accepting it as a valid CP/M CMD file. [2] ASCII values smaller than 10 are rarely or never used in batch scripts, so that this scheme gives reasonably good protection.

See also

Related Research Articles

Shell script Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by the Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

The Portable Executable (PE) format is a file format for executables, object code, DLLs and others used in 32-bit and 64-bit versions of Windows operating systems. The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code. This includes dynamic library references for linking, API export and import tables, resource management data and thread-local storage (TLS) data. On NT operating systems, the PE format is used for EXE, DLL, SYS, MUI and other file types. The Unified Extensible Firmware Interface (UEFI) specification states that PE is the standard executable format in EFI environments.

CP/M-86 Discontinued computer operating system for x86 processors

CP/M-86 was a version of the CP/M operating system that Digital Research (DR) made for the Intel 8086 and Intel 8088. The system commands are the same as in CP/M-80. Executable files used the relocatable .CMD file format. Digital Research also produced a multi-user multitasking operating system compatible with CP/M-86, MP/M-86, which later evolved into Concurrent CP/M-86. When an emulator was added to provide PC DOS compatibility, the system was renamed Concurrent DOS, which later became Multiuser DOS, of which REAL/32 is the latest incarnation. The FlexOS, DOS Plus, and DR DOS families of operating systems started as derivations of Concurrent DOS as well.

An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP environment variable to discover a suitable location to store temporary files, or the HOME or USERPROFILE variable to find the directory structure owned by the user running the process.

.exe is a common filename extension denoting an executable file for Microsoft Windows.

A fat binary is a computer executable program or library which has been expanded with code native to multiple instruction sets which can consequently be run on multiple processor types. This results in a file larger than a normal one-architecture binary file, thus the name.

COM file

A COM file is a type of simple executable file. On the Digital Equipment Corporation (DEC) VAX operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system. With the introduction of Digital Research's CP/M, the type of files commonly associated with COM extension changed to that of executable files. This convention was later carried over to DOS. Even when complemented by the more general EXE file format for executables, the compact COM files remained viable and frequently used under DOS.

cmd.exe Command prompt program

cmd.exe is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows, and ReactOS operating systems. The name refers to its executable filename. It is also commonly referred to as cmd or the Command Prompt, referring to the default window title on Windows. The implementations differ on the various systems but the behavior and basic set of commands is generally consistent. cmd.exe is the counterpart of COMMAND.COM in DOS and Windows 9x systems, and analogous to the Unix shells used on Unix-like systems. The initial version of cmd.exe for Windows NT was developed by Therese Stowell. Windows CE 2.11 was the first embedded Windows release to support a console and a Windows CE version of cmd.exe. On Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0 it is also referred to as Command Processor Shell. The ReactOS implementation of cmd.exe is derived from FreeCOM, the FreeDOS command line interpreter.

Relocation is the process of assigning load addresses for position-dependent code and data of a program and adjusting the code and data to reflect the assigned addresses. Prior to the advent of multiprocess systems, and still in many embedded systems, the addresses for objects were absolute starting at a known location, often zero. Since multiprocessing systems dynamically link and switch between programs it became necessary to be able to relocate objects using position-independent code. A linker usually performs relocation in conjunction with symbol resolution, the process of searching files and libraries to replace symbolic references or names of libraries with actual usable addresses in memory before running a program.

DOS Plus Discontinued computer operating system for x86 processors

DOS Plus was the first operating system developed by Digital Research's OEM Support Group in Newbury, Berkshire, UK, first released in 1985. DOS Plus 1.0 was based on CP/M-86 Plus combined with the PCMODE emulator from Concurrent PC DOS 4.11. While CP/M-86 Plus and Concurrent DOS 4.1 still had been developed in the United States, Concurrent PC DOS 4.11 was an internationalized and bug-fixed version brought forward by Digital Research UK. Later DOS Plus 2.x issues were based on Concurrent PC DOS 5.0 instead. In the broader picture, DOS Plus can be seen as an intermediate step between Concurrent CP/M-86 and DR DOS.

In computing, SUBST is a command on the DOS, IBM OS/2, Microsoft Windows and ReactOS operating systems used for substituting paths on physical and logical drives as virtual drives.

In computer data, a substitute character (␚) is a control character that is used to pad transmitted data in order to send it in blocks of fixed size, or to stand in place of a character that is recognized to be invalid, erroneous or unrepresentable on a given device. It is also used as an escape sequence in some programming languages.

Self-extracting archive

A self-extracting archive is a computer executable program which contains compressed data in an archive file combined with machine-executable program instructions to extract this information on a compatible operating system and without the necessity for a suitable extractor to be already installed on the target computer. The executable part of the file is known as a decompressor stub.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file may not process a batch of multiple data.

A file format is a standard way that information is encoded for storage in a computer file. It specifies how bits are used to encode information in a digital storage medium. File formats may be either proprietary or free and may be either unpublished or open.

MS-DOS Microsofts discontinued operating system

MS-DOS is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and few operating systems attempting to be compatible with MS-DOS, are sometimes referred to as "DOS". MS-DOS was the main operating system for IBM PC compatible personal computers during the 1980s, from which point it was gradually superseded by operating systems offering a graphical user interface (GUI), in various generations of the graphical Microsoft Windows operating system.

DOS Group of closely related PC-compatible operating systems

DOS is a platform-independent acronym for disk operating system which later became a common shorthand for disk-based operating systems on IBM PC compatibles. DOS primarily consists of Microsoft's MS-DOS and a rebranded version under the name IBM PC DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

Command-line interface Type of computer interface based on entering text commands and viewing text output

A command-line interface (CLI) processes commands to a computer program in the form of lines of text. The program which handles the interface is called a command-line interpreter or command-line processor. Operating systems implement a command-line interface in a shell for interactive access to operating system functions or services. Such access was primarily provided to users by computer terminals starting in the mid-1960s, and continued to be used throughout the 1970s and 1980s on VAX/VMS, Unix systems and personal computer systems including DOS, CP/M and Apple DOS.

CMD file may refer to:

References

  1. 1 2 3 Kurth, Rüdiger; Groß, Martin; Hunger, Henry (2019-01-03). "Betriebssystem SCP". www.robotrontechnik.de (in German). Archived from the original on 2019-04-27. Retrieved 2019-04-27.
  2. 1 2 3 4 Elliott, John C. "CP/M-86 executables (.CMD)". Seasip.info. Archived from the original on 2016-11-14. Retrieved 2016-08-29.
  3. 1 2 "3.4 Command (CMD) File Format". CP/M-86 Operating System - System Guide (PDF) (2nd printing, 1st ed.). Pacific Grove, California, USA: Digital Research. June 1981. pp. 20–21. Archived (PDF) from the original on 2020-02-28. Retrieved 2020-02-28. (17 pages)