Re: Understanding how kernel functions works and adding new one

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

 



On Sat, Dec 25, 2004 at 09:50:00 +0530, linux lover wrote:
> Hello ,
>          I want to know what things are require me to add my own
> function in kernel through modules?
>           Actually i  have 2 questions in my mind
>        1) Is it possible to write own user defined function in kernel
> modules and get in laoded in kernel and allow kernel to use it?

Yes.

Symbols exported by the module become exported symbols of the kernel.
Just put your function in a module and it will get in kernel.

To actualy call it is another matter though. You will have to register
it as a handler of something. As a method of a file or device, or put it
on a workqueue somewhere, or start it in a kernel thread...

>        2) Is it possible to add my own function program in C file to
> kernel and allow my kernel module to use it?

Yes.

Modules can use functions exported by other modules. So you can just put
it in another module. If it's not possible (but try hard before you give
up), you can of course compile it into the kernel. But you will have to
mark it with the macro EXPORT_SYMBOL to make it visible.

>        I want to add own function not any system call(Am i
> misunderstanding between syscall and new function call in kernel?)

No. You are right.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux