RS / RSPRO FreeBSD

Patrick Mahan PMahan at adaranet.com
Tue Feb 1 18:51:47 UTC 2011


> -----Original Message-----
> From: owner-freebsd-mips at freebsd.org [mailto:owner-freebsd-
> mips at freebsd.org] On Behalf Of Warner Losh
> Sent: Tuesday, February 01, 2011 9:15 AM
> To: freebsd-mips at 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 at gmail.com>
> wrote:
> >> Sure,
> >>
> >> I used the standard kernel configuration file and modifed this:
> >> options                 MD_ROOT
> >> options                 MD_ROOT_SIZE=40960
> >> options                 ROOTDEVNAME=\"ufs:md0\"
> >>
> >> to generate filesystem:
> >> makefs -t ffs -B big -s 40m rootfs.img path-to-filesystem/
> >>
> >> to embedd the filesystem (script code):
> >> addr=($(strings -td kernel | grep "MFS Filesystem" | awk '{print
> >> $1}')) #calculate start and end address for mdroot
> >> rootfs_start=${addr[0]}
> >> rootfs_end=$((${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 linker 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 FreeBSD for MIPS.

Patrick

----------------------------------------------------
Patrick Mahan
Lead Technical Kernel Engineer
Adara Networks
Disclaimer: The opinions expressed here are solely the responsibility of the author and are not to be
construed as an official opinion of Adara Networks.


More information about the freebsd-mips mailing list