From owner-freebsd-drivers@FreeBSD.ORG Thu Oct 27 21:35:31 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16AEB106564A for ; Thu, 27 Oct 2011 21:35:31 +0000 (UTC) (envelope-from adarsh.joshi@qlogic.com) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe002.messaging.microsoft.com [216.32.181.182]) by mx1.freebsd.org (Postfix) with ESMTP id B9C948FC14 for ; Thu, 27 Oct 2011 21:35:30 +0000 (UTC) Received: from mail94-ch1-R.bigfish.com (10.43.68.244) by CH1EHSOBE011.bigfish.com (10.43.70.61) with Microsoft SMTP Server id 14.1.225.22; Thu, 27 Oct 2011 21:20:16 +0000 Received: from mail94-ch1 (localhost.localdomain [127.0.0.1]) by mail94-ch1-R.bigfish.com (Postfix) with ESMTP id 3AF3F3C8475 for ; Thu, 27 Oct 2011 21:20:20 +0000 (UTC) X-SpamScore: -7 X-BigFish: VPS-7(zzc85fh14ffOzz1202hzz8275bh8275dhz2fh2a8h668h839h) X-Forefront-Antispam-Report: CIP:198.70.193.61; KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub1.qlogic.com; EFVD:NLI X-FB-SS: 0,0, Received-SPF: pass (mail94-ch1: domain of qlogic.com designates 198.70.193.61 as permitted sender) client-ip=198.70.193.61; envelope-from=adarsh.joshi@qlogic.com; helo=avexcashub1.qlogic.com ; 1.qlogic.com ; Received: from mail94-ch1 (localhost.localdomain [127.0.0.1]) by mail94-ch1 (MessageSwitch) id 1319750359140113_1243; Thu, 27 Oct 2011 21:19:19 +0000 (UTC) Received: from CH1EHSMHS023.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.241]) by mail94-ch1.bigfish.com (Postfix) with ESMTP id 1B6CF1158050 for ; Thu, 27 Oct 2011 21:19:19 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.61) by CH1EHSMHS023.bigfish.com (10.43.70.23) with Microsoft SMTP Server (TLS) id 14.1.225.22; Thu, 27 Oct 2011 21:19:10 +0000 Received: from avexmb1.qlogic.org ([fe80::9545:3a4f:c131:467d]) by avexcashub1.qlogic.org ([::1]) with mapi; Thu, 27 Oct 2011 14:19:16 -0700 From: Adarsh Joshi To: "freebsd-drivers@freebsd.org" Date: Thu, 27 Oct 2011 14:19:19 -0700 Thread-Topic: How to add driver source to BSD source? Thread-Index: AcyU7TQZ14LA/iUESaSdo6z38Y/Aow== Message-ID: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: How to add driver source to BSD source? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 21:35:31 -0000 Hi all, I am new to BSD, so kindly bare me if I am being stupid. I am trying to add my driver source code to the FreeBSD source with the int= ention of building kernel.debug for KGDB. I have included the driver source and the Makefile in /usr/src/sys/dev and = module directories and I have modified the /usr/src/sys/amd64/conf/MYKERNEL= (MYKERNEL copied from GENERIC) to include the appropriate device name. But when I try to do Config -g MYKERNEL It gives an error saying my device is unknown. I am pretty sure I am missin= g something but I am not sure what exactly is it. Any suggestions? Thank you regards Adarsh ________________________________ This message and any attached documents contain information from QLogic Cor= poration or its wholly-owned subsidiaries that may be confidential. If you = are not the intended recipient, you may not read, copy, distribute, or use = this information. If you have received this transmission in error, please n= otify the sender immediately by reply e-mail and then delete this message. From owner-freebsd-drivers@FreeBSD.ORG Thu Oct 27 22:07:53 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05EF8106564A for ; Thu, 27 Oct 2011 22:07:52 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (freebsd.czest.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id 4A8F18FC0C for ; Thu, 27 Oct 2011 22:07:51 +0000 (UTC) Received: from wkoszek-thinkpad-t410 (freebsd.czest.pl [212.87.224.105]) by freebsd.czest.pl (8.14.5/8.14.5) with ESMTP id p9RLp1lT086738 for ; Thu, 27 Oct 2011 21:51:02 GMT (envelope-from wkoszek@freebsd.czest.pl) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-drivers@freebsd.org References: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> Date: Thu, 27 Oct 2011 23:51:32 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Wojciech A. Koszek" Organization: FreeBSD.czest.pl Message-ID: In-Reply-To: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> User-Agent: Opera Mail/11.52 (Linux) X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.7 (freebsd.czest.pl [127.0.0.2]); Thu, 27 Oct 2011 21:51:02 +0000 (UTC) Subject: Re: How to add driver source to BSD source? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 22:07:53 -0000 Dnia 27-10-2011 o 23:19:19 Adarsh Joshi napisa= =C5=82(a): > Hi all, > > I am new to BSD, so kindly bare me if I am being stupid. > > I am trying to add my driver source code to the FreeBSD source with th= e intention of building kernel.debug for KGDB. > > I have included the driver source and the Makefile in /usr/src/sys/dev= and module directories and I have modified the /usr/src/sys/amd64/conf/= MYKERNEL (MYKERNEL copied from GENERIC) to include the appropriate devic= e name. > > But when I try to do > > Config -g MYKERNEL > > It gives an error saying my device is unknown. I am pretty sure I am m= issing something but I am not sure what exactly is it. Any suggestions? > > Thank you > regards > Adarsh > > Adarsh, In order to insert new driver in the FreeBSD tree you have to: - modify src/sys/conf/files 'files' if the device is generic. 'files.' if it's architecture= specific. You will see that there are 'optional' entries. You specify= optional and you must have coresponding: device in your kernel configuration file. In other words, you insert e.g.: dev/sample/sample.c optional sample in 'files' and: device sample in the kernel configuration. config(8) will read 'files*' stuff and generate appropriate meta-data= files. If you build the kernel by hand: cd sys//conf && config KERNEL_CONFIG cd ../compile/KERNEL_CONFIG make sys//compile/ will have stuff created by config(= 8). Basically opt_*.h files with potential options taken from KERNEL_CONF= IG, Makefile for building the kernel and some .c files, which will get li= nked to the kernel image. - provide source code in src/sys/dev/ - provide module Makefile in src/sys/modules/ For getting KLD module working. You must have that to get .ko module. The procedure explained in first two steps is necessary if you want to compile the kernel driver staticly into the kernel ELF file. For development, you may want to work with modules (aka kernel loadable modules aka .ko files). For this, you only need the last step - providin= g the Makefile. -- = Wojciech A. Koszek wkoszek@freebsd.czest.pl http://FreeBSD.czest.pl/~wkoszek/ From owner-freebsd-drivers@FreeBSD.ORG Thu Oct 27 22:28:39 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00E891065674 for ; Thu, 27 Oct 2011 22:28:39 +0000 (UTC) (envelope-from patfbsd@davenulle.org) Received: from smtp.lamaiziere.net (net.lamaiziere.net [94.23.254.147]) by mx1.freebsd.org (Postfix) with ESMTP id B73EF8FC14 for ; Thu, 27 Oct 2011 22:28:38 +0000 (UTC) Received: from baby-jane.lamaiziere.net (63.9.74.86.rev.sfr.net [86.74.9.63]) by smtp.lamaiziere.net (Postfix) with ESMTPA id 42B2EFAA31A5; Fri, 28 Oct 2011 00:12:47 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by baby-jane.lamaiziere.net (Postfix) with ESMTP id 338A873146; Fri, 28 Oct 2011 00:12:53 +0200 (CEST) Date: Fri, 28 Oct 2011 00:12:52 +0200 From: Patrick Lamaiziere To: freebsd-drivers@freebsd.org, Adarsh Joshi Message-ID: <20111028001252.6b5c782b@davenulle.org> In-Reply-To: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> References: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> X-Mailer: Claws Mail 3.7.10 (GTK+ 2.24.6; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: Subject: Re: How to add driver source to BSD source? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2011 22:28:39 -0000 Le Thu, 27 Oct 2011 14:19:19 -0700, Adarsh Joshi a écrit : > Hi all, Hello, > It gives an error saying my device is unknown. I am pretty sure I am > missing something but I am not sure what exactly is it. Any > suggestions? See /usr/src/sys/conf/files* and /usr/src/sys/modules/Makefile and NOTES file (not mandatory but for driver description) Regards. From owner-freebsd-drivers@FreeBSD.ORG Fri Oct 28 22:30:53 2011 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E20A8106564A for ; Fri, 28 Oct 2011 22:30:53 +0000 (UTC) (envelope-from adarsh.joshi@qlogic.com) Received: from TX2EHSOBE002.bigfish.com (tx2ehsobe001.messaging.microsoft.com [65.55.88.11]) by mx1.freebsd.org (Postfix) with ESMTP id 9646D8FC0A for ; Fri, 28 Oct 2011 22:30:53 +0000 (UTC) Received: from mail61-tx2-R.bigfish.com (10.9.14.250) by TX2EHSOBE002.bigfish.com (10.9.40.22) with Microsoft SMTP Server id 14.1.225.22; Fri, 28 Oct 2011 22:30:43 +0000 Received: from mail61-tx2 (localhost.localdomain [127.0.0.1]) by mail61-tx2-R.bigfish.com (Postfix) with ESMTP id 2691511200F8; Fri, 28 Oct 2011 22:30:49 +0000 (UTC) X-SpamScore: -15 X-BigFish: VPS-15(zz9371Kc89bh542M14ffOzz1202hzz8275bhz2fh2a8h668h839h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: CIP:198.70.193.61; KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub1.qlogic.com; EFVD:NLI X-FB-SS: 0, Received-SPF: pass (mail61-tx2: domain of qlogic.com designates 198.70.193.61 as permitted sender) client-ip=198.70.193.61; envelope-from=adarsh.joshi@qlogic.com; helo=avexcashub1.qlogic.com ; 1.qlogic.com ; Received: from mail61-tx2 (localhost.localdomain [127.0.0.1]) by mail61-tx2 (MessageSwitch) id 131984104942008_8005; Fri, 28 Oct 2011 22:30:49 +0000 (UTC) Received: from TX2EHSMHS005.bigfish.com (unknown [10.9.14.243]) by mail61-tx2.bigfish.com (Postfix) with ESMTP id 01DD16B0051; Fri, 28 Oct 2011 22:30:49 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.61) by TX2EHSMHS005.bigfish.com (10.9.99.105) with Microsoft SMTP Server (TLS) id 14.1.225.22; Fri, 28 Oct 2011 22:30:43 +0000 Received: from avexmb1.qlogic.org ([fe80::9545:3a4f:c131:467d]) by avexcashub1.qlogic.org ([::1]) with mapi; Fri, 28 Oct 2011 15:30:50 -0700 From: Adarsh Joshi To: Patrick Lamaiziere , "freebsd-drivers@freebsd.org" Date: Fri, 28 Oct 2011 15:30:55 -0700 Thread-Topic: How to add driver source to BSD source? Thread-Index: AcyU9Y/NObu4+VLTR+Gia2y9RyAbNQAy6Ogg Message-ID: <5E4F49720D0BAD499EE1F01232234BA873C6D8D5A1@AVEXMB1.qlogic.org> References: <5E4F49720D0BAD499EE1F01232234BA873C6D8D33A@AVEXMB1.qlogic.org> <20111028001252.6b5c782b@davenulle.org> In-Reply-To: <20111028001252.6b5c782b@davenulle.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Cc: Subject: RE: How to add driver source to BSD source? X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2011 22:30:54 -0000 Worked perfectly. Thanks to both of you -----Original Message----- From: Patrick Lamaiziere [mailto:patfbsd@davenulle.org] Sent: Thursday, October 27, 2011 3:13 PM To: freebsd-drivers@freebsd.org; Adarsh Joshi Subject: Re: How to add driver source to BSD source? Le Thu, 27 Oct 2011 14:19:19 -0700, Adarsh Joshi a =E9crit : > Hi all, Hello, > It gives an error saying my device is unknown. I am pretty sure I am > missing something but I am not sure what exactly is it. Any > suggestions? See /usr/src/sys/conf/files* and /usr/src/sys/modules/Makefile and NOTES file (not mandatory but for driver description) Regards. This message and any attached documents contain information from QLogic Cor= poration or its wholly-owned subsidiaries that may be confidential. If you = are not the intended recipient, you may not read, copy, distribute, or use = this information. If you have received this transmission in error, please n= otify the sender immediately by reply e-mail and then delete this message.