title: How to create a device node from the init_module code of a Linux kernel module?
body: <p>I am writing a module for the linux kernel and I want to create some device nodes in the init function</p>
  
  <pre><code>int init_module(void)
  {
      Major = register_chrdev(0, DEVICE_NAME, &amp;fops);
   // Now I want to create device nodes with the returned major number
  }
  </code></pre>
  
  <p>I also want the kernel to assign a minor number for my first node, and then I will assign the other nodes' minor numbers by myself.</p>
  
  <p>How can I do this in the code. I dont want to create devices from the shell using mknod</p>