From owner-freebsd-embedded@FreeBSD.ORG Wed Mar 27 17:16:58 2013 Return-Path: Delivered-To: freebsd-embedded@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9283FF1F; Wed, 27 Mar 2013 17:16:58 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) by mx1.freebsd.org (Postfix) with ESMTP id 6E3C0EC5; Wed, 27 Mar 2013 17:16:55 +0000 (UTC) Received: from c-24-8-230-52.hsd1.co.comcast.net ([24.8.230.52] helo=damnhippie.dyndns.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1UKty2-0005q8-9l; Wed, 27 Mar 2013 17:16:54 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r2RHGqed011799; Wed, 27 Mar 2013 11:16:52 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 24.8.230.52 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX1/K44jYGvAcSZpYnf+G5Vk1 Subject: Re: FreeBSD on the AP121 (AR9330) From: Ian Lepore To: Adrian Chadd In-Reply-To: References: Content-Type: text/plain; charset="us-ascii" Date: Wed, 27 Mar 2013 11:16:52 -0600 Message-ID: <1364404612.36972.59.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: freebsd-embedded@FreeBSD.org X-BeenThere: freebsd-embedded@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Dedicated and Embedded Systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Mar 2013 17:16:58 -0000 On Wed, 2013-03-27 at 09:48 -0700, Adrian Chadd wrote: > Hi, > > So I have FreeBSD mostly booting on the AR9330 based SoCs. > > The trouble? These ship with 16MB RAM and 4MB flash. > > CPU platform: Atheros AR9330 rev 1 > CPU Frequency=400 MHz > CPU DDR Frequency=400 MHz > CPU AHB Frequency=200 MHz > > ... > > Copyright (c) 1992-2013 The FreeBSD Project. > Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 > The Regents of the University of California. All rights reserved. > FreeBSD is a registered trademark of The FreeBSD Foundation. > FreeBSD 10.0-CURRENT #15 r248780:248782M: Tue Mar 26 22:31:51 PDT 2013 > adrian@marilyn:/home/adrian/work/freebsd/svn/obj/mipseb/mips.mips/usr/home/adrian/work/freebsd/svn/src/sys/AR9331 > mips > gcc version 4.2.1 20070831 patched [FreeBSD] > WARNING: WITNESS option enabled, expect reduced performance. > Preloaded elf kernel "kernel" at 0x80538074. > real memory = 16777216 (16384K bytes) > Physical memory chunk(s): > 0x005d2000 - 0x00f90fff, 10219520 bytes (2495 pages) > avail memory = 9768960 (9MB) > > The kernel is 4.5MB in size uncompressed and takes up ~ 2.5MB of RAM > just at startup. It's not going to be able to really do anything with > our current userland without killing processes. I know it won't even > be able to load the wlan/ath/bridge/switch modules. > > So at this point I'm really, really looking for some help with cutting > down both the kernel binary size and the kernel memory footprint. It's > a bit ridiculous at this point. > > The AR9330 is in a lot of the really cheap, really small APs that > companies like TP-Link make in ridiculous quantities. I'd love to > showcase FreeBSD + mesh on these, but there's just not enough space to > run things. > > So, who's up for it? I can send you hardware if you start making > progress. Lots and lots of embedded hardware. For starters you might try disabling WITNESS and other things you can't afford in a slimmed-down kernel. On the other hand, kernel bloat is ongoing; here's a random datapoint in the form of an 8.2 versus -current kernel built for an embedded arm using the same kernel config file (no debugging options enabled): 8.2 10.0 ---- ---- 3.4M 4M obj/arm.arm/usr/src/sys/TFLEX/kernel* 2.6M 3.1M obj/arm.arm/usr/src/sys/TFLEX/kernel.bin* 1.4M 1.6M obj/arm.arm/usr/src/sys/TFLEX/kernel.gz.tramp* If the system isn't doing heavy IO, try "option NBUF=128" to seriously slim down the amount of memory for buffers (by default it'll use 1/4 of total ram up to 64MB). It would be nice to know more about the implications of tweaking this number, but when I asked on a mailing list once I didn't get much useful info. -- Ian