Device files are interfaces of device drivers to user programs.
In Linux, is a device file implemented directly by its corresponding device driver, or by the OS kernel (excluding the device driver)?
The kernel generates the device files, but functions such as
write are mostly implemented by drivers that can be integrated in the kernel.
A good free (Creative Commons) book talks about it: Linux Device Drivers