Specifications

Red Hat Enterprise Linux to Oracle Solaris Porting Guide
60
Device Driver Interface and Driver-Kernel Interface
The following table lists the differences in data structures used by kernel modules on the two
platforms.
TABLE 6-3. DATA STRUCTURE AND FUNCTION CALLS
RHEL ORACLE SOLARIS 11
query_module() in Linux is used to query the kernel for
various bits pertaining to modules.
The _info() function returns information about a loadable
module. Within this function, the call mod_info() has to be
made.
#include <sys/modctl.h>
int mod_info(struct modlinkage *modlinkage,
struct modinfo *modinfo);
int _info(struct modinfo *modinfop)
{
return (mod_info(&modlinkage, modinfop));
}
create_module() in Linux attempts to create a loadable
module entry and reserve the kernel memory that will be
needed to hold the module.
The primary data structures used in support of module loading
are the modctl (module control) structure and module
structure. You can find the structure definitions for modctl and
module in /usr/include/sys/modctl.h and
/usr/include/sys/kobj.h, respectively.
#include <sys/modctl.h>
int mod_install(struct modlinkage
*modlinkage);
int _init(void)
{
int i;
if ((i = mod_install(&modlinkage)) !=
0)
cmn_err(CE_NOTE,"Could not install
module\n");
else
cmn_err(CE_NOTE,"flkm:
successfully installed");
return i;
}