whartung wrote:
A look at how the original Mac OS was structured is a solid foundation for an '816 based OS...
I have to disagree.
My position is using 1980s-era machines such as the ][gs and Mac as examples is not the best approach to designing a modern 65C816 machine and operation system. Those systems reflected the hardware capabilities of those times, and things have certainly advanced since then. The MC68000 running the first generation Mac, Atari ST and Amiga machines had no memory management whatsoever, and only careful and disciplined software design kept things running smoothly. That would have been true with any '816 system, including current designs. However, we now have the ability to conjure an MMU (more correctly, a hardware management unit or HMU) in programmable logic and give the '816 the help it would need in running a true, preemptive multitasking operating environment.
Also, I'm not sure that dividing RAM into 4KB pages as you describe in an '816 system is the most efficient approach. Memory is not nearly as costly per megabyte right now as it was 30 years ago, so allocating RAM in 64KB pieces, while wasteful in comparison to a 4KB paging system, is reasonable and does give a system enough head room for numerous processes. If one were to build a machine with 4MB of RAM, perhaps by using one of Garth's SIMMs, support for 63 simultaneously loaded processes would exist, assuming memory is allocated in 64KB "pages."
As some sort of data structure is necessary to keep track of memory allocation, the amount of allocation data that must be maintained will be inversely proportional to the size of the individual pages being allocated and freed. Succinctly, as page size decreases the page table size increases, as does the workload imposed on the kernel in managing memory. A question for the designer would be just how much performance is he or she willing to sacrifice in order to minimize inefficient memory utilization. Also, there are those two gorillas in the room that a 65C816 designer must consider as he designs his HMU: direct page, which is hard-wired to bank $00, and the stack, which is likewise hard-wired to bank $00. Unless steps are taken to somehow isolate one process' DP and stack from another, true memory protection will not be possible.
That said, there is no point in reiterating
what has already been discussed on this topic. Also, some discussion
here.