Re: How to use vxworks bootloader to load monta vista linux kernel image?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
OK, I got a little progress. I managed to build a problem with its own
head. I linked it with the compressed vmlinux image and then put it in
an ELF format. The entry address I set is 0x10000. When I tried to
start, I got this screen output:
"Attached TCP/IP interface to emac0.
Warning: no netmask specified.
Attaching network interface lo0... done.
Loading... 668152
Starting at 0x10000..."

Then nothing happened after that. The linux didn't come up. I think
the entry of the file has been correctly located but somehow it
couldn't decompress the linux file and put it in a correct address.
What could happen here and how should I debug it? Can I get some print
out information on the screen to monitor what is going on?

Thanks!
Frank



snipped-for-privacy@yahoo.com (Frank) wrote in message
Quoted text here. Click to load it

Re: How to use vxworks bootloader to load monta vista linux kernel image?
Hi Frank,

And congratulations on your success, and welcome to the world of porting
  Linux.  There's not much I can help you with now, its all about
knowing the board.  What I would do next is, if a UART is available
(which I would assume is, since you're working with vxWorks boot
loader),  write a small program that outputs to the UART, and put that
at the beginning of the zImage head.S.  Output an 'x' and see if it
shows up when you load your program, if it does, keep moving it down and
that's when you have the fun of finding out what to do next.  Once you
get it to jump to C code, it becomes a lot easier.

Good luck and have fun.

-- Steve



Frank wrote:
Quoted text here. Click to load it


Re: How to use vxworks bootloader to load monta vista linux kernel image?
Yes, my board has UART available. But I am not sure how to program on
it. Could you give several line of codes to show as an example?

When you booted the linux kernel successfully, did you change the
source code and rebuild it to make it work?

Thanks a lot!
Frank


Quoted text here. Click to load it

Re: How to use vxworks bootloader to load monta vista linux kernel image?
Quoted text here. Click to load it

I'll give you an example of an idea, but anything else is boardering on
contracting, and I do charge :-)

The uart is very specific to boards, and you really should know how to
program one. It's been a while since I needed to, and since I don't have
a PPC board available with me, I don't assume this code will work
(untested).  But it will give you an idea.

#define UART_BASE 0xf40003f8  // This must match where the UART register
is (physical address).  Don't use this number, it's from another board I
once worked on.

#define UART_REGSHIFT 0  // This may be 0 - 3 depending on how far the
UART registers are from each other (byte aligned to 64 bit alligned

#define UART_LSR 5
#define UART_TX 0
#define TX (UART_TX << UART_REGSHIFT)
#define LSR (UART_LSR << UART_REGSHIFT)

#define UART_LSR_TEMT   0x40
#define UART_LSR_THRE   0x20
#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)

    lis    r17, UART_BASE@h
    ori    r17,r17, UART_BASE@l
1:    lbz    r18,LSR(r17)
    andi.    r18,r18,BOTH_EMPTY
    bne    1b

    li    r18, 'x'
    stb    r18, TX(r17)



This also depends a lot on the board and what vxWorks boot monitor does
to the uart before it calls the code. Hopefully it doesn't reset it. And
this is assuming that you have a standard 16550 uart.

Note, that the above code also assumes that the MMU is off, since it
uses physical addresses, as well as cache, since that may make this loop
forever.

    
Quoted text here. Click to load it

I use to port kernels to different boards, so that means that I did a
lot to the kernel to get it running.  Not just some tweaks here and
there.  Sometimes, that's all it took, others I had to rewrite the PCI
layer.  It all depends on how standard the board is to what is already
out there.

-- Steve


Re: How to use vxworks bootloader to load monta vista linux kernel image?
Opps, missed a line.  Still I don't claim that this will work since it's
untested.

Steven Rostedt wrote:

Quoted text here. Click to load it

    cmpi  0,r18,BOTH_EMPTY

Quoted text here. Click to load it


Re: How to use vxworks bootloader to load monta vista linux kernel image?
Thanks a lot!

Frank

Quoted text here. Click to load it

Site Timeline