From owner-freebsd-mips@FreeBSD.ORG Tue Feb 1 18:51:47 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 430DB1065670 for ; Tue, 1 Feb 2011 18:51:47 +0000 (UTC) (envelope-from PMahan@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 175438FC1F for ; Tue, 1 Feb 2011 18:51:46 +0000 (UTC) X-ASG-Debug-ID: 1296584436-554967b10001-1gY7mK Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id cSlvjWK8ttKzSNOO; Tue, 01 Feb 2011 10:20:36 -0800 (PST) X-Barracuda-Envelope-From: PMahan@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Tue, 1 Feb 2011 10:20:36 -0800 From: Patrick Mahan X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Warner Losh , "freebsd-mips@freebsd.org" Date: Tue, 1 Feb 2011 10:20:24 -0800 X-ASG-Orig-Subj: RE: RS / RSPRO FreeBSD Thread-Topic: RS / RSPRO FreeBSD Thread-Index: AcvCNCSNNB2M8Ys1Sqa6m5XJsAmBUwAB8h3g Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CC075C0@SJ-EXCH-1.adaranet.com> References: <201101200928.45264.freebsd-mips@dino.sk> <527911.58663.qm@web33203.mail.mud.yahoo.com> <4D483F87.4020801@bsdimp.com> In-Reply-To: <4D483F87.4020801@bsdimp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-cr-hashedpuzzle: BRD5 BRJB DeME EbPe HFfZ HOa6 Id+K KAev LMlW LU2H NXib N+5Y OpDN QmPX S0MN Ttu1; 2; ZgByAGUAZQBiAHMAZAAtAG0AaQBwAHMAQABmAHIAZQBlAGIAcwBkAC4AbwByAGcAOwBpAG0AcABAAGIAcwBkAGkAbQBwAC4AYwBvAG0A; Sosha1_v1; 7; {4953F473-43CB-4F23-B38E-99930632BE8B}; cABtAGEAaABhAG4AQABhAGQAYQByAGEAbgBlAHQALgBjAG8AbQA=; Tue, 01 Feb 2011 18:20:24 GMT;UgBFADoAIABSAFMAIAAvACAAUgBTAFAAUgBPACAARgByAGUAZQBCAFMARAA= x-cr-puzzleid: {4953F473-43CB-4F23-B38E-99930632BE8B} acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1296584436 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com Cc: Subject: RE: RS / RSPRO FreeBSD X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Feb 2011 18:51:47 -0000 > -----Original Message----- > From: owner-freebsd-mips@freebsd.org [mailto:owner-freebsd- > mips@freebsd.org] On Behalf Of Warner Losh > Sent: Tuesday, February 01, 2011 9:15 AM > To: freebsd-mips@freebsd.org > Subject: Re: RS / RSPRO FreeBSD > > On 02/01/2011 03:33, Jayachandran C. wrote: > > On Tue, Feb 1, 2011 at 3:02 PM, Monthadar Al Jaberi > wrote: > >> Sure, > >> > >> I used the standard kernel configuration file and modifed this: > >> options MD_ROOT > >> options MD_ROOT_SIZE=3D40960 > >> options ROOTDEVNAME=3D\"ufs:md0\" > >> > >> to generate filesystem: > >> makefs -t ffs -B big -s 40m rootfs.img path-to-filesystem/ > >> > >> to embedd the filesystem (script code): > >> addr=3D($(strings -td kernel | grep "MFS Filesystem" | awk '{print > >> $1}')) #calculate start and end address for mdroot > >> rootfs_start=3D${addr[0]} > >> rootfs_end=3D$((${addr[1]}+1)) > >> echo "Generating kernel image" > >> head -c ${rootfs_start} kernel> kernel.new > >> cat rootfs.img>> kernel.new > >> tail -c +${rootfs_end} kernel>> kernel.new > >> gzip -9 kernel.new > >> > >> Sorry for the extreme delay, hope it helps... > > You can just set the MFS_IMAGE environment variable, and the 'make > > buildkernel' will patch the mfs image during the kernel build process. > > The script it uses is sys/tools/embed_mfs.s > > while that is true, I wonder if anybody has tried to create a linker > script that would allow you to add the MFS image as an ELF section and > use ldscript magic to get the start/end address. This would allow you > to generate MFS images of different sizes and attach them to the same > kernel. > Warner, I have some preliminary code to do this just like it is done for the linux = kernel. It creates a separate ELF section containing the compressed embedded file, then the li= nker map puts a 'start_mfs' and a 'stop_mfs' symbol to mark the start and end. But I haven= 't worked on it for 5 months or so and it was based on our privately modified version of FreeBS= D for MIPS. Patrick ---------------------------------------------------- Patrick Mahan Lead Technical Kernel Engineer Adara Networks Disclaimer: The opinions expressed here are solely the responsibility of th= e author and are not to be construed as an official opinion of Adara Networks.