Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!henry
From: henry@utzoo.UUCP (Henry Spencer)
Newsgroups: comp.sys.atari.st
Subject: Re: Forwarded message
Message-ID: <7510@utzoo.UUCP>
Date: Sun, 11-Jan-87 00:37:30 EST
Article-I.D.: utzoo.7510
Posted: Sun Jan 11 00:37:30 1987
Date-Received: Sun, 11-Jan-87 00:37:30 EST
References: <8701022135.AA07189@ucbvax.Berkeley.EDU> <7472@utzoo.UUCP>
Organization: U of Toronto Zoology
Lines: 20

> ...implementing fork().  The two approaches that have been discussed are
> using a compiler which generates relocatable code, and swapping a program
> into and out of a fixed area of memory. ...
> Well, I was all ready to give up on the idea as too much effort, when I was
> told that the Megamax C compiler generates fully relocatable code.  All
> code is either PC relative, or referenced through an address register which
> contains the location of the base of the code/data area. ...

Relocatable code is one thing; relocatable data is quite another.  Modern
machines generally make it fairly easy to generate code which is not tied
to specific assumptions about its own location or the location of its data
areas, but avoiding absolute addresses in the data is another story.  I
would be very surprised if a Megamax C pointer variable did not contain an
absolute address.  Absolute addresses also show up in things like return
addresses on the stack.  Fixing this is a lot of work and costs a lot in
speed.  Better to copy chunks of memory around; that will not be too bad
*IF* the programs stay small.  (Most of the MINIX utilities are small.)
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,decvax,pyramid}!utzoo!henry