Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Mar 2016 01:20:32 +0300
From:      Michael Zhilin <mizhka@gmail.com>
To:        Aleksandr Rybalko <ray@ddteam.net>
Cc:        freebsd-mips@freebsd.org
Subject:   Re: LZMA or ZIP uncompress BSD code
Message-ID:  <CAF19XBLBCwYJjN=H3qouJ7r4MZgn2crwdtvWCcKK97vGcrn-gw@mail.gmail.com>
In-Reply-To: <CAJ1Oi8E3d86U8wdNTEN-KJpm0yf2c1SuoQjQrPQJoyYe3RYePw@mail.gmail.com>
References:  <CAF19XBLCK9ZtvTsu%2BQCKgDdeYfy7yMbLtLiDBPGfu5R-PZmX5A@mail.gmail.com> <CAJ1Oi8E3d86U8wdNTEN-KJpm0yf2c1SuoQjQrPQJoyYe3RYePw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

Thank you for references, Aleksandr!

And there is good news. This morning I've found small implementation of
gzip without malloc / stdlib. It's called miniz hosted on googlecode /
github. I've spend whole day playing with it because it looks promising,
and... it works on both platforms (amd64 & mips32). It's nice code (i mean
ugly, but with piece of art) required only memcpy & memset.

Now I'm more relax than yesterday, because it works, even if gzip is far
from ideal (xz/lzma).

CFE. may be it's my fault, but I don't spend a lot of time playing with
CFE. It may be worth to do and I've put it in my list. On other hand,
dependency of particular CFE firmware may cause some troubles with support
of this stuff.

Best regards,
  Michael

On Sun, Mar 27, 2016 at 3:08 PM, Aleksandr Rybalko <ray@ddteam.net> wrote:

> Hi Michael!
>
> LZMA has very nice compression rate and it is public domain.
> But some bootloader support old versions of LZMA/XZ.
> So you can start with xz(1) in base, then to try gzip and/or older LZMA
> versions.
> You can look usage of older LZMA versions in ZRouter.org code (
> http://hg.zrouter.org/hg/zrouter/file/9ac53695a44d)
>
> P.S. it looks weird about 64k, maybe it needs proper CFE image to
> uncompress something bigger?
>
> 2016-03-26 23:55 GMT+02:00 Michael Zhilin <mizhka@gmail.com>:
>
>> Hi,
>>
>> I'm looking for ready-to-use BSD-licensed code to uncompress bytes (lzma
>> or
>> zip) by custom MIPS "bootloader" (
>>
>> https://github.com/Cka3o4Huk/freebsd-wifi-build/blob/asusrtn16/programs/mktrxfw/trxloader.c#L20
>> ).
>>
>> Could you please advice me any of it?
>>
>> Background:
>>
>> I'm playing with FreeBSD-based firmware for few Asus WiFi router based on
>> Broadcom MIPS processors and CFE bootloader. At boot, CFE unzips first 64K
>> of firmware (second bootloader) and second bootloader is responsible to
>> load kernel from flash and run it. So my goal is to write second
>> bootloader
>> to load kernel.
>>
>> As I mentioned I have few routers with different flashes. For instance,
>> Asus RT-N16 has a lot of flash memory (32MB), so I don't need implement
>> kernel compression. Firmware works fine on it. Other routers has only 8MB
>> (for example, Asus RT-N53), but it's not enough for raw kernel +
>> compressed
>> rootfs. I'm not expert in zip/lzma internals. That's why I'm looking for
>> ready BSD code to unpack kernel.
>>
>> Thank you in advance,
>>    Michael
>> _______________________________________________
>> freebsd-mips@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-mips
>> To unsubscribe, send any mail to "freebsd-mips-unsubscribe@freebsd.org"
>>
>
>
>
> --
> WBW
> -------
> Rybalko Aleksandr <ray@ddteam.net>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAF19XBLBCwYJjN=H3qouJ7r4MZgn2crwdtvWCcKK97vGcrn-gw>