Charles.Forsyth20060303-partialeea662d19 years agoHistory
335 lines · 6.3 KB · Text
RawDownload
.TH CONF 10.6.SH NAMEconf \- native and hosted kernel configuration file.SH DESCRIPTIONNative and hosted Inferno kernels are built for a given target.I platformin the host environment in directory.BI /os/ platformor.BI /emu/ platform .Existingplatforms include.B pcand.B ipaqfor native kernels and.BR Plan9 ,.BR Linux ,.B Nt(for all versions of Windows),and.BR Solaris ,amongst others.Each.I platformcan have different kernels with different configurations.A given configuration is built in the platform's directory using the.IR mk (10.1)command:.IP.EXmk 'CONF=\fIconf\fP'.EE.PPwhere.I confis a text file that specifies drivers, protocols and other parameters for thatparticular kernel:a parts list.The result of a successful.I mkisan executable or bootable file with a name determined by the.IR platform 's.BR mkfile ,typically.BI i conffor all native platforms,.BI $O. conffor Plan 9, Unix and clones,and.BI i conf .exefor Windows..PPA kernel configuration file has several sections of the form.IP.EX.I "label".IR "	item" " [ " "subitem ..." " ]"\&	....EE.PPEach section begins with a.I labelat the start of a line, which names a configurationcategory, followed bya list of each.I itemto select from that category,one line per item, with white space (ie, blank or tab) at the start of the line.An.I itemline can optionally list one or more.I subitemsthat must be included in the kernel to support it.A line that starts with a.L #is a comment.Empty lines are ignored..PP.I Labelsare chosen from the following set, listed in the orderin which they conventionally appear in a configuration file:.TF etherxx.TP.B devDevice drivers.TP.B ipIP protocols (native kernels only) taken from.B ../ip.TP.B linkHardware-specific parts of device drivers..TP.B miscArchitecture-specific files; specific VGA and SCSI interfaces.TP.B libLibraries to link with the kernel.TP.B modBuiltin Dis modules.TP.B portPortable components (other than drivers) from.B ../port.TP.B codeC code and declarations to include as-is in the generated configuration file.TP.B initDis init program.TP.B rootList of files and directories to put in the.IR root (3)file system.PD.PPWhen an.I itemis listedunder a given.I labelit causes a corresponding component to be included in the kernel.The details depend on the.IR label ,as discussed below.Each.I subitemrepresents a kernel subcomponent required by the corresponding.IR item .Both items and subitems can be either portable (platform-independent)or platform-specific.The source file for a given item or subitemis sought in the platform-directory(for platform-specific code), andin directories.BR ../portand.BR ../ip ,under control of the platform's.BR mkfileand.B ../port/portmkfile(which is included by.BR mkfile ).Resulting object files are left in the.I platformdirectory..PPOutside the.B devsection,each item and subitem.I xcauses the kernel image to include the code compiled from.IB x .c ,(or.IB x .sor.IB x .Sfor assembly-language support),or.IB portdir / x .c ,where.I portdiris one of the portable directories mentioned above.In the.B devsection, an item.I xcorresponds instead to the driver source file.BI dev x .cin the current (platform-specific)directory or a portable driver.IB portdir /dev x .c .Subitems are handled as in any other section.Typically they are auxiliary files that are needed by the associated driver..PPFor instance, in a native kernelthe portable driver for the.B drawdevice uses platform-specific code from.BR screen.c .That can be represented as follows:.IP.EXdev	draw	screen.EE.PPEach item.I xin the.B ipsectioncorresponds to a protocol implementation compiled from.BI ../ip/ x .c .Any subitemsare dealt with in the same way as in the.B devsection..PPThe.B linksection provides a way for hardware-specificparts of drivers to link at runtime to the hardware-invariant part of a devicedrivers.For each item.IR x ,the kernel will call the function.IB x linkduring its initialisation.Typically that function makes itself known to the device driver bycalling a function provided by that driver,passing the address of a interface-specific data structure or linkage table.For example,.B ethersmcis an interface-specific component:.IP.EXlink	\fR...\fP	ethersmc.EE.PPand its source file.B ethersmc.cprovides a function.B ethersmclinkthatcalls.B addethercardin the interface-invariant part of the driver,.BR devether.c :.IP.EXvoidethersmclink(void){	addethercard("smc91cXX", reset);}.EE.PPSimilarly, during kernel initialisation, for each item.I xin the.B modsection, the kernel calls the function.IB x init ,to initialise the corresponding built-in Limbo module..PPThe.B initsection selects the first Dis program run by the system.For native kernels, a given item.I xrefers to.BI ../init/ x .dis ,which is automatically built from.BI ../init/ x .b .For hosted kernels,.B emuinitis normally used, referring to.BR /dis/emuinit.dis ..PPThe.B libsection lists the libraries to include when linking the kernel,in an order that satisfies any dependencies amongst them.Each item.I xcorresponds to.BI /$SYSTARG/$OBJTYPE/lib x .a ,a target-specific libraryproduced by compiling the C source code in.BI /lib item,where.B SYSTARGand.B OBJTYPEare set in.B mkfileto the target system and object types..PPAn item in the.B rootsectionhas one of the forms:.IP.EX.I name.I "name source".EE.PPwhere.I nameand.I sourceare both absolute path names rooted at the Inferno source tree.The kernel's initial root file system (see.IR root (3))will contain a file or directory with the given.IR name ..I Namemust exist in the Inferno root, or an existing.I sourcefile must be named.In either case,if the existing name refers to a file, the file in the root file system will have that file's current contents.If it is a directory, the root file file system will have a directory with that name,but the directory will contain only those names listed inthe configuration file as belonging to that directory..I Sourceis often.L /to force a target.I nameto be a directory..SH FILES.B /emu/port/mkdevc.br.B /emu/port/mkdevlist.br.B /emu/port/mkroot.br.B /os/port/mkdevc.br.B /os/port/mkdevlist.br.B /os/port/mkroot.SH SEE ALSO.IR mk (10.1)