Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Feb 2011 10:20:24 -0800
From:      Patrick Mahan <PMahan@adaranet.com>
To:        Warner Losh <imp@bsdimp.com>, "freebsd-mips@freebsd.org" <freebsd-mips@freebsd.org>
Subject:   RE: RS / RSPRO FreeBSD
Message-ID:  <32AB5C9615CC494997D9ABB1DB12783C024CC075C0@SJ-EXCH-1.adaranet.com>
In-Reply-To: <4D483F87.4020801@bsdimp.com>
References:  <AANLkTi=vcLScFS%2BJxj0HSZc8hE9p4=W=hrnvMpMfm2OG@mail.gmail.com> <AANLkTinjupTkkesyY%2B65R8vmYKRpanrOy9C=nRJrPEX=@mail.gmail.com> <AANLkTikE9Fe0P82ADN3%2BV38=eHr3W1bGaYVx9Rg02pEB@mail.gmail.com> <201101200928.45264.freebsd-mips@dino.sk> <AANLkTikWhFUtU_38LgbFf%2B3G8iBTQWW115JSQsmm-%2Bpc@mail.gmail.com> <AANLkTimK7xM5-BQXSAjiAWiY0h_NixpdHD1XFqheFh_D@mail.gmail.com> <527911.58663.qm@web33203.mail.mud.yahoo.com> <AANLkTi=DjAs1QLYN90T4eSAPZCQAR3M_ArLTtiS%2B-nDK@mail.gmail.com> <AANLkTinkdBNmzJgHeBpFyh3eq9=70ksDUpYEaog%2BZYrZ@mail.gmail.com> <4D483F87.4020801@bsdimp.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----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<monthadar@gmail.com=
>
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32AB5C9615CC494997D9ABB1DB12783C024CC075C0>