NAME
conf – native and hosted kernel configuration file |
DESCRIPTION
Plan 9 kernels are built for a given target platform using platform–specific
code in directory /sys/src/9/platform and portable code in /sys/src/9/port,
/sys/src/9/ip and elsewhere. Existing platforms include alphapc
for the DEC Alpha, iPAQ for the Compaq iPAQ, pc for the Intel
x86, and ppc for
the IBM/Motorola PowerPC. Each platform can have several different
kernels with different configurations. A given configuration is
built in the platform's directory using the mk(1) command:
A kernel configuration file has several sections of the form
Labels are chosen from the following set, listed in the order
in which they conventionally appear in a configuration file: When an item is listed under a given label it causes a corresponding component to be included in the kernel. The details depend on the label, as discussed below. Each subitem represents a kernel subcomponent required by the corresponding item. Both items and subitems can be either portable (platform– independent) or platform–specific. The source file for a given item or subitem is sought in the platform–directory (for platform–specific code), and in directories ../port and ../ip, under control of the platform's mkfile and ../port/portmkfile (which is included by mkfile). Resulting object files are left in the platform directory. Outside the dev section, each item and subitem x causes the kernel image to include the code compiled from x.c, (or x.s for assembly–language support), or portdir/x.c, where portdir is one of the portable directories mentioned above. In the dev section, an item x corresponds instead to the driver source file devx.c in the current (platform–specific) directory or a portable driver portdir/devx.c. Subitems are handled as in any other section. Typically they are auxiliary files that are needed by the associated driver.
For instance, in a native kernel the portable driver for the draw
device uses platform–specific code from screen.c. That can be represented
as follows:
The link section provides a way for hardware–specific parts of
drivers to link at runtime to the hardware–invariant part of a
device drivers. For each item x, the kernel will call the function
xlink during its initialisation. Typically that function makes
itself known to the device driver by calling a function provided
by
that driver, passing the address of a interface–specific data structure
or linkage table. For example, ethersmc is an interface–specific
component:
An item in the bootdir section has one of the forms:
The port section usually contains initialisations for kernel–specific
values. The most common one is
|
FILES
/sys/src/9/port/mkdevc /sys/src/9/port/mkdevlist /sys/src/9/port/mkroot |
SEE ALSO
mk(1) |