From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 27 23:36:22 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F1F016A41F for ; Thu, 27 Oct 2005 23:36:22 +0000 (GMT) (envelope-from dmw@unete.cl) Received: from qmail2.ifxnetworks.com (qmail2.ifxnetworks.com [200.110.128.9]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1962743D48 for ; Thu, 27 Oct 2005 23:36:20 +0000 (GMT) (envelope-from dmw@unete.cl) Received: (qmail 32108 invoked from network); 27 Oct 2005 23:36:19 -0000 Received: from unknown (HELO hopto.org) ([200.73.29.233]) (envelope-sender ) by qmail2.ifxnetworks.com (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 27 Oct 2005 23:36:14 -0000 Received: from hopto.org (null@localhost.daemon.cl [127.0.0.1]) by hopto.org (8.13.4/8.13.1) with ESMTP id j9RNacGF039446; Thu, 27 Oct 2005 20:36:38 -0300 (CLST) (envelope-from dmw@unete.cl) Received: (from dmw@localhost) by hopto.org (8.13.4/8.13.1/Submit) id j9RNabjr039445; Thu, 27 Oct 2005 20:36:37 -0300 (CLST) (envelope-from dmw@unete.cl) X-Authentication-Warning: dmw.hopto.org: dmw set sender to dmw@unete.cl using -f Date: Thu, 27 Oct 2005 20:36:36 -0300 From: Daniel Molina Wegener To: ray@redshift.com Message-ID: <20051027233636.GA39380@dmw.hopto.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Description: message Content-Disposition: inline In-Reply-To: <3.0.1.32.20051027051451.00a842c0@pop.redshift.com> Organization: DMW Cc: kamal kc , freebsd , freebsd Subject: Re: compiling the kernel faster X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Molina Wegener List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 23:36:22 -0000 On Thu, Oct 27, 2005 at 05:14:51AM -0700, ray@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