<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sat, 25 Aug 1990 00:35:26 GMT
From   : mcsun!hp4nl!phigate!philica!geertj@uunet.uu.net (Geert Jan de Groot)
Subject: Z80 multitask

In article <2108@wn1.sci.kun.nl> lwj@cs.kun.nl (Luc Rooijakkers) writes:
>jurjen@cwi.nl (Jurjen NE Bos) writes:
>>clldomps@praxis.cs.ruu.nl (Louis van Dompselaar) writes:
>>>Is there anyone who has had some experience in using multitasking
>>>on a Z80 system? Please let me know what is, and what is not, possible...
>>Easy!  We (4 friends and me) built a multi-user Z80 systems already years
>>ago, featuring 512K RAM, two real floppy drives while the users thought
>>they had 4 floppies each (but if you wanted to read something, you had to
>>walk over and insert your floppy), 5 terminals, etc.
>>The system is still running, and today they are working on a LAN, hard disk,
>We did add a little bank switching logic external to the Z80, but that
>was not really difficult. It basically consists of a 16 byte memory
>that translates address lines A12 to A15 from the Z80 to address lines
>A12 to A18 on the bus (the 8th bit is used for write protect). For
>hardware freaks, these were just two 7485 chips and a few buffers.

A small correction (I am the 'hardware' member of this group, hi Jurjen,
Luc): I have had some requests earlier about how to do this, but
(yes, I'm ashamed!) lost the Email address:
We used 7489's instead of 7485's. 7489's are small, 16x4 bit wide RAMS, but
very fast (1984 standards, youth scientist's budget, i.e. remove from
scrap PCBs from a large electronics firm in Eindhoven).
A15-A12 of the Z80 are connected to the address lines of these RAMs, giving
4Kbyte pages. The  data-out lines of these RAMS (we have 2 of them, so 8
bit) are the address lines that go to the rest of the system.
One line is reserved for write-protection, giving a 512 Kbyte addres space.
In this address space, there is some memory-mapped I/O (a number of
video displays), but there is plenty of room left for users.

How does one control the RAMs for address remapping? This doesn't seem easy,
but it worked out for us: fortunately, thos RAM devices have separate data-in
lines. Those data-in lines are connected to the databus.
If one uses the 'OUT (B),A' instruction, the CPU really executes
'OUT (BC),A', thus the contents of register C are on A8-15 of the CPU,
and you can put the address of the RAM location on b4-7 of register C.
Register B contains the I/O address of the RAM chip as usual, and A
contains the new contents.
Nice and simple. We even didn't need to use an undocumented feature of the
Z80; all of this is documented and guaranteed.

A Nice Thing about running a multi-user system like this is that there is
always a layer 'above' your own program. If your program crashes, under
the condition it didn't scribble in the I/O devices (a big no-no for
multiuser of course), a special key combination is enough to 'reboot'
your virtual CP/M machine; no need to re-load the operating system.

The only problem is that all CP/M utilities don't know about the environment
they're in and don't know they can fork() and things like that. We wrote
all client-slave software ourselves, because IPC isn't defined in CP/M.
But, all of the CP/M software we know of works fine on one of the virual
machines of our multiuser system, and we don't have much non-standard
software (only for demonstration purposes).

Still a pleasure to work with! And because of the scrap material, it costed
only Hfl 1000,- (can't get disk drives from scratch). Physically, it is
a 19" rack more than 1.5 meter high, crammed with racks full of PCB's.
It takes at least 2 men to lift it. A real monster, but nice!

Why didn't we use MP/M? It was not available (as in: we didn't have a copy),
and the young scientists' budget didn't allow us to buy it.
We got CP/M via a machine which doesn't exist anymore (I think), 
and our only chance was to re-use the software that came with that machine..
Remember, this was the time that Exidy Sourcerers were Hot Machines, 
and we built the thing because the only Exidy we had was always busy.
It serves its purpose well.

Geert Jan


Geert Jan de Groot,            Email: geertj@ica.philips.nl
Philips ICA,                          ..!hp4nl!philica!geertj
Weisshausstrasse,              Ham: PE1HZG 
5100 Aachen, West-Germany

phone: +49 241 6003 714                 "Programs are like waffles:
fax:   +49 241 6003 709                 you should always throw the first one out"
[Standard disclaimers apply]    - Sutherland

End of INFO-CPM Digest V90 Issue #134
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>