[Simh] Adding second copy of device to PDP-8

Peter Allan petermallan at gmail.com
Tue Dec 29 16:03:19 EST 2015


David,

I went through a similar exercise a couple of years ago when I wanted to
add an additional massbus controller to the VAX-11/780 code in simh for RM
and RP disk drives.

I convinced myself that the "right" approach was to adopt the approach
taken for the rq disk controller, which can handle multiple controllers in
a single set of source code functions. However, this looked like a lot of
work.

What I actually did was to copy the file pdp11_rp.c to pdp11_rpb.c and
rename the functions in pdp11_rpb.c to be rpb_xxxxx, rather than rp_xxxxx.
There are many global variables defined in this file that would cause name
clashes if not handled, but actually, none of them need to be global, so I
defined them as static in pdp11_rpb.c.
There were a few other changes, but mainly just adding a DEVICE rpb_dev to
go alongside the DEVICE rp_dev. I am not proud of the approach, but the
resulting system worked.

If you are interested, I can send you the detailed list of the changes that
I made as an example.

Cheers

Peter Allan

On 29 December 2015 at 20:03, Mark Pizzolato <Mark at infocomm.com> wrote:

> On Wednesday, December 23, 2015 at 5:17 PM, David Gesswein wrote:
> >    I was looking at adding a second TD controller to the PDP-8. It did
> > not appear that simh has an easy way of adding another copy of a device
> it
> > already knows about with a new device code etc.
> >
> > My guess is I would need to modify the existing driver to duplicate
> > DEVICE td_dev and all structures referred to by it. It also looks like
> the
> > code directly references some of file global data so all direct
> references
> > would need to be changed. Is this the general approach?
>
> HI David,
>
> Adding an additional device instance to the code which implements a
> simulated device after the fact can be messy.
>
> Depending on how the device is connected to (and addressed by) the CPU
> there are several different approaches to supporting multiple instances of
> the same device.  This is best considered when the initial simulator for
> that particular device type is implemented.
>
> Numerous examples exist in the current PDP11 codebase.  The pdp11_xq and
> pdp11_rq devices create separate DEVICE instances for each of the
> independent device controllers that are simulated.  These are handled this
> way since Qbus/Unibus devices are memory mapped and the DEC address
> conventions for device addresses have each controller with independent
> device addresses.  Meanwhile, the pdp11_td, pdp11_dz, pdp11_dl, pdp11_dc
> and pdp11_vh devices each support simulating multiple controllers while
> they only have a single simh DEVICE structure.  For these devices this is
> possible since the memory mapped buss addressing conventions say that
> multiple independent controllers will occupy adjacent memory addresses in
> the I/O page, therefore increasing the number of supported controllers
> merely expands the size of the I/O page address window for successive
> controllers.   Depending on the needs of the device in question different
> relationships between the DEVICE and its related UNIT structures are
> possible.  You may want to look closely at pdp11_td.c for some ideas since
> it is a cartridge tape simulator and supports from 1 to 16 controllers with
> up to 32 drives.
>
> - Mark
>
> _______________________________________________
> Simh mailing list
> Simh at trailing-edge.com
> http://mailman.trailing-edge.com/mailman/listinfo/simh
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.trailing-edge.com/pipermail/simh/attachments/20151229/44574391/attachment.html>


More information about the Simh mailing list