Does CP/M have a kernel? [message #8118] |
Tue, 01 December 2020 21:31  |
|
Operating systems usually contain a kernel, which is the primary program of the OS that handles system calls, process management (starting and stopping programs), and stuff like that. Even MS-DOS has a kernel, MSDOS.SYS.
CP/M, on the other hand, I am unsure of. Even when looking for "CP/M kernel" on the internet, and finding a website that hosted an archive of the CP/M source code, nothing stood out to me as being the "kernel". But something has to handle the system calls, and something has to restart CCP.COM once a program finishes. So, I don't really know what's going on with that. If anyone has an answer for this, please do tell!
|
|
|
Re: Does CP/M have a kernel? [message #8119 is a reply to message #8118] |
Wed, 02 December 2020 06:30   |
tingo
Messages: 115 Registered: February 2017 Location: Oslo, Norway
|
Senior Member |
|
|
From "An Introduction to CP/M Features and Facilities": "CP/M is a monitor control program for microcomputer system development ..." and "... CP/M provides a general environment for program construction, storage, and editing, along with assembly and check-out facilities.".
"CP/M is logically divided into several distinct parts:"
"BIOS Basic I/O system (hardware dependent)"
"BDOS Basic Disk Operating System"
"CCP Console Command Processor"
"TPA Transient Program Area"
So a bit different to the kernel / userland distinction that kids of today are used to.
Torfinn
|
|
|
|
Re: Does CP/M have a kernel? [message #8121 is a reply to message #8120] |
Wed, 02 December 2020 10:16   |
|
wsm wrote on Wed, 02 December 2020 07:13I think the issue you may be having is using terminology and a model from other operating systems and trying to apply them to CP/M.
CP/M evolved in the very early days of microcomputers as a single user system basically as a way for programs to be portable across multiple systems while doing console and file-based disk I/O via common calls. CP/M-2 was the most widely used and understanding it creates a foundation to understand CP/M-3 and MP/M. A lot has been written about it's internals but the basics are as follows in ascending memory order:
Location 0-0FFh - fixed functions / addresses and useage
TPA (Transient Program Area - memory for CCP-invoked .COM user programs from 100h-CCP
CCP (Console Command Processor) - Interpret console commands plus some resident commands - not used by transient programs and can be overlayed for additional memory space.
BDOS (Basic Disk Operating System) - Callable functions from CCP or user programs for console & disk I/O
BIOS (Basic I/O System) - Unique routines for each machine called by BDOS to perform lowest level I/O
As to the restarting of CCP: User (i.e. transient) programs normally finish in one of two ways:
1) If it has not overlayed the CCP then it can RETurn to CCP which invoked it.
2) A RST 0 or JP 0 which is an indirect jump to the BIOS warm start routine whose purpose is to reload the CCP (and often BDOS) then re-invoke the CCP.
Although I prefer not to use such analogies, "kernel" is most aptly the BDOS and the BIOS can be thought of as a collection of supporting I/O drivers. Note that since the BIOS is unique to each machine and implementation, there can be incompatibility when trying to use formatted media with data such as floppy disks on multiple systems.
CP/M-3 added banking to get around some of the memory limitations while MP/M added multi-user and multi-tasking support.
That actually answers all of my questions. Very useful information, thank you!
|
|
|
|
|
|