can you point to the exact file/line info? I could not find the place
where it opens "/dev/mem". Note: It is very un-usual that user-space
opens "/dev/mem", typically you should go via a driver. At least, I
guess you would need root permissions. To debug it using a VP I would
use the Context and Function tracing after loading the symbols of the
shared library.
I would strongly recommend to write your own device driver. It is
really very simple and I have created a skeleton for you.
From your user-space code you would go and use it like this
#include “sys/ioctl.h”
…
int device = open( “/dev/steves_device”, O_RDWR)
#define READ_REG_A 0
…
int value= ioctl(device, READ_REG_A,0);
READ_REG_A is an arbitrary command that is passed to the Linux driver
which handles it:
static int steves_device_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
/* TODO: Check parameter cmd (define your own codes) and return
something, e.g contents of a register */
switch (cmd) {
case 0:
/* E.g.:*/
return steves_device_control.memory[0];
break;
}
}
The driver example can be found here:
http://groups.google.de/group/virtual-platform-users/web/steves_device.c
Put it into “kernel\arch\arm\mach-versatile” and add it to the
makefile there.
Regards,
Achim