Hello, could you help me? I need utility or part of code which read part of physical memory in non kernel mode. I wrote this : #include #include #include #include #include
int main() { FILE* fd = fopen("/dev/mem","r"); unsigned int i; unsigned int base; char c[4]; if (fd == 0) printf("Error while opening /dev/mem\n"); base = 0x40d00010;
fseek(fd, SEEK_SET, base); for (i = 0; i < 16*4; i+=4) { fread(&c,4,1,fd); printf("addr[%2X]=0x%.2X %.2X %.2X %.2X\n",base+i,c[0],c[1],c[2],c[3]); } return 0; }
But i cannot read /dev/mem on my device because /dev/mem doesn't work (cat /dev/mem cause segmentation fault). Is there any other possibility how do these. (ioctl)
Thank you
Tomas