vkbd driver and devfs

Timothy Bourke timbob at bigpond.com
Sun Feb 25 17:52:52 UTC 2007


I am writing some code (a driver) that exploits the vkbd driver and I have
some questions about the latter. The following notes apply to 6.2-RELEASE.

The vkbd driver seems to interact strangely with devfs, specifically:

1. The /dev/vkbdctl device never appears in directory listings (although
   it is found dynamically).
        kldload vkbd
        ls /dev | grep vkbd
        # nothing 
   
   Possible fix: add make_dev and destroy_dev calls to vkbd_modeevent().

2. Opening /dev/vkbdctl for the first time correctly creates two devices
   (and redirects the open to the first):
        /dev/vkbdctl0 
        /dev/vkbd0
        
   Closing /dev/vkbdctl0 correctly removes the /dev/vkbd0 device but not the
   /dev/vkbdctl0 device itself. Should it also be removed?
   Possible fix: `unclone' (if possible) /dev/vkbdctl0 in vkbd_dev_close().
   
   Maybe a /dev/vkbdctl<N> node should only be removed if no higher numbered
   nodes are in use? Then, presumably, all unopened lower numbered vkbdctl<M>
   nodes should also be removed?
   
   Currently /dev/vkbctl<N> nodes are removed en masse via a call to
   clone_cleanup() when the driver is unloaded.

3. Each new open on /dev/vkbdctl creates and returns new /dev/vkbdctl<N>
   devices with progressively higher values of N. Is this the proper behaviour?
   
   If not, possible fix: vkbd_dev_clone() should work upward from 0 looking
                         for unopen /dev/vkbdctl0 nodes before calling
                         clone_create().
 
Pointers to the documentation or source are most welcome. Perhaps I have
overlooked something obvious.

If necessary I will try to write a patch.

Tim.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-drivers/attachments/20070225/53603098/attachment.pgp


More information about the freebsd-drivers mailing list