what are the general steps involved in building a kernel driver?

Asked 1 month ago
Viewed 10 times

I'm quite new to linux drivers and just trying to understand the flow of the concepts.

As I see it till now:

  1. Create a .c file which gonna be considered as the kernel module.
  2. Register major & minor numbers.
  3. Load it with insmod() to the kernel.

So far so good (I hope. correct me if I'm wrong). That module is now considered as a driver?

My confusion starts about now: now what? I understood that the next step is to create a device file that contains the major & minor numbers so it can refer to the driver. Is it to allow the user to interact with the driver I created before?

Eventually, all the user need to do is to open a /dev file to interact with my driver that (will) involve hardware?

Am i getting it right?


asked 1 month ago

Correct Answer

Yes, these are exactly the steps.

answered 1 month ago