Kernel Programming Questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/5/24 Vadim Klishko <vadim at cirque.com>:
> On Friday, May 23, 2008 4:00 PM, "Greg KH" wrote:
>
>> On Fri, May 23, 2008 at 02:32:46PM -0600, Vadim Klishko wrote:
>>> Hello Everybody,
>>>
>>> Could anyone please tell me what functions I could call from a Linux kernel module to:
>>>
>>> 1) dynamically load a library,
>>
>> None.
>>
>>> 2) get the address of an exported function,
>>
>> None.
>>
>>> 3) unload the library?
>>
>> None.
>>
>> None of these things are things that you should do from within a kernel
>> module.
>>
>>> Also, what are the functions that would allow me to read from and
>>> write to a binary or text file from within a kernel module?
>>
>> None, this is not what a kernel module should ever be doing.
>>
>> Let's turn it around the other way, what are you trying to achieve that
>> makes you think the above things are necessary to do?
>>
> By reading a file, I am trying to load a system-wide device configuration. Of course, it could be hard-coded into the module, but why not try having it
> adjustable?

What's wrong with module parameters?

>
> The driver I am writing is for touchpads. Some customers want their devices to have functionality different from a standard mouse. For example, they may
> want to turn a touchpad into a keypad, where touching the surface in certain areas produces keystrokes. For those customers (OEM) who use a touchpad
> module to create their own device, this pretty much amounts to having a customized driver. Instead of having to build a new driver, they could simply edit the
> configuration file.

How about letting behaviour be changed by writing values to files in
sysfs (/sys) ?

> Thank you for pointing me to kernelnewbies. I realize it's premature to argue before I have read their arguments against doing these things in the kernel, but
> the first objection that crosses my mind is this: I can do it in Windows. Why not in Linux?

Read these :
http://kernelnewbies.org/FAQ/LibraryFunctionsInKernel
http://kernelnewbies.org/FAQ/WhyWritingFilesFromKernelIsBad

-- 
Jesper Juhl <jesper.juhl at gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux