Skip to content

M9 Parts X and XI: writing kernel code, and debugging it #10

Description

@tamnd

Roughly eighteen weeks. Fifteen lessons, W01 to W08 and B01 to B07. Pass 3 begins, and the reader stops reading kernel code and starts writing it.

Part X is writing kernel code. A module, an interface to userspace, allocation under the right constraints, locking your own data, kernel style C, KUnit, and the same module again in Rust. Part XI is debugging it, which is the half of kernel work that no book teaches directly and every kernel developer spends most of their time on.

The failure corpus is the sleeper deliverable in this milestone. Real recorded oopses, lockdep splats, KASAN reports, hung tasks and RCU stalls, curated and versioned. Nobody publishes one. Producing crashes on demand is harder than it sounds and it will take longer than the estimate suggests, and it is worth it, because reading a stack trace is a mechanical teachable skill that readers are currently left to pick up by accident.

Exit criterion. A reader can write, test and debug a module, and can find an injected bug in a supplied kernel with no hint, using traces, KASAN, lockdep and bisection.

Part X, writing kernel code

  • W01 Your first module
  • W02 Module lifecycle and refcounts
  • W03 Exposing an interface
  • W04 Allocating safely
  • W05 Locking your own data
  • W06 Kernel style C
  • W07 KUnit
  • W08 Rust in the kernel

Part XI, debugging and forensics

  • B01 Reading an oops
  • B02 BUG_ON, WARN_ON and panic
  • B03 printk and tracing as debugging
  • B04 KASAN
  • B05 drgn and live inspection
  • B06 The debug config matrix
  • B07 Fuzzing, and syzbot

Everything else

  • The failure corpus: real recorded oopses, lockdep splats, KASAN reports, hung tasks and RCU stalls
  • The syzbot pipeline, curating real reports with reproducers into gradeable exercises
  • The Oops Decoder playground, which will probably be the most used page on the site
  • OopsReader and KasanReport widgets
  • Nine blueprints at complete

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/debuggingOops reports, KASAN, lockdep, drgn, fault injection and syzbotarea/driversThe driver model, modules, sysfs and debugfskind/corpusA recorded trace, snapshot, oops or BTF dump the lessons are graded againstkind/milestoneA milestone checklist, tracking the issues that close itpriority/p1Needed for the current milestone but not blocking today

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions