From owner-freebsd-current@FreeBSD.ORG Tue Mar 8 20:52:16 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C620E106572B for ; Tue, 8 Mar 2011 20:52:16 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (lev.vlakno.cz [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 798278FC14 for ; Tue, 8 Mar 2011 20:52:16 +0000 (UTC) Received: from lev.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id A1C019CB118; Tue, 8 Mar 2011 21:52:14 +0100 (CET) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by lev.vlakno.cz (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kvdx8qcA80KN; Tue, 8 Mar 2011 21:52:13 +0100 (CET) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id EB5B69CB2E9; Tue, 8 Mar 2011 21:52:12 +0100 (CET) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.4/8.14.4/Submit) id p28KqCSs096577; Tue, 8 Mar 2011 21:52:12 +0100 (CET) (envelope-from rdivacky) Date: Tue, 8 Mar 2011 21:52:12 +0100 From: Roman Divacky To: Fabian Keil Message-ID: <20110308205212.GA96321@freebsd.org> References: <20110308173909.GA71091@freebsd.org> <20110308211931.1c5deb8b@r500.local> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20110308211931.1c5deb8b@r500.local> User-Agent: Mutt/1.4.2.3i Cc: current@freebsd.org Subject: Re: [TESTING]: one more boot2 shrinking patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Mar 2011 20:52:16 -0000 On Tue, Mar 08, 2011 at 09:19:31PM +0100, Fabian Keil wrote: > Roman Divacky wrote: > > > this diet patch > > > > http://lev.vlakno.cz/~rdivacky/boot2-final-diet.patch > > > > includes these changes: > > > > o bunch of variables are turned into uint8_t > > > > o initial setting of namep[] in lookup() is removed > > as it's only overwritten a few lines down > > > > o kname is explicitly initialized in main() as BSS > > in boot2 is not zeroed > > Are you saying the previous: > > static const char *kname = NULL; > > didn't work, or is this the explanation why the > initialization hasn't simply been removed? gcc nor clang emits any code to initialize static type foo = 0; because it's expected that BSS is zeroed, which is not the case in boot2 so we have to initialize that explicitly > > o the "fmt" dance in load() is removed > > > > o buf in printf() is made static to save space > > > > > > Please test/review this patch. John Baldwin already looked and I booted > > it so it should be quite safe. I plan to commit this in a few days unless > > problems are found.. > > Works for me with gcc from base on amd64. > > > I noticed an unrelated warning about an unused variable, though. > > /usr/src/sys/boot/i386/boot2/boot2.c: In function 'load': > /usr/src/sys/boot/i386/boot2/boot2.c:310: warning: unused variable 'x' > > It seems to be left over from: > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/boot/i386/boot2/boot2.c.diff?r1=1.91;r2=1.92;f=h > > The attached (only compile-tested) patch removes it. oh, I'll commit that with the rest thanks for the testing!