[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:

newproc()
{
        /*
         * make proc entry for new proc
         */
	/*
         * swap out old process
         * to make image of new proc
         */
}
(http://minnie.cs.adfa.edu.au/UnixTree/Nsys/sys/nsys/ken/slp.c.html)

We don't have kernel source for V4 :-(. It looks like V5 also swaps
the parent out:
http://minnie.cs.adfa.edu.au/UnixTree/V5/usr/sys/ken/slp.c.html


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

newproc()
{
	/*
         * If there is not enough core for the
         * new process, swap out the current process to generate the
         * copy.
         */
        if(a2 == NULL) {
                savu(u.u_ssav);
                xswap(rpp, 0, 0);
        } else {
        /*
         * There is core, so just copy.
         */
                rpp->p_addr = a2;
                while(n--) copyseg(a1++, a2++);
        }
        u.u_procp = rip;
        return(0);
}
(http://minnie.cs.adfa.edu.au/UnixTree/V6/usr/sys/ken/slp.c.html)

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

	Warren

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