Conceptual
Login

Predict a Sample Driver's Log Before You Run It

Kernel code is hard to step through with a debugger, so the main way you find out what it did is the messages it prints to the kernel log. This is a study habit: before you run a sample driver, read its source and write down, line by line, what you expect the log to say and in what order. Then run it and compare. Where your prediction and the real log disagree is exactly the thing you did not understand, and you find it in seconds instead of after an afternoon of guessing.

Questions this Concept answers

  • Why is comparing a predicted log against the real one such an efficient way to learn a sample driver?

This Concept is waiting for its first lesson!

Kernel code is hard to step through with a debugger, so the main way you find out what it did is the messages it prints to the kernel log. This is a study habit: before you run a sample driver, read its source and write down, line by line, what you expect the log to say and in what order. Then run it and compare. Where your prediction and the real log disagree is exactly the thing you did not understand, and you find it in seconds instead of after an afternoon of guessing.

Are you a teacher? Sign in to start contributing.

Sign In