compiling the kernel faster
Daniel Molina Wegener
dmw at unete.cl
Thu Oct 27 16:36:22 PDT 2005
On Thu, Oct 27, 2005 at 05:14:51AM -0700,
ray at redshift.com wrote:
> At 04:54 AM 10/27/2005 -0700, kamal kc wrote:
> | hello everybody,
> |
> | i am new to kernel programming.
> | i am developing a compression/decompression
> | functionality in the ip layer.
> |
> | i want to compile the kernel faster.
> |
> | it would
> | be ok if the kernel doesn't have support for sound
> | devices, or other devices like scsi,usb etc. because
> | i would be using the compiled kernel for
> | network data compression only.
> |
> | how could i do that. which source files and where in
> | the makefiles do i make modifications ????
> |
> | thanks for any suggestions
> |
> | kamal
>
> Kamal,
>
> The files you modify to drop stuff out of the kernel are in
> /sys/i386/conf/ (assuming you are on an Intel platform). Copy
> the GENERIC file in there to something else (e.g DEVKERNEL),
> then edit that file.
That's OK, also can take a look into the NOTES kernel config
for additional options.
> Comment out any drivers you don't need using # (check your
> dmesg output when you boot to see what drivers the OS is
> loading for your hardware). Don't comment out anything unless
> it's obviously something you don't need - doublt check the
> dmesg for stuff like network drivers, hard drive stuff, etc.)
>
> Once you comment out the drivers, you will need to re-compile
> the kernel. Go into /sys/i386/conf/ directory type this:
>
> config DEVKERNEL (using the example above)
>
> then change into the directory it shows you (should be
> something like ../compile/DEVKERNEL or something like that)
> and type this:
>
> make depend && make all install clean
>
> that will compile the new kernel and leave it in /boot/kernel
> (it will also backup your old kernel into kernel.old)
Here are new instructions to compile the kernel.
Go to the root source directory -- usually /usr/src -- then...
make buildkernel KERNCONF=DEVKERNEL
But, before making a new kernel, if you add new devices, edit
the src/sys/conf/files to add the device properly.
> go into /boot/kernel/ and type this:
>
> strip -s *
>
> then reboot using shutdown -r now
Nope, if you are developing over the kernel _never_ strip the
symbol table. Do not use the strip command. Instead, use the
kernel config command flag in the DEVKERNEL config file.
makeoptions DEBUG=-g
This will enable symbol tables on the kernel for debugging
purposes ;)
> If all goes well, you should boot to the new kernel. You can
> use the uname -a command to make sure you are on the new
> kernel okay. If the machine won't boot, you can boot into
> single user mode and copy the old kernel back in place.
>
> An excellent book on the subject is:
>
> Absolute BSD: The Ultimate Guide to FreeBSD (Paperback)
>
> good luck.
>
> Ray
That's OK
Also take a look on the FreeBSD Documetation Proyect.
Regards.
--
. 0 . | Daniel Molina Wegener
. . 0 | dmw at unete dot cl
0 0 0 | FreeBSD Power User
More information about the freebsd-net
mailing list