Configuration File Format


Kernel configuration is done via text files. There is no fancy graphical utility to configure the kernel, no menu-driven system; it's still much the same as found in 4.4BSD. (If you're not comfortable with text configuration files, you have absolutely no business building your own kernel.)

Each kernel configuration entry is on a single line. There is a label to indicate what sort of entry this is and then a description of the entry. Many entries also have comments, set off with a pound sign, much like this:

 option        FFS          # UFS 

The various configuration choices available for OpenBSD 3.3 are discussed in some detail in Appendix A. Later and earlier releases are slightly different, as the kernel evolves between releases. There are four different types of labels for kernel configuration entries: options, device drivers, pseudo-devices, and miscellaneous instructions.

Options are kernel functions that are not tied to or dependent on particular hardware. Options handle things like file systems, networking protocols, and compatibility layers. The boot-time kernel configuration tool is a kernel option. All options are labeled with "option."

Device drivers give the kernel the necessary information to support particular pieces of hardware. If you want OpenBSD to support a particular piece of hardware, the kernel must include the appropriate device driver. Device drivers kernel configuration entries are frequently quite long and include flags and settings that tell the kernel where to find the device and how it should be handled. Device drivers have no common label, but their entry starts with the name of the device.

 ec0     at isa? port 0x250 iomem 0xd8000 irq 9  # 3C503 ethernet 

Pseudo-devices are kernel entries that behave much like devices, but they have no real hardware attached to them. Pseudo-devices are frequently abstractions that sit on top of other hardware. They can be open, read to, written to, and closed, just like real hardware. For example, the packet filter sits on top of the network stack and captures network traffic. The loopback device is used for network connections to the local machine and has no actual hardware associated to it. The kernel will attach this pseudo-device to whatever appropriate hardware it finds. Pseudo-devices are labeled with "pseudo-device," much like this.

 pseudo-device   loop    2     # network loopback 

Finally, you have instructions directly to the kernel configuration process. You can have instructions to make(1), marked by the "makeoptions" label, or instructions to the config program itself. Here's an example of an instruction to config(8).

 config          bsd     swap generic 

With that information, you're ready to look at an actual kernel configuration.




Absolute Openbsd(c) Unix for the Practical Paranoid
Absolute OpenBSD: Unix for the Practical Paranoid
ISBN: 1886411999
EAN: 2147483647
Year: 2005
Pages: 298

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net