Read IO Port data on X86

Joel Sherrill joel.sherrill at OARcorp.com
Fri Mar 9 19:14:51 UTC 2012


I think you have a mix of RTEMS and non-RTEMS files. RTEMS does
not have a file named io.h. It is rtems/io.h. I really believe that if
you got this far, you are mixing and matching something.

I didn't do any real clean up on the code except to get it to compile
and link. Attached.

--joel

On 03/09/2012 02:07 AM, zhoupeng wrote:
> Hello,
> I am taking part in a project now , we want to use rtems in our pc104
> board(base on x86). Recently, I write a program for IO port (include
> driver and test program).The function of the program is very easy ,
> just read data form a port (eg:0x301).
> This is my first time to write a device driver useing rtems . In the
> process of debuging , I meet some errors ,can you tell me how to solve
> these errors. Thank you !
> Best Regard!
> I test these program under the folder of hello_world_c.
> error information:
> [root at localhost hello_world_c]# make
> i386-rtems4.10-gcc --pipe
> -B/home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/
> -specs bsp_specs -qrtems -g -Wall -O2 -g -g -I
> /home/rtems/rtems-4.10-work/rtems/cpukit/score/cpu/i386/rtems/score -I
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems
> -I /home/rtems/rtems-4.10-work/examples-v2/hello/hello_world_c
> -mtune=i386 -c -o o-optimize/test.o test.c
> In file included from test.c:53:
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/confdefs.h:54:
> error: expected '=', ',', ';', 'asm' or '__attribute__' before
> 'Configuration'
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/confdefs.h:59:
> error: expected '=', ',', ';', 'asm' or '__attribute__' before
> 'Configuration_POSIX_API'
> In file included from test.c:53:
> /home/rtems/rtems-4.10-wor!
> k/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/confdefs.h:2166:
> error: expected '=', ',', ';', 'asm' or '__attribute__' before
> 'Configuration'
> test.c: In function 'Init':
> test.c:68: warning: 'rtems_io_lookup_name' is deprecated (declared at
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/io.h:186)
> test.c:69: warning: passing argument 3 of 'rtems_io_open' makes
> pointer from integer without a cast
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/io.h:142:
> note: expected 'void *' but argument is of type 'int'
> test.c:80: warning: passing argument 3 of 'rtems_io_close' makes
> pointer from integer without a cast
> /home/rtems/rtems-4.10-work/bsp-install/i386-rtems4.10/pc386/lib/include/rtems/io.h:148:
> note: expected 'void *' but argument is of type 'int'
> make: *** [o-optimize/test.o] Error 1
>
>


-- 
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20120309/7e4acd27/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hello_world_c.tar.bz2
Type: application/x-bzip
Size: 3247 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20120309/7e4acd27/attachment-0001.bin>


More information about the users mailing list