From owner-freebsd-questions@FreeBSD.ORG Tue Oct 17 02:41:09 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83FC716A403 for ; Tue, 17 Oct 2006 02:41:09 +0000 (UTC) (envelope-from grog@lemis.com) Received: from ext-gw.lemis.com (ext-gw.lemis.com [150.101.14.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 495A143D58 for ; Tue, 17 Oct 2006 02:41:04 +0000 (GMT) (envelope-from grog@lemis.com) Received: from wantadilla.lemis.com (wantadilla.lemis.com [192.109.197.135]) by ext-gw.lemis.com (Postfix) with ESMTP id 0F925133066; Tue, 17 Oct 2006 12:11:03 +0930 (CST) Received: by wantadilla.lemis.com (Postfix, from userid 1004) id F26AF9C279; Tue, 17 Oct 2006 12:11:02 +0930 (CST) Date: Tue, 17 Oct 2006 12:11:02 +0930 From: Greg 'groggy' Lehey To: Olivier Nicole Message-ID: <20061017024102.GO96445@wantadilla.lemis.com> References: <200610170235.k9H2ZElx012419@banyan.cs.ait.ac.th> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vNrHrykRFvLVX6W3" Content-Disposition: inline In-Reply-To: <200610170235.k9H2ZElx012419@banyan.cs.ait.ac.th> User-Agent: Mutt/1.4.2.1i Organization: The FreeBSD Project Phone: +61-8-8388-8286 Fax: +61-8-8388-8725 Mobile: +61-418-838-708 VoIP: sip:0871270137@sip.internode.on.net WWW-Home-Page: http://www.FreeBSD.org/ X-PGP-Fingerprint: 9A1B 8202 BCCE B846 F92F 09AC 22E6 F290 507A 4223 Cc: freebsd-questions@freebsd.org Subject: Re: User vs Kernel mode X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2006 02:41:09 -0000 --vNrHrykRFvLVX6W3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tuesday, 17 October 2006 at 9:35:14 +0700, Olivier Nicole wrote: > Hi, > > I have an application that is running on virtual tty 0, i start it the > following way: > > /etc/ttys > ttyv0 "/usr/libexec/getty Door" cons25 on secure > > /etc/gettytab > Door: :ht:np:sp#115200:al=3Ddoor: > > /etc/passwd > door:*:0:0:Run the door program:/usr/local/door:/usr/local/door/door > > While the application is launched by getty, I would like to know if it > is running in user mode or in kernel mode. Processes always start in kernel mode, because they're started by the kernel. They typically spend most of their time in kernel mode (for example, whenever they're idle or waiting for I/O). An active process may switch back and forward between kernel mode and user mode thousands of times a second. > I think in user mode, and so there is no reason why it should affect > other processes, even if my application had some memory management > problems. A process which spends all its time in user mode is looping :-)=20 Maybe you should describe your problem. Greg -- When replying to this message, please copy the original recipients. If you don't, I may ignore the reply or reply to the original recipients. For more information, see http://www.lemis.com/questions.html See complete headers for address and phone numbers. --vNrHrykRFvLVX6W3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFFNEK+IubykFB6QiMRAmNcAKCrN6f+KCkWmVKjOVBLMKMy1WgdBwCcCOzT DaMboYxNNmkiY6yR8yHVl9w= =n+vE -----END PGP SIGNATURE----- --vNrHrykRFvLVX6W3--