Linux - KernelThis forum is for all discussion relating to the Linux kernel.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am running Fedora Core 5 on and i686 arch. I wrote a Python script to rapidly load and unload my kernel module via insmod and rmmod. When I execute this script, it does not take long before a kernel panic ensues. I don't have any screen capture or any other info, since my Linux machine is at work. My kernel module is a pci-driver for some custom hardware. My module does not do much on init and exit, but something is going wrong. I have run the read and write functions of this module for millions of iterations with no problems. There doesn't seem to be anything wrong with the module, once it's loaded. The following is a summary of what I'm doing:
*zero-out my device struct, which contains a pci_dev* array along with other info
*create /proc entry
*grab 9 minor device numbers for the major device number obtained dynamically.
*scan the pci-bus for cards with a certain vendor id.
*call pci_get on all devices to retrieve a pci_dev* for the device.
*assign a shared irq for my card(s) and set the pci irq register in my hardware.
*release the device numbers from init.
*remove /proc entry
*free_irq for each card.
*call pci_put to release the pci device.
*remove the cdev.
Something else to consider: This is a custom backplane that contains only my hardware. There isn't any other pci cards out there.
I can post more code on Monday, but I was wondering whether there was anything specific I need to worry about when loading/unloading kernel modules. Shouldn't I be able to load and unload them rapidly without a problem?
My Python code is something like:
f = os.popen('insmod module.ko')