RetroBrew Computers Forum
Discussion forum for the RetroBrew Computers community.

Home » RBC Forums » General Discussion » Does CP/M have a kernel?
icon5.gif  Does CP/M have a kernel? [message #8118] Tue, 01 December 2020 21:31 Go to next message
ashtons is currently offline  ashtons
Messages: 8
Registered: May 2020
Location: Louisiana
Junior Member

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 Go to previous messageGo to next message
tingo is currently offline  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 #8120 is a reply to message #8119] Wed, 02 December 2020 07:13 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
I 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.
icon14.gif  Re: Does CP/M have a kernel? [message #8121 is a reply to message #8120] Wed, 02 December 2020 10:16 Go to previous messageGo to next message
ashtons is currently offline  ashtons
Messages: 8
Registered: May 2020
Location: Louisiana
Junior Member

wsm wrote on Wed, 02 December 2020 07:13
I 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!
Re: Does CP/M have a kernel? [message #8122 is a reply to message #8121] Wed, 02 December 2020 11:02 Go to previous messageGo to next message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
You're welcome ... learning these kinds of things is an endless cycle that needs basic starting points and some of us learned about CP/M back in the 70's before the proliferation of operating systems and terminology. Hmmmm ... acronyms like MFT, MVT, VS1, SVS, HASP, OS/8 and RSX also spring to mind from the cobwebs of that era.
Re: Does CP/M have a kernel? [message #8123 is a reply to message #8122] Thu, 03 December 2020 13:22 Go to previous messageGo to next message
norwestrzh is currently offline  norwestrzh
Messages: 196
Registered: November 2015
Senior Member
>> Hmmmm ... acronyms like MFT, MVT, VS1, SVS, HASP, OS/8 and RSX also spring to mind from the cobwebs of that era.

And, Bill ..... don't forget PCMCIA!! (people can't memorize computer industry acronyms). <smirk>

Roger
Re: Does CP/M have a kernel? [message #8124 is a reply to message #8123] Thu, 03 December 2020 14:55 Go to previous message
wsm is currently offline  wsm
Messages: 232
Registered: February 2017
Location: AB, Canada
Senior Member
PCMCIA is twenty years newer than those OS's Smile Brings back memories of physical paper tape and punched cards plus the din of ASR's and 029's ... more acronyms. Luckily I never had to do the 2000 card pickup but I did watch others endure the pain of re-sorting Sad

As a sidenote: I actually interfaced a genuine IBM 33FD (the very first floppy with write capabilty) to my S100 system in the mid 70's ... slow and noisy but amazing at the time to upgrade from toggle switches to R/W removable storage and CP/M.
Previous Topic: RomWBW and CP/M anomaly
Next Topic: ZZ80RC, a hobbyist-friendly, CP/M-ready Z80 SBC in 50x100mm format


Current Time: Tue Sep 30 11:53:00 PDT 2025

Total time taken to generate the page: 0.31298 seconds