This is a discussion on Dynamically loading a device driver for kernel 2.6 (PnP). How doHAL and udev work together ? - Linux ; Hi, I still have some holes in my knowledge about how linux dynamically loads a driver module in response to for instance plugging a usb device. It would be great if somebody could point me to a walked through example. ...
I still have some holes in my knowledge about how linux dynamically
loads a driver module in response to for instance plugging a usb device.
It would be great if somebody could point me to a walked through
example. I am using SuSE Linux 10.2 with 2.6 kernel.
What I want to experiment with is the following:
I have a demo-board with ARM microcontroller and USB device port. For my
purposes I can invent my own vendor-id/device-id. I'll write first of
all a minimal driver and I'd like to see it automatically loaded when I
plug it into the USB-connection and removed sometime after I unplug the
SuSE 10.2 has done away with /proc/bus/usb. A lot of the examples I have
found mount usbfs to this mount point and carry on from there. SuSE uses
hald (HAL daemon) and udev instead. My understanding is that hald
recognises the plugging/unplugging and signals this to udev. hald takes
care of loading the driver module whereas udev dynamically creates a
mount point under /dev. I can control the mount-point by specifying it
appropriately in the udev rules files. (Am I right so far?)
What I have not been able to find on my system however, is where (and
how) I can associate a device (vendor-id/device-id) with a kernel
module. I would have expected to find some such files/settings under
/etc/modprobe.conf or /etc/modprobe.d/...
Surely there must be some way to add my custom info outside of
/lib/modules/... Otherwise, my config info would probably get
overwritten with every system update
I have done a lot of paging through Rubini's book and the HAL and udev
pages at sourceforge but still don't really have the full picture.
To summarise, the overall question is: If I design a USB device with
vendor-id 0x1234 and device-id 0xabcd (assuming these don't belong to
anybody else of course) and write a driver for it, how can I get (or,
can I get) the driver to be loaded whenever I plug the device and
unloaded when the device is unplugged.
I would be grateful for any links or clarifying infos