From owner-freebsd-questions Fri Nov 22 12:31:22 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EDA3837B401 for ; Fri, 22 Nov 2002 12:31:20 -0800 (PST) Received: from msgbas2x.cos.agilent.com (msgbas2x.cos.agilent.com [192.25.240.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7EB5C43E6E for ; Fri, 22 Nov 2002 12:31:20 -0800 (PST) (envelope-from yiding_wang@agilent.com) Received: from relcos2.cos.agilent.com (relcos2.cos.agilent.com [130.29.152.237]) by msgbas2x.cos.agilent.com (Postfix) with ESMTP id 1386C1FDF for ; Fri, 22 Nov 2002 13:31:15 -0700 (MST) Received: from axcsbh2.cos.agilent.com (axcsbh2.cos.agilent.com [130.29.152.144]) by relcos2.cos.agilent.com (Postfix) with SMTP id 6081956F for ; Fri, 22 Nov 2002 13:31:09 -0700 (MST) Received: from 130.29.152.144 by axcsbh2.cos.agilent.com (InterScan E-Mail VirusWall NT); Fri, 22 Nov 2002 13:31:04 -0700 Received: by axcsbh2.cos.agilent.com with Internet Mail Service (5.5.2653.19) id ; Fri, 22 Nov 2002 13:31:03 -0700 Message-ID: <334DD5C2ADAB9245B60F213F49C5EBCD019C7AA3@axcs03.cos.agilent.com> From: yiding_wang@agilent.com To: freebsd-questions@FreeBSD.ORG Subject: Questions about scsi hba driver Date: Fri, 22 Nov 2002 13:31:01 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This is the first expecrience for me with FreeBSD and I am going to start making fuss here. I am planning to write drivers for iSCSI and FC initiator as well as target ramdisk on FreeBSD, and just installed 4.7 and downloaded a few docs. By looking into CVS, I got a bit confused on driver building and loading process as well as source file layout. I will use Buslogic driver bt.c as an example. For better understanding, any reference to scsi driver under Linux, Unixware. Solaris, SCO OS5 will be welcomed since I have written drivers for scsi / FC / iSCSI under those enviornments. Here comes the first set of question: 1, I noticed that there are a few places drivers are spreaded. For example /sys/dev/buslogic/bt.c, v /sys/dev/buslogic/bt_pci.c, v /sys/dev/buslogic/btreg.h, v and same files and others which cover same hardware are located at: /sys/i386/scsi/Attic/bt.c, v /sys/i386/scsi/Attic/btreg.h, v /sys/pci/Attic/bt9xx.c, v /sys/pci/Attic/bt_pci.c, v etc. Why these drivers are spreaded? If I have a pci initiator driver, can the source only be located under /sys/dev/vendor instead of also put some part of code under /sys/pci/Attic? Does FreeBSD requires realmode driver to boot? Those bus (EISA, ISA, PCI) related subdirectories look like Solaris realmode driver distribution. 2, Where is proper place for driver source code? If this driver does not intend for a boot device, can it be placed anywhere like other Unixes? 3, There are Makefiles for aic7xxx, e.g. under module, but nothing for bt.c. Does that mean buslogic driver not supporting loadable module? 4, There are utility of "pkg_add" for driver loading, similar to Solaris, and "kldload" for module loading, similar to Linux. Can I assume both methods work for scsi driver. The difference will be kldload works only for this boot and module will be gone after "kldunload" or system reboot but "pag_add" will hook driver to kernel from boot to boot till pag_delete is performed. 5, If driver will be loaded with pkg_add, where are those related package required header files located? Many thanks! Eddie (Yiding) Wang SPG, Agilent Technologies 3175 Bowers Ave., MS 88C Santa Clara, Ca 95054 Tel: (408) 970-3059 Fax: (408) 970-3099 E-Mail: yiding_wang@agilent.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message