Posts

Showing posts from May 4, 2025

CP/M Internals

Image
The reason most people are still drawn to CP/M is because it is so easy to fully understand the system, up from the tiniest detail. Yet, CP/M is the direct predecessor of MS-DOS (which was modeled very closely after CP/M) and has full functionality for normal use. If you know CP/M, you understand the low-level basics of any PC, and it gives you a level of understanding of the hardware that you'd never gain with, for instance, Linux. In short, understanding CP/M is relatively easy, and it gives you an insight in today's computers that is hard to obtain in any other way. CP/M essentially provides programs with a set of function calls that allow them to communicate with the computer's I/O devices in a standardized manner. These system calls (the BDOS functions) ensure that user programs never have to bother with how the computer hardware stores a file or puts text on a screen - instead, the system calls can be relied upon to do the job. That concept is the basis for any operat...

CP/M Hardware

 A minimal 8-bit CP/M system would contain the following components:  A computer terminal using the ASCII character set An Intel 8080 (and later the 8085) or Zilog Z80 microprocessor The NEC V20 and V30 processors support an 8080-emulation mode that can run 8-bit CP/M on a PC-DOS/MS-DOS computer so equipped, though any PC clone could run CP/M-86. At least 16 kilobytes of RAM, beginning at address 0. The CPU could support up to 64 kilobytes. A means to bootstrap the first sector of the diskette.   At least one floppy-disk drive The only hardware system that CP/M, as sold by Digital Research, would support was the Intel 8080 Development System. Manufacturers of CP/M-compatible systems customized portions of the operating system for their own combination of installed memory, disk drives, and console devices.  CP/M would also run on systems based on the Zilog Z80 processor since the Z80 was compatible with 8080 code. While the Digital Research distributed core of CP...

CP/M Commands

 CP/M has two types of commands: built-in and transient.   If the CCP does not recognize the command as one of the built-in commands, it then searches the current disk for a file of the same name as the command and tries to load and execute it. In this way CP/M can be extended by any user developed program as a command. The built in commands are part of the CCP and are always available from the command prompt ERA - Erased one or more files from the disk DIR - Displays a directory of filenames on the disk REN - Renames a specified file SAVE - Saves blocks of memory contents to a file TYPE - Displays the contents of a file on the console USER - Changes the user number for disk access The transient commands are loaded into the TPA from disk and executed.   Here are some of the typical transient commands bundled with CP/M 2.2: STAT - Lists the number of bytes of storage remaining on the currently logged disk, provides statistical information about particular ...