Date: Sat, 8 Feb 2003 17:44:36 -0500 From: Craig Rodrigues <rodrigc@attbi.com> To: Auge Mike <tobe_better@hotmail.com> Cc: current@FreeBSD.ORG Subject: Re: printf....! Message-ID: <20030208224436.GA14654@attbi.com> In-Reply-To: <EE44CED6-3BB3-11D7-8E7D-0003937E39E0@mac.com> References: <F93rBLSAQV6uPDVniSn0000956b@hotmail.com> <EE44CED6-3BB3-11D7-8E7D-0003937E39E0@mac.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030208224436.GA14654>