how to display message from kernel module without using dmesg|tail ?

Hi,
I did finish the kernel-module example but after running the command insmod hellokernel.ko, I have to type the command dmesg | tail to see the result.
I hope someone experienced about this issue can help me.

Thank you for your time.

Best regards,
Thang Nguyen

I guess I forgot to question in my last post. I will ask again.

Is there any way to make the kernel module print directly on the text command line without using the display kernel message command [dmesg | tail]? Cause in my example, after load the kernel hellokernel, I have to type the display kernel messge to see the result of my print command. I ask this question cause when my friend ran my module it apprear directly on his text command line, but t didn’t on my text command line. Should I do anything to make it works the same way?

This is my hellokernel.c
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE(“Dual BSD/GPL”);
static int hello_init(void)
{
printk(KERN_ALERT “Hello, world\n”);
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT “Goodbye, cruel world\n”);
}
module_init(hello_init);
module_exit(hello_exit);

Best regards,
Thang Nguyen

Thang Nguyen wrote:

I guess I forgot to question in my last post. I will ask again.
Is there any way to make the kernel module print directly on the text
command line without using the display kernel message command [dmesg |
tail]? Cause in my example, after load the kernel hellokernel, I have to
type the display kernel messge to see the result of my print command. I
ask this question cause when my friend ran my module it apprear directly
on his text command line, but t didn't on my text command line. Should I
do anything to make it works the same way?
This is my hellokernel.c
#include <linux/init.h>
#include <linux/module.h>
MODULE_LICENSE("Dual BSD/GPL");
static int hello_init(void)
{
printk(KERN_ALERT "Hello, world\n");
return 0;
}
static void hello_exit(void)
{
printk(KERN_ALERT "Goodbye, cruel world\n");
}

either:

http://mail.nl.linux.org/kernelnewbies/2004-07/msg00020.html

or just remove the KERN_ALERT.

Regards,

Vladimir

Hi Valdimir. Thank you so much ^_^. I tried to search on Google but I did use the wrong key word then.