init_module, cleanup_module - module load and unload functions
int init_module(void);
void cleanup_module(void);
When a module is loaded into a running kernel, the init_module(9) function within that object file is called to set up the module. The implementation of that function initializes local features and uses functions such as register_chrdev(9) to attach itself to the kernel. It then returns zero(0) if it succeeds. If there is a problem or the module decides that it cannot be loaded, it returns instead an error code (i.e. -ENODEV) and the kernel releases the module again.
Once loaded, the cleanup_module(9) function of a module is used by the kernel to remove the module again. The module detaches itself from the kernel and returns.
Also list some source files for the kernel that implement the functions of the page.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |