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 - Linux Tutorial
From the course: Linux Device Drivers: Reading, Writing, and Debugging
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
(Locked)
Use device files3m 21s
-
(Locked)
Create device files2m 45s
-
(Locked)
Character device driver file operations4m 45s
-
(Locked)
Implementing operation functions7m 39s
-
(Locked)
Write a character device driver5m 29s
-
(Locked)
The /dev/null driver3m 44s
-
(Locked)
Understand the user and kernel address spaces5m 19s
-
(Locked)
Challenge: Write a character driver1m 53s
-
(Locked)
Solution: Write a character driver3m 53s
-
(Locked)
-
-
-
-