[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: parse error before "u32"



In theory you can do something like this:

int fd;
unsigned* data;
fd = open( "/dev/mem", O_RDWR );
data = (unsigned*)mmap( (void *)0, 0x00002000, PROT_READ|PROT_WRITE,
MAP_SHARED, fd, 0xB0000000 );

The first register (R_WAITSTATES) is then avaiable as data[0]. I think
that you have to add /dev/mem in e.g. packages/devices/axis-2.4/Makefile
and maybe you have to enable some kernel option also to get a working
/dev/mem.

>However I would really like to set the parallell 
>port into manual mode and read/write bytes from user space.

This usually indicates a bad design choice. Maybe you can use the
existing parallel port framework to control the lines instead?
I think it allows the user to control all the control lines and
data.

>Is it  possible to do this "the normal Linux way" i.e. by ioperm() 
>and inb() calls? 

No. inb() is unusable on CRIS.

/Mikael