From owner-freebsd-questions Tue Apr 25 10:48: 6 2000 Delivered-To: freebsd-questions@freebsd.org Received: from hostel8.kiuca.kiev.ua (host.kiuca.gu.net [194.93.181.201]) by hub.freebsd.org (Postfix) with ESMTP id 6FD7937BD90 for ; Tue, 25 Apr 2000 10:47:39 -0700 (PDT) (envelope-from qd@hostel8.kiuca.kiev.ua) Received: (from qd@localhost) by hostel8.kiuca.kiev.ua (8.9.3/8.9.3) id UAA27181 for questions@freebsd.org; Tue, 25 Apr 2000 20:46:32 +0300 (EEST) (envelope-from qd) Date: Tue, 25 Apr 2000 20:46:32 +0300 From: Valery Zamarayev To: questions@freebsd.org Subject: Re: some questions about kernel Message-ID: <20000425204632.A27154@inetgate.avt> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre2i In-Reply-To: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Apr 25, 2000 at 01:03:32PM +0200, Ariel Burbaickij wrote: > > I try to read some kernel sources of FreeBSD equipped with > book of Lions ,Bach and McKusick.What i saw was rather excessive > use of macros of rather complex nature (as for me surely) and > whole lot of #ifdefs , iterative #defines and some simmilar stuff > I have not seen usage of these progamming methods so far neither > im Lions book nor in Minix(sources I have seen so far) > So my first and some futher questions are: > 1) Why was such excessive usage of macros metohod of choice? > 2) What is __P macro used in many places in kernel sources? > my tip is:It is macro with variable count of arguments( > thing I have not seen before,would someone expalin why it was > neccesary)Would you expalin this technik to me ? it seems that __P is for the code to compile with different C compilers. I don't remember where it is defined. I don't know why this is necessary, FreeBSD uses one native compiler after all. > 3) How can i strip the sources from these #ifdefs,#defines and > get macros extended(I know i have to use cpp but it will > produce a whole lot empty lines bearing no information. > Besides,i do not know whether is it possible to use > cpp on whole hierarchies of source files) > > My 4 question is about implelemtation of some well-known fuction > in FreeBSD > I tried to locate some well-known in some circles surely :)) > functions(e.g. ialloc ,iput,ifree,iget)with some helpful > tools as gtags and flobal amd got a good dozen of files. > Same is true about buffer allocating functions. > So the questions is: > 4) Maybe somecatalogue is maintained with information about > where(in what file)each function is definied?Some functions > were probably re-named so maybe some another catalogue exists with > mapping between old-style names to new-style names ? > With old-style I mean books of Bach , Lion and Tannenbaum there is a hypertext version of the FreeBSD kernel source, I don't remember the URL, but www.freebsd.org has a link -- Valery Zamarayev To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message