Subject: Re: NetBSD without MMU ?
To: Lennart Augustsson <lennart@augustsson.net>
From: Wes Peters <wes@softweyr.com>
List: tech-ports
Date: 04/15/2002 20:21:09
Lennart Augustsson wrote:
>
> > : You don't _need_ an MMU to implement fork().... (eg. as in MINIX)
> > However, you do have to do some really major evil and hack the compiler to
> > make all code PIC-and-then-some (ensuring base register relative addressing
> > for all data accesses).
> Not at all. Original Unix implemented fork() without PIC. What you do
> is that you copy all of the current process to swap space and then you
> make that process the parent (well, I guess you could make it the child
> if you want). Context switch will be somewhat slow since it will
> require a swapping out and in.
One of the big improvements in many UNIX implementations in the early 80s
was to implement "shared text" - i.e. copy the data+bss segments but share
the text segment between processes. This saved memory and fork time both.
> Now, this particular solution may not apply if you don't have swap space. :)
Some of those old systems ran fine with no swap, right up until you tried
to load a large file into the editor. You get what you pay for.
--
"Where am I, and what am I doing in this handbasket?"
Wes Peters Softweyr LLC
wes@softweyr.com http://softweyr.com/