Editing and compiling FreeBSD source

Mike Meyer mwm at mired.org
Fri Sep 17 22:36:04 PDT 2004


In <7ea4ce2e54aa7d07618278640e7be260 at 200.140.233.95>, Cantarella <cantarella at senffnet.com.br> typed:
> 
>    This is my first e-mail for this list.
>    I am interested in studing to better understand FreeBSD´s source code.
>    With 'make buildkernel' and 'make installkernel' is it possible to
>    compile the changes that I have made?
>    The changes are simple (just some printf). I am just beginning this
>    trip through FreeBSD´s source code.

That will work, but it's the painfull way to do it. The old way is
easier to do development with:

1) cd /usr/src/sys/i386/conf
2) config YOURCONFIG
3) cd ../../compile/YOURCONFIG
4) make depend
5) make install

You only have to go back to step 1 if you touch the config file. You
only have to go back to step 4 if you add #include statements to a
source file. Most of the time, you simply redo the "make install", and
it only recompiles what you've changed and relinks the
kernel. buildkernel and installkernel will recompile everything every
time.

This won't remake kernel modules - but you can do "make's" in
/usr/src/sys/modules/* to deal with those.

	<mike
-- 
Mike Meyer <mwm at mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.


More information about the freebsd-hackers mailing list