Conceptual
Login

File Operations: Open, Read, Write and Release

A driver publishes a table of functions, one per thing a program can do to its file: open when someone opens it, read and write when they move bytes, release when the last user closes it. The kernel calls into that table when the matching system call arrives, so those functions are literally where your driver's behaviour lives. Anything you allocate in open you are responsible for freeing in release, because nothing else will.

Questions this Concept answers

  • Why is anything a driver allocates in `open` its own responsibility to free in `release`?