[pups] Forks under V6

Warren Toomey wkt at henry.cs.adfa.edu.au
Tue Feb 27 10:15:44 AEST 2001

In article by Norman Wilson:
> I believe the practice John Holden describes from Mini-UNIX (only one
> process in memory at a time, hence a context switch is the same as a
> swap) was also part of the very earliest UNIXes, on the PDP-7 and the
> 11/20, neither of which had hardware memory management.  Dennis Ritchie's
> `Evolution of the UNIX Time-Sharing System' paper (in the October 1984
> Bell Labs Technical Journal, the second issue to be devoted entirely to
> UNIX), tells how it worked in some detail.  It wouldn't surprise me if
> the swap-to-fork mechanism lived on for a while even after the system
> learned about memory management, but I don't actually know that.  (Warren:
> wbat does the old system you have do?)
> Norman Wilson

For the versions on the 11/20 [that's V1, V2 and V3], as there was no
memory protection, there was only 1 process in core at any time. Thus,
the parent was definitely swapped out.

The Nsys kernel (just before V4) also swaps the parent out:

         * make proc entry for new proc
         * swap out old process
         * to make image of new proc

We don't have kernel source for V4 :-(. It looks like V5 also swaps
the parent out:

By V6, the parent could stay in core if there was enough room:

         * If there is not enough core for the
         * new process, swap out the current process to generate the
         * copy.
        if(a2 == NULL) {
                xswap(rpp, 0, 0);
        } else {
         * There is core, so just copy.
                rpp->p_addr = a2;
                while(n--) copyseg(a1++, a2++);
        u.u_procp = rip;

I've omitted some lines of code here and there.


Received: (from major at localhost)
	by minnie.cs.adfa.edu.au (8.9.3/8.9.3) id OAA56632
	for pups-liszt; Tue, 27 Feb 2001 14:06:49 +1100 (EST)
	(envelope-from owner-pups at minnie.cs.adfa.edu.au)

More information about the TUHS mailing list