Re: pci memory access in user mode?



On Mar 28, 10:04 am, mich1985 <florian.harm...@xxxxxxxxxxxxxx> wrote:

if (val[0x0C]!=0xa511)
printf("Bitte Version pruefen! (0x%x != 0xA511)\n",val[0x0C]);

/* gives me 0xc001 instead of 0x1 or 0xc004 instead of 0x4 */
printf("Read: 0x%x\n", val[0x0]);

/* set io enable bit */
*(val+0x18)= (unsigned int) 0x200;

/* turn on my led */
*val = (unsigned int) 0x1;

I would suggest perhaps

*val = 0xFFFF;

since the bytes might be reversed, judging from your "read" comment.

Also, you might try using a voltmeter instead of an LED.

What is this device name?

-Mike
.