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

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…

Contents