Sean Hincheeinitial push75d07b48 years agoHistory
722 lines · 6.4 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>Compiling kernels (Diff)</title></head><body><h1><a name="top"></a>Compiling kernels <i>-Diff-</i></h1> <div class='body'> <!-- ***************************** --> <hr /><div class='diff_head'><a href="index.html">Sun Mar  2 11:36:20 EST 2008</a>, stella</div><hr />ThesourceforthePlan9kernels(otherthantheoriginalstandalonefileserverkernelsin/sys/src/fs)iskeptin/sys/src/9.ThedistributionincludeskernelsfortheIntelPC,theAlphaPC,aMIPS-basedworkstationcalledaCarrera,theCompaqiPAQ(bitsy),andaPowerPC-basedembeddedsystem.<p class='para'>Themachine-independentsourcecodeisin/sys/src/9/port.Eacharchitecturealsohasamachine-dependentdirectory:pc,alphapc,carrera,mpc,andsoon.</p> <p class='para'>Tobuildakernelforapre-existingconfigurationyoucdintothecorrespondingarchdirectoryandthenrunmkwiththeCONFvariablesettotheconfigurationfileyouwanttouse.</p> <p class='para'>Forexampletobuildthedefaultterminalkernelpcf:<pre>cd /sys/src/9/pcmk 'CONF=pcf'</pre> </p> <p class='para'>Toinstallthenewkernelcopythegeneratedkernelwiththenameoftheconfigfileprecededby9(eg.,9pcf)toyour9fatdirectory:<pre>9fat:cp /sys/src/9/pc/9pcf /n/9fat/</pre> </p> <p class='para'>Itisrecommendedthatyoukeepyouroldkernelaroundsoyoucanbootitincasesomethingiswrongwiththenewone,fordetailsofhowtodothissee<a href="http://plan9.bell-labs.com/magic/man2html/8/plan9.ini"><i>plan9.ini</i>(8)</a></p> <a name="HOW_TO_CONFIGURE_A_CUSTOM_KERNEL" /><h3>HOW TO CONFIGURE A CUSTOM KERNEL</h3> <p class='para'>AdistinctionismadebetweenthekernelconfigurationforterminalsandforCPUservers:theyhaveslightlydifferentbootsequences,anddifferentkernel-to-usermemoryratios.</p> <p class='para'>Eachkernelisdescribedbyaconfigurationfile.Forexample,thisisanabridgedversionofthepcdiskterminalconfigurationfile/sys/src/9/pc/pcdisk.</p> <pre>dev	root	cons	arch	env	ip link	ether2000 ether8390	ethermedium misc	archmp mp apic	kfs.root	vgamach64xx +cur	vgamga2164w +cur ip	il	tcp port	int cpuserver = 0; boot boot #S/sdC0/	il	local</pre> <p class='para'>Theformatissimple:eachwordoneachindentedlineisthenameofanobjectfiletolink.Thenon-indentedlinesmarksections.Youcanincludeorexcludevariousdriversbyinsertingorremovinglines.</p> <p class='para'>The<a href="../bootdir">bootdir</a>sectiondescribeshowthethe#//bootdirectoryispopulated.</p> <p class='para'>Youmightwanttoeditapre-existingkernelconfigurationfileifforexampleyouwanttobuildastandaloneterminal/CPU/authserverbutthedefaultserverconfigurationdoesn'thaveyourvideocarddriver.Torebuild9pccpufwithyourcarddriver,edit/sys/src/9/pc/pccpufandaddtheappropriatevgaline.</p> <p class='para'>Formultiprocessors,makesuretheline</p> <pre>	archmp		mp apic</pre> <p class='para'>appearsinyourconfigfileorthenewkernelwillonlyuseoneCPU.</p> <p class='para'>Thenrebuildthatkernelandinstallit:</p> <pre>cd /sys/src/9/pcmk 'CONF=pccpuf'cp 9pccpuf /3869fat:cp 9pccpuf /n/9fat/</pre> <p class='para'>Theargumenttomkspecifieswhichconfigurationfiletouse.Thedefaultforthepckernelsis``pc''.</p> <p class='para'>Itisusuallybesttoplayinacopyoftheconfigfilesratherthaneditthemdirectly.Thenyoucanmkwith</p> <pre>mk 'CONF=pcmyusername'</pre> <p class='para'>Butevenifyou

Lines 1–500 of 722.