Skip to contentSkip to conversation

Understanding how kernel functions works and adding new one

DISCUSSION linux lover 7 participants 7 messages Dec 25, 2004 – Dec 28, 2004

lore
Share & tools
lore
#0 lore raw

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?
2) Is it possible to add my own function program in C file to
kernel and allow my kernel module to use it?
I want to add own function not any system call(Am i
misunderstanding between syscall and new function call in kernel?)
Can anybody correct me in above approaches?Also give me steps
to do that adding functions in kernel/kernel module?
Thanks in advance.
regards,
linux.lover

#1 lore raw

Take a look at:

http://www.kernelhacking.org/docs/kernelhacking-HOWTO/index.html

and

http://www.linuxhq.com/lkprogram.html

First is a basic intro, the latter contains some good information to get you started.

You might also find just looking at random .c files in the driver source directory helpful, to see how it's been done there.

Lastly, I've noticed you've been asking some questions over the past few days which are easily answered by a simple Google search - may I suggest that as a first point of call in future. You'd probably learn a lot more by searching for stuff yourself.

Regards (and Merry Christmas),

Graeme.

Quoted 21 lines · linux lover

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?
2) Is it possible to add my own function program in C file to
kernel and allow my kernel module to use it?
I want to add own function not any system call(Am i
misunderstanding between syscall and new function call in kernel?)
Can anybody correct me in above approaches?Also give me steps
to do that adding functions in kernel/kernel module?
Thanks in advance.
regards,
linux.lover
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#2 lore raw
Quoted 6 lines

Lastly, I've noticed you've been asking some questions over the past few days which are easily answered by a simple Google search - may I suggest that as a first point of call in future. You'd probably learn a lot more by searching for stuff yourself.

I'll second that. Google is probably the closest thing to Microsoft's Knowlege Base that Linux has for quick questions ;) .

There are a number of good books written on the kernel - Linux Device Drivers is due to have its third edition released in February. I'm glad - my second edition copy is starting to look a little ragged from constant reference.

Check this website:

http://www.dit.upm.es/~jmseyas/linux/kernel/hackers-docs.html

It has a good listing of on- and off-line resources, and was updated recently.

Jim

#3 lore raw
Quoted 7 lines · Jim Nelson
Quoted 6 lines

Lastly, I've noticed you've been asking some questions over the past few days which are easily answered by a simple Google search - may I suggest that as a first point of call in future. You'd probably learn a lot more by searching for stuff yourself.

Quoted 5 lines

I'll second that. Google is probably the closest thing to Microsoft's Knowlege Base that Linux has for quick questions ;) .

There are a number of good books written on the kernel - Linux Device Drivers is due to have its third edition released in February. I'm glad
- my second edition copy is starting to look a little ragged from
constant reference.

I must mention Robert Love's Linux Kernel Programming. I'm half-way through it, and I can say it is excelent!

regards & merry xmas,
pedro venda.

#5 lore raw
In reply to Jim Nelson
Quoted 5 lines · Jim Nelson

There are a number of good books written on the kernel - Linux Device Drivers is due to have its third edition released in February. I'm glad - my second edition copy is starting to look a little ragged from constant reference.

In addition to this book, another one that I have found to be an
excellent source is, Understanding the Linux Kernel. There's a second
edition available now here:
http://www.amazon.com/exec/obidos/tg/detail/-/0596002130/ref=pd_qpt_gw_2/103-9996868-5870242 and I imagine that another will be released in the not too distance future, which will cover the 2.6 kernel. It wouldn't surprise me if
somebody here is inside information on a new edition.

Good luck,

Signature · 1 line
Sean
#4 lore raw
In reply to Pedro Venda
Quoted 7 lines · Pedro Venda
Quoted 4 lines

There are a number of good books written on the kernel - Linux Device Drivers is due to have its third edition released in February. I'm glad
- my second edition copy is starting to look a little ragged from constant reference.

I must mention Robert Love's Linux Kernel Programming. I'm half-way through it, and I can say it is excelent!

Also essential is Uresh Vahalia's Unix Internals. It's not a Linux book but contains detailed descriptions of many many brilliant innovations in the history of Unix.

http://www.amazon.com/exec/obidos/tg/detail/-/0131019082/102-7569379-1814536?v=glance

Lee