Merge/Cleanup status

Yinghai Lu yhlu at
Sun Oct 31 10:58:00 CET 2004

1. Using ROMCC to do propresser will help the size reduction?
2. what is usage for MOVNTI? It is for GDB....
3. How to use GDB to debug LinuxBIOS? Is it only for linuxbios_ram?
4. You will use llshell for crt0.s or auto.c debug?
5. Current romcc only take constant parameters for non inline function? It
that right?
6. Anyone has tried to compile LinuxBIOS under Suse 9.1?  what's the
recommended platform for LinuxBIOS compliation? It seems Suse 9.1 can not
compile Etherboot properly. I am always using RH9 to do the work. And just
found I can not compile LB for S2885, (size>65536), but I can do it in Suse
9.1 pro.



-----Original Message-----
From: Eric W. Biederman [mailto:eric at] On Behalf Of Eric W.
Sent: Saturday, October 30, 2004 1:39 AM
To: LinuxBIOS
Cc: Ronald G. Minnich; YhLu; Richard Smith; ollie at; Stefan Reinauer
Subject: Merge/Cleanup status

I have just committed another big bunch of code and I need to make
one more pass through the tree catch up other boards besides the
hdama to handle what I have introduced.  But things are cleaner more a
little smaller now, but with a little more functionality so I break
even on size.

- To reduce confuse rename the parts of linuxbios bios that run from
  ram linuxbios_ram instead of linuxbios_c and linuxbios_payload...
- Reordered the linker sections so the LinuxBIOS fallback image can take
more the 64KiB on x86
- ROM_IMAGE_SIZE now will work when it is specified as larger than 64KiB.
- Tweaked the and to move the sanity check to see if
everything will work.
- Start using romcc's built in preprocessor (This will simplify header
compiler checks)
- Add helper functions for examining all of the resources
- Remove debug strings from chip.h
- Add llshell to src/arch/i386/llshell (Sometime later I can try it...)
- Add the ability to catch exceptions on x86
- Add gdb_stub support to x86
- Removed old cpu options
- Added an option so we can detect movnti support
- Remove some duplicate definitions from pci_ids.h
- Remove the 64bit resource code in amdk8/northbridge.c in preparation for
making it generic
- Minor romcc bug fixes

ebiederman at (Eric W. Biederman) writes:

> So the things we can to do to keep size down.
> 1)  Use gcc-3.4 instead of gcc-3.3
      An updated size comparison for fallback gcc-3.3 vs gcc-3.4 on the
      hdama fallback image.

With gcc-3.3 I have:
$ size linuxbios_ram
   text	   data	    bss	    dec	    hex	filename
  40656	  39728	  58956	 139340	  2204c	linuxbios_ram

$ ls -l linuxbios_ram.nvr2b
-rw-r--r--  1 eric eric 28938 Oct 30 02:08 linuxbios_ram.nrv2b

$ ls -l linuxbios_ram.rom 
-rw-r--r--  1 eric eric 28938 Oct 30 02:08 linuxbios_ram.rom

$ size crt0.o
   text	   data	    bss	    dec	    hex	filename
  37033	      0	      0	  37033	   90a9	crt0.o

28938 + 37033 = 65971 or just over 65KiB

With gcc-3.4 I have:
$ size linuxbios_ram

   text	   data	    bss	    dec	    hex	filename
  40448	  38268	  60652	 139368	  22068	linuxbios_ram

$ ls -l linuxbios_ram.nrv2b
-rw-r--r--  1 eric eric 28317 Oct 30 02:16 linuxbios_ram.nrv2b

$ ls -l linuxbios_ram.rom 
-rw-r--r--  1 eric eric 28317 Oct 30 02:16 linuxbios_ram.rom

$ size crt0.o
   text	   data	    bss	    dec	    hex	filename
  37033	      0	      0	  37033	   90a9	crt0.o

28317 + 37033 = 65350 or just under 65KiB


So with this comparison I see the following.
28938 - 28317                     = 621 bytes or 2% more for gcc-3.3 in
compressed size
(40656 + 39728) - (40448 + 38268) = 1668 bytes or 2% more for gcc-3.3 in
uncompressed size

So switching to gcc-3.4 gives a 2% size reduction.  Not huge bug

> 2) Kill unused strings.
     The member is removed from device.h and the dead strings just remain to
     be killed.
> 3) Expand the space available for linuxbios_c.gz
     Done.  linuxbios_ram can now occupy more space on x86.
> 4) Better tune the current 64bit support for size.  I think the size
>    increase of the last few days has something to do with gcc's poor
>    handling of 64bit integers.  Perhaps linuxbios_c needs to go native
>    64bit on x86-64 capable machines.

     Some initial tuning has be done in particular some helper functions
     were introduced which noticeably bring the code size down.

> 5) Get non-inlining working usefully with romcc.
     Not really started but I have added functions:
     print_debug_hex8_(unsigned char value);
     print_debug_hex32_(unsigned int value);
     print_debug_(const char *str);

     Into arch/i386/lib/console.c so we can begin to experiment with
     this manually.  Once the manual case works it will be time to
     look at doing this automatically.

     In addition I modified the hdama build to let romcc preprocess
     the files itself without help from gcc.  Since that code works.
     (Well except for unsigned long constant expressions...)

> 6) cache-as-ram support (long term).
     Perhaps will make this easier to debug.
     I have added that into 
     src/arch/i386/ for people to play with.

And the list of files I touched this round.

CVS: ----------------------------------------------------------------------
CVS: Enter Log.  Lines beginning with `CVS:' are removed automatically
CVS: Committing in .
CVS: Modified Files:
CVS:    src/arch/i386/boot/linuxbios_table.c
CVS:    src/arch/i386/init/ src/arch/i386/lib/
CVS:    src/arch/i386/lib/c_start.S src/arch/ppc/init/
CVS:    src/arch/ppc/lib/cpuid.c src/config/
CVS:    src/config/ src/cpu/amd/model_fxx/
CVS:    src/cpu/amd/mtrr/amd_mtrr.c src/cpu/amd/socket_940/
CVS:    src/cpu/amd/socket_940/socket_940.c
CVS:    src/cpu/intel/model_f0x/
CVS:    src/cpu/intel/model_f1x/
CVS:    src/cpu/intel/model_f2x/
CVS:    src/cpu/intel/model_f3x/
CVS:    src/cpu/x86/16bit/ src/cpu/x86/16bit/
CVS:    src/cpu/x86/16bit/ src/cpu/x86/lapic/secondary.S
CVS:    src/cpu/x86/mtrr/earlymtrr.c src/cpu/x86/mtrr/mtrr.c
CVS:    src/devices/device.c src/devices/device_util.c
CVS:    src/devices/root_device.c src/include/delay.h
CVS:    src/include/device/device.h src/include/device/pci_ids.h
CVS:    src/include/device/resource.h
CVS:    src/mainboard/arima/hdama/
CVS:    src/mainboard/arima/hdama/
CVS:    src/mainboard/arima/hdama/mainboard.c
CVS:    src/northbridge/amd/amdk8/coherent_ht.c
CVS:    src/northbridge/amd/amdk8/northbridge.c src/ram/ramtest.c
CVS:    src/southbridge/amd/amd8111/amd8111.c
CVS:    src/superio/NSC/pc87360/superio.c
CVS:    targets/arima/hdama/ util/romcc/romcc.c
CVS: Added Files:
CVS:    src/arch/i386/llshell/
CVS:    src/arch/i386/llshell/readme.linuxbios
CVS:    src/config/linuxbios_ram.ld
CVS: Removed Files:
CVS:    src/config/linuxbios_c.ld
CVS: ----------------------------------------------------------------------

More information about the coreboot mailing list