* Redirecting output
@ 2005-03-23 6:42 shafa.hidee
2005-03-23 7:17 ` Jan Engelhardt
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: shafa.hidee @ 2005-03-23 6:42 UTC (permalink / raw)
To: linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Redirecting output
2005-03-23 6:42 Redirecting output shafa.hidee
@ 2005-03-23 7:17 ` Jan Engelhardt
2005-03-23 7:27 ` Martin Waitz
2005-03-23 11:36 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Jan Engelhardt @ 2005-03-23 7:17 UTC (permalink / raw)
To: shafa.hidee; +Cc: linux-kernel
>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
--
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Redirecting output
2005-03-23 6:42 Redirecting output shafa.hidee
2005-03-23 7:17 ` Jan Engelhardt
@ 2005-03-23 7:27 ` Martin Waitz
2005-03-23 11:36 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Martin Waitz @ 2005-03-23 7:27 UTC (permalink / raw)
To: shafa.hidee; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
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
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Redirecting output
2005-03-23 6:42 Redirecting output shafa.hidee
2005-03-23 7:17 ` Jan Engelhardt
2005-03-23 7:27 ` Martin Waitz
@ 2005-03-23 11:36 ` Andrew Morton
2 siblings, 0 replies; 5+ messages in thread
From: Andrew Morton @ 2005-03-23 11:36 UTC (permalink / raw)
To: shafa.hidee; +Cc: linux-kernel
"shafa.hidee" <shafa.hidee@gmail.com> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Redirecting output
[not found] <fa.hseagm2.1l76c0o@ifi.uio.no>
@ 2005-03-23 14:21 ` Bodo Eggert
0 siblings, 0 replies; 5+ messages in thread
From: Bodo Eggert @ 2005-03-23 14:21 UTC (permalink / raw)
To: shafa.hidee, linux-kernel
shafa.hidee <shafa.hidee@gmail.com> 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)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-03-24 0:33 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-23 6:42 Redirecting output shafa.hidee
2005-03-23 7:17 ` Jan Engelhardt
2005-03-23 7:27 ` Martin Waitz
2005-03-23 11:36 ` Andrew Morton
[not found] <fa.hseagm2.1l76c0o@ifi.uio.no>
2005-03-23 14:21 ` Bodo Eggert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox