Please use the "Index" for better experience.

Saturday, October 01, 2011

Anatomy of CP/M

                        The major reason for creating CP/M was to provide users, software developers (hobbyists), and software and hardware manufacturers one  single, standard interface, as there was no standard interface at that time. To achieve this target of making CP/M a standard, CP/M was built in three different parts: BIOS, BDOS, and CCP.
                        The BIOS (Basic I/O System), is a concept pioneered by Gary Kildall, which we still use in personal computers. This BIOS in CP/M, is similar to a monitor,but with standard specified functions and interfaces. The BIOS is a set of programs, usually stored in a ROM chip which placed on the motherboard. The BIOS directly controls hardware components other than microprocessor, and memory. Each manufacturer of computer kits, who wanted to use CP/M on their computers, was supposed to adapt this BIOS. (Later, all of the manufacturers, almost all of them, adapted this concept of BIOS.) The interface to BIOS, however, is the same, no matter how the underlying devices might work.
                        Gary called the core of the CP/M operating system as the BDOS, for Basic Disk Operating System. It is what we call the kernel today. It is independent of the hardware, and performs more primitive services. That means BDOS is same for all the hardware systems (with no changes), that CP/M is to run on. (In this time, DOS / monitors had to be written differently for each kind of hardware.)  Handling different types of hardware is task of the BIOS. The BDOS implements the CP/M filesystem, and some input/output abstraction*1 on top of the BIOS.
                        After BIOS, and BDOS; third and last component of the CP/M is the user interface: CCP – Console Command Processor. It is a text based user interface. Each of these components have size around 2000 to 4000 bytes. The BIOS, and BDOS are memory resident, that is they are always present in the memory. And, in the case of CCP, it is memory resident unless the memory is required for any other program. In such case, CCP would be over-written by the program (which requires the memory), and after the program finishes the execution, the CCP would be automatically reloaded in the memory. (More on this in “Memory Management”.)

                   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 (BIOS, BDOS and CCP) was stored in reserved areas at the beginning of any disk which would be used to boot the system. On start-up, the bootloader (usually contained in a ROM firmware chip) would load the operating system from the disk in drive A:
The major complexity of CP/M was reduced in the BDOS, and to a lesser extent, in 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.



*1=A standardised interface that provides general system functions but hides all the messy hardware details is called as abstraction.

No comments:

Post a Comment