Managing and Developing Dynamically Loadable Kernel Modules

Managing and Developing Dynamically Loadable Kernel Modules
Developing Dynamically Loadable Kernel Modules
Chapter 12 553
+DA2.0W +DS2.0 -Ae -DLWSYSCALL -DPGPROF -DACLS -DAUDIT \
-DIDDS -D__ROSE__ -DHPONCPLUS -D__ROSEVILLE__ \
-DSPP_OBP_BOOT -DSPP_RUNWAY_ERR_ENABLED -DPARISC \
-DRDB -DNEW_RDB -DKGDB_ON -DIVT_INTERCEPT -DCOMB_FLIPPER \
-DNEW_MFCTL_W -DSTCP -DIPSEC -D_UNSUPPORTED \
-D_HPUX_SOURCE -D_XPG4_EXTENDED -D_KERNEL -D__STDC_EXT__ \
-D_CLEAN_BE -D__TEMP64__ -D__hp9000s800 -D__NO_EM_HDRS \
-U__hp9000s700 -o mod.o -c
module_name
.c
3. For a 64-bit Itanium target machine, execute the following cc (1)
command:
/opt/ansic/bin/cc -I. -I/usr/conf -I/usr/conf/sys \
-Wp,-H300000 +kernel +Oshortdata=0 +XixdU +O2 +ESlit +DD64 \
-Ae -DLWSYSCALL -DPGPROF -DACLS -DAUDIT -DIDDS -D__ROSE__ \
-DHPONCPLUS -DVARIABLE_UAREA -DSTCP -DIVT_INTERCEPT \
-D_UNSUPPORTED -D_HPUX_SOURCE -D_XPG4_EXTENDED -D_KERNEL \
-D__STDC_EXT__ -D_CLEAN_BE -D_SYSCALL_64 -_NO_PA_HDRS \
-DKERNEL_DEBUGGER -U__IA64__ -U__hp9000s800 \
-U__hp9000s700 -U__hppa -o mod.o -c
module_name
.c
Installing the Module’s Component Files
Once the module’s mod.o, master, system, and optional files have been
created, call the kminstall command to copy those files to certain
subdirectories of /usr/conf and /stand. The kminstall command
creates the required subdirectories if they do not exist.
kminstall expects to find the module’s component files in the current
working directory. If
module_name
already exists on the system,
kminstall prints a message and fails.
To install a DLKM module’s components, follow these steps:
1. Change directories to the directory containing the module’s
component files.
2. Execute the following kminstall command:
/usr/sbin/kminstall -a
module_name
kminstall copies the module’s component files to the appropriate
locations. For example, kminstall copies the master file to /usr/conf/
master.d/
module_name
/0.1.0, and the system file to /stand/
system.d/
module_name
/0.1.0. File /usr/conf/master.d/
module_name
/0.1.0 is known as the module’s master configuration file.
File /stand/system.d/
module_name
/0.1.0 is known as the module’s
system description file.