title: How device driver write/read works
body: <p>Custom read and write operations are defined as</p>
  
  <pre><code>ssize_t (*read) (struct file *,char __user *, size_t, loff_t *);
  ssize_t (*write) (struct file *,const char __user *, size_t, loff_t *);
  </code></pre>
  
  <p>What happens when a read or write is made to a device?</p>
  
  <p>I couldnt find simple explanation of this in LDD book. </p>
  
  <p>For example what happens when I have a device and I made a write like</p>
  
  <pre><code>echo "Hello" &gt; /dev/newdevice
  </code></pre>
  
  <p>And I am writing a simple character device. Also</p>
  
  <pre><code>cat  /dev/newdevice
  </code></pre>
  
  <p>I know it depends on my custom read/write and what I need is simple read from memory and write to memory</p>