From owner-freebsd-questions@FreeBSD.ORG Tue Jan 16 01:51:27 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4761E16A40F for ; Tue, 16 Jan 2007 01:51:27 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout4.cac.washington.edu (mxout4.cac.washington.edu [140.142.33.19]) by mx1.freebsd.org (Postfix) with ESMTP id 26DB213C45B for ; Tue, 16 Jan 2007 01:51:27 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.139]) by mxout4.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id l0G1pQ9E022842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Jan 2007 17:51:26 -0800 X-Auth-Received: from [192.168.2.15] (dsl254-013-145.sea1.dsl.speakeasy.net [216.254.13.145]) (authenticated authid=youshi10) by smtp.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id l0G1pPlq031484 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 15 Jan 2007 17:51:26 -0800 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: References: X-Gpgmail-State: !signed Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Garrett Cooper Date: Mon, 15 Jan 2007 17:51:08 -0800 To: freebsd-questions@freebsd.org X-Mailer: Apple Mail (2.752.2) X-PMX-Version: 5.2.2.285561, Antispam-Engine: 2.5.0.283055, Antispam-Data: 2007.1.15.172932 X-Uwash-Spam: Gauge=IIIIIII, Probability=7%, Report='__CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' Subject: Re: Console and Shell 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, 16 Jan 2007 01:51:27 -0000 On Jan 15, 2007, at 3:09 PM, Kailas Ramasamy wrote: > Hi, > I would like to understand how the shell is tied to the console > port. When > an user connects a terminal > to the system via console port, a shell is started and tied to the > console > port (/dev/console ?). > Can some someone explain how this whole process works?. It would be > great if > you can point me > the source code and/or the any documents. > > Thanks > Kailas Why not just go to the source folder for sh (should be under /usr/src/ bin/sh/*) and grep for fopen or /dev/tty? Seems like the kernel would open up and attach the executing shell to its relevant TTY though with getty. -Garrett