LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-25-2010, 02:27 AM   #1
paliga
Member
 
Registered: Feb 2010
Posts: 39

Rep: Reputation: 0
Does a kernel module run in kernel or user space?


Hi...

Im pretty new to this whole (micro)kernel architecture story.

Im wondering if a kernel module is running in kernel or in user space?

Is a driver running as kernel module slower than a driver build into kernel?
If so, are there some current articles, benchmarks?

Thanks in advance and with kind regards,
chris
 
Old 10-25-2010, 04:07 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
Im wondering if a kernel module is running in kernel or in user space?
A kernel module is not treated differently to other parts of the kernel, apart from being dynamically loadable. It runs in supervisor mode.

Quote:
Is a driver running as kernel module slower than a driver build into kernel?
Yes, there is a small penalty because of the extra level of indirection making calls between the module and other kernel services. The fraction would be different depending on the number of calls being made. For most drivers it would not be significant (ie, worth making a module built in).

Quote:
this whole (micro)kernel architecture
The Linux kernel is not a microkernel, because it does not have any real separation between the components of the kernel. The kernel of OS X is based on the Mach microkernel, but is something of a hybrid.

Last edited by neonsignal; 10-25-2010 at 04:14 AM.
 
Old 10-25-2010, 04:09 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
A kernel module is (effectively and literally) an extension to the kernel. It runs in kernel context.
Except registered interrupt handlers - they, of course, run in interrupt context.
 
Old 10-25-2010, 04:13 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Nope - all kernel memory is non-paged and directly addressable. Built in or module.
 
Old 10-31-2010, 07:22 AM   #5
paliga
Member
 
Registered: Feb 2010
Posts: 39

Original Poster
Rep: Reputation: 0
thanks a lot : )
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to send events from kernel module to user space process yugandhar Linux - Kernel 2 02-21-2011 10:39 AM
Free user space pages of different user processes from inside kernel space trueskyte Linux - Kernel 1 10-22-2010 04:37 PM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 09:59 AM
linking .o files built in user space against kernel module using kbuild santigopal_mondal Linux - Newbie 1 01-03-2009 02:42 PM
Kernel Module to send Message to User Space Application hnshashi Linux - Newbie 2 08-22-2008 12:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration