Also, where does a program start? What memory address is executed first?
Are there any other special memory address? (other than the ones at the top
ie registers and stuff)
Thanks
4 Odd address trap or bus timeout
10 Reserved instruction execution
14 BPT execution
60 Console terminal
100 Clock
300 - 774 floating vectors
The floating vectors of for extra or non-standard devices. If they're not
used then
you can use them as ordinary memory.
>Also, where does a program start? What memory address is executed first?
>
Where would you like it to start? The PDP executes the next instruction
pointed
to by the PC (R7). If you have an operating system then that will have some
mechanism for determining where to start a user program. In RSX this start
address is held in the task header. I don't know how RT or RSTS do this.
>Are there any other special memory address? (other than the ones at the top
>ie registers and stuff)
>
Not that I'm aware of unless you're running a multiprocessor config. The
vector
address are virtual addresses and not physical so if you have a multi
processor
one processor's devices could interrupt in the middle of another processor's
memory depending on how the Kernel D-space APRs are configured.
Chris.
RSX Software Development Group.
> The floating vectors of for extra or non-standard devices. If they're not
> used then
> you can use them as ordinary memory.
>
> >Also, where does a program start? What memory address is executed first?
> >
> Where would you like it to start? The PDP executes the next instruction
> pointed
> to by the PC (R7). If you have an operating system then that will have some
> mechanism for determining where to start a user program. In RSX this start
> address is held in the task header. I don't know how RT or RSTS do this.
>
In RT (I think the last version I worked with was 5.2) in the SJ monitor,
a program generally starts at address 1000. with the stack pointing to
location 998.
Jim
I should have been more clear.
What I'm trying to do is write a simple PDP-11 simulator for a software
engineering course I'm taking.
What I wondering is, when the PDP-11 first boots, how did it know what to
do? Was there a certain memory address it assumed the OS would be at and
start running at that address? Or did something else happen?
I'm not planning to have an OS. Just a binary image that would be copied in
RAM and then run. Any suggestions?
Can anybody recommend and good books or websites that could provide hardware
info on the PDP-11? I haven't been able to find anything more indepth than
the instructions set and register layout etc.
Thanks
Roland
-----------
The program starts where ever you tell it to! And it can be different.
If memory serves, it works something like this ...
In most Micro PDP11s there is a firmware bootstrap starting at location
173000 ... which in turn loads a primary bootstrap from the first block
on the physical media, which is started at location 0(?). This
relocates itself, and loads a secondary bootstrap from the disk, which
in turn loads a system image.
The only externally defined address is location 0(?) where the primary
bootstrap is started from. The secondary bootstrap is written
specifically to load the operating system image being booted, which may
have a different transfer address depending on both the particular o/s
being loaded, or the particular build of the o/s.
Stuart
[ there was a power fail/up interrupt that vectored through location 24.
I think the machine took the power fail path when power was applied, and
the "run/halt" switch was in the run position. Generally one set halt
before power off when doing a clean shutdown. ]
Many 11's had some kind of bootstrap loader. Before the 11/70,
773000 through 773777 were generally reserved for bootstraps.
DEC had
"paper tape bootstrap",
"rc/rk/rp/rf and tc-11 bootstrap",
roll-your-own diode memory matrix; you snipped
diodes to build your own bootstrap.
To use these bootstraps you still had use the switches to start the
machine at 773000. For some bootstraps, you had to set a data value
into the switch register to choose a particular load device.
I believe the pdp-11/70 had a boostrap built in (M9301-YC). It
could be started at 17765000 to do a diagnostics, which then
transfered control to 17773000 to do a bootstrap. There were
some internal dip switches to set a default bootstrap device.
The bootstraps transfered control to well know locations.
It is all kind of fuzzy, but I think that the paper tape bootstraps
took a starting address from the paper tape. I also seem to recall
that the "block" bootstraps loaded block zero of the device at location
zero, and transfered control to zero. From there on it was up to the
software.
As a final note, I think that by convention paper tape programming
on the really old 11's, with not much memory, started the program
at 0400, which is the first location after the interrupt vectors.
Of course this was enforced by the paper tape bootstrap, not the
hardware.
I'm going to ramble a bit about the switches and console operation
to help people who have never seen a switch register understand that
life without a starting address is possible. Forrest.
-------------------------------
For the old machines ( 11/20 ) the console consisted of bits 17->0, load
address, examine, continue, enable(up)/halt(down), (single
instruction/single step), start, and deposit.
To load memory, one went through the sequence
set switches to 18 bit physical address
load address
L1 set 16 switches to data value
deposit
goto L1
The load address incremented with each deposit, so entering
a sequence was a little less tedious.
To start the progam
set 16 bit starting address
load address
start
"start" has the function of setting a well know state in the CPU.
"continue" transfers control to the "load address" location, but doesn't
twiddle the cpu state.
Note there was no special way to manipulate the registers. One did this by
addressing 777710 through 777717 for the Register set 0, supervisor sp, user
sp (note odd addresses for 16 byte quantities). The 777700->777707
addressed register set 1, kernel SP (777706), and the program counter
(777707). On some 11's it was possible to code a short loop in the
registers and execute them, but that did not work in most machines.
MOV @#777570,dst returned the bits 16->0 of the console switches allowing
the console to be used to modify program behaviour..
The 11/45 and 11/70 gained switches. The switch register grew to 22 bits
on the 11/70 to accomodate the extra addressing.
More importantly there was a new rotary switches
Data select: data paths/bus register/addrs
fpp&cpu/display register
Address display: User I/User D/Sup I/Sup D/Kernel I/Kernel D/
program physical/console physical
console physical examined a 22 bit address with no mapping.
[user|kernel|sup] [I|D] did a virtual translation of a 16 bit
address with the appropriate mapping hardware
program physical, when selected after a virtual examine or
deposit, displayed the 22 bit physical address resulting from
the translation.
The data select switch, when using the console, should
usually be set on "data paths". Setting it on display
register allowed the program to store information in the
console lights by mov, src,@#17777570. Bus reg and micro
address settings were used to display states of the micro
machine.
------------
In article <36B094...@concentric.net> , Stuart Brook
>What I wondering is, when the PDP-11 first boots, how did it know what to
>do? Was there a certain memory address it assumed the OS would be at and
>start running at that address? Or did something else happen?
If the machine has core memory, it could simply use the power-fail
vector (so long as it was previously set up) and run whatever that
pointed to. Otherwise, it powered-up in a halted state... Depending
on the machine and on the bootstrap installed, one would toggle
or punch in an address and tell the machine to start running begining
with that address (with *many* machines, it was 173000, on some
it was 173x00, where 'x' specified a device, on still others, one
started the boot code and then typed at the console)
Megan Gentry
Former RT-11 Developer
+--------------------------------+-------------------------------------+
| Megan Gentry, EMT/B, PP-ASEL | Internet (work): gentry!zk3.dec.com |
| Unix Support Engineering Group | (home): mbg!world.std.com |
| Compaq Computer Corporation | addresses need '@' in place of '!' |
| 110 Spitbrook Rd. ZK03-2/T43 | URL: http://world.std.com/~mbg/ |
| Nashua, NH 03062 | "pdp-11 programmer - some assembler |
| (603) 884 1055 | required." - mbg |
+--------------------------------+-------------------------------------+
>In RT (I think the last version I worked with was 5.2) in the SJ monitor,
>a program generally starts at address 1000. with the stack pointing to
>location 998.
Yes, a program LOADs starting usually at 1000 (octal). But the starting
address can be anywhere in the loaded image...
BTW, the stack starts at *776* and works downward...
Remember -- think *OCTAL*... :-)