From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 16 01:54:10 2007 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B00F816A407 for ; Tue, 16 Jan 2007 01:54:10 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from mxout1.cac.washington.edu (mxout1.cac.washington.edu [140.142.32.134]) by mx1.freebsd.org (Postfix) with ESMTP id 8F51F13C441 for ; Tue, 16 Jan 2007 01:54:10 +0000 (UTC) (envelope-from youshi10@u.washington.edu) Received: from smtp.washington.edu (smtp.washington.edu [140.142.32.141] (may be forged)) by mxout1.cac.washington.edu (8.13.7+UW06.06/8.13.7+UW06.09) with ESMTP id l0G1sADH007295 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Jan 2007 17:54:10 -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 l0G1qjgj026540 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Mon, 15 Jan 2007 17:52:51 -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:52:43 -0800 To: freebsd-hackers@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-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jan 2007 01:54:10 -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