> > But I
> > can't get "char dev. driver" module to be
insmoded -- it says that
> > put_user is unresolved symbol.
> If i understand your problem correctly you
are experiancing a so called module
> dependency problem. Insmod does not look
for dependant modules, it simply tryes
> to load the module its told to load.
> So try modprobe, or find out which module
is needed by your module and insmod
> that module before trying to load your
module, i cant say i know what module
> you mean, its name says nothing to me.

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

I did work through the module programmers
guide once, and getting the uaccess macros
working took many failed attempts.

> > 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), where x is the name of a
function to call at insmod time, at the end
of the module. The equivalent at rmmod time
is module_exit(y).

The prototypes for x and y are:

static int __init x(void);
static void __exit y(void);

Is this what you meant? Look in
linux/module.h, near MODULE_AUTHOR, for a
couple of others.

Steven.


-
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

Reply via email to