The point of ROM vs RAM at $0000 has been gone over a
few times. Do
"standard" CP/M machines use a shadow-ROM technique, or what, to
cold-start? We used to use a trick with the 68000 that would map ROM
at $000000, _and_ at some higher address, with the first few
instructions jumping to the higher ROM image, , and either an I/O pin
that toggled the address mapping for the lower ROM image, or just
watching for the first pulse from A23, such that the act of jumping up
to the higher ROM address itself would remove ROM from the bottom of
the memory map, revealing RAM.
There are many ways to accomplish getting RAM at 0, even though the CPU
has to boot from there.
Some systems force a JMP instruction onto the BUS during the first three
fetches, which transfers control to a ROM at a higher location.
An easy technique is to have the boot ROM appear in two places (0 and
somewhere else), and remove the select at 0 (replacing it with RAM)
after the first three fetches - the first instruction in the boot ROM
has to be a JMP to the actual boot ROM address (+3, otherwise you would
infinite loop on the startup JMP). One simple way to do this is to use
the select for the higher location to disable the zero one (which will
occur immediately after you JMP there).
The problem with either of those is that the ROM remains in the memory
map and takes up valuable RAM space.
I prefer to have the ROM copy itself to RAM, jump there, and then disable
the physical ROM via an I/O event - that way you are running from RAM, and
once booted, have a full 64k available to the OS (which must not reference
the boot ROM for I/O obviously).
How did CP/M systems handle 64K of RAM? Was there one
primary way it
was done, or did every hardware vendor do it differently? I should
probably just confine my efforts to 48K of RAM and use the upper 16K
for a boot ROM, but if it's easy to support 64K of RAM, why not?
CP/M covers a wide array of hardware - lots of different memory configurations,
although typically you must have ram at 0000 and it must extend contiguously
upward from there - the more the better. Many system has "holes" for memory
mapped I/O, video, disk (N* controller comes to mind). In general, as much as
you can arrange in a contiguous block from 0000 up is best.
To confirm, the minimal I/O system is some flavor of
serial interface
for console I/O (presumably piped to a display smart enough to handle
ANSI codes), and some form of block-addressable storage with a CP/M
filesystem, right? (I'm ignoring handy I/O like parallel printer
ports and 8255-type GPIO and the like, for the moment) Is it required
that the storage unit be writable? Is there a minimum size for the
display? That wouldn't matter for hanging a VT100-equivalent off of
the console port, but if I were to use some flavor of textual LCD, it
would very much matter. To find another way to ask, would the body of
extant CP/M apps freak out if you try to run them on a display that's
under 40 chars wide or under 24 chars tall? Do they expect 64 chars
wide or 80 chars wide? I don't think the OS itself actually cares how
wide or tall the display is, but perhaps some of the CUSPs, like DIR,
might.
CP/M itself is just a TTY interface - so it will run on just about any
format display - applications however are a different story, and as there
was no standard, there is no complete answer to your question. 80x24 as
probably as close to "standard" as you will get, and would give you the
maximum compatibility. You will also want a decent set of control codes
(cursor position, clear screen, clear to end of screen/line etc.). A TTY
that emulates some well known terminal from the era may make things
easier as many apps had prevonfigured setups for common TTYs.
Rather than taking a bare Z80, wiring on a Z8530, an
SRAM or two and
an EPROM, I was contemplating beefing up my 1976 SDS Z-80 Starter Kit
to the point where it could run CP/M. I've written about it here
before, when I first got it, to remind those that don't know or don't
remember what it is, it has a ~2MHz Z80, 1K of 21L02 SRAM, room for
one more K, one 2716 with "ZBUG", two empty 2716 sockets (one attached
to an EPROM programming circuit), a keypad and 7-segment LEDs, a
largish wire-wrap area, and two S-100 slots. Presuming I wire the
SRAM, a larger-capacity EPROM, and some serial device into the
wire-wrap area, is there anything I should look for in an S-100 card
that would be interesting to install? A video card (rather than a
serial console), perhaps? I think I have one or two S-100 video
cards, but I was never clear on how one attaches a keyboard to that
rig - is there an ASCII keyboard port typically provided on an S-100
video card, or is that a separate peripheral?
A video card will chew up valuable RAM, and many of them are only 16x64,
but it does let you do real-time screen updates, games etc.
Some video cards had a parallel keyboard port, many didn't - Usually it
was just an 8-bit parallel port with 7 data bits for the ASCII keycode,
and the 8th bit used for a key down/up indicator. You could also have a
serially interfaced keyboard.
The important thing to understand is that CP/M doesn't specify a display
or keyboard - pretty much any interface you might decide on can be made
to work under CP/M (within reason of course).
Dave
--
dave06a (at) Dave Dunfield
dunfield (dot) Firmware development services & tools:
www.dunfield.com
com Collector of vintage computing equipment:
http://www.classiccmp.org/dunfield/index.html