Ever since my college days, I’ve always loved having my own
compiled
nucleus. It gave me that special feeling of “my machine is better
that
yours.” I’m sure that every time my new core boots the feeling that
to have
It’s the same thing Super Man has when he hits the bad guys.
people.
A custom kernel boots the system faster, takes up less
memory space and one can install drivers for hardware not
supported by a default kernel. In addition to these benefits, a custom
nucleus
it serves as an interesting topic of conversation with geeks. Just ask
to them
“What is the size of its nucleus?”. This would keep the geek busy for
at some point where he would explain all the great things he did to
tea
kernel options to optimize your box.
If you’re a geek yourself, this is a great question to ask.
presented to those humble Nubians. They will never bother you
with stories of his nephew or younger sister after this 😀
Before we start compiling our own kernel, it is a
wonderfull idea
to make a backup of the current kernel.
# cd /boot
# cp -pvr kernel kernel.orig
The original generic kernel is now stored as kernel.orig. In
case the
kernel won’t boot (which has happened to me many times)
start up
with the generic kernel and try again. Booting any other kernel
it is
easy. At boot time, go to the boot prompt and just say
“boot
kernel.orig” and the default kernel would boot.
The kernel sources are located in the /usr/src/sys directory. Yew
No
installed, the kernel sources can be installed with the
Following
orders. First insert the FreeBSD installation CD into your CD drive.
# mount /cdrom
# mkdir -p /usr/src/sys
# ln -s /usr/src/sys /sys
# cat /cdrom/src/ssys.[a-d]* | tar -xzvf
-
Then go to the director where the configuration files are.
lying.
#cd /sys/i386/conf
In this directory is the GENERIC kernel configuration file.
lying.
Copy this file and put it as your custom name.
#cp -pvr BABYBSD GENERIC
# saw BABYBSD
First change the id value from GENERIC to BABYBSD (or
any name
you prefer). I have given my sample config file in the
end of
This article. The options are fairly easy to understand and a
Okay
the starting point would be FreeBSD
Manual that has documented most of the kernel options.
You can also go to a shell and run the command #fuzz
in
this directory I would create a file called LINT that has
everybody
options supported by the enumerated kernel.
After this stage just run the following commands
#/usr/sbin/config BABYBSD
#cd ../compile/BABYBSD
#do depends
#do
#do installation
Note that you must be root to run make install.
reboot and
the kernel should boot with your new shiny kernel. 🙂
# My sample kernel configuration file for FreeBSD/i386
i386 machine
CPU
I586_CPU
CPU
I686_CPU
identity
BABYBSD
SCHED_4BSD Options
#4BSD programmer
INET-options
#InterNETworking
INET6 Options
# IPv6 communication protocols
FFS Options
#Berkeley Fast File System
SOFT UPDATES Options
# Enable FFS soft update support
UFS_ACL Options
# Support for access control lists
UFS_DIRHASH Options
# Improve performance on large directories
MD_ROOT Options
# MD is a potential root device
NFSCLIENT Options
# Network file system client
nfsserver-options
# Network file system server
NFS_ROOT Options
# NFS usable as /, requires NFSCLIENT
MSDOSFS Options
#MSDOS file system
NTFS Options
options CD9660
# ISO 9660 file system
PROCFS Options
# Process file system (requires PSEUDOFS)
PSEUDOFS Options
# Pseudo-filesystem framework
GEOM_GPT Options
# GUID partition tables.
Options COMPAT_43
# Compatible with BSD 4.3 [KEEP THIS!]
COMPAT_FREEBSD4 Options
# FreeBSD4 compatible
options SCSI_DELAY=15000 #
delay
(in ms) before testing SCSI
KTRACE Options
# compatibility with ktrace(1)
SYSVSHM Options
# SYSV style shared memory
SYSVMSG Options
# SYSV-style message queues
SYSVSEM Options
# SYSV-style semaphores
_KPOSIX_PRIORITY_SCHEDULING#POSIX options
P1003_1B
real time extensions
KBD_INSTALL_CDEV# options
install on pc
a CDEV entry in /dev
options
AHC_REG_PRETTY_PRINT #
Print register bit fields in debug
# production. ~128k
a
driver.
options
AHD_REG_PRETTY_PRINT#
Print register bit fields in debug
# production. Add ~215k
a
driver.
ADAPTIVE_GIANT Options
# The giant mutex is adaptive.
device
apex
# I/O APICs
# Carrier bus. Don’t delete isa, even if you don’t have isa
slots
isa device
eisa device
device pci
# floppy drives
fdc device
# ATA and ATAPI devices
ata device
device
atadisk
# ATA drives
device
atapicd
# ATAPI CD-ROM drives
ATA_STATIC_ID# Options
Static
device numbering
# SCSI peripherals
device
bus
# SCSI bus (required for SCSI)
device channel
# SCSI media changers
device
# Direct access (disks)
device compact disc
#CD
device
spend
# Transfer device (direct SCSI access)
device
its
# SCSI environmental services (and
SAF-TE)
# atkbdc0 controls both PS/2 keyboard and mouse
device
atkbdc
# AT keyboard driver
device
atkbd
# On the keyboard
device
psm
# PS/2 mouse
device
vga
# VGA video card driver
device
splash
# Splash screen and screensaver support
# syscons is the default console driver, similar to a SCO
console
sc device
# Enable this for pcvt console driver (VT220 compatible)
#vt device
#XSERVER Options
# support for X server in a vt console
#FAT_CURSOR options #boot
with
block cursor
device
agp
# supports multiple AGP chipsets
# Floating point support – do not disable.
npx device
# Power management support (see NOTES for more options)
device #apm
# Add suspend/resume support for the i8254.
pmtimer device
# PCI Ethernet NICs that use the common MII bus controller
encoded
# NOTE: Be sure to keep the ‘device miibus’ line to use
thesis
NICK!
device
mibus
# MII bus support
device-rl
#RealTek 8129/8139
# Wireless NIC cards
device
Wifi
#802.11 support
# Pseudodevices.
device
circle
# network loop
device
same
# Memory and kernel memory devices
io-device
# I/O device
device
random
# entropy device
device
ether
# Ethernet support
sl device
# core slip
device
dpi
# core PPP
device
melody
# Packet-tunnel.
device
pty
# Pseudo-ttys (telnet, etc.)
MD device
# memory “disks”
device
gif
# IPv6 and IPv4 tunnels
device
faith
# IPv6 to IPv4 forwarding (translation)
# The `bpf’ device turns on the Berkeley packet filter.
# Be aware of the administrative consequences of enabling
East!
# Note that ‘bpf’ is required for DHCP.
device
gmp
# Berkeley Packet Filter
# USB support
device
uhci
# Interface UHCI PCI->USB
device
oh hey
# OHCI PCI->USB Interface
device
ehci
# EHCI PCI->USB interface (USB 2.0)
device
USB
# USB bus (required)
#device
udbp
# Bulk Dual Pipe USB Devices
device
ugen
# Generic
device
uhh
# “Human Interface Devices”
device
ukbd
# Keyboard
device
umass
# Disks/mass storage: requires scbus and
there
device
ums
#Mouse
# Specific to my machine
device
atapikam
# for the CD burner to be detected by K3B and other CD writers
software
device
sound
# To enable sound
device
“snd_ad1816”
device
“snd_als4000”
device
snd_cmi
device
“snd_cs4281”
device
snd_csa
device
“snd_ds1”
device
“snd_emu10k1”
device
“snd_es137x”
device
snd_ess
device
“snd_fm801”
device
snd_gusc
device
snd_ich
device
snd_master
device
“snd_master3”
device
snd_mss
device
snd_neomagic
device
“snd_sb16”
device
snd_sbc
device
snd_only
device
“snd_t4dwave”
device
“snd_via8233”
device
“snd_via82c686”
device
snd_vibes
device
snd_uaudio
pcii device
device
acpi
device
acpi_asus
device
acpi_video
device
cbb
# cardbus (sale) bridge
device
pc# card
computer card
bus (16 bit)
device
card bus#
card bus
bus (32 bit)
DEVICE_POLLING Options
options HZ=1000
PERFORMANCE Options
device
apm_saver # Requires APM
options
AUTO_EOI_1
AUTO_EOI_2 options
VESA Options