This is just an introduction into compiling your own FreeBSD kernel. For more detailed information, check out the FreeBSD Handbook.
root# mkdir [my kernel dir] root# cd /usr/src/sys root# tar cvf - . | (cd [my kernel dir]; tar xf -)
Here, if you want an ALTQ kernel, replace "DIRT" with "ALTQ.1000" or "ALTQ.100" depending upon the clock speed you want.
root# cd [my kernel dir]/i386/conf/ root# cp DIRT [my kernel name] root# config [my kernel name]
root# cd ../../compile/[my kernel name] root# make depend root# make clean root# make
root# cp [my kernel dir]/compile/[my kernel name]/kernel /kernel.[my kernel name] root# chflags noschg /kernel root# cp /kernel /kernel.prev root# cp /kernel.[my kernel name] /kernel root# chflags schg /kernel/usr/dirt/bin/change_kernel follows these steps.
Use uname -a to check that the new kernel is running (after rebooting, obviously.)
Compiling a 4.10 kernel gave me (Felix) some problems today. The procedure above failed in the make step, so I went back to the FreeBSD handbook and read about a new method (running make buildkernel KERNCONF=MYKERNEL in /usr/src). This worked like a charm (but the kernel binary ended up under /usr/obj).