Re: How to use vxworks bootloader to load monta vista linux kernel image?
From: Chuck Gales (cgales_at__NOSPAM_nc.rr.com)
Date: 03/25/04
- Next message: tcs: "Re: spin_lock()/spin_lock_irqsave() on UP and SMP machine"
- Previous message: Michael Schnell: "Re: Signal callback"
- In reply to: Frank: "How to use vxworks bootloader to load monta vista linux kernel image?"
- Next in thread: John: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Reply: John: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Reply: Steven Rostedt: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 25 Mar 2004 11:36:20 GMT
On Tue, 23 Mar 2004 16:23:23 -0800, Frank wrote:
> Hello all
>
> I am now trying to use vxworks bootloader to load the monta vista kernel.
> I used to use this bootloader to load the vxworks image file and worked
> well. Now I want to use the exact same bootloader and don't want to change
> it even a little because I don't have a tool to write the modified
> bootloader back into the flash rom. If necessary, I can work on the monta
> vista kernel. But before that, I have a couple of questions:
>
> 1. I got two files, one is called "vmlinux.gz" and the other is called
> "vmlinux" after I compiled the kernel. vmlinux is under directory
> $(Home)/linux-2.4.18_mvl30/ and vmlinux.gz is under directory
> (Home)/linux-2.4.18_mvl30/arch/ppc/boot/images. I found
> that the vmlinux.gz is not the compressed version of vmlinux. The size of
> the file I got by decompressing vmlinux.gz is smaller the one of vmlinux.
> So what's the difference between these two files? Are they all mvista
> linux kernel image file? I tried to load both of them
> by vxworks bootloader, which I used to load vxworks image, but neither of
> them has been successful. The message I got from minicom is as below:
>
> If I use file vmlinux
> ---------------------------
> boot device : emac
> unit number : 0
> processor number : 0
> host name : t40-xp
> file name : vmlinux
> inet on ethernet (e) : 137.31.3.200
> host inet (h) : 137.31.3.40
> user (u) : anonymous
> ftp password (pw) :
> flags (f) : 0x80
>
>
>
> Attached TCP/IP interface to emac0.
> Warning: no netmask specified.
> Attaching network interface lo0... done. Loading... 1561496
> machine check
> Exception next instruction address: 0x00c0ef8c Machine Status Register:
> 0x00029200
> Condition Register: 0x20482044
> Bus Error Address Register: 0xc00001fc Bus Error Syndrome Register:
> 0x08000000 Task: 0xf6e5a0 "tBoot"
>
>
>
> r0 = 0 sp = f6d980 r2 = 0 r3 = f63df4
> r4 = c00001fc r5 = 80 r6 = 0 r7 = 0
> r8 = 0 r9 = 0 r10 = 0 r11 = 0
> r12 = 0 r13 = 0 r14 = 0 r15 = 1
> r16 = 1 r17 = f6da30 r18 = 0 r19 = 15031c
> r20 = 0 r21 = c89f7c r22 = 0 r23 = 0
> r24 = 0 r25 = 0 r26 = 0 r27 = f63bfc
> r28 = 200 r29 = f6da00 r30 = f6da20 r31 = 200
> msr = 29200 lr = c515d0 ctr = 7f pc = c0ef8c
> cr = 20482044 xer = 0 ..
> --------------------------------------------
>
>
>
>
>
> If I use file vmlinux.gz
>
> -------------------------------------------- boot device : emac
> unit number : 0
> processor number : 0
> host name : t40-xp
> file name : vmlinux
> inet on ethernet (e) : 137.31.3.200
> host inet (h) : 137.31.3.40
> user (u) : anonymous
> ftp password (pw) :
> flags (f) : 0x80
>
>
>
> Attached TCP/IP interface to emac0.
> Warning: no netmask specified.
> Attaching network interface lo0... done. Loading... Erroneous header read
>
>
>
> Error loading file: errno = 0xffffffff. Can't load boot file!!
> .
> -----------------------------------------
>
>
>
> 2. I check the bootrom source file of vxworks. In bootConfig.c, function
> autoboot() calls bootload(), bootload() calls netload() and netload()
> calls bootLoadModule() in order to get a FUNCPTR. The FUNCPTR is a
> function pointer to the entry of the image. Since bootLoadModule() is
> implemented as one of the lib function, I couldn't see its source code. I
> don't know how bootLoadModule() gets the entry pointer to the image. To
> load mvista linux image by this bootloader, I think the bootLoadModule()
> needs to return the entry point of mvista linux image. But what should I
> do to link the bootLoadModule() and the entry point of the mvista linux
> image?
>
>
> 3. Vxworks use ELF as a file format. How can I change *.gz or uncompressed
> file to ELF file?
>
> I would appreciate any of your advice. Thanks a lot!
>
> Best regards,
> Frank
Frank,
The unmodified VxWorks bootloader will not be able to load linux kernel
images. This is due to several reasons which you are finding out.
- vmlinux is indeed an ELF image, which is targeted to load at address
0xC0000000 (if you analyze the ELF header, you will see this). However,
due to the MMU and other initializations done by the kernel, it is
physically loaded at memory address 0x00000000. When the kernel is
started by passing control to 0x00000000, it initializes the MMU and
'relocates' itself automatically to 0xC0000000.
- Additionally, the vmlinux image requires certain registers set to
receive the specified kernel parameters (any other kernel options set at
boot time.
- Any other image you find (vmlinux.gz) is usually a compressed image
used by various other bootloaders. Since the standalone ELF image is not
very space efficient, the kernel build procedure will typically compress
them and add other information necessary for loading. Typically, the
kernel for PPC will support PPCBoot/U-Boot as the default bootloader.
Read the BSP documentation from MontaVista and they will tell you which
bootloader is normally targeted.
Your only options is to compile U-Boot or another similar Linux bootloader
and load it on the board, or modify the VxWorks bootloader to read the
compressed kernel image, parse the required image and load it
appropriately.
Hope this helps.
Chuck
- Next message: tcs: "Re: spin_lock()/spin_lock_irqsave() on UP and SMP machine"
- Previous message: Michael Schnell: "Re: Signal callback"
- In reply to: Frank: "How to use vxworks bootloader to load monta vista linux kernel image?"
- Next in thread: John: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Reply: John: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Reply: Steven Rostedt: "Re: How to use vxworks bootloader to load monta vista linux kernel image?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|