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.

Solution: Write, trace, debug

Solution: Write, trace, debug

(cheerful music) - [Instructor] There was a lot to do in this challenge. Let's start out. There's our skeleton, there's the make file. We also got a clean target. You don't need that, just OBJ-M. And I'm going to clear the D message buffer and we see at the end of it, I already had done this stuff before. So you see that. So when you clear it, you see what's in it and then it's gone. So let's look at the make. So we need to do the make-C with that stuff. So I'm just going to run my script. There we go. Built the module. There it is. And so now I can insmod that and you put the .ko when you do an insmod. Now if I do my D message, I see the loaded message and of course when we list my modules, we see it at the top of the list there, skeleton, and then we can do a sudo rmmod skeleton. You don't put the .ko when you do an rmmod. And we do a D message. And there's the unloaded message and lsmod, it's gone. Then we wanted to do some tracing, so I've got it in a script there. That's a lot to…

Contents