From owner-freebsd-mips@freebsd.org Sun Mar 27 12:08:06 2016 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AA0EAD6A58 for ; Sun, 27 Mar 2016 12:08:06 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C41001006 for ; Sun, 27 Mar 2016 12:08:05 +0000 (UTC) (envelope-from ray@ddteam.net) Received: by mail-qk0-x22f.google.com with SMTP id s5so79377538qkd.0 for ; Sun, 27 Mar 2016 05:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ddteam-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=4QPRn6oxKvlDNljWngN0OQWN+fDWhceFnwhdlbF5UWA=; b=yd70cw1cDMIi0cNEFcdEEHcRBIG+cjoN7WqNE60IFBfxFZBMFgg3IUoAz2LPyGEDlw xkaA2kz0fWEgiVwGP3qIrrWOKdpPVVWFhf1jWju09HfMKTPNAH+rLVjlkzREpB7PuKnc FX3cYHNovQ9BK/PoF0AaTFeKeoyux+xn8QU/+ICUVUBbQAzMcAzHgE/GTZP+2ZOMH82S SkvXZQhaGq/0ztmElghIwrblpGP9qVlidDCU4YIAHO87v4wVJGudGQlhOmvc3jTMRthn A3WYPY4GzPo/WGyhnlm1KbMtzJn4/B3P24yUdR+2WcGFgymZCbP2z9c23kylJJmk+x3A njbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=4QPRn6oxKvlDNljWngN0OQWN+fDWhceFnwhdlbF5UWA=; b=iquwf8VxkC5kS9dK/AkKsHR6iA9uVogy2OSavPMczHck/GfOqHUJ/kUkUsen2Owc0y vJIFI8LmAfxj9Qe96KEdsFQXpMH0ymuYLxQGk4IRw7x1XaQQ98G33VcipbXPtZqeo+b6 XLByHTPVB64/awhnwNZS1rPjVUdsgyJ+98edi098+H1CHY5WT3Xq2jePp6A24ayazLpl P+WPne6rWxamqkSjaakTTXz7/Dod5Fi+lY22theZNB4sJ3QFkp7bdbSbMcTEKmqqy0ja 7TANpUOybUYSPIjY9PkhKeyQI3Xuf9BAM/F4rB2LYJPXkwkwY62Mp3j1uflkzbvPBzW/ Wf2g== X-Gm-Message-State: AD7BkJI1E3ErjvAIv3rwz13RuIQOTycwZLN60VHD83BVbeiAYBWTFqFFPVUP151zaiP90cJ+DtpH8GYnpJMcYg== MIME-Version: 1.0 X-Received: by 10.129.44.139 with SMTP id s133mr11254458yws.182.1459080484687; Sun, 27 Mar 2016 05:08:04 -0700 (PDT) Received: by 10.37.13.21 with HTTP; Sun, 27 Mar 2016 05:08:04 -0700 (PDT) In-Reply-To: References: Date: Sun, 27 Mar 2016 15:08:04 +0300 Message-ID: Subject: Re: LZMA or ZIP uncompress BSD code From: Aleksandr Rybalko To: Michael Zhilin Cc: freebsd-mips@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 27 Mar 2016 12:08:06 -0000 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 : > 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