Joe, I'm going to rewrite the memory management specification to explain that 'switching' a page into the address page is an instantaneous procedure. There is no need to copy external memory to internal memory - the MMU switches in an external memory/rom page, and work on it with no additional latency.
Why are you giving the CPU internal RAM when it could just as easily map external RAM directly?
I'm giving the CPU 16kw of internal memory so the processor has something to work with (a) before polling the bus, or (b) should there be no extra memory on the bus. So it's not a cache, per se - just a minimal amount of 'starter memory'.
Why are there separate "RAM" and "ROM" address spaces?
There's not separate address space for memory and rom and devices and so on - the only address space is the $10000 words that are currently loaded. The 'T' bits in the MMU allow the processor to switch pages of the 'rom' (like a BIOS) into a page of active address space, but doing so would switch out whatever else was in that space.
Why does the "hardware device" page mechanism allocate a space the same size as the maximum amount of RAM to every hardware device?
The maximum number of pages a device can have is 2^16 - but it could have less. For example, a hypothetical PPU device might have only 16kw of memory, and when selecting a page from that device, it would ignore all but the lower two bits of the page index selection word (I suppose the device itself would have to decide what - if any - page to expose to the MMU based on the page select index).
A clever system designer will probably use that function of the MMU to allow more than your limit of 2^16 pages of RAM by placing a few "devices" that are just more RAM. Is that the intended use?
Absolutely - and the OS writer would have to poll the system at start-up to determine what memory is available to use, and where it is on the hardware bus.
I'm adamant about keeping the $10000 address space. The MMU exists to extend this so that multiple processes can run, each with their own active memory - and if the OS supports it, each process can access even more memory by requesting that the OS switch in additional pages.
Code: Select all
=========================[ 1.F. Memory Management ]=============================
(Possible edit to Version 0.1e)
As the processor has a 16-bit address bus, it can only address $10000 words of
memory at a time. When the 'Memory Paging' status bit is clear, this address
space is filled with the processor's internal $10000 kw of memory.
When the 'Memory Paging' status bit is set, the processor's integrated memory
management unit (MMU) is activated. The MMU divides the processor's address
space into 16 pages of 4 kilowords each, and allows each individual page to be
moved in memory, or switched with a page of address space from a hardware
device.
There is no additional latency incurred by accessing address space mapped to a
page of memory in an external device unless the external device is intrinsically
slower than the internal memory (an inexpensive but slow memory device might
incur some additional latency, for example).
Each of the currently loaded 16 x 4 kiloword pages in address space are
described by 2 words:
WORD 0 (flags)
FEDC BA98 7654 3210
SWE. TT.. hhhh hhhh
S - Supervisor only, 1: User mode accesses to this page cause a page fault.
W - Write protect, 1: writing to this page cause a page fault.
E - Execute protect, 1: executing on this page cause a page fault.
T - Page type:
00: Use processor internal memory page with index = (word 1 & 0x000F)
01: Use blank page, reads/executes are 0x0000, writes fail silently.
10: Use hardware page, device = h, page index = (word 1)
11: Use processor ROM, page index = (word 1)
WORD 1 (index)
FEDC BA98 7654 3210
iiii iiii iiii iiii
i - Index of device page mapped to this address page.