How to Show Printk() Message in Console

printk() messages not appearing in console

I hope i can answer to your question. I also faced same issue and tried my level best to print kernel message to console, but nothing works. Then I started searching for the reason...

The reason is, If klogd is not running, the message won’t reach user space unless you read /proc/kmsg. Reference: oreilly or /dev/kmsg. klogd reads kernel log messages and helps process and send those messages to the appropriate files, sockets or users. since absence of daemon, it won't send to standard output. Unless you read the message from ring buffer or buffer overflow, it will remains.

Where does printk() print to?

dmesg should display printk messages.

Send printk to serial

Try booting your kernel with the command line 'console=ttyS1,<baud>', where <baud> is the baud rate you configured for that port in the VM settings. The kernel will then use /dev/ttyS1 as the main console, and that's where printk will send all of its output to.



Related Topics



Leave a reply



Submit