LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-08-2010, 08:20 AM   #1
nakul.k1
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Rep: Reputation: 0
Smile linux kernel questions need help


Hi guys
It would be of great help if i get some answers for my questions bellow.

1) I wanted to know can kernel space access user space pointers ,variable
and functions just by including the user space header files yes or no ?
if no then what happen when kernel tries to access user space pointer.

2) kmalloc(1024,GFP_USER);
where does the above kmalloc function allocate memory is it kernel space
or in user space.

3) How is semaphore used in Inter process communication?

4) How is device power management handled in linux ?
i mean i need the complete process in the form of code and document
for any simple device.
a) starting from registering the device driver into the kernel module
b) power consumed by the module during run time idle time etc and who
decide the power consumed by the device must be 'x' volts during
normal operation and 'x-y' volts during idle mode and 0 volts
during sleep mode in which case the state of the device is saved
and restored back when the device is woken up.
 
Old 08-08-2010, 09:01 AM   #2
Meson
Member
 
Registered: Oct 2007
Distribution: Arch x86_64
Posts: 606

Rep: Reputation: 67
Sounds like a homework question.
 
1 members found this post helpful.
Old 08-09-2010, 04:35 AM   #3
bsat
Member
 
Registered: Feb 2009
Posts: 347

Rep: Reputation: 72
Hi,

It would be great help for us if you atleast try to use google once before posting the questions.
You can refer the follwoing
http://oreilly.com/catalog/linuxdrive3/book/index.csp

Understanding Linux Kernel.
 
Old 08-09-2010, 04:52 AM   #4
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by nakul.k1 View Post
1) I wanted to know can kernel space access user space pointers ,variable
and functions just by including the user space header files yes or no ?
if no then what happen when kernel tries to access user space pointer.

2) kmalloc(1024,GFP_USER);
where does the above kmalloc function allocate memory is it kernel space
or in user space.
See if the below link helps you somehow:
http://www.makelinux.net/ldd3/chp-8-sect-1.shtml
and
http://people.ee.ethz.ch/~arkeller/l...ace_howto.html

Last edited by TheIndependentAquarius; 08-09-2010 at 05:06 AM.
 
Old 08-09-2010, 05:00 AM   #5
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by nakul.k1 View Post
3) How is semaphore used in Inter process communication?

4) How is device power management handled in linux ?
i mean i need the complete process in the form of code and document
for any simple device.
a) starting from registering the device driver into the kernel module
...
These questions can be answered by Google.
Put in the following keywords in Google search bar and hit enter:
Quote:
linux semaphore ipc
Quote:
device power management linux
http://tldp.org/LDP/khg/HyperNews/ge...s/devices.html

One more advice:
Quote:
Always search Google before asking any question. And in your opening post always mention whatever you have tried till now to solve your problem.
Simply marking the post as not helpful and moving ahead is not going to help you anyway.

Last edited by TheIndependentAquarius; 08-09-2010 at 05:06 AM.
 
Old 08-09-2010, 06:23 AM   #6
nakul.k1
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Original Poster
Rep: Reputation: 0
Hi Anisha and bsat

thanks for the reply

Before posting these questions i google to find the solutions but was unable to catch up
my questions are quite simple
atleast for these 2 questions i am expecting to get some straight forward answer in one or two lines

-------------------------------------------------------------------------------
1) I wanted to know can kernel space access user space pointers ,variable
and functions just by including the user space header files yes or no ?
if no then what happen when kernel tries to access user space pointer.

2) kmalloc(1024,GFP_USER);
where does the above kmalloc function allocate memory is it kernel space
or in user space?

(doubt)i know the answer for the above question is
(solution as seen in google)--Used to allocate memory for user-space pages

now the doubt is where is this memory allocated in user space or in kernel space and for which process is this memory allocated user space process or kernel space process.
i ask this question because user space process allocates memory with call to malloc
and kernel space process allocates memory with call to kmalloc(size,GFP_KERNEL).

-------------------------------------------------------------------------------
 
Old 08-09-2010, 06:41 AM   #7
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
Quote:
Originally Posted by nakul.k1 View Post
1) I wanted to know can kernel space access user space pointers ,variable
and functions just by including the user space header files yes or no ?
if no then what happen when kernel tries to access user space pointer.
I think yes,
The below link shows function access_ok, read its description.
http://www.gnugeneration.com/mirrors...api/x3936.html

and all I tried to get that link was to search in Google your keywords:
Quote:
kernel tries to access user space pointer
You could have done that too !!!!

Last edited by TheIndependentAquarius; 08-09-2010 at 06:42 AM.
 
1 members found this post helpful.
Old 08-09-2010, 10:35 AM   #8
nakul.k1
LQ Newbie
 
Registered: Jul 2010
Posts: 25

Original Poster
Rep: Reputation: 0
Once again thanks for your time anisha it was of great help


ČNakul
 
1 members found this post helpful.
Old 08-09-2010, 11:38 AM   #9
TheIndependentAquarius
Senior Member
 
Registered: Dec 2008
Posts: 4,680
Blog Entries: 29

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
I am glad I could help you here
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Questions on linux kernel nakul.k1 Linux - Kernel 5 08-09-2010 11:39 AM
Linux kernel memory questions / limitations kd2000 Linux - Kernel 5 05-18-2010 03:44 AM
Questions on how to compile a Linux Kernel mbwallace Linux - Newbie 5 02-04-2010 11:56 AM
Linux kernel patches questions VertX Linux - Software 4 06-12-2005 03:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 05:48 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration