Quantcast
Viewing latest article 1
Browse Latest Browse All 4

Answer by Will Hartung for Why did CP/M require RAM in the bottom part of the address space?

In contrast to many other CPUs, a feature of the 8080 is the separate address space for I/O devices. Other CPUs (like the 6502) used memory mapped I/O.

As a result of this architecture, the entirety of the 64K address space is available to the CPU as normal memory.

Since CP/M is designed at the outset as a disk based system, there's no heritage of having any real requirement for anything in ROM. It could all be loaded from disk. If you wanted to, you could bootstrap a CP/M system on an IMSAI or Altair with nothing but RAM and the front panel. (Not suggesting anyone did, just that's it's possible.)

So, given now that you can have a system with access to the entire memory map, it behooves a designer to put the minimal amount of requirements on the underlying system up front, and then work within those minimal constraints.

Essentially, at a logical level, the system requirements for a CP/M system are a computer with RAM available from 0x0000-0x00FF, as this area is reserved by the OS, and then memory at 0x0100-0xXXXX.

The programs view of the OS is solely through the two entry points (JP 0000 and JP 0005), and the published memory map of the first page of RAM.

That's a pretty minimal surface requirement. The CP/M system "requires" very little. You could have a CP/M system with 2 pages of RAM (1 for CP/M, 1 for your application) and BIOS/BDOS, even the application, in ROM. You could have a CP/M system where the OS consumes 0 RAM (via crazy hardware architecture shenanigans banking in the BIOS whenever it sees "JP 5").

The point isn't whether these designs are practical, or that they were even considered, rather simply that they're possible.

In the end, CP/M is a system that requires 1 page of RAM, offers it's list of services (i.e. disk file access etc via JP 5), and mandates that your application starts at 0x0100. That's it. The sky is that-a-way -->.

In practice, this minimal baseline turned out to be quite flexible. Most systems are 64K RAM machines, banking out a ROM boot loader, with BIOS/BDOS at high memory. That's because of how it was implemented and shipped from DR. Simple, useable, and practical.

In the end, it enabled general purpose systems with different amounts of RAM (including large amounts), different architectures, memory bank schemes, even the rise of MP/M which could run off the shelf CP/M binaries. As long as it LOOKS like CP/M to the binary, it IS CP/M.

So, having programs load at 0x0100 simply gives them the biggest opportunity to have as much access to the system resources as possible.


Viewing latest article 1
Browse Latest Browse All 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>