From the course: Linux Device Drivers: Reading, Writing, and Debugging
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Module parameters in device driver code - Linux Tutorial
From the course: Linux Device Drivers: Reading, Writing, and Debugging
Module parameters in device driver code
- [Instructor] Let's look at parameters for modules a little bit more. This is valuable because when you write a driver, you may well want to have some parameters, not only for important functionality, but sometimes to say, turn on debug mode, a secret mode that you have that will dump more information or whatever. So let's investigate. If you want to have parameters, then there's some macros that you put in your driver source code. For example, there's one called module_param, all in lowercase, where you put the name of the variable that will get set and it's type and then permission modes. The permission modes represent what the file underneath the SIS module directory will have. If the permission modes you give are zero, then there will not be a file showing up underneath SIS module. And you can have the permissions be writeable, for example. And if they're writeable, that means from user space, somebody could write a value into that file and it would change the variable in your…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
The benefits of loadable modules4m 15s
-
(Locked)
Introduction to module commands4m 57s
-
(Locked)
Depmod and modprobe4m 11s
-
(Locked)
Module parameters1m 49s
-
(Locked)
Module parameters in device driver code3m 59s
-
(Locked)
Work with licensing and modules2m 35s
-
Challenge: Work with loadable modules1m 23s
-
Solution: Work with loadable modules3m 14s
-
-
-
-
-
-
-