From owner-freebsd-current Sat Feb 8 14:43:59 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E470037B401 for ; Sat, 8 Feb 2003 14:43:57 -0800 (PST) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id 242CE43F75 for ; Sat, 8 Feb 2003 14:43:57 -0800 (PST) (envelope-from rodrigc@attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost [127.0.0.1]) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6) with ESMTP id h18MibhE016366; Sat, 8 Feb 2003 17:44:37 -0500 (EST) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost) by h00609772adf0.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id h18Mibmp016365; Sat, 8 Feb 2003 17:44:37 -0500 (EST) Date: Sat, 8 Feb 2003 17:44:36 -0500 From: Craig Rodrigues To: Auge Mike Cc: current@FreeBSD.ORG Subject: Re: printf....! Message-ID: <20030208224436.GA14654@attbi.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG >I was trying to know how "printf" works in FreeBSD... I hvae reached >to this >point : > >#define _write(fd, s, n) \ > __syscall(SYS_write, (int)(fd), (const void *)(s), (size_t)(n)) > >I'am not really familiar with the way FreeBSD handle interrupts. I >like from >any one of you to tell me what functions will be called next and in >which >files, till we get the string of the printf function argment displayed >in >the terminal. Look in /usr/src/sys/kern/syscalls.master. You will see that this write() is listed as a system call. If you run the script makesyscalls.sh which is in the same directory, it will create syscalls.c, syscalls.h, sysproto.h, and syscall.mk. If you look at /usr/src/sys/sys/syscall.h, you will see SYS_write defined in that file. You can see the man page for syscall() to see what it does when you do syscall(SYS_write, ...); Look in /usr/src/sys/kern/sys_generic.c, and look at the write() function there..... I'm not familiar with DOS interrupts, but hopefully that will give you more clues....:) You should also look at the Developer's Handbook: http://www.freebsd.org/doc/en_US.ISO8859-1/books/developers-handbook/ -- Craig Rodrigues http://home.attbi.com/~rodrigc rodrigc@attbi.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message