Hello again
first of all thank you for your suggestion
my idea was actually to (somehow) force the compiler
to allocate the function in shared memory. Then both,
the user-space program and rtl program could have
access to it.
I have been playing with this idea. I had a structure
which was allcoated in shared memory. In that
structrue I defined two pointers to functions:
int (*ptrf1) (int)
int (*ptrf2) (int)
in the rt program these pointers are given the address
of two different functions. In the user-space progam I
have the same structure with this two pointers which
now have a value given by the rtl program. 
The rtl process works correctly, however when
executing these funtions on the user-space program, it
comes up with a "segmentation falut (core dumped)"
error. The same happens if the process is invertedm,
i. e. when the user-space programs gives the address
of the functions to the pointers and the rtl programs
tries to execute them.
I printed the addresses of the pointers and functions
and realised that user-space programs and rtl programs
use different memory space. Is that true? 
Is it possible to have a whole funtion allocated in
shared memory?
I hope the explanation was clear.
thanks again
Raul


--- Olaf Petzold <[EMAIL PROTECTED]> wrote: >
Am Mon, 29 Jan 2001 schrieben Sie:
> > AFAIK the only way to access functions that exist
> in kernel space is via
> > explicit calls to a "device driver" which could be
> read/write but are much
> > more commonly done via the standard ioctl(2)
> mechanism.  There simply is no
> > way to directly "call" such a function because the
> kernel is not in the
> > address space of any user task.
> >     Norm
> I guess the main problem would be how can the
> program find his data segment /
> stack etc. because it in different memory regions in
> user and kernel space. The
> normal way is to share source code and share data in
> shm or use fifos/devices.
> Nevertheless, a kernel module has to be compiled as
> module, a user programm as
> such. User programs afford elf sections there is
> nothing for kernel modules,
> further more main vs. init_module. Isn't such symbol
> in the kernel module
> maybee you will able to insmod/rmmod the module
> without crash but it isn't
> exceuted by the kernel (nice experience on c++ with
> c++ linkage of these
> symbols)
> 
> Regards
> Olaf
> -- [rtl] ---
> To unsubscribe:
> echo "unsubscribe rtl" | mail [EMAIL PROTECTED]
> OR
> echo "unsubscribe rtl <Your_email>" | mail
> [EMAIL PROTECTED]
> ---
> For more information on Real-Time Linux see:
> http://www.rtlinux.org/rtlinux/
> 


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to