[comp.lang.c] PDP-11 data and function address spaces

chris@mimsy.umd.edu (Chris Torek) (11/09/89)

In article <11567@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
>By the way, the PDP-11 is the main example of a system where data and
>function address spaces are distinct ....

Before anyone jumps in and `corrects' Doug with stories of 11s in their
college days (`why, when I was a boy, we had to carry our 11/40s 5 miles
uphill through the snow to school each day, and 5 miles uphill back home
again, where we could not even use it since the electricity was all DC,
and . . .' :-) ), you should realise that PDPs came in different models
and had different operating systems that used different capabilities.
One of the (somewhat less frequently used) capabilities was what was
called `split I&D', in which each machine address had to be qualified
with `instruction' or `data' before it was unique.  There were two
separate locations 0400, one containing code, and one containing data.

This is reflected in C in that

	char *p;
	int fn();

	p = (char *)fn;

is non-portable, and hence, even after such an assignment, the result of

	(*(int (*)())p)();

is at best non-standard.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@cs.umd.edu	Path:	uunet!mimsy!chris

henry@utzoo.uucp (Henry Spencer) (11/10/89)

In article <20642@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>... PDPs came in different models
>and had different operating systems that used different capabilities.
>One of the (somewhat less frequently used) capabilities was what was
>called `split I&D', in which each machine address had to be qualified
>with `instruction' or `data' before it was unique...

Dept. Of Really Fussy Nit-Picking:  relatively few pdp11s, and relatively
few pdp11 operating systems, supported split-space -- Unix on the 44/45/70
was just about the sole example -- but when it *was* available, it got used
*A LOT*.  This is one reason why a stock V7 did not run very well on the
smaller 11s without split-space, although if you munged it hard enough you
could make it go all right.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

thor@stout.ucar.edu (Rich Neitzel) (11/10/89)

In article <1989Nov9.200332.8763@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>Dept. Of Really Fussy Nit-Picking:  relatively few pdp11s, and relatively
>few pdp11 operating systems, supported split-space -- Unix on the 44/45/70
>was just about the sole example 

Alas, you have forgotten the 11/73 and 11/83. Also, RSX-11M+ uses I&D space
extensively, even for the kernel. BTW, why do UNIX people seem so unfamiliar
with DEC's Q-bus PDP's? Also, I note the extensive use of the past tense is
talking about them - but they are alive and kicking (usually the butt of 
some overrated VAX).




-------------------------------------------------------------------------------

minow@mountn.dec.com (Martin Minow) (11/10/89)

In article <20642@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes:
>In article <11567@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes:
>>By the way, the PDP-11 is the main example of a system where data and
>>function address spaces are distinct ....
>
>Before anyone jumps in and `corrects' Doug with stories of 11s in their
>college days ...

Hmmph, in my college days, computers used these funny-looking glass bottles
called tubes.
>
>This is reflected in C in that
>
>	char *p;
>	int fn();
>
>	p = (char *)fn;
>
>is non-portable, and hence, even after such an assignment, the result of
>
>	(*(int (*)())p)();
>
>is at best non-standard.

However, it should work, since the only thing that distinguished an
"instruction" reference from a "data" reference was the instruction
(actually, the register address) used to reference it.  What you
couldn't do (easily), however, was
	short function[] = {
	    012700,		/* Move value to R0		*/
	    012345,		/* Random value			*/
	    000207,		/* Return			*/
	};
	int	(*fn)();	/* Address of a function	*/
	...
	    fn = &function[0];
	    result = (*fn)();
The problem here is that the value you assign to "fn" is a virtual
address in data space, but the same virtual address in instruction
space may be a completely different physical address.

Martin Minow
minow@thundr.enet.dec.com

peter@ficc.uu.net (Peter da Silva) (11/11/89)

In article <1989Nov9.200332.8763@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
> Dept. Of Really Fussy Nit-Picking:  relatively few pdp11s, and relatively
> few pdp11 operating systems, supported split-space -- Unix on the 44/45/70
> was just about the sole example...

Dept. of Even More Fussy Nit-Picking: DEC finally twigged to this just
before they gave up on the 11. RSX-11M+ supported Split I&D.

DEC is to software as McDonalds is to fried chicken.
-- 
`-_-' Peter da Silva <peter@ficc.uu.net> <peter@sugar.hackercorp.com>.
 'U`  --------------  +1 713 274 5180.
"*Real* wizards don't whine about how they paid their dues"
	-- Quentin Johnson quent@atanasoff.cs.iastate.edu

henry@utzoo.uucp (Henry Spencer) (11/12/89)

In article <5121@ncar.ucar.edu> thor@stout.UCAR.EDU (Rich Neitzel) writes:
>>Dept. Of Really Fussy Nit-Picking:  relatively few pdp11s, and relatively
>>few pdp11 operating systems, supported split-space -- Unix on the 44/45/70
>>was just about the sole example 
>
>Alas, you have forgotten the 11/73 and 11/83. Also, RSX-11M+ uses I&D space
>extensively, even for the kernel...

If we're being really picky, the 73 was an lsi11, not a pdp11.  The 8n is
a slightly different story, but I can always hide behind the "just about"...

RSX-11M started using split-space pretty late in the game.  Early on, Unix
was notorious for giving the 11 MMU much more of a workout than any of the
DEC systems did.

>BTW, why do UNIX people seem so unfamiliar with DEC's Q-bus PDP's?

Probably because good ones did not become available until the pdp11's days
as a desirable Unix machine were already visibly ending.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

mikes@rtech.UUCP (Mike Schilling(This sentence no verb.)) (11/13/89)

From article <1989Nov9.200332.8763@utzoo.uucp>, by henry@utzoo.uucp (Henry Spencer):
> Dept. Of Really Fussy Nit-Picking:  relatively few pdp11s, and relatively
> few pdp11 operating systems, supported split-space -- Unix on the 44/45/70
> was just about the sole example [...]

Not to mention a REAL operating system, RSX11M-plus.  Also, all the J-11
machines, 11/73/83/84 (53?), have separate I&D space.

gwyn@smoke.BRL.MIL (Doug Gwyn) (11/14/89)

In article <5121@ncar.ucar.edu> thor@stout.UCAR.EDU (Rich Neitzel) writes:
>Alas, you have forgotten the 11/73 and 11/83.

Also the PDP-11/55.  I think every PDP-11 model >= 44 other than 60
supported separate I&D spaces.

>... they are alive and kicking ...

The PDP-11 line was great.  The reason it is generally considered in
the past tense is that modern expectations are extremely hard to meet
with an architecture that limits a process's (I or D) address space
to "only" 64Kbytes.  Therefore people who are used to modern computer
architectures consider the PDP-11 obsolete in this very important
respect.  Undoubtedly they are still useful for many things; I wish I
had one.

peter@ficc.uu.net (Peter da Silva) (11/14/89)

In article <11588@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
> In article <5121@ncar.ucar.edu> thor@stout.UCAR.EDU (Rich Neitzel) writes:
> >Alas, you have forgotten the 11/73 and 11/83.

> Also the PDP-11/55.  I think every PDP-11 model >= 44 other than 60
> supported separate I&D spaces.

I think the 11/24 did, too. Or maybe I'm thinking of the 11/23+?

> Undoubtedly they are still useful for many things; I wish I had one.

Look for bankruptcy auctions. I know a guy who got one for $50, complete
and operational.
-- 
`-_-' Peter da Silva <peter@ficc.uu.net> <peter@sugar.hackercorp.com>.
 'U`  --------------  +1 713 274 5180.
"*Real* wizards don't whine about how they paid their dues"
	-- Quentin Johnson quent@atanasoff.cs.iastate.edu

henry@utzoo.uucp (Henry Spencer) (11/16/89)

In article <11588@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn) writes:
>>Alas, you have forgotten the 11/73 and 11/83.
>
>Also the PDP-11/55.  I think every PDP-11 model >= 44 other than 60
>supported separate I&D spaces.

The 50 and 55 were 45s with factory-installed fast memory and a different
front-panel color.  Actually, the 70 was a 45 deep down inside too, but
the modifications were a bit more drastic there.

I think the ">=44 && !=60" rule is correct.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

henry@utzoo.uucp (Henry Spencer) (11/16/89)

In article <6958@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> Also the PDP-11/55.  I think every PDP-11 model >= 44 other than 60
>> supported separate I&D spaces.
>
>I think the 11/24 did, too. Or maybe I'm thinking of the 11/23+?

No.  Neither had split-space.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

peter@ficc.uu.net (Peter da Silva) (11/16/89)

In article <1989Nov15.165806.21515@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
> In article <6958@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
> >I think the 11/24 did, too. Or maybe I'm thinking of the 11/23+?

> No.  Neither had split-space.

I'm pretty sure the LSI-11/23+ did. Or are you differentiating between the
LSI-11 and PDP-11.
-- 
`-_-' Peter da Silva <peter@ficc.uu.net> <peter@sugar.hackercorp.com>.
 'U`  --------------  +1 713 274 5180.
"*Real* wizards don't whine about how they paid their dues"
	-- Quentin Johnson quent@atanasoff.cs.iastate.edu

mikes@rtech.UUCP (Mike Schilling(This sentence no verb.)) (11/19/89)

From article <6989@ficc.uu.net>, by peter@ficc.uu.net (Peter da Silva):
> In article <1989Nov15.165806.21515@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>> In article <6958@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> >I think the 11/24 did, too. Or maybe I'm thinking of the 11/23+?
> 
>> No.  Neither had split-space.
> 
> I'm pretty sure the LSI-11/23+ did. Or are you differentiating between the
> LSI-11 and PDP-11.
No, it's a function of the processor type.  J-11 machines (11/73, 11/84, etc.)
have 6 sets of mapping registers: separate I and D space in user, supervisor,
and kernel mode.  F-11 machines (11/23, 11/73, 11/23, micro-pdp11, etc.)
have only 2: user and kernel.  Some of the larger machines (11/70, 11/44, etc.)
also have 6.

What the 23+ DOES have are Unibus Mapping Registers (UMRs).  These map from
18-bit Unibus addresses to 22-bit memory addresses, and are only of interest to
device-driver writers.

henry@utzoo.uucp (Henry Spencer) (11/19/89)

In article <6989@ficc.uu.net> peter@ficc.uu.net (Peter da Silva) writes:
>> >I think the 11/24 did, too. Or maybe I'm thinking of the 11/23+?
>
>> No.  Neither had split-space.
>
>I'm pretty sure the LSI-11/23+ did. Or are you differentiating between the
>LSI-11 and PDP-11.

The difference between the 23 and 23+ was that the *physical* address space
got larger.  (Specifically, DEC started using some extra bits that the MMU
was already producing.)  The CPU remained unchanged, and its MMU did not
implement split space.
-- 
A bit of tolerance is worth a  |     Henry Spencer at U of Toronto Zoology
megabyte of flaming.           | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

mikes@rtech.UUCP (Mike Schilling(This sentence no verb.)) (11/20/89)

From article <4103@rtech.rtech.com>, by mikes@rtech.UUCP (Mike Schilling(This sentence no verb.)):
> What the 23+ DOES have are Unibus Mapping Registers (UMRs).  

Not true of course, as has been pointed out to me.  The 23+ has no Unibus
at all. I meant the 11/24.  May Ken Olson forgive me.