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

ramdisk.img-mini-HOWTO

To: linux-mips@fnet.fr
Subject: ramdisk.img-mini-HOWTO
From: Harald Koerfgen <harald.koerfgen@netcologne.de>
Date: Tue, 09 Jun 1998 17:50:07 +0200 (MEST)
Organization: none
Reply-to: "Harald Koerfgen" <harald.koerfgen@netcologne.de>
Sender: harry@franz.no.dom
Hi all,

this is very first piece of documentation i am writing for the DECstation Linux
Port. If you have any suggestions to improve this feel free to contact me.


        ramdisk.img-mini-HOWTO

1. Prepare a ramdisk image just like described in 
linux/Documentation/ramdisk.txt.
This can be either compressed or uncompressed. You will probably prefer a 
compressed
one cause this will load faster.

2. Using the following linker-script

--- snip here ---

OUTPUT_FORMAT("ecoff-littlemips")
OUTPUT_ARCH(mips)
SECTIONS
{
  .data :
  {
    __rd_start = .;
    *(.data)
    __rd_end = .;
  }
}

--- snip here ---

convert this binary image to a linkable ecoff object file with the command

mipsel-linux-ld -T ld.script -b binary <name_of_your_ramkdisk_image> -o 
ramdisk.img

This puts the ramdisk image into the .data section of the object file and adds 
the
two symbols __rd_start and __rd_end. I could have taken care of this in the 
linker
script "ld.ecoff" but I simply have been to lazy :-).

3. Copy the object file ramdisk.img to linux/arch/mips/dec/boot and "make 
netboot".

4. This process is reversible with 

mipsel-linux-objcopy --output-target=binary ramdisk.img <name>

so you can use the standard ramdisk.img as a template for your own experiments. 
The
standard ramdisk.img contains a compressed ramdisk image so you have to 
decompress
<name> with gunzip. Due to the alignment in the object files you will probably 
get a
 warning message

gunzip: test.gz: decompression OK, trailing garbage ignored

which can safely be ignored.

Have fun.
---
Regards,
Harald

<Prev in Thread] Current Thread [Next in Thread>
  • ramdisk.img-mini-HOWTO, Harald Koerfgen <=