title: How to read ring buffer within linux kernel space?
body: <p>I'm writing a Linux character driver which can print system logs in user space. Just as the command 'dmesg' does. 
  I've learned that all the log that we print with 'printk' will be sent to a space named ring buffer. So I have the questions:</p>
  
  <ol>
  <li>Is ring buffer inside kernel space?</li>
  <li>If so, how can I read the ring buffer inside kernel space? (I've tried to read the source code of dmesg.c. But it did not help.)</li>
  </ol>