From owner-freebsd-mips@freebsd.org Sun Mar 27 11:06:52 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 448B6ADF7B9 for ; Sun, 27 Mar 2016 11:06:52 +0000 (UTC) (envelope-from imaginac@ch1flweb04.chileadmin.com) Received: from ch1flweb04.chileadmin.com (ch1flweb04.chileadmin.com [190.215.57.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0219F18C1 for ; Sun, 27 Mar 2016 11:06:51 +0000 (UTC) (envelope-from imaginac@ch1flweb04.chileadmin.com) Received: from imaginac by ch1flweb04.chileadmin.com with local (Exim 4.86_1) (envelope-from ) id 1ak7IN-00071N-EY for freebsd-mips@freebsd.org; Sun, 27 Mar 2016 06:47:43 -0300 To: freebsd-mips@freebsd.org Subject: X-PHP-Script: www.imagina360.cl/post.php for 206.162.192.6 Date: Sun, 27 Mar 2016 06:47:43 -0300 From: "Support" Reply-To: "Support" Message-ID: X-Priority: 3 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ch1flweb04.chileadmin.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [765 500] / [47 12] X-AntiAbuse: Sender Address Domain - ch1flweb04.chileadmin.com X-Get-Message-Sender-Via: ch1flweb04.chileadmin.com: authenticated_id: imaginac/from_h X-Authenticated-Sender: ch1flweb04.chileadmin.com: support@imagina360.cl X-Source: X-Source-Args: X-Source-Dir: Content-Type: text/plain; charset=us-ascii 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 11:06:52 -0000 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 From owner-freebsd-mips@freebsd.org Sun Mar 27 22:20:35 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 E38F5ADFD82 for ; Sun, 27 Mar 2016 22:20:35 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::236]) (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 563141DDA for ; Sun, 27 Mar 2016 22:20:35 +0000 (UTC) (envelope-from mizhka@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id k79so668073lfb.2 for ; Sun, 27 Mar 2016 15:20:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=iX4hT5rLq3w/iI7j0j+E8EOmkWM6kEmyMYkWn1+yWIs=; b=WVV+bK/IDc4LRHLW8FKbQIIsqzM8xlBpFWYOFeHtYm33bXfT6XVCLgtbpGb8U5ZRuM Dl7gOF6aEaQZh11YFO6H8fKXxIVqll7YphOJ4gc0bW9okINm0MkTu7Lpyw4iyg5ZiZ0W anXL2S5/z+zh6QtwNc80aVnLls4EXBaD32IcDtqB8+3GX9Ldmr6KT4YEzzDO/chldT5I 2o+PYsFsKhqWYDmu4q4VdKOBARP9zOa10dMBnq1XOgzA8yFeQ1tzMruZRxzr4FPnX4p6 oQ5+BOAdf658VrivBuRDVciV3TOPbKq9V0J1R4/pY2YC+y3HZNFF51MKAx1h2bIIZY4n lUDQ== 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=iX4hT5rLq3w/iI7j0j+E8EOmkWM6kEmyMYkWn1+yWIs=; b=A+URikVfUg2ZO13WpmcoijcAPQbZzjExrtlVyzq3Oryh2vW9aLfmPrX7p+MRiIsgLY 1Z06N2j7X0gbtU29GkSrg5SLOWAt/xGWEPsCy9l1IuMRluulaGK+oYOrx2WakscnAwWe kP+teyw63Wx4jFlEF0A8HwvczHNjhoXWb5n41EDnC+aBU3putTuGsX+R8XQwov37nfOP eSCIrzm6vyPAx2yq56QFbDfLx55uLE6NjOocRKT70Zp3HYETV/gyk42sSTvCNI+UU8cE B+RbTmD+U3obyAxZRBH7N5Dvj9cM5lhWqsG1YXjQBtqdHw5AyIduipH3etKWcqAMGiiB PrIw== X-Gm-Message-State: AD7BkJIKUHHYxZMw2Ox+WBgpOJnZT/kugm2qJ0rzAW00UZiYJJqHIqoETRULcstRUNIlxdSd5I3jLXdj2QPoxA== MIME-Version: 1.0 X-Received: by 10.25.80.1 with SMTP id e1mr7043096lfb.165.1459117232254; Sun, 27 Mar 2016 15:20:32 -0700 (PDT) Received: by 10.112.180.138 with HTTP; Sun, 27 Mar 2016 15:20:32 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Mar 2016 01:20:32 +0300 Message-ID: Subject: Re: LZMA or ZIP uncompress BSD code From: Michael Zhilin To: Aleksandr Rybalko 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 22:20:36 -0000 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 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 : > >> 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 > >