Dear everyone,
I have a few questions with regard to USB device drivers and device node creation. I should mention that I am a newbe in programming device drivers.
I am trying to write a USB device driver for a Braille display. I would ideally like to give the Braille display its own device node in /dev so that programs could write to the device, thereby displaying text on the display without knowing the technical details. I have studied a lot of different USB device drivers, but have been unable to find a satisfactory answer.
The driver that comes closest to what I want to achieve is the driver located in /usr/share/examples/kld/cdev/module. However, this is not a device driver and I am unable to understand how I would create the device node for a real USB device. How would one create that device node?
I would also assume that the device_attach method would be the correct place to create a device node?
From looking at the driver I mentioned above, I see that the open(), close(), read() and write() functions are declared. Can those functions be declared in the USB device driver too and serve a similar purpose as they do in the cdev driver?
Are there any good references on creating USB device drivers for FreeBSD? The documentation seems to be very scarce.
One final question: Say that a program opens the newly created device node. How does the system know that this device node belongs to a particular attached device?
I think that was all for now.
Any help is greatly appreciated and I look forward to any replies,
Peter.
FreeBSD 8.1-i386
I have a few questions with regard to USB device drivers and device node creation. I should mention that I am a newbe in programming device drivers.
I am trying to write a USB device driver for a Braille display. I would ideally like to give the Braille display its own device node in /dev so that programs could write to the device, thereby displaying text on the display without knowing the technical details. I have studied a lot of different USB device drivers, but have been unable to find a satisfactory answer.
The driver that comes closest to what I want to achieve is the driver located in /usr/share/examples/kld/cdev/module. However, this is not a device driver and I am unable to understand how I would create the device node for a real USB device. How would one create that device node?
I would also assume that the device_attach method would be the correct place to create a device node?
From looking at the driver I mentioned above, I see that the open(), close(), read() and write() functions are declared. Can those functions be declared in the USB device driver too and serve a similar purpose as they do in the cdev driver?
Are there any good references on creating USB device drivers for FreeBSD? The documentation seems to be very scarce.
One final question: Say that a program opens the newly created device node. How does the system know that this device node belongs to a particular attached device?
I think that was all for now.
Any help is greatly appreciated and I look forward to any replies,
Peter.
FreeBSD 8.1-i386