From the course: Linux Device Drivers: Reading, Writing, and Debugging
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Implementing operation functions - Linux Tutorial
From the course: Linux Device Drivers: Reading, Writing, and Debugging
Implementing operation functions
- [Instructor] Let's look more closely at these file operations and how it works. So making the calls from user space and getting to the functions in your driver is going to bring the path through the standard C library. So we want to visualize that, and we'll get an idea about what you should do with some of these functions in your driver. So in user's base, we have a process, a program, let's say it calls read. Well, that read will actually be in the standard C library. And then the standard C library will do something special. It'll do a system call mechanism, and that's dependent on the architecture how that works. That'll be some sort of special assembly language instruction, which will trap into the kernel. Now, the process is executing in kernel space, in kernel mode. And there's a function registered for all the system calls. So that'll be sys_read for a read. And that can do some stuff, and then it will, using the file descriptor like we described, get the address of the read…
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)
-
-
-
-