Looking for:
Chapter 8. Configuring the FreeBSD Kernel | FreeBSD Documentation Portal.Free Serial Number Parallels Desktop 8 For Mac- One moment, please
Parallels Desktop 8 Activation Key for Greasemonkey - Navigation menu
Parallels Desktop 8 Activation Key [tutorial] - video Dailymotion - Documentation
The kernel is the core of the FreeBSD operating system. It is responsible for managing memory, enforcing security controls, networking, disk access, and much more. While much of FreeBSD is dynamically configurable, it is still occasionally necessary to configure and compile a custom kernel.
All of the commands listed in the examples in this chapter should be executed as root. Traditionally, FreeBSD used a monolithic kernel.
Today, most of the functionality in the FreeBSD kernel is contained in modules which can be dynamically loaded and unloaded from the kernel as necessary. This allows the running kernel to adapt immediately to new hardware and for new functionality to be brought into the kernel.
This is known as a modular kernel. Occasionally, it is still necessary to perform static kernel configuration. Sometimes the needed functionality is so tied to the kernel that it can not be made dynamically loadable. Some security environments prevent the loading and unloading of kernel modules and require that only needed functionality is statically compiled into the kernel.
Building a custom kernel is often a rite of passage for advanced BSD users. This process, while time consuming, can provide benefits to the FreeBSD system. This has a number of benefits, such as:. Faster boot time. Since the kernel will only probe the hardware on the system, the time it takes the system to boot can decrease. Lower memory usage. This is important because the kernel code remains resident in physical memory at all times, preventing that memory from being used by applications.
For this reason, a custom kernel is useful on a system with a small amount of RAM. Additional hardware support. Before building a custom kernel, consider the reason for doing so. If there is a need for specific hardware support, it may already exist as a module. Most kernel drivers have a loadable module and manual page. For example, the ath 4 wireless Ethernet driver has the following information in its manual page:.
This is mostly true for certain subsystems. On a dual-boot system, the inventory can be created from the other operating system. If FreeBSD is the only installed operating system, use dmesg 8 to determine the hardware that was found and listed during the boot probe.
Most device drivers on FreeBSD have a manual page which lists the hardware supported by that driver. For example, the following lines indicate that the psm 4 driver found a mouse:. Since this hardware exists, this driver should not be removed from a custom kernel configuration file.
Another tool for finding hardware is pciconf 8 , which provides more verbose output. For example:. This output shows that the ath driver located a wireless Ethernet device.
The -k flag of man 1 can be used to provide useful information. For example, it can be used to display a list of manual pages which contain a particular device brand or name:. Once the hardware inventory list is created, refer to it to ensure that drivers for installed hardware are not removed as the custom kernel configuration is edited. In order to create a custom kernel configuration file and build a custom kernel, the full FreeBSD source tree must first be installed.
This directory contains a number of subdirectories, including those which represent the following supported architectures: amd64 , i , powerpc , and sparc Instead, copy the file to a different name and make edits to the copy.
The convention is to use a name with all capital letters. The default editor is vi, though an easier editor for beginners, called ee, is also installed with FreeBSD.
The format of the kernel configuration file is simple. Each line contains a keyword that represents a device or subsystem, an argument, and a brief description. Any text after a is considered a comment and ignored. To remove kernel support for a device or subsystem, put a at the beginning of the line representing that device or subsystem. Do not add or remove a for any line that you do not understand. It is easy to remove support for a device or option and end up with a broken kernel.
For example, if the ata 4 driver is removed from the kernel configuration file, a system using ATA disk drivers may not boot. When in doubt, just leave support in the kernel. Alternately, keep the kernel configuration file elsewhere and create a symbolic link to the file:. An include directive is available for use in configuration files. This allows another configuration file to be included in the current one, making it easy to maintain small changes relative to an existing file.
If only a small number of additional options or drivers are required, this allows a delta to be maintained with respect to GENERIC , as seen in this example:. As upgrades are performed, new features added to GENERIC will also be added to the local kernel unless they are specifically prevented using nooptions or nodevice.
A comprehensive list of configuration directives and their descriptions may be found in config 5. To build a file which contains all available options, run the following command as root :. Once the edits to the custom configuration file have been saved, the source code for the kernel can be compiled using the following steps:. Install the new kernel associated with the specified kernel configuration file.
Shutdown the system and reboot into the new kernel. If something goes wrong, refer to The kernel does not boot. By default, when a custom kernel is compiled, all kernel modules are rebuilt. For example, this variable specifies the list of modules to build instead of using the default of building all modules:.
Additional variables are available. Refer to make. If config fails, it will print the line number that is incorrect. If make fails, it is usually due to an error in the kernel configuration file which is not severe enough for config to catch. Review the configuration, and if the problem is not apparent, send an email to the FreeBSD general questions mailing list which contains the kernel configuration file.
If the new kernel does not boot or fails to recognize devices, do not panic! Fortunately, FreeBSD has an excellent mechanism for recovering from incompatible kernels. Simply choose the kernel to boot from at the FreeBSD boot loader. This can be accessed when the system boot menu appears by selecting the "Escape to a loader prompt" option.
At the prompt, type boot kernel. After booting with a good kernel, check over the configuration file and try to build it again. Also, dmesg 8 will print the kernel messages from the current boot. When troubleshooting a kernel, make sure to keep a copy of GENERIC , or some other kernel that is known to work, as a different name that will not get erased on the next build. This is important because every time a new kernel is installed, kernel. As soon as possible, move the working kernel by renaming the directory containing the good kernel:.
To fix this, recompile and install a world built with the same version of the source tree as the kernel. It is never a good idea to use a different version of the kernel than the rest of the operating system. Last modified on : December 27, by Li-Wen Hsu. Book menu. Table of Contents 8. Synopsis 8. Why Build a Custom Kernel? Finding the System Hardware 8. The Configuration File 8.
Building and Installing a Custom Kernel 8. If Something Goes Wrong. When to build a custom kernel. How to take a hardware inventory. How to customize a kernel configuration file. How to use the kernel configuration file to create and build a new kernel. How to install the new kernel. How to troubleshoot if things go wrong. Alternatively, to load the driver as a module at boot time, place the following line in loader.
The Configuration File In order to create a custom kernel configuration file and build a custom kernel, the full FreeBSD source tree must first be installed. Building and Installing a Custom Kernel Once the edits to the custom configuration file have been saved, the source code for the kernel can be compiled using the following steps:. Procedure: Building a Kernel.
Change to this directory:.
Comments
Post a Comment