Hi,
I have created a dummy module for learning device driver in linux. I
want to redirect the standard output of printk to my xterm. But by default
it is redirected to tty.
I have remote logged into the machine.
Please help.
Regards
Shafa.hidee
>Hi,
> I have created a dummy module for learning device driver in linux. I
>want to redirect the standard output of printk to my xterm. But by default
>it is redirected to tty.
What shall happen if you close the pts of the xterm?
Jan Engelhardt
--
hoi :)
On Wed, Mar 23, 2005 at 12:12:02PM +0530, shafa.hidee wrote:
> I have created a dummy module for learning device driver in linux. I
> want to redirect the standard output of printk to my xterm. But by default
> it is redirected to tty.
The kernel does not have 'standard output', so you can't redirect it.
Please consult the manual for dmesg and syslog.
And please have a look at a good Linux kernel book.
This will help you understand the kernel and will answer most
of your questions.
--
Martin Waitz
"shafa.hidee" <[email protected]> wrote:
>
> I have created a dummy module for learning device driver in linux. I
> want to redirect the standard output of printk to my xterm. But by default
> it is redirected to tty.
>
> I have remote logged into the machine.
You can do this from within the module_init() handler only:
module_init_handler(...)
{
mm_segment_t old_fs;
....
old_fs = set_fs(KERNEL_DS);
sys_write(1, "foo\n", 4);
set_fs(old_fs);
...
}
The text comes out on modprobe's standard output.
Don't tell anyone I told you this.
shafa.hidee <[email protected]> wrote:
> I have created a dummy module for learning device driver in linux. I
> want to redirect the standard output of printk to my xterm. But by default
> it is redirected to tty.
tail -f /var/log/syslog (or /var/log/messages)