From the course: Linux Device Drivers: Reading, Writing, and Debugging

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Use device files

Use device files

- [Instructor] Let's talk about device files. This is a key part of working with device drivers. The device file is going to be how user space talks to your driver for certain kinds of drivers. Device files normally reside in the /dev directory. You can put 'em other places, but that's the standard place and that's where they automatically appear most of the time. There's different kinds of device files. There's character and block device files, and you'll see lots of those in the dev directory. The dev directory these days on Linux is typically a RAM-based temp file system. That means it's recreated every time you reboot, and it's populated automatically by the kernel and the Systemd service for that. The dev directory has both kinds of device files, char and block, but there's also some soft links and sub directories in there. Character device files are for devices that look more like files, you can read and write 'em and seek 'em, maybe. Block device files are for things that have…

Contents