What happens when writing to a device driver?

For example:

echo "some text" > /proc/device_driver

I'm guessing that echo has a write-call that somehow invokes the write-function in the driver. What are the "steps" from the echo-function to the drivers write function?


As explained in the The Linux Kernel Module Programming Guide (5.2. Read and Write a /proc File), the kernel calls a function associated with the driver during the driver's initialization to read the data from userspace into the kernel.

The echo program does not know anything special about the kernel; the kernel does all of the work.

Further reading:

Not the answer you're looking for? Browse other questions tagged or ask your own question.