From owner-freebsd-hackers@FreeBSD.ORG Sun Jan 23 12:26:53 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3DAE16A4CE for ; Sun, 23 Jan 2005 12:26:53 +0000 (GMT) Received: from mail.gmx.net (pop.gmx.de [213.165.64.20]) by mx1.FreeBSD.org (Postfix) with SMTP id BD3BC43D2F for ; Sun, 23 Jan 2005 12:26:52 +0000 (GMT) (envelope-from MethoD.EaglE@gmx.net) Received: (qmail 30783 invoked by uid 0); 23 Jan 2005 12:26:51 -0000 Received: from 134.76.249.10 by www25.gmx.net with HTTP; Sun, 23 Jan 2005 13:26:50 +0100 (MET) Date: Sun, 23 Jan 2005 13:26:50 +0100 (MET) From: =?ISO-8859-1?Q?=22Anton_W=F6llert=22?= To: freebsd-hackers@freebsd.org MIME-Version: 1.0 X-Priority: 3 (Normal) X-Authenticated: #9939996 Message-ID: <11679.1106483210@www25.gmx.net> X-Mailer: WWW-Mail 1.6 (Global Message Exchange) X-Flags: 0001 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Subject: operation sequence of ioctl's X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2005 12:26:54 -0000 Hello, my question is how a ioctl is called when i use int ioctl(fd ....) from userland. i think first, a trap is generated through the handler in exeption.S, that calls the routine for system-calls, and that calls via the syscall-vector-table the function sys_ioctl (? i think). by the way, where is this vector-table initialized? sys_ioctl handles then the copying of args etc. and calls then some kind of fd->some_what->ioctl(foo, bar, bla). so i think the function which is called, depends of the filedescriptor that is passed via ioctl. so am i right with the assumption that for example the kbd-driver adds via what? the /dev/kdb file-descriptor and if i want to control something from the keyboard, i have to do ioctl(open("/dev/kbd"), TURN_LED_ON, 0) (just as an meta-code example). but what is with the stdin, stdout and stderr file-descriptors. what type do they have and where are they initialized? so and last question, where is the function|macro VOP_IOCTL defined? thanks in advance -- Sparen beginnt mit GMX DSL: http://www.gmx.net/de/go/dsl