[U-Boot] Weird problem with kernel/initrd loading

Wolfgang Denk wd at denx.de
Fri Nov 27 11:46:53 CET 2009


Dear "Ioannis Kyriakopoulos",

please do not send separate copies of the same message to individual
mail addresses and the mailing list. And please don't full-quote.

In message <SNT111-DS791525D81F9DA69DED9DDA79A0 at phx.gbl> you wrote:
> 
> Can you then please tell me in which cases initrd command is used

There is no such thing as an "initrd command". What you are referring
to here is the "initrd=" command line argument to the Linux kernel.

> because I've seen it being used in many examples like here
> http://wiki.davincidsp.com/index.php/Initrd You are right though 
> that there is in nowhere documented as a command! 

It is not a command. 

You have many ways to to the same thing (see
http://en.wikipedia.org/wiki/TIMTOWTDI).

With U-Boot, you use a U-Boot image which contains a ramdisk, and you
pass the address of this image as the second argument to the "bootm"
command. U-Boot will do the necessary things, which on ARM includes
setting up the required ATAG_INITRD / ATAG_INITRD2 entries. The Linux
kernel picks up the location of the ramdisk from these ATAGs. 

> >you _cannot_ use the same address in the "initrd=0x81600000" argument, 
> >as this address is the image header and not the ramdisk."
> 
> So the actual ramdisk address should be the one being set using the
> Load Address (-a switch) and the entry point (-e switch) switches of
> mkimage?

A ramdisk is no executable code, so it cannot have somethign as an
"entry point". You use "-a 0 -e 0" when building a ramdisk image.

> But how the kernel knows where the ramdisk is and mounts it if I don't pass
> any arguments on the command line about its memory location? That's what 

This is architecture dependent. Some architectures use a device tree,
others use other means. On ARM, they use ATAGs.

> I don't understand! Also, I thought it is necessary to use mkimage not only 
> for the kernel image but also for the initrd for being able to be used by
> U-boot, but as it seems it's not!

The U-Boot way is to create a U-Boot image, but as mentioned above -
TIMTOWTDI.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Old programmers never die, they just branch to a new address.


More information about the U-Boot mailing list