From the course: Linux Device Drivers

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Solution: Write, trace, debug

Solution: Write, trace, debug - Linux Tutorial

From the course: Linux Device Drivers

Start my 1-month free trial

Solution: Write, trace, debug

(upbeat music) - [Instructor] So let's look at solutions to these problems. For number one, we want to have the skeleton.c and makefile, we want to build it and sort it, remove it, and then look at the output from the printks in D message. So let's give that a try. So there's the skeleton.c, there's the makefile. We do a make. Oh, it's not that simple now, right? We've got to do make minus capital C, lib/modules/uname minus r slash build, So that make changes directory there. And then we set the capital M macro for the chromic file to say, "Oh we want to make them in the current directory." And what do we want to make? We want to make modules. So there we go. We get skeleton dot KO, so we've made it let's clear out our messages and we don't need to see what's in there now. So we'll just send the output to dev null. Now let's intermod our module, no complaints. Let's remove our module and let's look at D message.…

Contents