title: How to display linux printk() messages in virtual console (tty1)
body: <p>I'm trying to solve problem with linux <strong>printk()</strong> messages (Linux raspberrypi 3.6.11+ #87 PREEMPT Fri Feb 7 00:17:11 CET 2014 armv6l GNU/Linux).<br>
  What I have is a kernel module which implements <strong>unlocked_ioctl</strong> function from <strong>struct file_operations</strong>. When I call this function from user space with specified <strong>cmd=CMD_PRINTK</strong>, the following code is executed:</p>
  
  <pre><code>   case CMD_PRINTK:
     {
           printk(KERN_EMERG    "TEST KERN_EMERG\n");
           printk(KERN_ALERT    "TEST KERN_ALERT\n");
           printk(KERN_CRIT     "TEST KERN_CRIT\n");
           printk(KERN_ERR      "TEST KERN_ERR\n");
           printk(KERN_WARNING  "TEST KERN_WARNING\n");
           printk(KERN_NOTICE   "TEST KERN_NOTICE\n");
           printk(KERN_INFO     "TEST KERN_INFO\n");
           printk(KERN_DEBUG    "TEST KERN_DEBUG\n");
     }
  </code></pre>
  
  <p>What I was expecting is that amount of displayed messages will depend on second value of  </p>
  
  <pre><code>root@raspberrypi:/mnt/raspberrypi/linux/linux/mod# *cat /proc/sys/kernel/printk*
  7   **4**   1   7
  </code></pre>
  
  <p>But what I observe is only the first message "TEST KERN_EMERG\n" which is printed by syslogd btw on every virtual terminal (pts/1...)</p>
  
  <p>In kernel command line I've specified the console as <strong>tty1</strong></p>
  
  <pre><code>root@raspberrypi:/mnt/raspberrypi/linux/linux/mod# *cat /proc/cmdline*
  
  dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2708.boardrev=0x3 bcm2708.serial=0xf8900c76 smsc95xx.macaddr=B8:27:EB:90:0C:76 dwc_otg.lpm_enable=0 **console=/dev/tty1** root=/dev/nfs nfsroot=192.168.1.102:/home/borys/rpi_rootfs ip=192.168.1.103:192.168.1.102:192.168.1.1:255.255.255.0:rpi:eth0:off rootfstype=nfs
  </code></pre>
  
  <p>I tried to use <strong><em>minicom</em></strong> to connect to <strong>/dev/tty1</strong> but still I cannot observe any messages displayed there.<br>
  I tried to kill <strong><em>syslogd</em></strong> but it didn't help.</p>
  
  <p>At the moment I think that I don't understand something about virtual terminals. I had setup with STLinux platform and console specified as serial port (<strong>/dev/ttyAS0</strong>) and I was able to connect with serial cable from my host computer and I saw all <strong>printk()</strong> messages. </p>
  
  <p>Can someone explain how to display kernel <strong>printk()</strong> messages in virtual terminal via <strong><em>minicom</em></strong> connection?<br>
  Is it possible at all?<br>
  Will it be possible to control <strong>printk()</strong> messages verbosity then?</p>
  
  <p><strong>Updated: 05.05.2014</strong></p>
  
  <p>My colleague found first mistake in my cmdline. It should be </p>
  
  <pre><code>**console=tty1**
  </code></pre>
  
  <p>not </p>
  
  <pre><code>**console=/dev/tty1**
  </code></pre>
  
  <p>because filesystem is not available at the moment of cmdline parsing. After this change I can see debugs in virtual terminal and using 
  <strong>dmesg -n x</strong>
  as suggested by <strong>oakad</strong> below, I can change its verbosity. </p>
  
  <p>This is almost but not certainly what I wanted actually. The one thing which I'm still missing is the connection to vitural terminal <strong>tty1</strong> via <strong>minicom</strong>. </p>
  
  <p>Currenlty I can see kernel logs only on the screen connected to my raspberry pi or via serial interface <strong>ttyAMA0</strong>. </p>
  
  <p>Additionally when I run my test on PC I can see kernel debugs if I switch to virtual console via <em>Alt+Ctrl+n</em> where <em>n</em> is the number of virtual console. </p>
  
  <p>What I would like to have is for example:
  <strong>ssh</strong> session to raspbery pi in which I start <strong>minicom</strong> and specify <strong>tty1</strong> as a port. 
  The same in case of PC I would like to start xterm (<strong>/dev/pts/n</strong>) in which I start minicom and specify <strong>tty1</strong> as a port. </p>
  
  <p>Unfortunatelly both, in case of rasberry Pi and in case of PC I cannot see kernel debugs in such <strong>minicom</strong> session. In case of raspberry Pi I tried to send file from minicom and I saw it was working - file content was displayed in display connected directly to rasberry pi. Unfortuanatelly logs from rasberry to <strong>minicom</strong> are not transferred or are stucked somewhere. Does anyone could tell me if such method for kernel logs display is possible at all?</p>