Re: First program on arm board



On Jan 31, 6:23 pm, Juergen Beisert <jbeis...@xxxxxxxxxxxx> wrote:
Chads wrote:
On Jan 31, 3:17 pm, Juergen Beisert <jbeis...@xxxxxxxxxxxx> wrote:
You like the hard way? Why do you do it in assembler?

It's not working. Seems I missing lots of things here. First thing
which comes is how to write linker file for it. Can someone please
guide me or give me pointer so that I can study it. I have found few
sample linker files from Linux kernel code also and trying to figure
out how to write them.

What's your intention? A program that runs on bare metal or as part of
the Linux kernel or something that should run as a usermode program?
Programming in assembler *could* make sense if it should run on bare
metal. For the other cases you should do it in "C".

Thank you for your response.
Yes I want to run it on bare metal thats why witting it in assembly.
But you wrote:
I am very new to embedded linux. I have a pxa255 based board and I am
planning to put linux on it.

But if you plan to bring Linux in your box, why do you start with bare
metal?

Writing linker script files is not such complicated. Refer ld's manpages.
All it does is to give your code some kind of "layout" when it gets
translated to binary: Where to place the text segment content in the file
and at runtime (same for data and bss segment).
But how do you want to run this program on your bare metal? This CPU
needs some kind of setup after reset. To bring up the SDRAM controller
for example.

Juergen

First I am planning to have my basics ready. The very basic program
which I can think of is writing this code to toggle LED.

All right, you want to go the hard way...

Can you please let me know in detail what all setups will be required
to run program on bare metal?

Sorry, I can't. Because I know nothing about your hardware (only your
processor). At least your SDRAM controller must be actice and your clock
setup must be correct. Otherwise nothing will happen. And you will need
Hi,

I was able to write linker script but still my first program is not
working.

Please see if someone can help.

-Chads

some kind of JTAG tool to bring your small program into your target.

Even if you can share path of any tutorial which explain in detail
will be very helpful.

Try to study the U-Boot bootloader code. They do all the required setup
and - maybe - your hardware is also supported.

I am currently reading "http://www.redhat.com/
docs/manuals/enterprise/RHEL-4-Manual/gnu-linker/scripts.html"

To link your program its the right direction.

JB

.



Relevant Pages

  • Re: First program on arm board
    ... which comes is how to write linker file for it. ... sample linker files from Linux kernel code also and trying to figure ... needs some kind of setup after reset. ... Because I know nothing about your hardware (only your ...
    (comp.os.linux.embedded)
  • Re: First program on arm board
    ... thing which comes is how to write linker file for it. ... of the Linux kernel or something that should run as a usermode ... needs some kind of setup after reset. ... At least your SDRAM controller must be actice and your clock ...
    (comp.os.linux.embedded)
  • Re: First program on arm board
    ... thing which comes is how to write linker file for it. ... of the Linux kernel or something that should run as a usermode ... At least your SDRAM controller must be actice and your clock ... /* mov pc,lr need to see what it is ??? ...
    (comp.os.linux.embedded)
  • Re: First program on arm board
    ... thing which comes is how to write linker file for it. ... of the Linux kernel or something that should run as a usermode ... Used cross arm assembler to create its executable file. ... Transferring this binary image to my board at 0x0 as processor ...
    (comp.os.linux.embedded)