Nathan Paul Simons wrote:

>
>         memset(), fprintf() and others are libc functions.  What you need to
> do is change your module to use kernel specific functions (since the kernel
> can't call user-space functions without some trickery . . .).  For example,
> change fprintf() to rtl_printf(), and use rtl_printf() just like regular
> printf (ie do not specify a filestream to write to).
>         Also, there is a memset() function in the kernel, just include
> asm/string.h in your module to get access to it and other string functions
> native to the kernel.

I've include asm/string.h instead of string.h but this include file generates
my new unresolved links.
I'v read the source string.h and I seen extern declarations for the inline
functions written inside.
I solved the problem in a very bad way, I copied the string.h into my working
directory, I removed all extern keywords, and now I get no unresolved links.
My module continues to be not able to acces to profibus card this means that I
can load the module without erros but I does nothing !!!
The user space version works fine.
I'm going to study on how to develope modules.

How can I access file like /dev/... from a RT module ?

>
>         If you want to get really snazzy and make this piece of code work in
> user-space or as a module, try using defines, ie
>

I don't need this and i'll follow your suggestion to dont get snazzy  ;-)

>
> #ifdef  MODULE
> #define fprintf(stream, format, args...)        rtl_printf(format, ## args)
> #else   /* not a module */
> #define fprintf(stream, format, args...)        fprintf(stream, format, \
>                                                         ## args)
> #endif  /* MODULE */
>
> Although you will probably run into other more complicated problems with
> making it run in both user-space and kernel.nks a
>
> --
> Nathan Paul Simons, Junior Software Engineer for FSMLabs
> http://www.fsmlabs.com/

Thanks a lot, Thomas.


-- [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