Discussion:
[Simh] Custom ROMs on PDP-11 sim
Aaron Jackson
2017-12-15 15:18:18 UTC
Permalink
Hi all,

Sorry if this has been asked before.

I am wondering if it is possible to use attach ROM dumps in the PDP-11
simh? I haven't found anything about it in the documentation. If not, I
suppose it wouldn't be too hard to modify the bootrom header.

Thanks,
Aaron.

--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
Mark Pizzolato
2017-12-15 17:09:55 UTC
Permalink
Hi Aaron,
I am wondering if it is possible to use attach ROM dumps in the PDP-11 simh?
I haven't found anything about it in the documentation. If not, I suppose it
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models) doesn't
actually use any ROMs and doesn't currently support simulation of any cards
which user supplied ROMS might have been installed in.

What problem are you trying to solve???

- Mark
Aaron Jackson
2017-12-15 17:37:12 UTC
Permalink
Hi Mark,

It probably does not matter anymore unfortunately. I have a PDP-11 from
a Unimation PUMA robot, which has a 16x EPROM board in it but no power
supply. I was hoping to try running what was on them inside a
simulator. I started dumping them and realised that they have all been
erased before it was sent to me.

Of course I could have tried installing the card in my PDP-11/73 but I
thought there might have been an easier way with the simulator.

Never mind, thanks anyway.

Aaron.
Post by Mark Pizzolato
Hi Aaron,
I am wondering if it is possible to use attach ROM dumps in the PDP-11 simh?
I haven't found anything about it in the documentation. If not, I suppose it
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models) doesn't
actually use any ROMs and doesn't currently support simulation of any cards
which user supplied ROMS might have been installed in.
What problem are you trying to solve???
- Mark
--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
khandy21yo
2017-12-16 03:14:56 UTC
Permalink
Can't you just load them into ram and run them from there?Rom is just non writable memory.


Sent from my Galaxy Tab® A
-------- Original message --------From: Aaron Jackson <***@aaronsplace.co.uk> Date: 12/15/17 10:37 AM (GMT-07:00) To: Mark Pizzolato <***@infocomm.com> Cc: ***@trailing-edge.com Subject: Re: [Simh] Custom ROMs on PDP-11 sim
Hi Mark,

It probably does not matter anymore unfortunately. I have a PDP-11 from
a Unimation PUMA robot, which has a 16x EPROM board in it but no power
supply. I was hoping to try running what was on them inside a
simulator. I started dumping them and realised that they have all been
erased before it was sent to me.

Of course I could have tried installing the card in my PDP-11/73 but I
thought there might have been an easier way with the simulator.

Never mind, thanks anyway.

Aaron.
Post by Mark Pizzolato
Hi Aaron,
I am wondering if it is possible to use attach ROM dumps in the PDP-11 simh?
I haven't found anything about it in the documentation. If not, I suppose it
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models) doesn't
actually use any ROMs and doesn't currently support simulation of any cards
which user supplied ROMS might have been installed in.
What problem are you trying to solve???
- Mark
--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
Timothe Litt
2017-12-16 11:14:25 UTC
Permalink
Post by khandy21yo
Can't you just load them into ram and run them from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so would need
to be part of a simulated device for any code to execute properly[1]. 
(And any
code in them probably touches the device registers, so you need the device
to get anywhere.)  As Mark pointed out, SimH doesn't currently support any
devices that way - it does functional emulation of I/O devices.  (It
wouldn't
be difficult to write such a device emulation if there were a reason to.)

However, to disassemble code/view data, they could be loaded into any RAM
address & poked at with the SimH console.

Some reformatting would be required, since ROMs of that era would
typically be
byte-wide, with 2 devices/word - e.g. one ROM contains the even bytes,
another
the odd ones. (There are other organizations.)

FWIW, ROMs in I/O devices tend to be one or more of:

* Code for on-board processors (rare in early PDP-11s, but Ethernet
and (t)MSCP boards had them)
* Identifying data for the device (e.g. device type, model, serial,
timing, geometry, etc)
* Bootcode/self-test/primitive driver for the host to execute
* Data for the host (e.g. Fonts or strings)

However, as Aaron says that the devices have been erased, it's all moot
at this point :-)

So that's probably more than you wanted to know...

[1] While the code would likely be PIC, things like references to the
device's registers would also be relative to where the code is loaded. 
Looping on a "done" bit relocated to RAM is likely to be frustrating...
Post by khandy21yo
Sent from my Galaxy Tab® A
-------- Original message --------
Date: 12/15/17 10:37 AM (GMT-07:00)
Subject: Re: [Simh] Custom ROMs on PDP-11 sim
Hi Mark,
It probably does not matter anymore unfortunately. I have a PDP-11 from
a Unimation PUMA robot, which has a 16x EPROM board in it but no power
supply. I was hoping to try running what was on them inside a
simulator. I started dumping them and realised that they have all been
erased before it was sent to me.
Of course I could have tried installing the card in my PDP-11/73 but I
thought there might have been an easier way with the simulator.
Never mind, thanks anyway.
Aaron.
Post by Mark Pizzolato
Hi Aaron,
Post by Aaron Jackson
I am wondering if it is possible to use attach ROM dumps in the
PDP-11 simh?
Post by Mark Pizzolato
Post by Aaron Jackson
I haven't found anything about it in the documentation. If not, I
suppose it
Post by Mark Pizzolato
Post by Aaron Jackson
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models)
doesn't
Post by Mark Pizzolato
actually use any ROMs and doesn't currently support simulation of
any cards
Post by Mark Pizzolato
which user supplied ROMS might have been installed in.
What problem are you trying to solve???
- Mark
--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
Johnny Billquist
2017-12-16 12:35:19 UTC
Permalink
Top-posting to make it simple, while still keeping the original text.

While it is true that device access might be done using relative
addressing, that would in general be a bad software design. Things like
device CSRs should never be accessed as relative addresses, but should
be absolute. Any sane programmer should know that. And it is not any
extra effort in doing this on a PDP-11, so the programmer have no real
excuse for not doing it right. (But I know that people sometimes still
do things wrong anyway.)

However, that said, actually writing programs fully PIC on a PDP-11
takes a little more effort, and many times, people didn't do that, so
there is a risk that the program really needs to run located on the
addresses given by the card.

But, as have been said several times now, this is all moot. Without the
ROM contents, nothing to really do here.

Johnny
Post by Timothe Litt
Post by khandy21yo
Can't you just load them into ram and run them from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so would need
to be part of a simulated device for any code to execute properly[1].
(And any
code in them probably touches the device registers, so you need the device
to get anywhere.)  As Mark pointed out, SimH doesn't currently support any
devices that way - it does functional emulation of I/O devices.  (It
wouldn't
be difficult to write such a device emulation if there were a reason to.)
However, to disassemble code/view data, they could be loaded into any RAM
address & poked at with the SimH console.
Some reformatting would be required, since ROMs of that era would
typically be
byte-wide, with 2 devices/word - e.g. one ROM contains the even bytes,
another
the odd ones. (There are other organizations.)
* Code for on-board processors (rare in early PDP-11s, but Ethernet
and (t)MSCP boards had them)
* Identifying data for the device (e.g. device type, model, serial,
timing, geometry, etc)
* Bootcode/self-test/primitive driver for the host to execute
* Data for the host (e.g. Fonts or strings)
However, as Aaron says that the devices have been erased, it's all moot
at this point :-)
So that's probably more than you wanted to know...
[1] While the code would likely be PIC, things like references to the
device's registers would also be relative to where the code is loaded.
Looping on a "done" bit relocated to RAM is likely to be frustrating...
Post by khandy21yo
Sent from my Galaxy Tab® A
-------- Original message --------
Date: 12/15/17 10:37 AM (GMT-07:00)
Subject: Re: [Simh] Custom ROMs on PDP-11 sim
Hi Mark,
It probably does not matter anymore unfortunately. I have a PDP-11 from
a Unimation PUMA robot, which has a 16x EPROM board in it but no power
supply. I was hoping to try running what was on them inside a
simulator. I started dumping them and realised that they have all been
erased before it was sent to me.
Of course I could have tried installing the card in my PDP-11/73 but I
thought there might have been an easier way with the simulator.
Never mind, thanks anyway.
Aaron.
Post by Mark Pizzolato
Hi Aaron,
Post by Aaron Jackson
I am wondering if it is possible to use attach ROM dumps in the
PDP-11 simh?
Post by Mark Pizzolato
Post by Aaron Jackson
I haven't found anything about it in the documentation. If not, I
suppose it
Post by Mark Pizzolato
Post by Aaron Jackson
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models)
doesn't
Post by Mark Pizzolato
actually use any ROMs and doesn't currently support simulation of
any cards
Post by Mark Pizzolato
which user supplied ROMS might have been installed in.
What problem are you trying to solve???
- Mark
--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Timothe Litt
2017-12-16 15:21:40 UTC
Permalink
Post by Johnny Billquist
Top-posting to make it simple, while still keeping the original text.
While it is true that device access might be done using relative
addressing, that would in general be a bad software design. Things
like device CSRs should never be accessed as relative addresses, but
should be absolute. Any sane programmer should know that. And it is
not any extra effort in doing this on a PDP-11, so the programmer have
no real excuse for not doing it right. (But I know that people
sometimes still do things wrong anyway.)
While this case is moot, dumping peripheral ROMs has come up before, so
correct information may be useful to someone in the future.

I'm pretty sure that (among other things), I'm knowledgeable, sane and a
programmer.  I was not writing about "the general case".  This thread
was specifically about ROMs embedded in a peripheral.  This is a
different environment from the "general" case, and one where your
comments are off-base.  This is the exception to *never*.  It has
nothing to do with laziness or 'wrong'; I assumed neither.  And PIC is
only one aspect of the problem as presented.

It is true that in a typical OS driver, a CSR base is specified by an
absolute (if possibly mapped) address, with code like

    mov #173100, r0 ; or
    mov csrbase(R5), r0 ; where r5 points to some data structure, and
csrbase contains an absolute I/O address
    bit    #100, 4(r0)

This ensures that the *code* can be moved; *the device is at some fixed
address* determined by SYSGEN, autoconfiguration, or the like.  So the
references are register deferred and/or indexed relative to an
"absolute" address.  The code should be PIC, as most (later) OSs want to
be able to dynamically load drivers.  I'd agree that in this case, PIC
with an absolute device address is the preferred (and sometimes
required) implementation.

In the specific case of a device ROM, CSR access would indeed be
properly done with relative addressing.  There isn't much (sane)
choice.  Calling it 'bad software design' is inappropriate, and
overlooks the environmental constraints and functional requirements of a
device ROM.

The key point is that a device ROM is an integral part of the peripheral
that it serves; its CSRs are at a fixed offset to the code, but both are
at an unknown base address.  *There is no absolute address; both the
CSRs and the code are relocatable* as a unit: when the peripheral is
installed, and when/if an OS maps it to a virtual address.  And
*executing the code requires that the CSRs are emulated*.  Thus, *both
the code and CSR references in the ROM must be position-independent*.

Consider:

* Plugin a device with some CSRs, a boot ROM, and more than one IO
space address.
* (Since we're being pedantic, turn on power.)
* Press (processor) RESET
* Enter the boot ROM address in the switches; load address; start. (Or
the ASCII console equivalent.)

* Later, the OS may have mapped the device at some random (well,
properly aligned) virtual address, and calls into the boot rom for
some function that it provides.  (For a disk, it might be to write a
crash dump.)

Either way, the ROM code is running, and ready to operate the device.

Now, where, exactly is an absolute address for the CSRs going to come
from?  There is no generally useful absolute address that can be encoded
in the ROM.

"Divine inspiration" isn't an option.

For the first case, there's no outside source of data.  No OS data
structure or config file; no base address in a register.  And
implementing autoconfigure is not practical. (You'd probably call a
proposer 'not sane').  The code can't read its CSRs to find its Unibus
address - because the problem is finding its CSRs.  But it does have PC.

For the second case, the OS could pass a CSR address.  But sane coders
will do something that works in both
cases.  And saves code.

Note that the CSRs and the code live on the same (hardware) module.  So
the offset between them is fixed.
(And, no, an OS isn't allowed to change the offset with memory mapping,
even when the distance might allow it.)

So, the CSRs are found using this offset and PC.  That's relative
addressing - though there's more than one possible implementation.

PC-relative addressing is a perfectly valid (and sane) solution.  Here
are some code snippets that illustrate the situation.

    .title DevROM
    .sbttl YMMV

    .psect CSRs D,RW,GBL ; May or may not overlay part of the ROM
CSRBASE: .blkw 8 ; This device has 8 CSRs

    CSR0 = CSRBASE+0
    CSR1 = CSRBASE+2
    CSR3 = CSRBASE+6

    .psect CODE I,RO
     bit    #100, CSR0  ; This is PC-relative

Of course, if CSRs are referenced more than once some space can be saved
by putting one or more CSR addresses into (a) register(s) and using
register deferred addressing.  But those addresses are determined
relative to the PC - so somewhere, there is still PC-relative address
computation.

    move PC, r0
10$: sub #<10$-CSRBASE>, r0
    bit #100, (r0)

    bic #200, 6(r0) ; Indexed - doesn't save space
or, if CSR3 gets used a lot, spend 3 words to save one/reference
    mov r0, r1
    add  #<CSR3-CSR0>, r1
    bic  #200, (r1)

The only case that a peripheral ROM wouldn't find its CSRs using the PC
is where it has no code.  (Or, if ITS coder wasn't 'sane' - e.g. forced
the device to a fixed address in IO space.)

And yes, the code must be PIC - that is, the code's references to itself
must be position-independent since the hardware can be installed at
various addresses, and the OS can later map it to one or more VAs.

As for data; all data references (pointers) need to be
position-independent - self-relative or relative to the base of the ROM.

Device base address:
+----------------------------+
| CSR 0
| CSR 1
| ...
| CSR n
| Gap
| Code
+----------------------------+

Exactly how the hardware is implemented may vary.  Usually the CSRs are
below the code, though the converse can be true.  And whether the gap
exists - and how big varies.  Sometimes CSRs overlay the ROM; others the
gap aligns the code to a convenient boundary for address multiplexing -
no sane hardware designer of this period would have included an adder.

(Note that 'gap' here is not the 'gap' used in floating address
assignments; if in floating address space, it must not NXM modulo 10,
per the address assignment rules.)

This brings us back to my original points:

* To execute code in a peripheral ROM that touches its CSRs, the ROM
must be in I/O space
* (Almost) certainly, the code will find its CSRs using PC-relative
offsets (addressing and/or math)
* Thus, if you load the ROM into RAM, it will assign some RAM location
to the CSRs.  This won't work.
* If the ROM contains code that talks to the device, it is a near
certainty (not a 'risk') that it must be placed in I/O space *and*
that the CSRs are implemented.  E.g. a full device emulation must be
created.
* The code in the ROM must be PIC, as must any pointers to data.

It is always possible that someone built a device that has a single
fixed Unibus address (e.g. no more than one per system, no address
jumpers).  And that the ROM is never called with memory mapping
enabled.  In that case, all the PIC requirements go away.  However, it
would still require working CSRs, however they're found.  But that would
be a design with severe limitations, and I'd be surprised if an engineer
with any PDP-11 background would have created such a beast.

Before quoting doctrine and casting aspersions, it is best to completely
understand the problem.
Post by Johnny Billquist
However, that said, actually writing programs fully PIC on a PDP-11
takes a little more effort, and many times, people didn't do that, so
there is a risk that the program really needs to run located on the
addresses given by the card.
But, as have been said several times now, this is all moot. Without
the ROM contents, nothing to really do here.
  Johnny
Post by Timothe Litt
Post by khandy21yo
Can't you just load them into ram and run them from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so would need
to be part of a simulated device for any code to execute properly[1].
(And any
code in them probably touches the device registers, so you need the device
to get anywhere.)  As Mark pointed out, SimH doesn't currently support any
devices that way - it does functional emulation of I/O devices.  (It
wouldn't
be difficult to write such a device emulation if there were a reason to.)
However, to disassemble code/view data, they could be loaded into any RAM
address & poked at with the SimH console.
Some reformatting would be required, since ROMs of that era would
typically be
byte-wide, with 2 devices/word - e.g. one ROM contains the even bytes,
another
the odd ones. (There are other organizations.)
   * Code for on-board processors (rare in early PDP-11s, but Ethernet
     and (t)MSCP boards had them)
   * Identifying data for the device (e.g. device type, model, serial,
     timing, geometry, etc)
   * Bootcode/self-test/primitive driver for the host to execute
   * Data for the host (e.g. Fonts or strings)
However, as Aaron says that the devices have been erased, it's all moot
at this point :-)
So that's probably more than you wanted to know...
[1] While the code would likely be PIC, things like references to the
device's registers would also be relative to where the code is loaded.
Looping on a "done" bit relocated to RAM is likely to be frustrating...
Post by khandy21yo
Sent from my Galaxy Tab® A
-------- Original message --------
Date: 12/15/17 10:37 AM (GMT-07:00)
Subject: Re: [Simh] Custom ROMs on PDP-11 sim
Hi Mark,
It probably does not matter anymore unfortunately. I have a PDP-11 from
a Unimation PUMA robot, which has a 16x EPROM board in it but no power
supply. I was hoping to try running what was on them inside a
simulator. I started dumping them and realised that they have all been
erased before it was sent to me.
Of course I could have tried installing the card in my PDP-11/73 but I
thought there might have been an easier way with the simulator.
Never mind, thanks anyway.
Aaron.
Post by Mark Pizzolato
Hi Aaron,
Post by Aaron Jackson
I am wondering if it is possible to use attach ROM dumps in the
PDP-11 simh?
Post by Mark Pizzolato
Post by Aaron Jackson
I haven't found anything about it in the documentation. If not, I
suppose it
Post by Mark Pizzolato
Post by Aaron Jackson
wouldn't be too hard to modify the bootrom header.
The PDP11 simulator (which simulates MANY different PDP11 models)
doesn't
Post by Mark Pizzolato
actually use any ROMs and doesn't currently support simulation of
any cards
Post by Mark Pizzolato
which user supplied ROMS might have been installed in.
What problem are you trying to solve???
- Mark
--
Aaron Jackson
PhD Student, Computer Vision Laboratory, Uni of Nottingham
http://aaronsplace.co.uk
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
_______________________________________________
Simh mailing list
http://mailman.trailing-edge.com/mailman/listinfo/simh
Johnny Billquist
2017-12-16 21:38:44 UTC
Permalink
Post by Timothe Litt
Post by Johnny Billquist
Top-posting to make it simple, while still keeping the original text.
While it is true that device access might be done using relative
addressing, that would in general be a bad software design. Things
like device CSRs should never be accessed as relative addresses, but
should be absolute. Any sane programmer should know that. And it is
not any extra effort in doing this on a PDP-11, so the programmer have
no real excuse for not doing it right. (But I know that people
sometimes still do things wrong anyway.)
While this case is moot, dumping peripheral ROMs has come up before, so
correct information may be useful to someone in the future.
Indeed.
Post by Timothe Litt
I'm pretty sure that (among other things), I'm knowledgeable, sane and a
programmer.  I was not writing about "the general case".  This thread
was specifically about ROMs embedded in a peripheral.
Not trying to make any statements about you here.
Post by Timothe Litt
  This is a
different environment from the "general" case, and one where your
comments are off-base.  This is the exception to *never*.  It has
nothing to do with laziness or 'wrong'; I assumed neither.  And PIC is
only one aspect of the problem as presented.
It is true that in a typical OS driver, a CSR base is specified by an
absolute (if possibly mapped) address, with code like
    mov #173100, r0 ; or
    mov csrbase(R5), r0 ; where r5 points to some data structure, and
csrbase contains an absolute I/O address
    bit    #100, 4(r0)
This ensures that the *code* can be moved; *the device is at some fixed
address* determined by SYSGEN, autoconfiguration, or the like.  So the
references are register deferred and/or indexed relative to an
"absolute" address.  The code should be PIC, as most (later) OSs want to
be able to dynamically load drivers.  I'd agree that in this case, PIC
with an absolute device address is the preferred (and sometimes
required) implementation.
In the specific case of a device ROM, CSR access would indeed be
properly done with relative addressing.  There isn't much (sane)
choice.  Calling it 'bad software design' is inappropriate, and
overlooks the environmental constraints and functional requirements of a
device ROM.
Fair enough. If you actually have a device which includes both CSR and
code, that are moved together through I/O space, then yes you'd want to
use relative addressing for the CSR.

However, such a device would be wrong to start with. And I've never seen
anyone do that, but sure, it could be done.

But with the limited space in the I/O page, you would not want to have
the same code replicated all over the space.

So in the end no, I do not believe that it would ever be the right thing
to have relative addressing for CSRs. Your example is valid in that such
a design would make sense to have relative addressing, but such a device
is already a wrong thing to start with, and should not be.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Timothe Litt
2017-12-16 22:32:30 UTC
Permalink
Post by Johnny Billquist
However, such a device would be wrong to start with. And I've never
seen anyone do that, but sure, it could be done.
Read the OP.  He has such a device.  It has ROMs with PDP-11 code -- or
at least, that's his assumption.  And it's a Unimate robot controller. 
If that assumption is correct, it fits the architecture that I described.
Post by Johnny Billquist
But with the limited space in the I/O page, you would not want to have
the same code replicated all over the space.
It depends.  If I were an OEM, and I anticipated a small number of my
devices per CPU, this would be a good way to avoid having a separate ROM
module.  Robots costing $100Ks fit that bill. 

Further, the typical code isn't very large.  For example, the M9301-YA,
512 words - in I/O space, can bootstrap 8 different devices AND has 7
CPU self-tests and a memory test.  The -YB has a console emulator,
self-tests, and 11 device bootstraps.

So it's quite plausible to have a host-run self-test, bootstrap,
calibration, or other code on- board without consuming unreasonable
amounts of I/O space.

There are other schemes to avoid duplication, but I'll leave those as an
exercise for the reader.
Post by Johnny Billquist
So in the end no, I do not believe that it would ever be the right
thing to have relative addressing for CSRs. Your example is valid in
that such a design would make sense to have relative addressing, but
such a device is already a wrong thing to start with, and should not be.
You don't get to decide and enforce what is right/wrong or what should
not be.  As a system architect, I had some power to ordain what should
be.  But one quickly discovers that even that power is limited.  You can
have an opinion, but sometimes reality butts in.  Your idea of
architectural purity and/or design constraints will be tested (and
changed) by Manufacturing, OEMs, customers, and the field - which have
their own challenges.

It is unwise to assume that you know enough to say "never" or "always". 
Unless you like being proven wrong.
Post by Johnny Billquist
    Johnny
Johnny Billquist
2017-12-16 23:07:07 UTC
Permalink
Post by Johnny Billquist
However, such a device would be wrong to start with. And I've never
seen anyone do that, but sure, it could be done.
Read the OP.  He has such a device.  It has ROMs with PDP-11 code -- or
at least, that's his assumption.  And it's a Unimate robot controller.
If that assumption is correct, it fits the architecture that I described.
No, you are making several assumptions here.
First of all, there is nothing saying that it even works if you have
several devices. Second, we do not know if it can be at different
addresses. Third, even though you have ROMs on it, there is nothing that
says that those are even exposed to the PDP-11. Fourth, what was often
done was that if you had PDP-11 code available on the card, it was
separately enabled compared to the CSRs as such, and if the memory was
enabled, it was located at a fixed address in I/O space (several
examples of such controllers exist). Fifth, another solution some
controllers applied was that the code would be DMAd from ROMs into
PDP-11 ram, and then executed from there, and that was only used for
diagnostics and configuration stuff (see most SCSI controllers for
example). Point 4 and 5 have lots of previous art, and those are the
only ones I know of which present any PDP-11 code, and those do not use
the scheme you are suggesting, but do use absolute addresses for CSRs in
the PDP-11 code. For the SCSI controllers, you interactively have to
tell which CSR the code should access, and for some other controllers,
they have the code at a fixed address, for booting, and only support
booting from the controller at a fixed CSR address.
Post by Johnny Billquist
But with the limited space in the I/O page, you would not want to have
the same code replicated all over the space.
It depends.  If I were an OEM, and I anticipated a small number of my
devices per CPU, this would be a good way to avoid having a separate ROM
module.  Robots costing $100Ks fit that bill.
Further, the typical code isn't very large.  For example, the M9301-YA,
512 words - in I/O space, can bootstrap 8 different devices AND has 7
CPU self-tests and a memory test.  The -YB has a console emulator,
self-tests, and 11 device bootstraps.
Yes. And these bootstraps are very tight, and only works on fixed CSR
addresses.
So it's quite plausible to have a host-run self-test, bootstrap,
calibration, or other code on- board without consuming unreasonable
amounts of I/O space.
If you repeat those 512 word on each card, you'll run out of I/O space
after 6 cards (at best). Add any other devices, and you hit trouble even
earlier.
There are other schemes to avoid duplication, but I'll leave those as an
exercise for the reader.
Any scheme will by necessity have you not repeat the same code and
memory use on each card.
Post by Johnny Billquist
So in the end no, I do not believe that it would ever be the right
thing to have relative addressing for CSRs. Your example is valid in
that such a design would make sense to have relative addressing, but
such a device is already a wrong thing to start with, and should not be.
You don't get to decide and enforce what is right/wrong or what should
not be.  As a system architect, I had some power to ordain what should
be.  But one quickly discovers that even that power is limited.  You can
have an opinion, but sometimes reality butts in. Your idea of
architectural purity and/or design constraints will be tested (and
changed) by Manufacturing, OEMs, customers, and the field - which have
their own challenges.
It is unwise to assume that you know enough to say "never" or "always".
Unless you like being proven wrong.
I certainly do not get to decide right or wrong.

The rest we can continue argue, if you want to.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Paul Koning
2017-12-16 20:42:59 UTC
Permalink
Post by Timothe Litt
Post by khandy21yo
Can't you just load them into ram and run them from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so would need
to be part of a simulated device for any code to execute properly[1].
It would make sense (and it would be very easy) to add a feature to SIMH to load a memory image file into what is nominally ROM in I/O space. It could be made ROM from the program point of view (i.e., it's loaded from the user interface but the CPU can't store there).

paul
Bob Eager
2017-12-16 21:15:49 UTC
Permalink
On Sat, 16 Dec 2017 15:42:59 -0500
Post by Paul Koning
Post by Timothe Litt
Post by khandy21yo
Can't you just load them into ram and run them from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so
would need to be part of a simulated device for any code to execute
properly[1].
It would make sense (and it would be very easy) to add a feature to
SIMH to load a memory image file into what is nominally ROM in I/O
space. It could be made ROM from the program point of view (i.e.,
it's loaded from the user interface but the CPU can't store there).
And has already been done for the VAX; even simulation of the slower
ROM speed.
Timothe Litt
2017-12-16 21:45:06 UTC
Permalink
Post by Paul Koning
Post by Timothe Litt
Can't you just load them into ram and *run them* from there?
Rom is just non writable memory.
He could, except that these ROMs are probably in I/O space, so would need
to be part of a simulated device for any code to execute properly[1]. 
It would make sense (and it would be very easy) to add a feature to
SIMH to load a memory image file into what is nominally ROM in I/O
space.  It could be made ROM from the program point of view (i.e.,
it's loaded from the user interface but the CPU can't store there).
paul
Sure, that's trivial.  But a ROM in a peripheral is going to want to
talk to that peripheral, so to "run the code", as the OP said he wanted
to do, the CSRs need to be implemented too.  ROM or RAM, a memory
location doesn't act like a CSR, so the likely result is that the code
will loop, hang waiting for an interrupt, or do something else strange
when the locations that expects are CSRs don't act like a device.

If the goal is to disassemble, loading into I/O space would ensure that
all the addresses are correct.  But if he really wants to *execute* the
code, it's rather more involved.

Again, ROMs embedded in peripherals (he said a robot) are part of a
device, and the code will expect the other parts to be there and to be
functional.  His device's CSRs aren't emulated.  So this is necessary,
but not sufficient.

If it were just a BOOT rom (e.g. a M9301-xx), your suggestion would
work, as it's separate from the device emulation.   (You can read the
M9301 maintenance and operation manual on bitsavers.)
Tim Stark
2017-12-17 00:20:26 UTC
Permalink
Folks,

Well, there are some PDP-11 tech docs indicates that higher models like
11/53, 11/73, 11/74, 11/83, 11/84, 11/93, and 11/94 have built-in own
firmware ROMs at starting 160000 with switch bits for banking.

Tim
Christian Gauger-Cosgrove
2017-12-17 00:48:38 UTC
Permalink
Post by Tim Stark
Well, there are some PDP-11 tech docs indicates that higher models like
11/53, 11/73, 11/74, 11/83, 11/84, 11/93, and 11/94 have built-in own
firmware ROMs at starting 160000 with switch bits for banking.
Don't include the 11/74 in that list, as it's the SMP 11/70 derived
Beast of a machine.

Per Micronote 039 the KDJ11-B boards (M8190) has bootstrap/diagnostic
ROMs, which covers certain models of 11/73, but does cover the 11/83
and 11/84. The KDJ11-E (M8981) of the 11/93 and 11/94, and the KDJ11-D
(M7554) of the 11/53 also have on board boot ROMs.
The KDJ11-A (M8192) boards which are also called PDP-11/73, do not
have ROMs; for them you need to use an MXV11-B (possibly with it's
memory disabled; enjoy board surgery), an MRV11-D ROM module, or a
22-bit upgraded BDV11 bootstrap/terminator card (ECO Rev. E, I
believe).

I've not looked at the bootstrap ROMs of the KDJ11-B, KDJ11-D, or
KDJ11-E, but I know the information for the MRV11-D and BDV11. In the
BDV11 the bootstrap ROMs "live" at 173000--173777 and which of the 256
words (512 bytes) are mapped into that space is controlled by the PCR
at 177520 (the lower byte lets you set which page 173000--173377 is
mapped to, the upper byte of the PCR controls 173400--173777; there
are maximum 256 possible 128 word pages). In the MRV11 the bootstrap
ROMs "live" at two different windows, 173000--173777 (as with the
BDV11) and 165000--165777; the PCR lives at 177520 (as with the
BDV11). The PCR is split into controller two 512 byte windows
separately (window 0 is the one at 173000 and window 1 is at 165000);
however there are only 7 bits available (highest order bit of each
byte is ignored) so the maximum possible is 128 512B pages mappable.

I've not looked at the MXV11-B documentation, but the MRV11-D is
specifically mentioned to be compatible with MXV11-B boot ROMs so I
would assume it would work similarly.

Cheers,
Christian
--
Christian M. Gauger-Cosgrove
STCKON08DS0
Contact information available upon request.
Johnny Billquist
2017-12-17 11:56:34 UTC
Permalink
Post by Tim Stark
Folks,
Well, there are some PDP-11 tech docs indicates that higher models like
11/53, 11/73, 11/74, 11/83, 11/84, 11/93, and 11/94 have built-in own
firmware ROMs at starting 160000 with switch bits for banking.
As Christian said, the 11/74 is not correct to include in this
discussion, as it is in a different family.
All the others are J11 based machines, and somewhat similar.

Also, some variant of the 11/73 used a double height module, which did
not include any boot roms, so that one does not have anything around this.

I can't remember how the 53, 83 and 84 works straight up, but I just
went back and checked the 93 and 94. I think the others work the same,
but someone should check.

Anyway, the 93 and 94 have an 8K EEPROM, which obviously is too big to
all fit at the same time in the I/O page. However, it does not map into
160000 ever. There are two memory areas in the I/O page set aside for
boot roms.
165000, holding 512 bytes.
173000, holding 512 bytes.

Usually 165000 holds self diagnostics, and the common code for booting,
while 173000 holds device specific booting code.

The KDJ11 module can use neither, one, or both of these areas. If 165000
is enabled, it holds the basic, common code, which can then also boot
using traditional M9312 boot roms, located in 173000. For this, the
KDJ11 needs to disable its own use of 173000. If you have some module
with its own booting in general, which uses 165000, you also should
disable the KDJ11 use of that area (obviously). The enabling and
disabling of the use of these areas are controlled by a CSR at 177520
(there don't seem to be a specific name for that CSR).

If the KDJ11 use either of these areas, they are bank switched. The
KDJ11 creates the full address into the EEPROM by using the low 9 bits
from the physical address, and the high bits come from a register called
PCR (177522). One byte is used for the 165000 area, and one byte for the
173000 area.

All this is documented in the 11/93 and 11/94 manuals.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Johnny Billquist
2017-12-17 12:04:30 UTC
Permalink
Post by Johnny Billquist
Post by Tim Stark
Folks,
Well, there are some PDP-11 tech docs indicates that higher models
like 11/53, 11/73, 11/74, 11/83, 11/84, 11/93, and 11/94 have built-in
own firmware ROMs at starting 160000 with switch bits for banking.
As Christian said, the 11/74 is not correct to include in this
discussion, as it is in a different family.
All the others are J11 based machines, and somewhat similar.
Also, some variant of the 11/73 used a double height module, which did
not include any boot roms, so that one does not have anything around this.
I can't remember how the 53, 83 and 84 works straight up, but I just
went back and checked the 93 and 94. I think the others work the same,
but someone should check.
Anyway, the 93 and 94 have an 8K EEPROM, which obviously is too big to
all fit at the same time in the I/O page. However, it does not map into
160000 ever. There are two memory areas in the I/O page set aside for
boot roms.
165000, holding 512 bytes.
173000, holding 512 bytes.
Usually 165000 holds self diagnostics, and the common code for booting,
while 173000 holds device specific booting code.
The KDJ11 module can use neither, one, or both of these areas. If 165000
is enabled, it holds the basic, common code, which can then also boot
using traditional M9312 boot roms, located in 173000. For this, the
KDJ11 needs to disable its own use of 173000. If you have some module
with its own booting in general, which uses 165000, you also should
disable the KDJ11 use of that area (obviously). The enabling and
disabling of the use of these areas are controlled by a CSR at 177520
(there don't seem to be a specific name for that CSR).
If the KDJ11 use either of these areas, they are bank switched. The
KDJ11 creates the full address into the EEPROM by using the low 9 bits
from the physical address, and the high bits come from a register called
PCR (177522). One byte is used for the 165000 area, and one byte for the
173000 area.
All this is documented in the 11/93 and 11/94 manuals.
And to correct myself. When I write EEPROM I was short-circuiting
myself. There is both a ROM and EEPROM on the module. And for 165000,
when enabled, the access can go either to ROM or EEPROM. And the ROM is
the 8K. Select of ROM or EEPROM is also done through the CSR at 177520.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Johnny Billquist
2017-12-17 12:08:35 UTC
Permalink
Post by Johnny Billquist
Post by Johnny Billquist
Post by Tim Stark
Folks,
Well, there are some PDP-11 tech docs indicates that higher models
like 11/53, 11/73, 11/74, 11/83, 11/84, 11/93, and 11/94 have
built-in own firmware ROMs at starting 160000 with switch bits for
banking.
As Christian said, the 11/74 is not correct to include in this
discussion, as it is in a different family.
All the others are J11 based machines, and somewhat similar.
Also, some variant of the 11/73 used a double height module, which did
not include any boot roms, so that one does not have anything around this.
I can't remember how the 53, 83 and 84 works straight up, but I just
went back and checked the 93 and 94. I think the others work the same,
but someone should check.
Anyway, the 93 and 94 have an 8K EEPROM, which obviously is too big to
all fit at the same time in the I/O page. However, it does not map
into 160000 ever. There are two memory areas in the I/O page set aside
for boot roms.
165000, holding 512 bytes.
173000, holding 512 bytes.
Usually 165000 holds self diagnostics, and the common code for
booting, while 173000 holds device specific booting code.
The KDJ11 module can use neither, one, or both of these areas. If
165000 is enabled, it holds the basic, common code, which can then
also boot using traditional M9312 boot roms, located in 173000. For
this, the KDJ11 needs to disable its own use of 173000. If you have
some module with its own booting in general, which uses 165000, you
also should disable the KDJ11 use of that area (obviously). The
enabling and disabling of the use of these areas are controlled by a
CSR at 177520 (there don't seem to be a specific name for that CSR).
If the KDJ11 use either of these areas, they are bank switched. The
KDJ11 creates the full address into the EEPROM by using the low 9 bits
from the physical address, and the high bits come from a register
called PCR (177522). One byte is used for the 165000 area, and one
byte for the 173000 area.
All this is documented in the 11/93 and 11/94 manuals.
And to correct myself. When I write EEPROM I was short-circuiting
myself. There is both a ROM and EEPROM on the module. And for 165000,
when enabled, the access can go either to ROM or EEPROM. And the ROM is
the 8K. Select of ROM or EEPROM is also done through the CSR at 177520.
And I need to proofread things before sending.
Also, 173000 is always ROM. EEPROM is only a possible option for the
165000 area, and at power on, it will be the ROM that is accessed.

Johnny
--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: ***@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol
Loading...