Subject: Emulator design

From: [email-masked] (Greg Ewing)
Date: Tue, 30 Nov 1993 02:58:52 GMT

I've been thinking about the architecture of my
emulator-to-be-perhaps-maybe. I'd like to share some of
my thoughts and see if any other emulator writers have
any comment to make.

My current idea is to run the emulator itself and each
of the I/O devices as a separate process. The devices
and CPU communicate through sockets by means of
UDP datagrams.

A suitable protocol would be devised to carry the information
which passes over the I/O bus. From CPU to device, this would
include the IOT instruction bits and the AC contents.
The device would be able to supply data to load into the AC
or cause a skip, and also have the means to request an
interrupt or transfer chunks of data in or out of the
memory.

An optimisation will probably be necessary to keep device
flags local to the CPU, so that interprocess communication
isn't needed on every skip-on-flag instruction. 

Advantages I can see in the multiple-process architecture:

- It makes the system very modular

- Multi-threading seems to be a natural way to emulate
	pieces of hardware that operate in parallel

- Devices can be plugged into/out of a running system
	(or was this not a recommended practice?)

- Debugging a device is simplified: just attach a debugger
	to the device process

- A crashed device won't bring down the system

What do you think about this idea? If it turns out to be
practical, perhaps the protocol could be developed into
a net.standard so we could swap device emulators!

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of Japan Inc.|
[email-masked]	   +--------------------------------------+