All pastes #590117 Raw Edit

ramez

public text v1 · immutable
#590117 ·published 2007-06-26 10:59 UTC
rendered paste body
#include <linux/module.h>      /* Needed by all modules */
#include <linux/kernel.h>      /* Needed for KERN_ALERT */
#include <linux/init.h>        /* Needed for the macros */

MODULE_LICENSE("GPL");

/* Declare what kind of code we want from the header files */
//#define __KERNEL__         /* We're part of the kernel */
//#define MODULE             /* Not a permanent part, though. */

/* Standard headers for LKMs */
//#include <linux/modversions.h> 
#include <linux/module.h>  

static int carl_data __initdata = 3;


static int __init carl_init(void)
{
           printk(KERN_ALERT "Hello, world %d\n", carl_data);
              return 0;
}


static void __exit carl_exit(void)
{
           printk(KERN_ALERT "Goodbye, world\n");
}


module_init(carl_init);
module_exit(carl_exit);