2004-03-06 00:06:21

by john moser

[permalink] [raw]
Subject: Kernel-User shared buffer

Hi.

I'm trying to create a shared buffer for realtime communication
between the kernel and a userspace application. All allocation
is done for the userspace task in the kernel, and the kernel is
to write to the ram from within syscalls made by other
processes.

I don't think remap_page_range will work for this application,
but I am unsure, and I am unsure of its usage besides.

The basic logic is pretty much as follows:

task_t *acl_daemon = tskacld;
acldata *waclque;
waclque = kmalloc(sizeof(acldata), GFP_KERN);
addr = map_to_user(acl_daemon, waclque, sizeof(acldata));
old_aclque->msg = msg;
old_aclque->next = addr;
old_aclque->eval = ACL_EVAL_EVAL;

pretty much, I want to map system memory to userspace per task,
in the context of the core kernel. This is NOT a driver or
loadable module.

If you could give me a source file and function name of a
function that does this or does something similar, I could
work from there. I've already tried making do_mmap() call a
do_mmap_task() (which is the original do_mmap() with "current"
replaced with "tsk", and tsk passed), but I don't think this
helps me :/

_____________________________________________________________
Linux.Net -->Open Source to everyone
Powered by Linare Corporation
http://www.linare.com/


2004-03-06 21:00:22

by Karim Yaghmour

[permalink] [raw]
Subject: Re: Kernel-User shared buffer


john moser wrote:
> I'm trying to create a shared buffer for realtime communication
> between the kernel and a userspace application. All allocation
> is done for the userspace task in the kernel, and the kernel is
> to write to the ram from within syscalls made by other
> processes.

I'm not sure what you mean by "realtime", but have a look at relayfs:
http://www.opersys.com/relayfs/index.html

Karim
--
Author, Speaker, Developer, Consultant
Pushing Embedded and Real-Time Linux Systems Beyond the Limits
http://www.opersys.com || [email protected] || 1-866-677-4546

2004-03-09 00:50:04

by Peter Chubb

[permalink] [raw]
Subject: Re: Kernel-User shared buffer

>>>>> "john" == john moser <[email protected]> writes:

john> Hi. I'm trying to create a shared buffer for realtime
john> communication between the kernel and a userspace application.
john> All allocation is done for the userspace task in the kernel, and
john> the kernel is to write to the ram from within syscalls made by
john> other processes.

It's easier to go the other way. Get your application to map the
buffer from a filesystem that you provide. See, e.g., the code in
arch/ia64/kernel/perfmon.c.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*