FreeBSD kernel Debugging tools for Virtual Memory Module

Dag-Erling Smørgrav des at des.no
Mon Jan 5 15:50:07 UTC 2009


Eugene Grosbein <eugen at kuzbass.ru> writes:
> First, you need to recompile source you change for sure :-)
> But you have not rebuild all other files all the time.
> You need to add to your /etc/src.conf (or /etc/make.conf for 6.x and earlier):
>
> MODULES_WITH_WORLD=yes
>
> This will skip rebuilding of all modules during 'make buildkernel'
> but you MUST to copy all modules from /boot/kernel to /boot/modules
> (all files other than /boot/kernel/kernel*) if you do this.

What is the point, if you use NO_KERNELCLEAN as recommended below?  The
modules won't be rebuilt either unless something that affects them has
changed.  Running a new kernel with old modules is a great way to shoot
yourself in the foot.

If you absolutely want to skip modules, build your kernel with
-DNO_MODULES, but install it normally, or use reinstallkernel instead of
installkernel.  The latter will overwrite your running kernel - but you
should keep an unmodified kernel around anyway.

You can boot entirely without modules if you include everything you need
(including acpi) in your kernel config.

> Then, if you do not change kernel config file,
> recompile your changes with command (only second time and then):
>
> cd /usr/src; make NO_KERNELDEPEND=yes NO_KERNELCLEAN=yes buildkernel

You should not use -DNO_KERNELDEPEND unless you know for sure that no
#include directives have been added or removed and no kernel options
have changed.

It is safe to use -DNO_KERNELCLEAN, but not -DNO_KERNELDEPEND, even if
your config file changed.

> Second, you should use some kind of virtual machine (like qemu from
> ports) to speedup your development cycle even more: install the system
> into virtual machine and you'll need not another box to debug the
> kernel and need not rebuild your development box. Test your changes
> with the system installed into VM and reboot it only. Use ddb or kgdb
> already noted here.

The best solution by far is to use actual hardware and netboot from your
development machine.  It's easy to set up, and you don't lose context
every time you reboot the test system.

DES
-- 
Dag-Erling Smørgrav - des at des.no


More information about the freebsd-questions mailing list