Sean Hincheeinitial push75d07b48 years agoHistory
676 lines · 6.5 KB · HTML
RawDownload
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head>	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />	<meta name="keywords" content="9p, 9p2000, research, Plan 9, Inferno, Unix, Open Source, Bell Labs" />	<meta name="description" content="Open source distributed operating system Plan 9 from Bell Labs." />	<link rel="stylesheet" href="/wiki-style.css" media="all" type="text/css" />	<title>bootdir (Diff)</title></head><body><h1><a name="top"></a>bootdir <i>-Diff-</i></h1> <div class='body'> <!-- ***************************** --> <hr /><div class='diff_head'><a href="index.html">Wed Dec 28 14:58:09 EST 2005</a>, ziphos (207.183.171.11)</div><hr />InMidDecember2002,anewfeaturewasaddedtothesystem.Itchangestheprevious#//boottobeadirectoryratherthanafile,andallowswhatusedtobeabinarythathadtobecompiledtobeascriptinstead.<p class='para'>RussCoxsaidsomethinglikethisin<a href="http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&selm=606456fcdc17ce997666a1895d86f9ba%40plan9.bell-labs.com">http://groups.google.com/groups?dq=&amp;hl=en&amp;lr=&amp;ie=UTF-8&amp;selm=606456fcdc17ce997666a1895d86f9ba%40plan9.bell-labs.com</a></p> <p class='para'>Thereisanewkernelconfigfilesectioncalled"bootdir"thatliststhefilestobeplacedin#//boot.Therearenobinariesin#/itselfanymore.</p> <p class='para'>Atypicalbootdirsectionmightlooklike</p> <pre>	bootdir		bootpcdisk.out boot		/386/bin/ip/ipconfig		/386/bin/auth/factotum		/386/bin/disk/kfs		/386/bin/cfs</pre> <p class='para'>whichsaysthat/bootwillcontainfourfiles:boot,ipconfig,factotum,kfs,andcfs,copiedfromthelistedpaths.</p> <p class='para'>Thekernelshavealwaysspecialcasedboot$CONF.outtogetitlistedas/boot.Itisnow/boot/boot,andnolongeraspecialcase.</p> <p class='para'>Nowthateverythingisin/boot,initcodehadtochangeforallthekernels;/boot/bootitselfhadtochangetoexec/boot/ipconfig(insteadof/ipconfig),etc.Finally,auth_getkeychanged.Itlooksfor/factotumandthen/boot/factotum,todealwitheithertypeofkernel.</p> <p class='para'>Thebootfile/386/bin/ip/ipconfig(e.g.)turnsinto_386_bin_ip_ipconfig.root.sandthen_386_bin_ip_ipconfig.root.8.It'sabitofanuglyname,butmkcleanwillgetridofthem.Youcouldimaginejustusingthelastpathelement,butthatmightleadtoweirdbuildinconsistenciesifkernelswereusingtwodifferentfileswiththesamelastelement.Oneunfortunateconsequenceofthebignameisthat_386_bin_auth_factotum.root.sistoolongforthecurrentfileserverstodealwith.Youcoulduselnfstogetaroundthis,butIdidn'twanttorequire<a href="http://plan9.bell-labs.com/magic/man2html/4/lnfs"><i>lnfs</i>(4)</a>forthekernelbuild,sowehavearuleinportmkfilethatcopiesfactotumandipconfigtofactotum.hackandipconfig.hackandthenthebootdirsectionactuallylookslike:</p> <pre>	bootdir		bootpcdisk.out boot		ipconfig.hack ipconfig		factotum.hack factotum		/386/bin/disk/kfs		/386/bin/cfs</pre> <p class='para'>sadly.Thatwillgoawaywhenwegetlongfilenames.</p> <p class='para'>Thepcinitcodeisalsochanged.Whereasbeforeitusedtodo</p> <pre>	exec("/boot", ["boot", 0]);</pre> <p class='para'>inhand-codedassembly(pc/initcode.s),itnowdoes</p> <pre>	open("#c/cons", OREAD);	open("#c/cons", OWRITE);	open("#c/cons", OWRITE);	bind("#c", "/dev", MAFTER);	bind("#ec", "/env", MAFTER);	bind("#e", "/env", MCREATE|MAFTER);	bind("#s", "/srv", MREPL|MCREATE);	execl("/boot/boot", "/boot/boot", 0);</pre> <p class='para'>inC(port/initcode.c).Thepointistosetupenoughofanamespacethat/boot/bootcanbeashellscript.Eventuallytheotherarchitecturesshouldchangetoo,thoughit'snoturgent.Ifsomeonewantstodothebitsy,sendmemailandI'llletyouknowwhatittooktogetoneoftheoldundistributedmipskernelschangedover.(Thecompilersetupissimilar.)</p> <p class='para'>Asamuchbiggerexample,Ibuiltakernelcalledpcexttheothernight.ItusesrxandtrampolinetoconnectthroughaPlan9gatewaymachinetotherootfileserver.

Lines 1–500 of 676.