linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Regarding parallel port in MPC8245...
@ 2004-08-02  7:25 m madhuker
  2004-08-02  7:34 ` Pantelis Antoniou
  2004-08-02  8:13 ` Wolfgang Denk
  0 siblings, 2 replies; 4+ messages in thread
From: m madhuker @ 2004-08-02  7:25 UTC (permalink / raw)
  To: linuxppc-embedded


Hello all...
         Im working on MPC8245 board..
with timesys GPL-linux..

I want to transfer data(just glow a light) in serial
port or parallel port...

so i worte a simple program to glow a light in
parallel port as follows:

---------
#include "asm/io.h"
#include<unistd.h>
#include<stdlib.h>
#include<stdio.h>
main()
{
        outb(0x378,0xff);
        printf("Data sent out \n");
}
----------------------------------------

but when i compiled,it showing errors as follows:

[root@mail root]# powerpc-linux-gcc out.c
/tmp/ccED5Jlo.o: In function `main':
/tmp/ccED5Jlo.o(.text+0x20): undefined reference to
`outb'
/tmp/ccED5Jlo.o(.text+0x20): relocation truncated to
fit: R_PPC_REL24 outb
collect2: ld returned 1 exit status
[root@mail root]#
----------------------------------------

the oub function  defination is in  "asm/io.h"..which
i included but also it is showing error undefined
reference...

in x86 it was executed perfectly...

Please can anybody help out from this problem....

                                      Regards
                                      Madhukar


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regarding parallel port in MPC8245...
  2004-08-02  7:25 Regarding parallel port in MPC8245 m madhuker
@ 2004-08-02  7:34 ` Pantelis Antoniou
  2004-08-02  8:53   ` Wolfgang Denk
  2004-08-02  8:13 ` Wolfgang Denk
  1 sibling, 1 reply; 4+ messages in thread
From: Pantelis Antoniou @ 2004-08-02  7:34 UTC (permalink / raw)
  To: m madhuker; +Cc: linuxppc-embedded


m madhuker wrote:
> Hello all...
>          Im working on MPC8245 board..
> with timesys GPL-linux..
>
> I want to transfer data(just glow a light) in serial
> port or parallel port...
>
> so i worte a simple program to glow a light in
> parallel port as follows:
>
> ---------
> #include "asm/io.h"
> #include<unistd.h>
> #include<stdlib.h>
> #include<stdio.h>
> main()
> {
>         outb(0x378,0xff);
>         printf("Data sent out \n");
> }
> ----------------------------------------
>
> but when i compiled,it showing errors as follows:
>
> [root@mail root]# powerpc-linux-gcc out.c
> /tmp/ccED5Jlo.o: In function `main':
> /tmp/ccED5Jlo.o(.text+0x20): undefined reference to
> `outb'
> /tmp/ccED5Jlo.o(.text+0x20): relocation truncated to
> fit: R_PPC_REL24 outb
> collect2: ld returned 1 exit status
> [root@mail root]#
> ----------------------------------------
>
> the oub function  defination is in  "asm/io.h"..which
> i included but also it is showing error undefined
> reference...
>
> in x86 it was executed perfectly...
>
> Please can anybody help out from this problem....
>
>                                       Regards
>                                       Madhukar
>
>
>
>

http://www.amazon.com/exec/obidos/tg/detail/-/0764551302/002-9292903-4601667?v=glance


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regarding parallel port in MPC8245...
  2004-08-02  7:25 Regarding parallel port in MPC8245 m madhuker
  2004-08-02  7:34 ` Pantelis Antoniou
@ 2004-08-02  8:13 ` Wolfgang Denk
  1 sibling, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-08-02  8:13 UTC (permalink / raw)
  To: m madhuker; +Cc: linuxppc-embedded


In message <20040802072537.86860.qmail@web13604.mail.yahoo.com> you wrote:
>
>          Im working on MPC8245 board..
> with timesys GPL-linux..
...
> ---------
> #include "asm/io.h"
> #include<unistd.h>
> #include<stdlib.h>
> #include<stdio.h>
> main()
> {
>         outb(0x378,0xff);
>         printf("Data sent out \n");
> }
> ----------------------------------------
...
> the oub function  defination is in  "asm/io.h"..which
> i included but also it is showing error undefined
> reference...

You make many errors here at once.

First: "asm/io.h" is a kernel header file, and you are  not  supposed
to include it at all in a user space application file.

Second: outb() is only available for kernel code (drivers) on PowerPC.

Third: I don't think that 0x378 will work on your MPC8245 board.

Four: eventually there is not even a PC style parallel port  on  your
board.

> in x86 it was executed perfectly...

Not all the world is a VAX...


Check with your board manual if there is really a PC  style  parallel
port  on  it,  and if so, on which addresses it is mapped. Then study
Alessandro Rubini, Jonathan Corbet:  _"Linux  Device  Drivers"_,  2nd
Edition,  and  get  a clue about driver programming. Then implement a
device driver.

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
FORTRAN? The syntactically incorrect statement "DO 10 I = 1.10"  will
parse  and  generate  code  creating  a  variable, DO10I, as follows:
"DO10I = 1.10" If that doesn't terrify you, it should.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Regarding parallel port in MPC8245...
  2004-08-02  7:34 ` Pantelis Antoniou
@ 2004-08-02  8:53   ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2004-08-02  8:53 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: m madhuker, linuxppc-embedded


Dear Pantelis,

in message <410DEE94.8030601@intracom.gr> you wrote:
>
> > so i worte a simple program to glow a light in
> > parallel port as follows:
...
> http://www.amazon.com/exec/obidos/tg/detail/-/0764551302/002-9292903-4601667?v=glance

Did you _really_ intend to point to "Gardening for Dummies"  by  Mike
MacCaskey & Bill Marken?

How is this related to this topic?

Best regards,

Wolfgang Denk

--
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd@denx.de
There are no data that cannot be plotted on a straight  line  if  the
axis are chosen correctly.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-02  8:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-02  7:25 Regarding parallel port in MPC8245 m madhuker
2004-08-02  7:34 ` Pantelis Antoniou
2004-08-02  8:53   ` Wolfgang Denk
2004-08-02  8:13 ` Wolfgang Denk

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).