Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.