Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 05 Jan 2009 16:33:22 +0100
From:      =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= <>
To:        Eugene Grosbein <>
Cc:, Kamlesh Patel <>,
Subject:   Re: FreeBSD kernel Debugging tools for Virtual Memory Module
Message-ID:  <>
In-Reply-To: <> (Eugene Grosbein's message of "Fri, 2 Jan 2009 15:21:17 +0700")
References:  <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
Eugene Grosbein <> 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 earl=
> 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=3Dyes NO_KERNELCLEAN=3Dyes 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.

Dag-Erling Sm=C3=B8rgrav -

Want to link to this message? Use this URL: <>