[net.unix-wizards] how to do overlays in v7???

drew@genix.UUCP (04/05/84)

After grepping the documentaion on our system this is all I was
able to come up with:

  from ld(1):

     -O   This is an overlay file, only the text segment will be
          replaced by exec(2).  Shared data must have the same
          layout as in the program overlaid.

  from exec(2):

     Exec in all its forms overlays the calling process with the
     named file, then transfers to the entry point of the core
     image of the file.  There can be no return from a successful
     exec; the calling core image is lost.

  from a.out(5):

     #define A_MAGIC4 0405       /* overlay */

Hmm.  That's not much to go on.
What do I have to do to ensure the shared data has the same layout?
How dow I distinguish shared from non-shared dat?
Are that any tricks which will let me load the overlay then continue
executing in shared code.

Some trivial examples sure would help.
-- 
Drew Einhorn
{csu-cs,gatech,lanl-a,convex,pur-ee,ucbvax}!unmvax!genix!drew
P.O. Box 781, Tijeras, NM 87059, USA.
505/281-1122  505/898-9666

gwyn@brl-vgr.ARPA (Doug Gwyn ) (04/08/84)

405 overlays are not the same as Berkeley-style text overlays, which are
probably more what you want.  You can get these via 2.?BSD, V7M, or a
complete re-implementation on JHU/BRL PDP-11 UNIX.

henry@utzoo.UUCP (Henry Spencer) (04/11/84)

After some minor investigation, we added the following line to the
"BUGS" section of our ld(1) manual page:

	The proper use of overlays is an undocumented black art.

The odds are very high that V7 overlays don't do what you want.
My understanding is that they were added solely for the benefit of
Steve Bourne's (unreleased) Algol 68 compiler, and nobody else has
any idea of how they work or what they do.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry

boyd@basser.SUN (Boyd Roberts) (04/13/84)

Berkeley have an implementation of overlays (in 2.?BSD
or something) for the PDP11 (segmentation register
fiddling).  Some of the people here have implemented
them on an 11/60 and an 11/34.

I personally implemented it on an 11/23 so that my
users could use "vi" (I pleaded with them not to,
"I said Burnie, they'll never make their money").
Believe me, it's sloooooow.  But it does work.

I could probably send some doco on it (via mail)
if you mail to me.


Boyd Roberts.		...!decvax!mulga!boyd:basser

ron@BRL-TGR.ARPA (04/23/84)

From:      Ron Natalie <ron@BRL-TGR.ARPA>

The bell 405 type file overlays are not the same as the berkeley 430,431
type overlays.  The 405 was sort of a partial exec rather than runtime
remapping of the text space like the MENLO code.

-Ron