Re: [TESTING]: one more boot2 shrinking patch

From: Fabian Keil <freebsd-listen_at_fabiankeil.de>
Date: Tue, 8 Mar 2011 21:19:31 +0100
Roman Divacky <rdivacky_at_freebsd.org> 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?

>         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.

Fabian

Received on Tue Mar 08 2011 - 19:43:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:12 UTC