#include <linux/module.h> int init_module(const char *name, struct module *image);
モジュールイメージは、先頭部分にモジュール構造体が置かれ、その後に適切 なコードとデータが配置される。モジュール構造体の定義を以下に示す:
struct module
{
unsigned long size_of_struct;
struct module *next;
const char *name;
unsigned long size;
long usecount;
unsigned long flags;
unsigned int nsyms;
unsigned int ndeps;
struct module_symbol *syms;
struct module_ref *deps;
struct module_ref *refs;
int (*init)(void);
void (*cleanup)(void);
const struct exception_table_entry *ex_table_start;
const struct exception_table_entry *ex_table_end;
#ifdef __alpha__
unsigned long gp;
#endif
};
next と refs 以外の全てのポインタ要素は、 モジュールの本体内部を指し、カーネル空間での適切な値で初期化される (つまりモジュールの残りの部分と共に再配置される)ことが期待される。