kernel configuration and debug
FreeBSD next boot
root@fbsd:/usr/src # nextboot -k kernel.safe root@fbsd:/usr/src # ll /boot/nextboot.conf -rw------- 1 root wheel 43B Apr 15 10:48 /boot/nextboot.conf root@fbsd:/usr/src # cat /boot/nextboot.conf nextboot_enable="YES" kernel="kernel.safe" root@fbsd:/usr/src #
FreeBSD install kgdb
cc@fbsd:~ % cd /usr/ports/devel/gdb cc@fbsd:/usr/ports/devel/gdb % sudo make install clean BATCH="YES"
FreeBSD Kernel config file options
To compile with -O0, update this line in the kernel config file
makeoptions DEBUG="-g -O0"
FreeBSD build a new kernel
root@fbsd:/usr/src # make -j`sysctl -n hw.ncpu` kernel KERNCONF=MYKERNEL > /tmp/kernel.log
Ubuntu Linux build a new kernel
apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev packaging-dev fakeroot bc git python3 dwarves cp /boot/config-$(uname -r) .config make olddefconfig make localmodconfig make menuconfig make clean make -j `nproc` bindeb-pkg LOCALVERSION=-custom > /tmp/kernel.log cd .. dpkg -i *.deb