Demo module
This commit is contained in:
		
						commit
						eb3dd5a393
					
				
					 1 changed files with 26 additions and 0 deletions
				
			
		
							
								
								
									
										26
									
								
								demo_module.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								demo_module.c
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					#include <linux/module.h>
 | 
				
			||||||
 | 
					#include <linux/init.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* Meta Info */
 | 
				
			||||||
 | 
					MODULE_DESCRIPTION("Demo kernel module.");
 | 
				
			||||||
 | 
					MODULE_VERSION("0.0.1");
 | 
				
			||||||
 | 
					MODULE_AUTHOR("Imbus");
 | 
				
			||||||
 | 
					MODULE_LICENSE("GPL");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @brief Called on load
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					static int __init demo_mod_init(void) {
 | 
				
			||||||
 | 
					    printk("Demo module loaded successfully...");
 | 
				
			||||||
 | 
					    return 0;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * @brief Called on unload
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					static void __exit demo_mod_exit(void) {
 | 
				
			||||||
 | 
					    printk("Demo module unloaded successfully...");
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					module_init(demo_mod_init);
 | 
				
			||||||
 | 
					module_exit(demo_mod_exit);
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue