Skip to contentSkip to conversation

Limon & PowerQUICC II, Booting the kernel

DISCUSSION [email protected] 3 participants 3 messages Sep 26, 2000

lore
Share & tools
lore
#0 lore raw

Hi

Sorry for my 1st mail. The kernel gets loaded into RAM at 0x400000.

Still, when I issue the 'run' command the target crashes.

---------------- Linux Monitor 1.4.2-SBC-8260 ---------------- limon>
limon>
limon> load
BOOTP/TFTP from server 10.1.20.2; our IP address is 10.1.20.1. Filename '/usr/src/nfs/limonZImage'.
Loading: >.................................................................< done.
limon>
limon> debug
limon> dw 400000

00400000   6e6a725e  00000000  0007864c  6b657230  njr^.......Lker0
00400010   00078660  48000005  7c6b1b78  7cb92b78  ...`H...|k.x|.+x
00400020   38600040  7c600124  3c800040  60840000  8`.@|`.$<..@`...
00400030   7c6802a6  3863fffc  7c681b78  7c032000  |h..8c..|h.x|. .
00400040   40820028  3c800040  60840000  3ca00040  @..(<..@`...<..@
00400050   60a5b274  38a50003  7ca42850  54a5f0be  `..t8...|.(PT...
00400060   7ca72b78  48000060  7c6802a6  3863fffc  |.+xH..`|h..8c..
00400070   7c681b78  3c800040  60840000  3ca00040  |h.x<..@`...<..@

limon>
limon>
limon> run
... crash

Question:

1. Do I have to strip off the elf header from my kernel file?

2. Does the run command relocate the kernel at addr 0?

3. Some data are transferred from limon to the kernel.
- Does Limon handle this correctly?
- Where are these data located?

4. Why does it crash?

I guess that answering 3) should solve the problem.....

Thank you for any help

Ruedi

#1 lore raw
Quoted 3 lines · On Tue, Sep 26, 2000 at 01:49:46PM +0100, [email protected] wrote:

Question:

1. Do I have to strip off the elf header from my kernel file?

Yes. Call me lazy, but I haven't yet written code to handle ELF (but I will). You need to convert the kernel to a straight binary file with something like:

objcopy -O binary vmlinux vmlinux.bin

then encode it as you have done with something like:

mklimon -o vmlinix.limon -k vmlinux.bin

The downloaded kernel can be 4M-1K (0x3ffc00) in size, so I don't bother with compressing it.

The kernel size limit, load address issues and the lack of handling of ELF will all go away in the near future (now that I have time to work on limon again).

Quoted 1 line

2. Does the run command relocate the kernel at addr 0?

mklimon allows several images to be combined. The kernel get moved to 0, and initrd gets moved to the top of memory.

Quoted 3 lines

3. Some data are transferred from limon to the kernel.
- Does Limon handle this correctly?
- Where are these data located?

limon uses an enhanced version of the bootinfo structure (not the same as bd_info). It is currently set up at 0x3ffe00 by the run command (this will change in the next version).

Quoted 1 line

4. Why does it crash?

limon doesn't handle ELF (yet).

Neil.

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

#2 lore raw
Quoted 2 lines · Neil Russell

The downloaded kernel can be 4M-1K (0x3ffc00) in size, so I don't bother with compressing it.

Yes, please bother compressing it. Making zImage is more than just compressing the file. The code in arch/ppc/mbxboot will (interactively) create the command line, properly allocate the initial ram disk, and most importantly creates the board information structure that is required
by the kernel. There is also hardware initialization expected by the kernel that is often coordinated in the various functions found in the arch/ppc/mbxboot files. You can't simply boot vmlinux on an embedded
system and expect it to work (unless your boot rom is doing exactly the functions of arch/ppc/mbxboot).

The ELF header of the resulting zImage should be removed by just using 'dd':
dd if=zImage bs=64k skip=1 of=zImage.bin

Using objcopy or other generic programs on zImage will likely result in a mess, because the file isn't really a valid ELF image.

Quoted 2 lines

limon uses an enhanced version of the bootinfo structure (not the same as bd_info).

The kernel expects a board info that matches what it was configured to use. Every board is different. You should modify arch/ppc/mbxboot/misc.c
to know it was called by limon and properly convert or discover information
necessary for the kernel version of the structure.

	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/