That reminds me, I stumbled upon the website of the
Unix Heritage Society (http://www.tuhs.org/) which has the source code for the early versions of Unix.
Here is the first version
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V1
I did not really spend enough time reading the source to understand what's going on but it's interesting regardless.