title: How can I find which physical device /dev/console connects to?
body: <p>There is a device file called <code>/dev/console</code>, whose <code>(major,minor)</code> is <code>(5,1)</code>.
  When I boot with a serial console, it connects to my UART port as <code>/dev/ttyS0</code> does.
  But when I boot with serial console disabled, the <code>/dev/console</code> seems to connect to elsewhere, where <code>/dev/ttyS0</code> always connects to the same physical device, namely <code>UART0</code>. 
  Is there any indication (like something in <code>/proc</code> or <code>/sys</code>) showing such information? I have tried there but found nothing I want.
  I am starting to trace the Linux kernel source to clarify their relationships. 
  Can anyone give me some hints? When, where, how and what to determine the physical device to which <code>/dev/console</code> connects?</p>
  
  <p>EDIT: The latest finding is that:</p>
  
  <ol>
  <li>the <code>/dev/console</code> is configured by <code>console=</code> of the kernel parameters, which in turn is used by <code>getty</code> to open <code>stdin/stdout/stderr</code>. If no <code>console=</code> is specified, <code>/dev/null</code> is opened as <code>stdin/stdout/stderr</code>. But I am not sure they are exactly the same with <code>/dev/console</code>, which implies <code>/dev/console</code> can have its I/O connecting to different physical devices. </li>
  <li>The <code>/dev/console</code> can be read if a USB HID keyboard is plugged and the <code>console=</code> is not configured as UART. Therefore <code>/dev/console</code> == <code>/dev/null</code> seems to make little sense.
  Need more investigations.</li>
  </ol>