For build kernel we need installed source code(/usr/src) FreeBSD.

There are 2 ways to build kernel.

1st way.

Go to /usr/src/sys/i386/conf.

# cd /usr/src/sys/i386/conf


Copy original config to own config.

# cp GENERIC SIMPLEBSDKERN


Launch build configuration.

# config SIMPLEBSDKERN


Go to directory with configuration.

# cd /usr/src/sys/i386/compile/SIMPLEBSDKERN


Launch setup configuration.

# make depend


Build kernel.

# make


Install kernel into the system.

# make install


All commands must works without errors.

Restart server.

# reboot


Check kernel.

# uname -a

 

2nd way.

# cd /usr/src/sys/i386/conf
# cp GENERIC SIMPLEBSDKERN
# cd /usr/src
# make buildkernel KERNCONF=SIMPLEBSDKERN
# make installkernel KERNCONF=SIMPLEBSDKERN