On Mon, May 21, 2001 at 08:40:23PM +0100, Steven Smith wrote:
>>> But I can't get "char dev. driver" module to be insmoded -- it
>>> says that put_user is unresolved symbol.
> put_user is defined in the kernel proper, rather than in a module.
> Or, more accurately, in asm/uaccess.h. put_user is actually a
> preprocessor macro around various other functions (__put_user_1,
> __put_user_2, and __put_user_4), so no module should ever depend on
> it directly.
Yes, I've figured it out with grep.
> If you look in /proc/ksyms, you will see that those functions are
> exported, whereas put_user isn't. As to what you can do about it -
> haven't a clue. Make sure the -DMODULE, -D__KERNEL__, -DLINUX, and
> -I/usr/src/linux/include are given before the name of the file to
> compile.
After I've included <asm/uaccess.h>, it doesn't compile any more --
saying something like 'movl %ah, %ecx -- wrong argiments', or
something like that. I've tried to produce hello.s, and corrected
'movl' to 'movb' [;)], thought it did't work either.
I have gcc-2.92.2, just compiled from sources (not that *** gcc
shipped with my RH 7.0). I don't think it's the problem -- I've just
compiled kernel without any significant errors.
I've seen put_user() used in fs/read_write.c, and movel all #include's
from that file -- however, it had no significant effect.
May be it has something to do with my arch ?? I have Cyrix processor,
and I don't know any further details -- it was shipped along with my
laptop.
> I did work through the module programmers guide once, and getting
> the uaccess macros working took many failed attempts.
Is there any way or any place to see correct usage of this funcs ?? I
don't know how it happened. Could you send your *working* result ??
>>> P.s.: I've seen that there are some neafty macros instead of
>>> init_module and cleanup_module. Is it documented anywhere ??
> Tag module_init(x) ... Is this what you meant? Look in
> linux/module.h, near MODULE_AUTHOR, for a couple of others.
Yes, that's exactly it. Thanks.
--
WBR.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.linux-learn.org/faqs