sending message to printk buffer from user space -- not working

Actually i want my driver messages to reach my terminal for debugging purpose. So i just try to check by following below link.

I refred following link :--

I am using a ubuntu in side vmplayer virtual machine. Ubuntu is running in terminal mode inside virtual machine. I am trying to send some message to kernel printk buffer, buts echo command fails.

klog demon is also running i confirmed with following command .

ps aux | grep klogd 

Cat command on proc printk entry :---

# cat /proc/sys/kernel/printk
4 4 1 7

run echo command :---

#sudo echo "<1>Writing critical printk messages from userspace" >/dev/kmsg

But i am not able to get the message on the terminal. I am getting following error when runs above command :--

-bash: /dev/kmsg: Permission denied

Please suggest how to print on console ?

my actual requirement is to ... send messages of printk() in my driver ... directly to my console. I am just testing here from my console that messages of low priority reaches console or not .

1 Answer

Use:

echo "<1>Writing critical printk messages from userspace" | sudo tee /dev/kmsg

See this answer to understand why.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like