All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] Booting with ramdisk
@ 2011-03-21 14:46 Guillaume Dargaud
  2011-03-27 21:12 ` Peter Korsgaard
  0 siblings, 1 reply; 4+ messages in thread
From: Guillaume Dargaud @ 2011-03-21 14:46 UTC (permalink / raw)
  To: buildroot

Hello all,
I'm trying to do something very classic, but it doesn't seem to work and the more I read about it the more I'm confused 
by the amount of antiquated info and nearly-but-not-quite-so relevant info (like doing a temporary ramdisk before the 
real OS loads).

So I have a kernel and a buildroot-generated OS, currently on an NFS server. I boot with the following kernel parameters 
and everything goes fine:
console=ttyUL0,115200 rw root=/dev/nfs ip=bootp

Now I want to embed that OS in the kernel (no need for a network anymore as the kernel is on a flash mem). So I did the 
following:
- add ROOTFS CPIO to the buildroot options and make a new version
- point CONFIG_INITRAMFS_SOURCE to the resulting rootfs.cpio file
- change the kernel parameters to "console=ttyUL0,115200 root=/dev/ram" (that's in a dts file)

The kernel stops instantly without even a blip on the console. A debugger reveals that it stops at 0x401718... I have no 
idea what's going on at this stage.
-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Booting with ramdisk
  2011-03-21 14:46 [Buildroot] Booting with ramdisk Guillaume Dargaud
@ 2011-03-27 21:12 ` Peter Korsgaard
  2011-04-08  8:00   ` Guillaume Dargaud
  2011-04-14  9:04   ` Guillaume Dargaud
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Korsgaard @ 2011-03-27 21:12 UTC (permalink / raw)
  To: buildroot

>>>>> "Guillaume" == Guillaume Dargaud <dargaud@lpsc.in2p3.fr> writes:

Hi,

 Guillaume> Now I want to embed that OS in the kernel (no need for a
 Guillaume> network anymore as the kernel is on a flash mem). So I did
 Guillaume> the following: - add ROOTFS CPIO to the buildroot options
 Guillaume> and make a new version - point CONFIG_INITRAMFS_SOURCE to
 Guillaume> the resulting rootfs.cpio file

That sounds correct. If you build your kernel in buildroot we even have
initramfs option that handles it all, but the above should afaik work
as well.

 Guillaume> - change the kernel parameters to "console=ttyUL0,115200 root=/dev/ram" (that's in a dts file)

That shouldn't be needed.

 Guillaume> The kernel stops instantly without even a blip on the
 Guillaume> console. A debugger reveals that it stops at 0x401718... I
 Guillaume> have no idea what's going on at this stage.

Strange. What architecture/system is this? How much did the (compressed)
kernel grow? Perhaps it's too big / you'll need to load it higher. For
most archs, the kernel want to decompress into address 0, so if you load
it too low, you might end up overwriting the compressed kernel as you're
decompressing it.

Perhaps you could add some debugging prints to the bootloader handover /
kernel decompression?

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Booting with ramdisk
  2011-03-27 21:12 ` Peter Korsgaard
@ 2011-04-08  8:00   ` Guillaume Dargaud
  2011-04-14  9:04   ` Guillaume Dargaud
  1 sibling, 0 replies; 4+ messages in thread
From: Guillaume Dargaud @ 2011-04-08  8:00 UTC (permalink / raw)
  To: buildroot

On Sunday 27 March 2011 23:12:51 Peter Korsgaard wrote:
> >>>>> "Guillaume" == Guillaume Dargaud <dargaud@lpsc.in2p3.fr> writes:
> Hi,
> 
>  Guillaume> Now I want to embed that OS in the kernel (no need for a
>  Guillaume> network anymore as the kernel is on a flash mem). So I did
>  Guillaume> the following: - add ROOTFS CPIO to the buildroot options
>  Guillaume> and make a new version - point CONFIG_INITRAMFS_SOURCE to
>  Guillaume> the resulting rootfs.cpio file
> 
> That sounds correct. If you build your kernel in buildroot we even have
> initramfs option that handles it all, but the above should afaik work
> as well.
> 
>  Guillaume> - change the kernel parameters to "console=ttyUL0,115200
> root=/dev/ram" (that's in a dts file)
> 
> That shouldn't be needed.

OK, I've tried with the same kernel params, only adding
CONFIG_INITRAMFS_SOURCE="/home/dargaud/Devel/buildroot-2010.11/output/images/rootfs.cpio"
And it won't run just the same.

>  Guillaume> The kernel stops instantly without even a blip on the
>  Guillaume> console. A debugger reveals that it stops at 0x401718... I
>  Guillaume> have no idea what's going on at this stage.
> 
> Strange. What architecture/system is this? How much did the (compressed)
> kernel grow? Perhaps it's too big / you'll need to load it higher. For
> most archs, the kernel want to decompress into address 0, so if you load
> it too low, you might end up overwriting the compressed kernel as you're
> decompressing it.
> 
> Perhaps you could add some debugging prints to the bootloader handover /
> kernel decompression?

The original kernel elf file is 1.4 Mb and it grows to 2.5 Mb with the ramdisk, which seems about right considering the 
compression.
It's a PowerPC architecture and the kernel gets loaded at 0x400000
I don't know how to change the loading address or how to look at the uncompressed size in memory, how can I see if this 
is the right track ?
-- 
Guillaume Dargaud
http://www.gdargaud.net/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Buildroot] Booting with ramdisk
  2011-03-27 21:12 ` Peter Korsgaard
  2011-04-08  8:00   ` Guillaume Dargaud
@ 2011-04-14  9:04   ` Guillaume Dargaud
  1 sibling, 0 replies; 4+ messages in thread
From: Guillaume Dargaud @ 2011-04-14  9:04 UTC (permalink / raw)
  To: buildroot

On Sunday 27 March 2011 23:12:51 Peter Korsgaard wrote:

>  Guillaume> The kernel stops instantly without even a blip on the
>  Guillaume> console. A debugger reveals that it stops at 0x401718... I
>  Guillaume> have no idea what's going on at this stage.
> 
> Strange. What architecture/system is this? How much did the (compressed)
> kernel grow? Perhaps it's too big / you'll need to load it higher. For
> most archs, the kernel want to decompress into address 0, so if you load
> it too low, you might end up overwriting the compressed kernel as you're
> decompressing it.

Absolutely correct. I used:
powerpc-linux-objcopy --change-addresses 0x400000 simpleImage.virtex405-ml405.elf reloc800000.elf
And it booted fine afterwards at the new 0x800000 load address.
-- 
Guillaume Dargaud
http://www.gdargaud.net/Climbing/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-04-14  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-21 14:46 [Buildroot] Booting with ramdisk Guillaume Dargaud
2011-03-27 21:12 ` Peter Korsgaard
2011-04-08  8:00   ` Guillaume Dargaud
2011-04-14  9:04   ` Guillaume Dargaud

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.