How does kernel understand, which driver module function handles read/write/etc?

I found a couple of articles, where it is shown how to make your own hello-world driver.

I supposed that function names should be hardcoded (for example, when you read from device, you use read function, etc).

But everywhere are used functions names like hello_read (first article) or device_file_read (second article), when describing what should happen when i cat device.

How does kernel understand, what function he should use?

Source: linux

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.