Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261379AbVCWLhD (ORCPT ); Wed, 23 Mar 2005 06:37:03 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261395AbVCWLhD (ORCPT ); Wed, 23 Mar 2005 06:37:03 -0500 Received: from fire.osdl.org ([65.172.181.4]:46550 "EHLO smtp.osdl.org") by vger.kernel.org with ESMTP id S261379AbVCWLg7 (ORCPT ); Wed, 23 Mar 2005 06:36:59 -0500 Date: Wed, 23 Mar 2005 03:36:31 -0800 From: Andrew Morton To: "shafa.hidee" Cc: linux-kernel@vger.kernel.org Subject: Re: Redirecting output Message-Id: <20050323033631.0f7ad778.akpm@osdl.org> In-Reply-To: <001e01c52f74$2f27daa0$6a88cb0a@hss.hns.com> References: <001e01c52f74$2f27daa0$6a88cb0a@hss.hns.com> X-Mailer: Sylpheed version 0.9.7 (GTK+ 1.2.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 804 Lines: 30 "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. > > 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. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/