linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Peter Asemann <peter.asemann@web.de>
To: linuxppc-embedded@ozlabs.org
Subject: Writing a small test program - a bit off topic
Date: Mon, 09 May 2005 11:58:25 +0200	[thread overview]
Message-ID: <427F3441.2010108@web.de> (raw)

Hi there!

I *hope* this mail isn't very off topic. In principle it probably is, 
but I don't know a mailing list which is about writing test programs to 
test processors in order to debug a hardware to get linux running. Plus, 
I suppose there are people out there who could help me. So I hope you 
won't stone me for this post.

Whatever:
I have to write some test program for a mpc875 processor. It should run 
in the processor cache as the memory of the hardware doesn't work for 
hardware-problem-reasons.

I set up the memory mapping of the IMMR of the processor with the 
debugger (BDM4GDB) so the IMMR is at 0xff000000.
Then I want to change the state of two leds. This can be done by writing 
some values into some memory-mapped MPC registers (PEDAT / PEDIR) which 
reside at IMMR + 0xac8 / 0xad8.

I wrote a C program to do that; As there is no OS I think I can just try 
to write to memory locations directly:

#define CONFIG_8xx

int main(void){
long* a;
long* b;
a = (long*)0xff000ac8;
*a = 0x00001800;
b = (long*)0xff000ad8;
*b = 0x00001800;
}

Actually, if I compile it (using Denx ELDK 3.1) with

ppc-linux-gcc -static led.c -o led

the resulting program is 477K big.
On the other hand, if I do

ppc-linux-as -mcom led.s
and
ppc-linux-as -mcom led.s -o led.bin

the resulting program is 439 byte big.

Now, my questions are: Will the 439 byte program faciliated this way do 
what I want? Did I make some fatal newbie mistakes? Does somebody know 
how to upload code to the mpc instruction cache and execute it?

Thanks for reading,

Peter Asemann

             reply	other threads:[~2005-05-09 10:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-09  9:58 Peter Asemann [this message]
2005-05-09 20:04 ` Writing a small test program - a bit off topic McMullan, Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=427F3441.2010108@web.de \
    --to=peter.asemann@web.de \
    --cc=linuxppc-embedded@ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).