I'm novice at linux low level programming. Would you like to help me..?
I hope to access my memory-mapped based ISA Card. From several news group articles, I got to know that it is needed to use functions as ioremap(), readb(), writeb().... 
 
so , I wrote my sample code for reading&writing the registers of my memory mapped ISA Card.  but.. I always faild to link.
 
my code & error message is as follows..
Can you give me a comment and good solution..?
 
#include <asm/io.h>
 
void main()
{
 unsigned long addr;
 unsigned long size;
 unsigned char readbyte;
 
 addr = 0xd6000;
 size = 4095;
 
 ioremap(addr,size);
 readbyte=readb(addr);
}
 
>> gcc -o memiotest memiotest.c
 
memiotest.c: In function `main':
memiotest.c:4: warning: return type of `main' is not `int'
/tmp/ccrVq7Af.o: In function `main':
/tmp/ccrVq7Af.o(.text+0x1d): undefined reference to `ioremap'
/tmp/ccrVq7Af.o(.text+0x29): undefined reference to `readb'
collect2: ld returned 1 exit status
 

>> gcc -D__KERNEL__ -o memiotest memiotest.c
 
memiotest.c: In function `main':
memiotest.c:4: warning: return type of `main' is not `int'
/tmp/ccHR1coE.o: In function `main':
/tmp/ccHR1coE.o(.text+0x1d): undefined reference to `ioremap'
collect2: ld returned 1 exit status
 
 

Reply via email to