← DriversDRIVERS 5.1

Character Device Drivers

Not yet catalogued — waiting on Phases 2–4 to unlock this phase. The centerpiece topic: "walk me through writing a char driver" is the single most-asked driver interview question. 16 bytes across 2 chapters.

Planned chapters

  • A — The Char Driver Skeleton. Device files and major/minor numbers, alloc_chrdev_region, cdev_init/cdev_add, the file_operations table (the payoff of 1.7.A), open/release, read/write with copy_to_user/copy_from_user, auto /dev nodes via class_create/device_create, and llseek — then writing the full skeleton from scratch, twice.
  • B — Advanced Char. ioctl encoding (_IO/_IOR/_IOW/_IOWR) and implementing it, blocking reads via wait queues, O_NONBLOCK and -EAGAIN, poll/select support, and handling multiple openers safely.

Not yet catalogued — check back once this topic is underway.

Notes from readers

Comments — via GitHub