title: insmod error in kernel module programming
body: <p>I am just starting with modular programming. </p>
  
  <p>Above are my two files:</p>
  
  <p>hello.c</p>
  
  <pre><code>#include &lt;linux/init.h&gt;
  #include &lt;linux/module.h&gt;
  
  static int hello_init(void)
  {
      printk(KERN_ALERT "TEST: Hello world\n");
      return 0;
  }
  
  static void hello_exit(void)
  {
      printk(KERN_ALERT "TEST: Good Bye");
  }
  
  module_init(hello_init);
  module_exit(hello_exit);
  </code></pre>
  
  <p>Makefile</p>
  
  <pre><code>obj-m += hello.o
  
  KDIR = /usr/src/linux-headers-3.13.0-46-generic
  
  all:
      $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
  
  clean:
      rm -rf *.o *.ko *.mod.* *.symvers *.order
  </code></pre>
  
  <p>And here's my terminal output showing error in insmod command, kindly help.</p>
  
  <pre><code>anubhav@anubhav-Inspiron-3421:~/Desktop/os$ make
  make -C /usr/src/linux-headers-3.13.0-46-generic  SUBDIRS=/home/anubhav/Desktop/os modules
  make[1]: Entering directory `/usr/src/linux-headers-3.13.0-46-generic'
  Building modules, stage 2.
  MODPOST 1 modules
  make[1]: Leaving directory `/usr/src/linux-headers-3.13.0-46-generic'
  anubhav@anubhav-Inspiron-3421:~/Desktop/os$ insmod hello.ko
  insmod: ERROR: could not insert module hello.ko: Operation not permitted
  </code></pre>