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.
hello, im writing a Usb driver and i have an issue.
when i insmod the driver with the device already plugged in before, the probe function is not called. it is only called after i disconnect the device and plug it again.
i wanna make it work when i start my pc with the device plugged in.
could someone please help me?
best regards,
jacob.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
The logic escapes me. As I understand (but don't know) it, the probe function is triggered by plugging in a device. Why should that happen when you insert a module if you didn't program that into the module?
Asked the other way round, do the other drivers trigger a probe? If so, find out how they do it.
well maybe i asked the question the wrong way.
when you start ubuntu for example with some usb device plugged in before system loads you see the device working.
in my driver i want the same behavior. at the moment it works only when i plug the device after the driver is already loaded then the probe callback is called and initialization begins.
i want it to work if i start the pc with the device plugged.
can you help please?
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Well, that is definitely lots later than the other drivers get loaded and by an other mechanism too. Is your driver a kernel object, i.e. *.ko module? Then you should use the usual mechanism to load it, too...
thank you for your time but i dont know any mechanism to load a KO because i'm new to linux. im using 2.4.23 kernel because i have some old drivers which are not availible on 2.6.
could you give me more information about the mechanism you mentioned earlier.
thanks!
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
I see. Right now I'm not in front of a linux box. I'll try to look it up tonight. In short, the kernel modules are kept in a directory like /lib/modules/2.4.23/* and get loaded via insmod which is controlled by a list in /etc/<forgot>/<it>. I hope I can five you more details later.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Yeah, I just remembered. The system uses /sbin/modprobe during the boot process. The controlling file resides in /etc/modprobe.conf (if your system uses that to load modules).
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
Ooops. First make sure that your system has "/sbin/modprobe". Then it is google for you, find out what preceded modprobe.conf and modify that. Sorry, I can't give more help here, I havo no system which is that old.
I am not very sure but I feel if you want your module to be loaded when the kernel loads you either need to compile the kernel with the driver so that the kernel image has the driver or, you can add the insmod command in the rc.local script so that the module gets loaded as soon as the system boots up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.