From owner-freebsd-arch@FreeBSD.ORG Mon Jan 19 03:23:42 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9C54D16A4CE for ; Mon, 19 Jan 2004 03:23:42 -0800 (PST) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26FB543D2D for ; Mon, 19 Jan 2004 03:23:39 -0800 (PST) (envelope-from ru@FreeBSD.org.ua) Received: from phantom.cris.net (ru@localhost [127.0.0.1]) by phantom.cris.net (8.12.10/8.12.10) with ESMTP id i0JBOEjm042956 for ; Mon, 19 Jan 2004 13:24:17 +0200 (EET) (envelope-from ru@FreeBSD.org.ua) Received: (from ru@localhost) by phantom.cris.net (8.12.10/8.12.10/Submit) id i0JBODYZ042946 for arch@FreeBSD.org; Mon, 19 Jan 2004 13:24:13 +0200 (EET) (envelope-from ru) Date: Mon, 19 Jan 2004 13:24:11 +0200 From: Ruslan Ermilov To: arch@FreeBSD.org Message-ID: <20040119112411.GG41159@FreeBSD.org.ua> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c7hkjup166d4FzgN" Content-Disposition: inline User-Agent: Mutt/1.5.5.1i Subject: Revamp of kerberos5/ makefiles X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2004 11:23:42 -0000 --c7hkjup166d4FzgN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Mark Murray suggested that I leak this here in order to bikeshed it enough before it meets the tree, so here it goes, for those interested... ----- Forwarded message from Ruslan Ermilov ----- Date: Thu, 15 Jan 2004 16:47:24 +0200 =46rom: Ruslan Ermilov To: Mark Murray , "Jacques A. Vidrine" Cc: Bruce Evans Subject: Re: kerberos5/ makefiles revamp On Wed, Jan 14, 2004 at 12:41:22AM +0200, Ruslan Ermilov wrote: > I'd like to spend some time now to revamp the kerberos5/ build > infrastructure [...] >=20 Attached is the functional diff (style changes omitted) to bring kerberos5/ makefiles to a normal level, in my definition of "normal". ;) It also accumulates the previous patch to fix dependencies in the WITH_OPENLDAP case. The commit log would look alongside this: : Overhaul of kerberos5/ makefiles. Most notable changes are: :=20 : - Dropped support for standalone builds, this was only partially : supported anyway, and required so much magic in makefiles that : made life dangerous (e.g., by using the custom yacc rules). :=20 : - Got rid of .OBJDIR in makefiles -- makes building of individual : files possible again. :=20 : - Made the .x.c transformations -j safe. :=20 : - Reprogrammed LDADD to fix static build of some utilities that : was broken. :=20 : - Removed redundant .h's from SRCS, only kept those that are : generated. :=20 : - libkrb5/ INCS were bogusly installed again with libgssapi/. :=20 : - Made build-tools real tools with their own makefiles in : separate directories. This allows us to properly track : their dependencies, etc. :=20 : - Faster build, 21% less of makefile code! What would probably meet some resistance is dropping support for standalone builds, so let me explain it in a bit more detail here (not in the commit log) why I think it should be removed. First, the definition. The standalone build is an ability to just type "make" from the top-level kerberos5/ directory, and have everything built. While the intent seems to be clever, the implementation was only partial and too painful -- lot of trickery in makefiles to pick up fresh headers and non-determinism (depending on the order you make things, different headers may be used). Most importantly, it just didn't work as coded, because to build the non-lib/ portion of kerberos5/, you need to at least have libraries installed, to link against them. Just to proof, an attempt to build the stock fresh kerberos5/ on a 134 days old 5.1-CURRENT machine (9ball.rtp.FreeBSD.org) fails because it attempts to link with an older Heimdal library from /usr/lib: =3D=3D=3D> libexec/kdc kerberos4.o: In function `encode_v4_ticket': kerberos4.o(.text+0x227): undefined reference to `_krb5_krb_time_to_life' *** Error code 1 OTOH, dropping support for standalone builds doesn't mean you can't build it manually, no. It's still possible, just requires a bit more than just typing "make". Specifically, you should just be following the "buildworld" way to build things: make obj (optional) make depend (optional) make includes # build and install includes (cd lib; make all; make install) # build and install libraries make all # build everything else We could even add this sequence to a top level kerberos5/Makefile, as a convenience. ;) Comments, questions, reviews, suggestions (not about fixing style at this time) are highly welcome! Ah, and the last but not least: it has been intensively tested on two UP and SMP machines, outside and within the buildworld, for both native and another platform (TARGET_ARCH=3Dsparc64), with and without -j, and with and without "make depend" in the non-buildworld mode. Please note that before attempting to apply this patch you need to create new src/kerberos5/tools/* directories from the patch manually. The patch is available from: http://people.FreeBSD.org/~ru/patches/kerberos5-makefiles.patch ----- End forwarded message ----- --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --c7hkjup166d4FzgN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAC75bUkv4P6juNwoRAluPAKCCspwcVGUVwP1waS6yV+2nViw7IgCffnrB Mkw1FomUNbM6WpBxpXbIL18= =V4CR -----END PGP SIGNATURE----- --c7hkjup166d4FzgN-- From owner-freebsd-arch@FreeBSD.ORG Mon Jan 19 16:23:14 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 65CFE16A4CE for ; Mon, 19 Jan 2004 16:23:14 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 545C443D39 for ; Mon, 19 Jan 2004 16:23:12 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i0K0NCkX002305 for ; Mon, 19 Jan 2004 16:23:12 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <400C74EF.1020208@acm.org> Date: Mon, 19 Jan 2004 16:23:11 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-arch@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: RFC: libpkg X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 00:23:14 -0000 I've started to build a libpkg as part of my ongoing project to overhaul the existing FreeBSD pkg_* tools [1]. Although my design docs are very rough still, I'd appreciate any input on whether this general approach would be useful to people who are considering building other sorts of packaging tools: http://people.freebsd.org/~kientzle/libarchive/libpkg.3.txt Tim Kientzle [1] That work has been extensively discussed on this mailing list; for anyone who missed it, more details are available at: http://people.freebsd.org/~kientzle/libarchive/ From owner-freebsd-arch@FreeBSD.ORG Tue Jan 20 12:26:45 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2903A16A4CE for ; Tue, 20 Jan 2004 12:26:45 -0800 (PST) Received: from mailbox.gr (mailbox.gr [216.121.96.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DD7343D7D for ; Tue, 20 Jan 2004 12:26:35 -0800 (PST) (envelope-from nobody@mailbox.gr) Received: (from nobody@localhost) by mailbox.gr (8.9.3p2/8.9.3) id WAA04531; Tue, 20 Jan 2004 22:24:18 +0200 Date: Tue, 20 Jan 2004 22:24:18 +0200 Message-Id: <200401202024.WAA04531@mailbox.gr> From: "dkouroun@mailbox.gr" To: freebsd-arch@FreeBSD.org Subject: which one of the systems is best for my X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 20:26:45 -0000 Dear sirs, Thank you for giving us for free the FreeBSD OS. It is a great relief haveing an OS for free! I would like to ask you since I am a newbie which is the Operating system which suits best for an Opteron dual box? Is it FreeBSD AMD64 or FreeBSD IA64? Can somebody install FreeBSD i386 on an Opteron Dual Box? How much memory do those systems support? Are they compatible with OpenMP and MPI ? Is there any Linux alternative to FreeBSD for 64bit OS (SuSe or RedHat) which one would you suggested? Thanks in advance! Drosos. _____________________________________________________________________________________ http://www.mailbox.gr Αποκτήστε δωρεάν το μοναδικό σας e-mail. http://www.thesuperweb.gr Δεν έχετε web site; Αποκτήστε το τώρα και πάρτε δώρο το domain σας! From owner-freebsd-arch@FreeBSD.ORG Tue Jan 20 13:29:58 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E38F716A4CE for ; Tue, 20 Jan 2004 13:29:58 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id B8BA743D39 for ; Tue, 20 Jan 2004 13:29:52 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.10/8.12.3) with ESMTP id i0KLTmaT016843; Tue, 20 Jan 2004 13:29:48 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.10/8.12.3/Submit) id i0KLTmcu016842; Tue, 20 Jan 2004 13:29:48 -0800 Date: Tue, 20 Jan 2004 13:29:48 -0800 From: Brooks Davis To: "dkouroun@mailbox.gr" Message-ID: <20040120212948.GB11747@Odin.AC.HMC.Edu> References: <200401202024.WAA04531@mailbox.gr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GID0FwUMdk1T2AWN" Content-Disposition: inline In-Reply-To: <200401202024.WAA04531@mailbox.gr> User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu cc: freebsd-arch@freebsd.org Subject: Re: which one of the systems is best for my X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 21:29:59 -0000 --GID0FwUMdk1T2AWN Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable [This would have been better to ask on -questions or -hardware.] On Tue, Jan 20, 2004 at 10:24:18PM +0200, dkouroun@mailbox.gr wrote: > Dear sirs, > Thank you for giving us for free the FreeBSD OS. It is a great relief > haveing an OS for free! I would like to ask you since I am a newbie > which is the Operating system which suits best for an Opteron dual > box? > Is it=20 > FreeBSD AMD64 or > FreeBSD IA64? FreeBSD AMD64 or i386 will run on an Opteron. IA64 will definatly not. > Can somebody install FreeBSD i386 on an Opteron Dual Box? Yes. This will be a good choice in many cases because third-party app support is still better. Hopefully this will change by 5.3 or so. > How much memory do those systems support? In i386 4GB unless there is PAE support (I'm not sure). With amd64, more then existing motherboards support. > Are they compatible with OpenMP and MPI ? Both of the opensource MPI implementations work fine and have ports (MPICH and LAM-MPI.) I don't know of a free OpenMP implemenation with FreeBSD support, but I haven't looked either. > Is there any Linux alternative to FreeBSD for 64bit OS (SuSe or > RedHat) which one would you suggested? Neither. This is a FreeBSD list. :-) -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --GID0FwUMdk1T2AWN Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFADZ3KXY6L6fI4GtQRAiUrAKC19VStoHjAawghJ0T+epqJHsBBRQCgzcax s1Tpxdw2Eyy1vdi8bDd18ms= =bStH -----END PGP SIGNATURE----- --GID0FwUMdk1T2AWN-- From owner-freebsd-arch@FreeBSD.ORG Wed Jan 21 03:12:00 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3CDB116A4CE for ; Wed, 21 Jan 2004 03:12:00 -0800 (PST) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id A36FF43D2D for ; Wed, 21 Jan 2004 03:11:57 -0800 (PST) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id 562463ABB51; Wed, 21 Jan 2004 12:12:33 +0100 (CET) Date: Wed, 21 Jan 2004 12:12:32 +0100 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20040121111232.GF393@garage.freebsd.pl> References: <12416.1074036757@critter.freebsd.dk> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="C94crkcyjafcjHxo" Content-Disposition: inline In-Reply-To: <12416.1074036757@critter.freebsd.dk> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p13 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: arch@freebsd.org Subject: Re: About removable disks, mountroot and sw-raid X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2004 11:12:00 -0000 --C94crkcyjafcjHxo Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 14, 2004 at 12:32:37AM +0100, Poul-Henning Kamp wrote: +> There has been some discussions about how we handle removable disks +> and mountroot, raid engines and such stuff. I've think this over a bit and... +> First I will present the scenarios from which I have analyzed the +> situation. +>=20 +> A: Normal boot. +> Machine boots kernel, in relatively short time all disks +> are found. +>=20 +> B: Slow boot +> Machine boots kernel, disk dribble in at a rate of one +> every 20 seconds as the cabinet powers them up. +>=20 +> C: Boot with failed root disk. +> Machine boots kernel, in relatively short time all disks +> are found, root disk is not one of them. (This is a strange +> scenario I know, but it is important for the analysis). +>=20 +> D: Machine boots, all raid disks present. +>=20 +> E: Machine boots, one raid disk missing. +>=20 +> F: Machine running. Operator plugs complete raid-set in, one disk +> at a time. +>=20 +> The solution: +> ------------- +>=20 +> I want to add a counter (protected by a mutex) which the diskdrivers +> and GEOM will increment while they are configuring devices. +>=20 +> That means that as soon as the ata-disk system notices that there +> _may_ be a disk on a cable, it will increment this counter. +>=20 +> If it subsequently determines that there wasn't a disk after all, +> it decrements by one again. +>=20 +> If it finds a disk, it hands it off to GEOM/disk_create(9) before +> decrementing the counter. +>=20 +> GEOM will similarly hold reference counts until all tasting have +> settled down, so all geom classes have had their chance to do +> their thing. +>=20 +> mount_root will stall on this counter being non-zero, and when it +> goes to zero, try to open the root dev and fail if it is not found. +>=20 +> This solves scenario A. I think this is done already in SYSINIT(). We can wait for every driver to tell us "I've finished looking for devices." and then run our function for made use of every tasted disk. +> Scenario B is only solvable with outside knowledge. I propose to +> add a tunable which says either how long time in total or maybe +> more: useful how long time after the count went to zero before we +> give up looking for the root dev.=20 +>=20 +> This means that the system will "stick around for a while" hoping +> the missing disk appears, and after the timeout, it will fail. +>=20 +> A default timeout of 40 seconds from the last disk appeared +> sounds like a good shot at a default to me. I'm not sure about that. For what we want to wait? If every driver said that there are no more disks on it, there is nothing to wait for, IMHO. +> Provided what the user wants for scenario C is for mount_root to +> fail, we have also solved that. A magic timer configuration of -1 +> could mean "never", that caters for alternative desires. Our function called from SYSINIT() may decide about this. +> Now about sw-RAID (and mirror, and stripe and ...) +>=20 +> In general these methods must collect tributaries until they are +> satisfied they can run. +>=20 +> For non-redundant configs this is trivial: all bits must be present. +>=20 +> For redundant methods, the administrator will have to set a policy +> and I can imagine the following policies: +> 1. Run when you have all tributaries. +> 2. Run when you have quorum (ie: one copy of mirror etc) +> 3. When you have quorum, run if no further tributaries have +> arrived in N seconds. +>=20 +> Again a simple tunable integer can configure this (-1, 0, >0) and +> maybe for simplicity we should use the same as we use for mountroot. IMHO solution should be more general. If module is loaded at boot time or if it is loaded as a kld module there should be differences in action. My solution is: Set timeout in function called from SYSINIT() or in function called on module load. After this timeout GEOM class assume that all disks present in system was tasted and we should start with what we got. That's why I proposed G_TA_FIRST/G_TA_LAST flag for taste event. Note that event if we solve boot problem this problem (when to stop waiting for taste events) still exists, so such timeout or additional flag is still needed. We also should not run tasting events before we're in proper boot stage, then additional flags for taste event will make sens at boot time as well. What do you think? --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --C94crkcyjafcjHxo Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBQA5eoD/PhmMH/Mf1AQGh3QQAieRW+NIEbyKHf3u0rkmyUmMtTen0yenc aLSkz2E3Q/rrp7Gu+/PKl6DZMn/JKF2RJqYGHyh9vC+rk5qo5Gfyu1VaQdQex/w5 p40t2W9ke/01h/6siVpYM2Nsgkt7/HrVw40IXvY487QCkRSVKaa9Q9EWihU6sfnV B8fYqjD9zO8= =Mr21 -----END PGP SIGNATURE----- --C94crkcyjafcjHxo-- From owner-freebsd-arch@FreeBSD.ORG Wed Jan 21 23:25:26 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD00216A4CE for ; Wed, 21 Jan 2004 23:25:26 -0800 (PST) Received: from smtpout.mac.com (smtpout.mac.com [17.250.248.44]) by mx1.FreeBSD.org (Postfix) with ESMTP id BEA8343D3F for ; Wed, 21 Jan 2004 23:25:25 -0800 (PST) (envelope-from woolie@mac.com) Received: from mac.com (smtpin08-en2 [10.13.10.153]) by smtpout.mac.com (Xserve/MantshX 2.0) with ESMTP id i0M7PPf0005954 for ; Wed, 21 Jan 2004 23:25:25 -0800 (PST) Received: from [192.168.0.5] (c-24-20-112-85.client.comcast.net [24.20.112.85]) (authenticated bits=0) by mac.com (Xserve/smtpin08/MantshX 3.0) with ESMTP id i0M7PO2j015568 for ; Wed, 21 Jan 2004 23:25:25 -0800 (PST) User-Agent: Microsoft-Entourage/10.1.4.030702.0 Date: Wed, 21 Jan 2004 23:24:31 -0800 From: Steven Woolgar To: Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Subject: VFS layers... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 07:25:26 -0000 I am studying the source organization and do not currently have access to a BSD machine I can rebuild to include kernel debugging. I was wondering if someone could explain (or illustrate) the back trace (call stack) of a call from int open( const char*, int ) all the way through to the UFS layer. I am looking at the source code and am making progress, but it is long and tedious work without a compiling and step- able code. Thanks for any help. Oh, and if this isn't a appropriate request for this list please tell me. Woolie From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 10:13:59 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 686D416A4CE for ; Thu, 22 Jan 2004 10:13:59 -0800 (PST) Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id AF9A243D5E for ; Thu, 22 Jan 2004 10:13:36 -0800 (PST) (envelope-from robert@fledge.watson.org) Received: from fledge.watson.org (localhost [127.0.0.1]) by fledge.watson.org (8.12.10/8.12.10) with ESMTP id i0MIBWUd001597; Thu, 22 Jan 2004 13:11:32 -0500 (EST) (envelope-from robert@fledge.watson.org) Received: from localhost (robert@localhost)i0MIBWtG001594; Thu, 22 Jan 2004 13:11:32 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Thu, 22 Jan 2004 13:11:32 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Steven Woolgar In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-arch@freebsd.org Subject: Re: VFS layers... X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 18:13:59 -0000 On Wed, 21 Jan 2004, Steven Woolgar wrote: > I am studying the source organization and do not currently have access > to a BSD machine I can rebuild to include kernel debugging. > > I was wondering if someone could explain (or illustrate) the back trace > (call stack) of a call from int open( const char*, int ) all the way > through to the UFS layer. > > I am looking at the source code and am making progress, but it is long > and tedious work without a compiling and step- able code. > > Thanks for any help. > > Oh, and if this isn't a appropriate request for this list please tell > me. You probably want freebsd-fs, but here are two paths to ufs_open() that might be of interest to you: The first path is via the open() system call. The "missing" bit that isn't visible in DDB is the "macro/inline magic" that occurs in the context of a compiled kernel. db> trace ufs_open(cd631a70,cd631b2c,c06e40c3,cd631a70,c2364c6c) at ufs_open ufs_vnoperate(cd631a70,c2364c6c,4000,100,c20ce780) at ufs_vnoperate+0x18 vn_open_cred(cd631bdc,cd631cdc,0,c2362980,3) at vn_open_cred+0x3f3 vn_open(cd631bdc,cd631cdc,0,3,9) at vn_open+0x33 kern_open(c20ce780,28064e9b,0,1,0) at kern_open+0xc8 open(c20ce780,cd631d14,c,cd631d40,3) at open+0x30 syscall(2f,2f,2f,80484b9,80484b9) at syscall+0x310 Xint0x80_syscall() at Xint0x80_syscall+0x1d --- syscall (5, FreeBSD ELF32, open), eip = 0x280540af, esp = 0xbfbfe9dc, ebp = 0xbfbfea88 --- db> trace ufs_open(cd631a58,cd631ac4,c065bb07,cd631a58,c094c280) at ufs_open ufs_vnoperate(cd631a58,c094c280,c2877618,1,c2362980) at ufs_vnoperate+0x18 exec_check_permissions(cd631b8c,11000,11000,cd631aec,c07f498d) at exec_check_permissions+0x107 kern_execve(c20ce780,80c8200,80c3df0,80c8000,0) at kern_execve+0x339 execve(c20ce780,cd631d14,c,0,3) at execve+0x30 syscall(2f,2f,2f,80c3d70,80c8200) at syscall+0x310 Xint0x80_syscall() at Xint0x80_syscall+0x1d --- syscall (59, FreeBSD ELF32, execve), eip = 0x2815fbaf, esp = 0xbfbfa6bc, ebp = 0xbfbfa6d8 --- The malloc/inline magic is built from src/sys/kern/vnode_if.src when the kernel is compiled, and is storaged in vnode_if.[hc] in the kernel compile directory. Here's a sample for VOP_OPEN: struct vop_open_args { struct vnodeop_desc *a_desc; struct vnode *a_vp; int a_mode; struct ucred *a_cred; struct thread *a_td; int a_fdidx; }; extern struct vnodeop_desc vop_open_desc; static __inline int VOP_OPEN( struct vnode *vp, int mode, struct ucred *cred, struct thread *td, int fdidx) { struct vop_open_args a; int rc; a.a_desc = VDESC(vop_open); a.a_vp = vp; a.a_mode = mode; a.a_cred = cred; a.a_td = td; a.a_fdidx = fdidx; ASSERT_VI_UNLOCKED(vp, "VOP_OPEN"); ASSERT_VOP_LOCKED(vp, "VOP_OPEN"); rc = VCALL(vp, VOFFSET(vop_open), &a); CTR5(KTR_VOP, "VOP_OPEN(vp 0x%lX, mode %ld, cred 0x%lX, td 0x%lX, fdidx %ld)", vp, mode, cred, td, fdidx); if (rc == 0) { ASSERT_VI_UNLOCKED(vp, "VOP_OPEN"); ASSERT_VOP_LOCKED(vp, "VOP_OPEN"); } else { ASSERT_VI_UNLOCKED(vp, "VOP_OPEN"); ASSERT_VOP_LOCKED(vp, "VOP_OPEN"); } return (rc); } FYI, VCALL() is implemented in src/sys/sys/vnode.h: #define VDESC(OP) (& __CONCAT(OP,_desc)) ... #define VOFFSET(OP) (VDESC(OP)->vdesc_offset) ... #define VOCALL(OPSV,OFF,AP) (( *((OPSV)[(OFF)])) (AP)) ... #define VCALL(VP,OFF,AP) VOCALL((VP)->v_op,(OFF),(AP)) So the basic idea is that the set of operations for a vnode is compiled from the operation definition in vnode_if.src into a function pointer vector. However, all this evaluation happens inline, so in the stack trace you just see a call from the consumer of the VOP straight to the file system. A descriptor for each method is defined in vnode_if.c as a result of the compilation, and looks something like the following: static int vop_open_vp_offsets[] = { VOPARG_OFFSETOF(struct vop_open_args,a_vp), VDESC_NO_OFFSET }; struct vnodeop_desc vop_open_desc = { 0, "vop_open", 0, vop_open_vp_offsets, VDESC_NO_OFFSET, VOPARG_OFFSETOF(struct vop_open_args,a_cred), VOPARG_OFFSETOF(struct vop_open_args,a_td), VDESC_NO_OFFSET, NULL, }; This somewhat obfuscated approach makes up for a lack of object oriented programming in allowing the method set to be expanded at runtime, and opaque to the caller. Robert N M Watson FreeBSD Core Team, TrustedBSD Projects robert@fledge.watson.org Senior Research Scientist, McAfee Research From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 13:02:51 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 02B0F16A4CE for ; Thu, 22 Jan 2004 13:02:51 -0800 (PST) Received: from dswu17.btconnect.com (c2bapps9.btconnect.com [193.113.154.18]) by mx1.FreeBSD.org (Postfix) with SMTP id 7304843D2F for ; Thu, 22 Jan 2004 13:02:48 -0800 (PST) (envelope-from BPICKLES@btconnect.com) Received: from sdlbase (actually host 117.152.134.81.in-addr.arpa) by dswu17 with SMTP-CUST (XT-PP) with ESMTP; Thu, 22 Jan 2004 21:02:46 +0000 Message-ID: <018b01c3e12c$042b19d0$1d02a8c0@sdlbase> From: "Bob Pickles" To: Date: Thu, 22 Jan 2004 21:09:25 -0000 MIME-Version: 1.0 X-Priority: 1 X-MSMail-Priority: High X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.1 Subject: Device Driver Deleopment X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bob Pickles List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 21:02:51 -0000 Hi=20 Looking for some help with FreeBSD 5.1, I am new to this but I am=20 fairly quick to learn. Problem that I am having, is that in my device driver, it see's my PCI = card, but when=20 I call make_dev the system hangs, then resets. If I try to use mknod, then it fails also. Looked at the /dev mount and = even devfs fails. Is there some form of protection here that I don't know about? How can I create a device on /dev? Thanks Bob Pickles From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 13:09:05 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7D2C116A4CE for ; Thu, 22 Jan 2004 13:09:05 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F02D43D5C for ; Thu, 22 Jan 2004 13:09:00 -0800 (PST) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.10/8.12.10) with ESMTP id i0ML8quO002147; Thu, 22 Jan 2004 22:08:57 +0100 (CET) (envelope-from phk@phk.freebsd.dk) To: Bob Pickles From: "Poul-Henning Kamp" In-Reply-To: Your message of "Thu, 22 Jan 2004 21:09:25 GMT." <018b01c3e12c$042b19d0$1d02a8c0@sdlbase> Date: Thu, 22 Jan 2004 22:08:52 +0100 Message-ID: <2146.1074805732@critter.freebsd.dk> cc: freebsd-arch@freebsd.org Subject: Re: Device Driver Deleopment X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 21:09:05 -0000 In message <018b01c3e12c$042b19d0$1d02a8c0@sdlbase>, "Bob Pickles" writes: >Hi > >Looking for some help with FreeBSD 5.1, I am new to this but I am >fairly quick to learn. > >Problem that I am having, is that in my device driver, it see's my PCI card, but when >I call make_dev the system hangs, then resets. > >If I try to use mknod, then it fails also. Looked at the /dev mount and even devfs fails. >Is there some form of protection here that I don't know about? >How can I create a device on /dev? It sounds to me like you are calling make_dev() with wrong parameters, all our other device drivers get this to work, so I suggest finding a similar one and compare it to your own code. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 13:16:35 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF39516A4CE for ; Thu, 22 Jan 2004 13:16:35 -0800 (PST) Received: from dswu28.btconnect.com (dswu28.btconnect.com [193.113.154.29]) by mx1.FreeBSD.org (Postfix) with SMTP id 6016243D1D for ; Thu, 22 Jan 2004 13:16:34 -0800 (PST) (envelope-from BPICKLES@btconnect.com) Received: from sdlbase (actually host 117.152.134.81.in-addr.arpa) by dswu28 with SMTP-CUST (XT-PP) with ESMTP; Thu, 22 Jan 2004 21:16:32 +0000 Message-ID: <019d01c3e12d$f0856dc0$1d02a8c0@sdlbase> From: "Bob Pickles" To: "Poul-Henning Kamp" References: <2146.1074805732@critter.freebsd.dk> Date: Thu, 22 Jan 2004 21:23:01 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-arch@freebsd.org Subject: Re: Device Driver Deleopment X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bob Pickles List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 21:16:36 -0000 Hi Poul Thanks for the feedback. I'll look at the parameters on other pci drivers. Best Regards Bob ----- Original Message ----- From: "Poul-Henning Kamp" To: "Bob Pickles" Cc: Sent: Thursday, January 22, 2004 9:08 PM Subject: Re: Device Driver Deleopment > In message <018b01c3e12c$042b19d0$1d02a8c0@sdlbase>, "Bob Pickles" writes: > >Hi > > > >Looking for some help with FreeBSD 5.1, I am new to this but I am > >fairly quick to learn. > > > >Problem that I am having, is that in my device driver, it see's my PCI card, but when > >I call make_dev the system hangs, then resets. > > > >If I try to use mknod, then it fails also. Looked at the /dev mount and even devfs fails. > >Is there some form of protection here that I don't know about? > >How can I create a device on /dev? > > It sounds to me like you are calling make_dev() with wrong parameters, > all our other device drivers get this to work, so I suggest finding a > similar one and compare it to your own code. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > > ***This message has been scanned for virus, spam, and undesirable content.*** > ***For further information, contact your mail administrator.*** From owner-freebsd-arch@FreeBSD.ORG Thu Jan 22 13:31:45 2004 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1707A16A4CE for ; Thu, 22 Jan 2004 13:31:45 -0800 (PST) Received: from dswu83.btconnect.com (dswu83.btconnect.com [193.113.154.14]) by mx1.FreeBSD.org (Postfix) with SMTP id D966E43D39 for ; Thu, 22 Jan 2004 13:31:40 -0800 (PST) (envelope-from BPICKLES@btconnect.com) Received: from sdlbase (actually host 117.152.134.81.in-addr.arpa) by dswu83 with SMTP-CUST (XT-PP) with ESMTP; Thu, 22 Jan 2004 21:31:38 +0000 Message-ID: <01b701c3e130$0ca90870$1d02a8c0@sdlbase> From: "Bob Pickles" To: "Poul-Henning Kamp" References: <2146.1074805732@critter.freebsd.dk> Date: Thu, 22 Jan 2004 21:38:13 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 cc: freebsd-arch@freebsd.org Subject: Re: Device Driver Deleopment X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Bob Pickles List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jan 2004 21:31:45 -0000 Poul I looked at other drivers and this has done the job... it installs now. I should have done this before. Many Thanks Bob ----- Original Message ----- From: "Poul-Henning Kamp" To: "Bob Pickles" Cc: Sent: Thursday, January 22, 2004 9:08 PM Subject: Re: Device Driver Deleopment > In message <018b01c3e12c$042b19d0$1d02a8c0@sdlbase>, "Bob Pickles" writes: > >Hi > > > >Looking for some help with FreeBSD 5.1, I am new to this but I am > >fairly quick to learn. > > > >Problem that I am having, is that in my device driver, it see's my PCI card, but when > >I call make_dev the system hangs, then resets. > > > >If I try to use mknod, then it fails also. Looked at the /dev mount and even devfs fails. > >Is there some form of protection here that I don't know about? > >How can I create a device on /dev? > > It sounds to me like you are calling make_dev() with wrong parameters, > all our other device drivers get this to work, so I suggest finding a > similar one and compare it to your own code. > > -- > Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 > phk@FreeBSD.ORG | TCP/IP since RFC 956 > FreeBSD committer | BSD since 4.3-tahoe > Never attribute to malice what can adequately be explained by incompetence. > _______________________________________________ > freebsd-arch@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-arch > To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org" > > ***This message has been scanned for virus, spam, and undesirable content.*** > ***For further information, contact your mail administrator.***