#include #include MODULE_AUTHOR("Márton Németh "); MODULE_DESCRIPTION("Test alloc_disk"); MODULE_LICENSE("GPL"); static struct gendisk *gd_ptr; static int test_init_module(void) { printk(KERN_DEBUG "starting module\n"); gd_ptr = alloc_disk(1); if (!gd_ptr) { return -ENOMEM; } printk(KERN_DEBUG "gd_ptr after alloc=%p\n", gd_ptr); return 0; } static void test_exit_module(void) { printk(KERN_DEBUG "unloading module\n"); del_gendisk(gd_ptr); } module_init(test_init_module); module_exit(test_exit_module);