Kernel Programming Questions

Fabio De Lorenzo delorenzo.fabio at gmail.com
Fri May 23 22:52:12 UTC 2008


Vadim,

If you want to access to Userspace and load a binary files from KS,
use request_firmware() .

But as Greg said, you have to better understand the meaning of kernel space.


Regards
Fabio



On Fri, May 23, 2008 at 3:42 PM, Vadim Klishko <vadim at cirque.com> wrote:
> 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?
>
> 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.
>
>>> Any help will be sincerely appreciated.
>>
>> The kernelnewbies mailing list and wiki covers the above topic in great
>> detail if you wish to understand why you should not be doing any of the
>> above from within the kernel.
>>
> 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?
>
>> thanks,
>>
>> greg k-h
>
> Vadim
>
> _______________________________________________
> devel mailing list
> devel at linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/devel
>



More information about the devel mailing list