SUCCESS! The problem is by opening the device directly was never going to get mapped correctly no matter what I tried. So, I have to open a file that represents the memory system and insert the PCIe address into the mmap function call. so, I changed
to
and changed
to
where OFFSET is the BAR address assigned by the OS.
I don't know why the first method didn't work. Must be something about my system.
EDIT: 4/4/13: 1:59PM: Both methods of opening the file are working now. You won't believe what I discovered.
If I embed the 'open' call within the conditional statement as above, both methods fail.
If I use the 'open' call by itself and test the descriptor seperately, both methods work.
What 'da hell?
Rich (BB code):
if(dev = open("/sys/bus/pci/devices/0000:02:00.0/resource0", ....
Rich (BB code):
if(dev = open(/dev/mem, ...
Rich (BB code):
map = mmap(0, FILESIZE, PROT_READ | PROT_WRITE, MAP_SHARED, dev, 0);
Rich (BB code):
map = mmap(0, FILESIZE, PROT_READ | PROT_WRITE, MAP_SHARED, dev, OFFSET);
I don't know why the first method didn't work. Must be something about my system.
EDIT: 4/4/13: 1:59PM: Both methods of opening the file are working now. You won't believe what I discovered.
If I embed the 'open' call within the conditional statement as above, both methods fail.
If I use the 'open' call by itself and test the descriptor seperately, both methods work.
What 'da hell?
Last edited: