Re: Difference between process & kernel module

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

 



Rakesh Jagota wrote:

hi , 


My comments inline.

> 
> Hi all,
> what is the difference between provcess and kernel module? 

A Process - 
1) Can be executed on its own . Is an executable.
2) Has life , it runs on the CPU .Has a kernel data_structue associated with it called struct task_struct in kernel
space.
3) Has a process id.

A Module  - is just object code linked with the kernel when insmod'ed, 

1) Can't be executed on their own , it is not an executable .
2) Doesn't have any struct task_struct associated with it, Since it is not a process .
3) Can be considered as a library , which processes use  ( through an interface  ), hence they run in process context (
not always though  ).

As process
> contains text, data, bss, stack & heap, Will all this present for kernel
> Module also?  
asking silly Q?

i suggest you try some simple modules , it would clear your doubts.

> 
> Is it possible to do like whatever we are doing inside the process, can we
> do the same in the kernel module.

More than what a process can do , cause your module code is executing in kernel mode. 
> 
> Thanks,
> rakesh
> 

cheers,
Amith

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[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