LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 10-27-2007, 09:12 AM   #1
rajeshwar27singh
LQ Newbie
 
Registered: Oct 2007
Posts: 11

Rep: Reputation: 0
Isolating driver memory space


For my project i want to isolate the memory space which my network driver uses from that of KERNEL. How should i start with it.
 
Old 10-28-2007, 07:53 PM   #2
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
What exactly do you mean by that? In Linux, drivers are run in kernel-space, so your network driver is the kernel. Are you saying that you are developing a new driver and want to make sure it's memory space is never reallocated to another area of the kernel? Then the best shot is to never release memory you've allocated. Or do you mean that you wish to somehow insulate the kernel from a pre-existing driver? I'm not sure that can be done.
 
Old 10-29-2007, 03:15 AM   #3
rajeshwar27singh
LQ Newbie
 
Registered: Oct 2007
Posts: 11

Original Poster
Rep: Reputation: 0
I am making a device recovery system. So what i want to do is just restart the driver again when ever any fault is created so for that i want to make sure that my driver never uses any extra space of kernel so that during rebooting of the driver my kernel is not effected.
 
Old 10-29-2007, 07:37 AM   #4
PatrickNew
Senior Member
 
Registered: Jan 2006
Location: Charleston, SC, USA
Distribution: Debian, Gentoo, Ubuntu, RHEL
Posts: 1,148
Blog Entries: 1

Rep: Reputation: 48
My recommendation would be to just write the driver so it can be used as a module. Then, if everything is written right, when you rmmod the driver's module it should completely remove itself from the kernel's memory space. After that you insmod it again and try again.
 
Old 10-29-2007, 05:39 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,657
Blog Entries: 4

Rep: Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938Reputation: 3938
As they said, a driver is the kernel. A device-driver author must be very careful about allocating memory, and there are various specific macros that are designed for use by drivers precisely so that the system can clean-up, say, "the memory used by a particular device" when it needs to do so.

It is quite common for drivers to be modular, and that's very convenient when you are debugging them, but the memory-cleanup that occurs when a driver is to be unloaded is still done in cooperation with the driver code, which must be written "correctly."

There are copious .. copious .. numbers of good drivers out there with source-code and documentation that's generally quite easy to read. If you don't find one that's exactly what you're looking for (very likely), you're certain to find one that is extremely close. Unlike 'The System Which Must Not Be Named,' Linux holds no secrets.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Isolating processes badradiation Linux - General 3 10-18-2006 02:39 PM
isolating net usage Meatwad Linux - Networking 3 09-03-2004 11:09 AM
swap space used: 0; memory used: 90-95% abs Slackware 9 08-30-2004 12:33 PM
Accessing PCI memory space HTS Programming 7 04-30-2004 10:55 AM
Do I have enough disk space and memory? MarkFour Linux - Newbie 2 02-06-2004 07:43 PM

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

All times are GMT -5. The time now is 04:40 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
Open Source Consulting | Domain Registration