Details of how the kernel is configured for DiRT

Goal:Have a single config file that works on all of the DiRT machines so that we don't have to maintain separate config files and compilations of kernels. It may come to that at some point but I would definitely try to avoid it.

To build a standard (not your own experimental - do that elsewhere, using this as a guildeline) kernel for us to use in the DIRT group you need to go edit the config file and make some changes. In this case we start with /usr/src/sys/i386/conf/GENERIC. First, we copy it to /usr/src/sys/i386/conf/DIRT and then start editing.

NOTE: Looking at the LINT config file in conf directory can be quite useful. It is basically the "everything including the kitchen sink" listing of devices and options so it gives a good idea of things to include.

NOTE: We still need to apply an ALTQ patch so that will probably lead to an DIRT-ALTQ config file with these changes plus the ALTQ changes.

First change the ident line from GENERIC to DIRT; this will make sure that if you do a uname -a on a machine you can tell if it's running a DIRT kernel or a GENERIC one.

ident		DIRT

Since you probably will want to know which DIRT kernel you are running (i.e. see the config file) I find it handy to turn on the INCLUDE_CONFIG_FILE option. You can then use the command in the comment below to extract the config file information from the kernel binary.

# This allows you to actually store this configuration file into
# the kernel binary itself, where it may be later read by saying:
#    strings /kernel | grep ^___ | sed -e 's/^___//' > MYKERNEL
#
options         INCLUDE_CONFIG_FILE     # Include this file in kernel

I find it useful to be able to do kernel debugging so:

#####################################################################
# DEBUGGING OPTIONS

#
# Enable the kernel debugger.
#
options		DDB

This is the only hardware related change I've had to make. I'm not really sure what the problem was but I know that on brain, howard, floyd, and goober the kernel hangs at boot up if you don't disable the ex0 device and since we don't use that particular device this is the way to go.

# this is what was there. - i needed to disable ex0 to avoid problems
# on howard, floyd, goober, etc.
#device ex0 at isa? port? net irq? vector exintr
device ex0 at isa? disable port? net irq? vector exintr

Well, now there are two changes. poirier's ep0 card is at a different location that what's expected in the standard config. So, we add:

# this is to support poirier - this matches its card and other cards
# continue to match ep0
device ep1 at isa? port 0x280 net irq 11 vector epintr

It's a good idea to increase the number of pseudo-ttys, esp. if you use X to have windows open on lots of machines as we tend to. Also, you have to add the bpf devices so we can do dumps of network traffic. I'm not sure what the discard device is.

pseudo-device	pty	64
pseudo-device	bpfilter	4	#Berkeley packet filter
pseudo-device	disc			#Discard device

To use dummynet you have to turn on the IPFIREWALL and it's recommended that you increase the clock rate (HZ) to get more precise delays. Finally, since firewalls are usually there to keep you mostly disconnected from the internet the default state is for the machine to boot up with the firewall denying ALL packets. We just want it for dummynet though so we use the IPFIREWALL_DEFAULT_TO_ACCEPT option. And, of course, we need to specify the DUMMYNET option.

options         IPFIREWALL              #firewall
options 	HZ=1000
options		IPFIREWALL_DEFAULT_TO_ACCEPT #allow everything by default

# options DUMMYNET enables the "Dummynet" bandwidth manager and
# delay emulator -- see dummynet(4) . It requires IPFIREWALL.
#
options DUMMYNET

When we installed our first FreeBSD version I quickly found that X (I think) needed more than the additional SYSV interfaces so I've added them here. Maybe it's been fixed but I don't think this hurts anything and it's annoying to have to rebuild the kernel when you install some new package that won't work because these aren't available.

# These three options provide support for System V Interface
# Definition-style interprocess communication, in the form of shared
# memory, semaphores, and message queues, respectively.
#
options		SYSVSHM
options		SYSVSEM
options		SYSVMSG
Once you've got your config file you do:
config DIRT
and, as directed:
cd ../../compile/DIRT
make depend | tee /tmp/make.depend.out
make | tee /tmp/make.out

Now, install your kernel on ALL of the dirt machines (see /usr/dirt/bin/install_kernels and /usr/dirt/bin/setup_machines for some tools to build on. Warning: setup_machines does more than just install the kernel. Don't use it as is.)

It's very important that you actually install and reboot all machines since some machines may have device conflicts that aren't present on the machine you've reconfigured for.


Other DiRT documents
Author: Mark Parris Last updated: January 3, 1999