Modify

Opened 9 years ago

Closed 9 years ago

#2549 closed enhancement (fixed)

adm5120 reduce wasted flash space by ~60kB

Reported by: berny156 at gmx.de Owned by: juhosg
Priority: normal Milestone: Kamikaze 8.09 RC1
Component: other Version:
Keywords: adm5120 lzma-loader flash Cc:

Description

The lzma-loader is just 4+ KiB long, but at the moment it is stored in a 64 KiB long block. The first patch aligns and searches the kernel at 4 KiB boundaries, so that the lzma-loader uses 8 KiB. This will restore 56 KiB flash!

The second patch strips unused formats in printf.c of the lzma-loader. My loader-br-6104k.gz uses now 4015 Bytes (gcc 4.1.2), the kernel starts at the first 4 KiB boundary. Both patches together free 60 KiB flash on my router!

...
trxsplit: searching TRX header in 'admboot'
trxsplit: searching TRX header in 'config'
trxsplit: searching TRX header in 'firmware'
trxsplit: TRX header found at 0x1000
trxsplit: creating TRX partitions in 'firmware' (31,2)
Creating 2 MTD partitions on "firmware":
0x0000101c-0x0008a800 : "kernel"
mtd: partition "kernel" doesn't start on an erase block boundary -- force read-only
0x0008a800-0x001f0000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-only
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=1A0000, len=50000
0x001a0000-0x001f0000 : "rootfs_data"
VFS: Mounted root (squashfs filesystem) readonly.                                                                                  
...

The Edimax BR-6104K(P) routers have got only (unsane) 2 MiB flash, therefore each KiB is precious! The patches were tested with both the Edimax BR-6104K and BR-6104KP, the original bootloader and the tftp-loader from midge.

Attachments (2)

001-shrink_lzmaloader_block.patch (1.7 KB) - added by berny156 AT gmx.de 9 years ago.
reduce kernel alignment in image from 64 KiB to 4 KiB
002-strip_lzmaloader_printf.patch (5.9 KB) - added by berny156 AT gmx.de 9 years ago.
strip printf.c of lzma-loader to make the loader smaller than 4 KiB

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by berny156 AT gmx.de

reduce kernel alignment in image from 64 KiB to 4 KiB

Changed 9 years ago by berny156 AT gmx.de

strip printf.c of lzma-loader to make the loader smaller than 4 KiB

comment:1 Changed 9 years ago by juhosg

  • Owner changed from developers to juhosg
  • Status changed from new to assigned

comment:2 Changed 9 years ago by juhosg

  • Resolution set to fixed
  • Status changed from assigned to closed
  • The first patch applied in [9450], thanks.
  • About the second: the formats of the printk which are currently unused, may be in use by a later version of the lzma-loader. Currently i don't want to remove them, sorry.

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.