Re: autoconf.h #defines different names for modules/non-modules

Ben Gertzfield (che@debian.org)
09 Sep 1998 12:23:05 -0700


>>>>> "David" == David Woodhouse <David.Woodhouse@mvhi.com> writes:

Ben> In any case, I hope the proper way to #ifdef out code that
Ben> needs to go into the kernel proper (i.e. not a driver)
Ben> whether or not something is compiled in as a module is:
Ben>
Ben> #ifdef CONFIG_DFS_TRACE || CONFIG_DFS_TRACE_MODULE ...
Ben> #endif
Ben>
Ben> but that looks awfully silly. Why is this necessary?

David> Because in general it's a silly thing to do. If something
David> is compiled as a module, it should be usable in a standard
David> kernelš. The kernel itself shouldn't change according to
David> which modules are compiled with it.

In this case, however, the kernel *should* change according to the
modules that are compiled with it.

The module that I'm working on performs traces from within the kernel,
monitoring functions like do_fork() in kernel/fork.c, sys_open() in
fs/open.c, et cetera. It needs to report its findings to user-space
so that they can be recorded, and it does this through a char
driver, which is the buffer module I wrote.

If the support for the buffer module is not compiled into the kernel,
it would be extremely bad to compile in the profiling code that I've
written into do_fork() et al.

David> It's extremely useful to be able to compile new modules for
David> new hardware or features without having to recompile the
David> whole kernel. If every modular driver did this kind of
David> thing, it'd be impossible.

Then the impression I'm getting from this is that I shouldn't make my
buffer driver be able to be a module at all, but instead force the
support for it to be compiled in monolithically. Is this correct?

David> ( Take a look at the PC speaker driver for a prime example
David> of this bad behaviour - you can only load the pcsnd.o
David> module into a kernel which was compiled with CONFIG_PCSP=m
David> :)

This is probably the same kind of problem I'm running into -- very
low-level things had to be modified, the kinds of things that can't
just be changed through a normal module.

Ben

-- 
Brought to you by the letters Q and M and the number 19.
"Mmm.. incapacitating.." -- Homer Simpson
Debian GNU/Linux -- where do you want to go tomorrow? http://www.debian.org/
I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html