title: Linux Kernel Driver Module: Handle multiple device files using a single driver
body: <p>I am a beginner to kernel module programming. And using resources online (especially <a href="http://www.opensourceforu.com/2011/02/linux-character-drivers/" rel="nofollow">this tutorial</a>) I have managed to write most of my driver.</p>
  
  <p>The driver basically is a character device which maps different areas of SRAM into separate files. You can see the actual code <a href="http://pastebin.com/YJKRr7tv" rel="nofollow">here</a>.</p>
  
  <p>Right now I am able to successfully create 4 files under <code>/dev</code> and reading/writing the first file works too but the other 3 files do not work. I am using <strong>minor number</strong> to distinguish between the files and assign the starting address accordingly.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Why are the other files not working?</li>
  <li>Is there a better way to implement the module?</li>
  </ol>
  
  <p>Thanks.</p>