Modern Character Devices (Slideshow)

Character Devices: Problems

  • Manually creating device nodes is cumbersome

  • Number conflicts are much more likely than name conflicts

  • Want names, not numbers

Linux way: devtmpfs

  • File system that contains device nodes

  • Automatically populated by the kernel

  • … with a little driver support

$ mount
...
devtmpfs on /dev type devtmpfs (rw,relatime,...)
...

Dynamic Device Numbers

jjj

  • From register_chrdev_region() to alloc_chrdev_region()

    • blah

https://www.kernel.org/doc/htmldocs/kernel-api/API-alloc-chrdev-region.html

int alloc_chrdev_region(
    dev_t * dev,
    unsigned baseminor,
    unsigned count,
    const char * name);

Device Classes

Devices