The Sysctl driver module


Sysctl


Description:

The 'sysctl' method defines global variables that are accessible through the /proc/sys/<driver.name>/<variable> interface just by echo or cat. LDDK manages all necessary tasks for reading or writing this variables automatically. The access modes ( rwx,rwx,rwx ) can be set with the 'access' option. For handling special tasks as type or value checking, an own proc handler can be implemented with the 'handler' method directive as shown by this example. The 'strategy' method directive can be used to implement own strategy functions (see /usr/src/linux/kernel/sysctl.c for details) If the sysctl method is used in a driver the dbgMask variable is automatically accessible through the sysctl interface. It can just be set to verbose debugging with. echo 0x06 >/proc/sys/<driver.name>/dbgMask realize that this can be done while the driver is running !


Driver inodes:

The driver inode in /dev is usually created by

mknod /dev/Sysctl c major minor
If another major is needed it can be specified by the Sysctl_major option to insmod:

insmod Sysctl.o Sysctl_major=new_major

Driver inodes:

All driver generated with LDDK have debugging information compiled into the code that can be configured with the dbgMask option to insmod. The bits of dbgMask specifies the debugging verbosity:

For example:

insmod Sysctl.o dbgMask=0x06 logs all function entrys and exits to the kernel log daemon.

Wed Dec 23 18:02:01 1998