Brad Boyer flar at
Tue Sep 27 03:44:04 EST 2005

On Mon, Sep 26, 2005 at 03:48:03PM +0800, zhonglei wrote:
>    I get a pointer shramptr from sys_shmat(shid,0,SHM_R|SHM_W,&shramptr) to use share RAM in my driver.
> But when I assign a value into this pointer in my interrupt routine,
> the system shows: oops: kernel access of bad area!
> what's the problem?

The problem is that sys_shmat is the implementation of the shmat() system
call and is therefore only intended to attach shared memory to a normal
user-space process. The memory is attached to whatever process is listed
as current at the time of the call. This is obviously not what you wanted,
since you apparently want something that is useful from kernel-space.

Perhaps you should tell the list what you are trying to do from a more
conceptual view? No matter what you are trying to do, I think you are
misunderstanding the services that are available to a driver in the kernel.
The key question you need to answer is where you need to be able to
access this memory. In particular, do you need it in a user-space program?

	Brad Boyer
	flar at

More information about the Linuxppc-dev mailing list