linux-mips-fnet
[Top] [All Lists]

Re: Embedded system with RAM Disk

To: Harald Koerfgen <Harald.Koerfgen@home.ivm.de>
Subject: Re: Embedded system with RAM Disk
From: Charles Lepple <clepple@negativezero.org>
Date: Wed, 26 Jan 2000 20:26:34 -0500
Cc: Victor Wells <vwells@ti.com>, linux@cthulhu.engr.sgi.com, linux-mips@fnet.fr
References: <XFMail.000126201529.Harald.Koerfgen@home.ivm.de>
Sender: clepple@tool.negativezero.org
Harald Koerfgen wrote:
[...]
> Once upon a time I had a hack which did something similar, linking a ramdisk
> image into the kernel image which resulted in a single file for 
> kernel+ramdisk.

You may be in luck -- the PowerPC Linux port does something along these
lines (if I understand the issue correctly).

It involves using objcopy to add a section into the ELF image, and
recompiling some stuff in arch/ppc/*boot to reference the address of the
new section. 

The PPC board that I used would not load ELF images with extra sections,
so I resurrected some code that would convert the ramdisk (and gzipped
vmlinux, actually -- I'm not sure if the MIPS code does anything like
this) into assembly 'define word' statements, assemble the resulting
file, and link it in. The file had symbols for initrd_start & _length,
and the assembly was surprisingly quick. The ramdisk, in effect, became
part of the data section of the kernel image (zImage, actually).

I mention this because the conversion to ECOFF might be nuking the
ramdisk or something. The aforementioned method almost guarantees that
your ramdisk will make it into memory if the whole file is loaded by
your boot firmware.

Hope this helps,

-- 
Charles Lepple
clepple@ieee.org || http://www.negativezero.org/charles/

<Prev in Thread] Current Thread [Next in Thread>