From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 08:59:44 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DC89416A41F for ; Tue, 15 Nov 2005 08:59:44 +0000 (GMT) (envelope-from mayong@mail.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing2.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 934C043D4C for ; Tue, 15 Nov 2005 08:59:44 +0000 (GMT) (envelope-from mayong@mail.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id DDC8018001D8 for ; Tue, 15 Nov 2005 08:59:43 +0000 (GMT) X-OB-Received: from unknown (205.158.62.55) by wfilter.us4.outblaze.com; 15 Nov 2005 08:59:43 -0000 Received: by ws1-3.us4.outblaze.com (Postfix, from userid 1001) id D5A72101E4; Tue, 15 Nov 2005 08:59:43 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: freebsd-drivers@freebsd.org Date: Tue, 15 Nov 2005 03:59:42 -0500 Received: from [159.226.5.225] by ws1-3.us4.outblaze.com with http for mayong@mail.com; Tue, 15 Nov 2005 03:59:42 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: ws1-3.us4.outblaze.com Message-Id: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> Subject: How to make my new driver be configurable in the kernel configuration file? 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: Tue, 15 Nov 2005 08:59:45 -0000 Hi all, I wrote and debuged my driver for a new device in KLD mode,now I want to pl= ug it into the kernel,so that it can be loaded when the system boots,and m= ake it be configurable in the kernel configuration file like other device d= river as "device XXX",I don't know what to do,could anyone be kind to help = me? --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/ From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 13:53:46 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C984916A42D for ; Tue, 15 Nov 2005 13:53:46 +0000 (GMT) (envelope-from matthew@mundomateo.com) Received: from mail.mundomateo.com (static-24-56-193-117.chrlmi.cablespeed.com [24.56.193.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 450D943D49 for ; Tue, 15 Nov 2005 13:53:43 +0000 (GMT) (envelope-from matthew@mundomateo.com) Received: from [10.0.81.12] (ws12.mundomateo.com [10.0.81.12]) by mail.mundomateo.com (Postfix) with ESMTP id 55AB45F71 for ; Tue, 15 Nov 2005 08:53:42 -0500 (EST) Message-ID: <4379E860.4000806@mundomateo.com> Date: Tue, 15 Nov 2005 08:53:36 -0500 From: Matthew Hagerty User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-drivers@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Updating a driver that uses ata_cmd to run under 6.0-Release X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: matthew@mundomateo.com List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2005 13:53:46 -0000 Greetings, I posted this in hackers, but it seems that was the wrong list, so I'll try here. If this is still the wrong place to post, please let me know so I don't continue to look like an ass... Thanks. I'm trying to use an AoE (ata over ethernet) EtherDrive (from coraid.com), but their "FreeBSD 6.0" kernel patch seems to have been developed against 6.0 early on, or they just renamed the 5.x patch and hoped no one would notice. Needless to say, the patch fails to compile because they are using the ata_cmd struct, which seems to have been totally rewritten in 6.0. I don't know very much about kernel hacking (yet) and I'm hoping to be able to just replace some structure references and a few defines and get things working. My initial problems are trying to find references to tie all this together. I cannot seem to find much documentation on GEOM or how to add new 'services' (correct term?) to the kernel, hence my post here for help. I have isolated the parts of the patch that seem to reference the old struct, listed below. I looked at the old ata_cmd struct (from a 5.4 install) and found a new ata_ioc_request struct that seems to contain almost all the members (that I need) that were used from the old ata_cmd struct, so is it feasible that I can simply re-cast against ata_ioc_request and change the references? Here are the members that are currently used: struct ata_cmd *iocmd; iocmd->cmd iocmd->u.request.count iocmd->u.request.data iocmd->u.request.u.ata.count iocmd->u.request.u.ata.command iocmd->u.request.u.ata.feature iocmd->u.request.timeout iocmd->u.request.u.ata.lba The only reference that is not in ata_ioc_request is the 'cmd' member, which is used in the code like this: if (iocmd->cmd != ATAREQUEST) { Which leads me to the other problem I'm having. Two defines are used that I cannot reliably find a replacement for: IOCATA ATAREQUEST I did find a IOCATAREQUEST that could maybe be the replacement for ATAREQUEST? But as for IOCATA, I can find nothing that seem cut and dry. Last, the function that uses the ata_cmd struct the most (there is one other, but it does nothing new) seems to be called by GEOM? The only reference to the function call is while creating a new disk with disk_create(), like this: struct disk *disk; ... disk = disk_alloc(); ... disk->d_ioctl = aoeblk_ioctl; ... disk_create(disk, DISK_VERSION_00); What I can't find is where GEOM defines the prototypes for the functions it can call (d_open, d_close, d_strategy, d_ioctl, d_dump), but the prototype for the aoeblk_ioctl() function has the ata_cmd struct passed in as a void pointer and casts it to ata_cmd... So how do I know what kind of data the GEOM system is passing the function for any given call? I see there is a 'cmd' parameter (unrelated to the above ioctl->cmd), but without docs for each of the the disk_create() support functions, I can't really tell how to use it. I've included (for reference) the two main functions below that I need to modify. Any insight would be greatly appreciated as to how I can proceed with the modifications, or where I can get more documentation about the ata.h changes, disk_create() function prototypes, etc.. Thank you, Matthew /* * Ioctl only for select smartmontools ata commands. * We fake out the ATAREQUEST ata ioctl -- ugly, but effective. */ static int aoeblk_ioctl(struct disk *disk, ulong cmd, void *vp, int flag, struct thread *td) { struct ata_cmd *iocmd; Aoedev *d; int n; if (cmd != IOCATA) { log(LOG_INFO, "aoe: aoeblk_ioctl: cmd %ld not IOCATA.\n", cmd); return ENOTTY; } iocmd = (struct ata_cmd *) vp; if (iocmd == NULL) { log(LOG_INFO, "aoe: aoeblk_ioctl: NULL arg ptr.\n"); return EINVAL; } if (iocmd->cmd != ATAREQUEST) { log(LOG_INFO, "aoe: aoeblk_ioctl: unknown iocmd->cmd=%d\n", iocmd->cmd); return ENOTTY; } if (iocmd->u.request.count) { if (iocmd->u.request.data == NULL) { log(LOG_INFO, "aoe: aoeblk_ioctl: null return data pointer\n"); return EINVAL; } iocmd->u.request.count = 512; iocmd->u.request.u.ata.count = 1; } d = disk->d_drv1; mtx_lock(&d->mtx); if ((d->flags & DEVFL_UP) == 0) { log(LOG_INFO, "aoe: aoeblk_ioctl: device for unit %ld is not up.\n", d->unit); mtx_unlock(&d->mtx); return ENXIO; } switch (iocmd->u.request.u.ata.command) { case ATA_ATA_IDENTIFY: copyout(d->ident, iocmd->u.request.data, sizeof d->ident); mtx_unlock(&d->mtx); return 0; case ATA_SMART: if (iocmd->u.request.u.ata.feature != ATA_SMART_ATTR_AUTOSAVE) { n = aoecmd_ata_smart(d, iocmd); mtx_unlock(&d->mtx); return n; } default: mtx_unlock(&d->mtx); log(LOG_INFO, "aoe: aoeblk_ioctl: unallowed ata command; " "cmd=%2.2X feat=%2.2X.\n", iocmd->u.request.u.ata.command, iocmd->u.request.u.ata.feature); return EINVAL; } } static void disk_create_task(void *ctx, int useless) { struct disk *disk; Aoedev *d; d = (Aoedev *) ctx; disk = disk_alloc(); /* Disk_destroy triggers freeing the allocated disk. */ if (disk == NULL) { log(LOG_INFO, "aoe: disk_create_task: cannot alloc disk structure.\n"); mtx_lock(&d->mtx); d->flags &= ~DEVFL_TASKON; mtx_unlock(&d->mtx); return; } d->disk = disk; disk->d_drv1 = d; disk->d_maxsize = DFLTPHYS; disk->d_sectorsize = DEV_BSIZE; disk->d_mediasize = DEV_BSIZE * d->nsectors; disk->d_unit = d->unit; disk->d_name = "aoed"; disk->d_open = aoeblk_open; disk->d_close = aoeblk_close; disk->d_ioctl = aoeblk_ioctl; disk->d_strategy = aoeblk_strategy; disk_create(disk, DISK_VERSION_00); mtx_lock(&d->mtx); d->flags &= ~DEVFL_TASKON; d->flags |= DEVFL_UP; mtx_unlock(&d->mtx); } From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 15:40:40 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E26A16A41F for ; Tue, 15 Nov 2005 15:40:40 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (66-23-216-219.clients.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id A7AA443D45 for ; Tue, 15 Nov 2005 15:40:39 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2002034 for multiple; Tue, 15 Nov 2005 10:40:49 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAFFealV087129; Tue, 15 Nov 2005 10:40:36 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Tue, 15 Nov 2005 10:21:59 -0500 User-Agent: KMail/1.8.2 References: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> In-Reply-To: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511151022.00866.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Tue, 15 Nov 2005 15:40:40 -0000 On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: > Hi all, > I wrote and debuged my driver for a new device in KLD mode,now I want to > plug it into the kernel,so that it can be loaded when the system boots,and > make it be configurable in the kernel configuration file like other device > driver as "device XXX",I don't know what to do,could anyone be kind to help > me? To add your driver you update the src/sys/conf/files* files. If your driver is machine independent, you can add it to src/sys/conf/files. For example, here are the lines in sys/conf/files for the cy(4) driver: dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci If your driver only works on a single architecture (such as i386) then add it to the architecture file sys/conf/files. (e.g. sys/conf/files.i386). The device names after 'optional' specify which devices must be enabled in the kernel config for that file to be included. Thus, in the example above, src/sys/dev/cy/cy.c is included as long as 'device cy' is in the kernel, but src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and 'device isa' are in the kernel config file. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 15:40:42 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36E2116A41F for ; Tue, 15 Nov 2005 15:40:42 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (66-23-216-219.clients.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5046543D45 for ; Tue, 15 Nov 2005 15:40:41 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2002035 for multiple; Tue, 15 Nov 2005 10:40:51 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAFFealW087129; Tue, 15 Nov 2005 10:40:38 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org, matthew@mundomateo.com Date: Tue, 15 Nov 2005 10:24:49 -0500 User-Agent: KMail/1.8.2 References: <4379E860.4000806@mundomateo.com> In-Reply-To: <4379E860.4000806@mundomateo.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511151024.50614.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: Subject: Re: Updating a driver that uses ata_cmd to run under 6.0-Release 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: Tue, 15 Nov 2005 15:40:42 -0000 On Tuesday 15 November 2005 08:53 am, Matthew Hagerty wrote: > Greetings, > > I posted this in hackers, but it seems that was the wrong list, so I'll > try here. If this is still the wrong place to post, please let me know > so I don't continue to look like an ass... Thanks. > > > I'm trying to use an AoE (ata over ethernet) EtherDrive (from > coraid.com), but their "FreeBSD 6.0" kernel patch seems to have been > developed against 6.0 early on, or they just renamed the 5.x patch and > hoped no one would notice. Needless to say, the patch fails to compile > because they are using the ata_cmd struct, which seems to have been > totally rewritten in 6.0. Your best bet might be to talk to the ata driver author sos@FreeBSD.org. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Tue Nov 15 16:19:56 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4796916A41F; Tue, 15 Nov 2005 16:19:56 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id D624343D4C; Tue, 15 Nov 2005 16:19:55 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jAFGJ9hY037050; Tue, 15 Nov 2005 09:19:09 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 15 Nov 2005 09:19:09 -0700 (MST) Message-Id: <20051115.091909.74713594.imp@bsdimp.com> To: jhb@freebsd.org From: Warner Losh In-Reply-To: <200511151022.00866.jhb@freebsd.org> References: <20051115085943.D5A72101E4@ws1-3.us4.outblaze.com> <200511151022.00866.jhb@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Tue, 15 Nov 2005 09:19:09 -0700 (MST) Cc: freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Tue, 15 Nov 2005 16:19:56 -0000 From: John Baldwin Subject: Re: How to make my new driver be configurable in the kernel configuration file? Date: Tue, 15 Nov 2005 10:21:59 -0500 > On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: > > Hi all, > > I wrote and debuged my driver for a new device in KLD mode,now I want to > > plug it into the kernel,so that it can be loaded when the system boots,and > > make it be configurable in the kernel configuration file like other device > > driver as "device XXX",I don't know what to do,could anyone be kind to help > > me? > > To add your driver you update the src/sys/conf/files* files. If your driver > is machine independent, you can add it to src/sys/conf/files. For example, > here are the lines in sys/conf/files for the cy(4) driver: > > dev/cy/cy.c optional cy > dev/cy/cy_isa.c optional cy isa > dev/cy/cy_pci.c optional cy pci > > If your driver only works on a single architecture (such as i386) then add it > to the architecture file sys/conf/files. (e.g. sys/conf/files.i386). > The device names after 'optional' specify which devices must be enabled in > the kernel config for that file to be included. Thus, in the example above, > src/sys/dev/cy/cy.c is included as long as 'device cy' is in the kernel, but > src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and 'device isa' > are in the kernel config file. You can augment the system files with the files directive if you don't want to edit sys/conf/files.foo: files "/foo/bar/baz" and put something like the above in that. Warner From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 16 16:03:41 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C91DB16A420 for ; Wed, 16 Nov 2005 16:03:41 +0000 (GMT) (envelope-from mayong@mail.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1803C43D46 for ; Wed, 16 Nov 2005 16:03:41 +0000 (GMT) (envelope-from mayong@mail.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id AFFE7180021D for ; Wed, 16 Nov 2005 16:03:40 +0000 (GMT) X-OB-Received: from unknown (205.158.62.50) by wfilter.us4.outblaze.com; 16 Nov 2005 10:33:10 -0000 Received: by ws1-4.us4.outblaze.com (Postfix, from userid 1001) id 20B9A164A49; Wed, 16 Nov 2005 10:33:10 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: freebsd-drivers@freebsd.org Date: Wed, 16 Nov 2005 05:33:09 -0500 Received: from [159.226.5.225] by ws1-4.us4.outblaze.com with http for mayong@mail.com; Wed, 16 Nov 2005 05:33:09 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: ws1-4.us4.outblaze.com Message-Id: <20051116103310.20B9A164A49@ws1-4.us4.outblaze.com> Cc: freebsd-hackers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Wed, 16 Nov 2005 16:03:42 -0000 ----- Original Message ----- From: "Warner Losh" To: jhb@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel config= uration file? Date: Tue, 15 Nov 2005 09:19:09 -0700 (MST) >=20 > From: John Baldwin > Subject: Re: How to make my new driver be configurable in the=20 > kernel configuration file? > Date: Tue, 15 Nov 2005 10:21:59 -0500 >=20 > > On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: > > > Hi all, > > > I wrote and debuged my driver for a new device in KLD mode,now I want= to > > > plug it into the kernel,so that it can be loaded when the system boo= ts,and > > > make it be configurable in the kernel configuration file like other d= evice > > > driver as "device XXX",I don't know what to do,could anyone be kind t= o help > > > me? > > > > To add your driver you update the src/sys/conf/files* files. If=20 > > your driver is machine independent, you can add it to=20 > > src/sys/conf/files. For example, here are the lines in=20 > > sys/conf/files for the cy(4) driver: > > > > dev/cy/cy.c optional cy > > dev/cy/cy_isa.c optional cy isa > > dev/cy/cy_pci.c optional cy pci > > > > If your driver only works on a single architecture (such as i386)=20 > > then add it to the architecture file sys/conf/files. (e.g.=20 > > sys/conf/files.i386). The device names after 'optional' specify=20 > > which devices must be enabled in the kernel config for that file=20 > > to be included. Thus, in the example above, src/sys/dev/cy/cy.c=20 > > is included as long as 'device cy' is in the kernel, but=20 > > src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and=20 > > 'device isa' are in the kernel config file. >=20 > You can augment the system files with the files directive if you don't > want to edit sys/conf/files.foo: >=20 > files "/foo/bar/baz" >=20 > and put something like the above in that. >=20 > Warner >=20 > _______________________________________________ > freebsd-drivers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > To unsubscribe, send any mail to "freebsd-drivers-unsubscribe@freebsd.org" Thank you! I did as that but came across some problems,these are the=20 jobs and the errors: 1) I copyed the files to the sys/dev/mydevice and added=20 "dev/mydevice/mydevice.c optinonal mydevice" in the file=20 /usr/src/sys/conf/files.i386,and added a line "device mydevice" in=20 the sys/i386/conf/MYKERNEL(a copy of GENERIC),but met a error when=20 config MYKERNEL:syntax error (the line I just added). 2) Then,I modified line in files.i386 as "dev/mydevice/mydevice.c=20=20= =20 standard",configed successfully,but another error occured when make=20 depend(make buildkernel KERNCONF=3DMYKERNEL the same): ... ../../../dev/mydevice/mydevice.c:27:20: mydevice.h: No such=20 file or directory ../../../dev/mydevice/mydevice.c:28:44: mydevicekern.h: No such=20 file or directory ../../../dev/mydevice/mydevice.c:29:49: mydeviceioctl.h: No=20 such file or directory mkdep: compile failed *** Error code 1 ... and the source code of mydevice.c is as follows: ... #include "sjy22b.h" #include "sjy22bkern.h" #include "sjy22bioctl.h" ... the three headers are just in the sys/dev/mydevice directory,I don't=20 know why this happened. Need your suggestion! Thanks Yong --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/ From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 16 16:29:18 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1194A16A41F; Wed, 16 Nov 2005 16:29:18 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4CBC43D66; Wed, 16 Nov 2005 16:29:15 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2067365 for multiple; Wed, 16 Nov 2005 11:28:37 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAGGSRul001754; Wed, 16 Nov 2005 11:28:29 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-drivers@freebsd.org Date: Wed, 16 Nov 2005 11:28:25 -0500 User-Agent: KMail/1.8.2 References: <20051116103310.20B9A164A49@ws1-4.us4.outblaze.com> In-Reply-To: <20051116103310.20B9A164A49@ws1-4.us4.outblaze.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511161128.26191.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: freebsd-hackers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Wed, 16 Nov 2005 16:29:18 -0000 On Wednesday 16 November 2005 05:33 am, Yong Ma wrote: > ----- Original Message ----- > From: "Warner Losh" > To: jhb@freebsd.org > Subject: Re: How to make my new driver be configurable in the kernel > configuration file? Date: Tue, 15 Nov 2005 09:19:09 -0700 (MST) > > > From: John Baldwin > > Subject: Re: How to make my new driver be configurable in the > > kernel configuration file? > > Date: Tue, 15 Nov 2005 10:21:59 -0500 > > > > > On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: > > > > Hi all, > > > > I wrote and debuged my driver for a new device in KLD mode,now I want > > > > to plug it into the kernel,so that it can be loaded when the system > > > > boots,and make it be configurable in the kernel configuration file > > > > like other device driver as "device XXX",I don't know what to > > > > do,could anyone be kind to help me? > > > > > > To add your driver you update the src/sys/conf/files* files. If > > > your driver is machine independent, you can add it to > > > src/sys/conf/files. For example, here are the lines in > > > sys/conf/files for the cy(4) driver: > > > > > > dev/cy/cy.c optional cy > > > dev/cy/cy_isa.c optional cy isa > > > dev/cy/cy_pci.c optional cy pci > > > > > > If your driver only works on a single architecture (such as i386) > > > then add it to the architecture file sys/conf/files. (e.g. > > > sys/conf/files.i386). The device names after 'optional' specify > > > which devices must be enabled in the kernel config for that file > > > to be included. Thus, in the example above, src/sys/dev/cy/cy.c > > > is included as long as 'device cy' is in the kernel, but > > > src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and > > > 'device isa' are in the kernel config file. > > > > You can augment the system files with the files directive if you don't > > want to edit sys/conf/files.foo: > > > > files "/foo/bar/baz" > > > > and put something like the above in that. > > > > Warner > > > > _______________________________________________ > > freebsd-drivers@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers > > To unsubscribe, send any mail to > > "freebsd-drivers-unsubscribe@freebsd.org" > > Thank you! I did as that but came across some problems,these are the > jobs and the errors: > > 1) I copyed the files to the sys/dev/mydevice and added > "dev/mydevice/mydevice.c optinonal mydevice" in the file > /usr/src/sys/conf/files.i386,and added a line "device mydevice" in > the sys/i386/conf/MYKERNEL(a copy of GENERIC),but met a error when > config MYKERNEL:syntax error (the line I just added). > > 2) Then,I modified line in files.i386 as "dev/mydevice/mydevice.c > standard",configed successfully,but another error occured when make > depend(make buildkernel KERNCONF=MYKERNEL the same): > ... > ../../../dev/mydevice/mydevice.c:27:20: mydevice.h: No such > file or directory > ../../../dev/mydevice/mydevice.c:28:44: mydevicekern.h: No such > file or directory > ../../../dev/mydevice/mydevice.c:29:49: mydeviceioctl.h: No > such file or directory > mkdep: compile failed > *** Error code 1 > ... > and the source code of mydevice.c is as follows: > ... > #include "sjy22b.h" > #include "sjy22bkern.h" > #include "sjy22bioctl.h" > ... > the three headers are just in the sys/dev/mydevice directory,I don't > know why this happened. > Need your suggestion! You'll need to include them as "dev/mydevice/mydevice.h" rather than "mydevice.h" -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 16 16:38:08 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B3AAD16A41F; Wed, 16 Nov 2005 16:38:08 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (vc4-2-0-87.dsl.netrack.net [199.45.160.85]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4A40343D4C; Wed, 16 Nov 2005 16:38:08 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (localhost.village.org [127.0.0.1] (may be forged)) by harmony.bsdimp.com (8.13.3/8.13.3) with ESMTP id jAGGa8rb053516; Wed, 16 Nov 2005 09:36:08 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 16 Nov 2005 09:36:11 -0700 (MST) Message-Id: <20051116.093611.06948893.imp@bsdimp.com> To: jhb@freebsd.org From: "M. Warner Losh" In-Reply-To: <200511161128.26191.jhb@freebsd.org> References: <20051116103310.20B9A164A49@ws1-4.us4.outblaze.com> <200511161128.26191.jhb@freebsd.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0 (harmony.bsdimp.com [127.0.0.1]); Wed, 16 Nov 2005 09:36:08 -0700 (MST) Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Wed, 16 Nov 2005 16:38:08 -0000 In message: <200511161128.26191.jhb@freebsd.org> John Baldwin writes: : On Wednesday 16 November 2005 05:33 am, Yong Ma wrote: : > ----- Original Message ----- : > From: "Warner Losh" : > To: jhb@freebsd.org : > Subject: Re: How to make my new driver be configurable in the kernel : > configuration file? Date: Tue, 15 Nov 2005 09:19:09 -0700 (MST) : > : > > From: John Baldwin : > > Subject: Re: How to make my new driver be configurable in the : > > kernel configuration file? : > > Date: Tue, 15 Nov 2005 10:21:59 -0500 : > > : > > > On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: : > > > > Hi all, : > > > > I wrote and debuged my driver for a new device in KLD mode,now I want : > > > > to plug it into the kernel,so that it can be loaded when the system : > > > > boots,and make it be configurable in the kernel configuration file : > > > > like other device driver as "device XXX",I don't know what to : > > > > do,could anyone be kind to help me? : > > > : > > > To add your driver you update the src/sys/conf/files* files. If : > > > your driver is machine independent, you can add it to : > > > src/sys/conf/files. For example, here are the lines in : > > > sys/conf/files for the cy(4) driver: : > > > : > > > dev/cy/cy.c optional cy : > > > dev/cy/cy_isa.c optional cy isa : > > > dev/cy/cy_pci.c optional cy pci : > > > : > > > If your driver only works on a single architecture (such as i386) : > > > then add it to the architecture file sys/conf/files. (e.g. : > > > sys/conf/files.i386). The device names after 'optional' specify : > > > which devices must be enabled in the kernel config for that file : > > > to be included. Thus, in the example above, src/sys/dev/cy/cy.c : > > > is included as long as 'device cy' is in the kernel, but : > > > src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and : > > > 'device isa' are in the kernel config file. : > > : > > You can augment the system files with the files directive if you don't : > > want to edit sys/conf/files.foo: : > > : > > files "/foo/bar/baz" : > > : > > and put something like the above in that. : > > : > > Warner : > > : > > _______________________________________________ : > > freebsd-drivers@freebsd.org mailing list : > > http://lists.freebsd.org/mailman/listinfo/freebsd-drivers : > > To unsubscribe, send any mail to : > > "freebsd-drivers-unsubscribe@freebsd.org" : > : > Thank you! I did as that but came across some problems,these are the : > jobs and the errors: : > : > 1) I copyed the files to the sys/dev/mydevice and added : > "dev/mydevice/mydevice.c optinonal mydevice" in the file : > /usr/src/sys/conf/files.i386,and added a line "device mydevice" in : > the sys/i386/conf/MYKERNEL(a copy of GENERIC),but met a error when : > config MYKERNEL:syntax error (the line I just added). : > : > 2) Then,I modified line in files.i386 as "dev/mydevice/mydevice.c : > standard",configed successfully,but another error occured when make : > depend(make buildkernel KERNCONF=MYKERNEL the same): : > ... : > ../../../dev/mydevice/mydevice.c:27:20: mydevice.h: No such : > file or directory : > ../../../dev/mydevice/mydevice.c:28:44: mydevicekern.h: No such : > file or directory : > ../../../dev/mydevice/mydevice.c:29:49: mydeviceioctl.h: No : > such file or directory : > mkdep: compile failed : > *** Error code 1 : > ... : > and the source code of mydevice.c is as follows: : > ... : > #include "sjy22b.h" : > #include "sjy22bkern.h" : > #include "sjy22bioctl.h" : > ... : > the three headers are just in the sys/dev/mydevice directory,I don't : > know why this happened. : > Need your suggestion! : : You'll need to include them as "dev/mydevice/mydevice.h" rather than : "mydevice.h" Usually that's spelled '#include ' since it is relative to one of the -I paths. In practice, however, it rarely makes a difference. Warner From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 16 17:56:47 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 429B116A41F for ; Wed, 16 Nov 2005 17:56:47 +0000 (GMT) (envelope-from mayong@mail.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing2.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAA5C43D45 for ; Wed, 16 Nov 2005 17:56:45 +0000 (GMT) (envelope-from mayong@mail.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 1FB7318001DB for ; Wed, 16 Nov 2005 17:56:45 +0000 (GMT) X-OB-Received: from unknown (205.158.62.182) by wfilter.us4.outblaze.com; 16 Nov 2005 03:20:01 -0000 Received: by ws1-6.us4.outblaze.com (Postfix, from userid 1001) id 7C66D1CE30A; Wed, 16 Nov 2005 03:20:01 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: freebsd-drivers@freebsd.org Date: Tue, 15 Nov 2005 22:20:01 -0500 Received: from [159.226.5.225] by ws1-6.us4.outblaze.com with http for mayong@mail.com; Tue, 15 Nov 2005 22:20:01 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: ws1-6.us4.outblaze.com Message-Id: <20051116032001.7C66D1CE30A@ws1-6.us4.outblaze.com> Cc: freebsd-hackers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Wed, 16 Nov 2005 17:56:47 -0000 ----- Original Message ----- From: "John Baldwin" To: freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel config= uration file? Date: Tue, 15 Nov 2005 10:21:59 -0500 >=20 > On Tuesday 15 November 2005 03:59 am, Yong Ma wrote: > > Hi all, > > I wrote and debuged my driver for a new device in KLD mode,now I want to > > plug it into the kernel,so that it can be loaded when the system boots= ,and > > make it be configurable in the kernel configuration file like other dev= ice > > driver as "device XXX",I don't know what to do,could anyone be kind to = help > > me? >=20 > To add your driver you update the src/sys/conf/files* files. If your dri= ver > is machine independent, you can add it to src/sys/conf/files. For exampl= e, > here are the lines in sys/conf/files for the cy(4) driver: >=20 > dev/cy/cy.c optional cy > dev/cy/cy_isa.c optional cy isa > dev/cy/cy_pci.c optional cy pci >=20 > If your driver only works on a single architecture (such as i386) then ad= d it > to the architecture file sys/conf/files. (e.g. sys/conf/files.i386). > The device names after 'optional' specify which devices must be enabled in > the kernel config for that file to be included. Thus, in the example abo= ve, > src/sys/dev/cy/cy.c is included as long as 'device cy' is in the kernel, = but > src/sys/dev/cy/cy_isa.c is only included if both 'device cy' and 'device = isa' > are in the kernel config file. >=20 > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org Thank you! I did as that but came across some problems,these are the jobs a= nd the errors: 1) I copyed the files to the sys/dev/mydevice and added "dev/mydevice/myde= vice.c optinonal mydevice" in the file /usr/src/sys/conf/files.i386,and a= dded a line "device mydevice" in the sys/i386/conf/MYKERNEL(a copy of GENER= IC),but met a error when config MYKERNEL:syntax error (the line I just adde= d). 2) Then,I modified line in files.i386 as "dev/mydevice/mydevice.c standa= rd",configed successfully,but another error occured when make depend(make b= uildkernel KERNCONF=3DMYKERNEL the same): ... ../../../dev/mydevice/mydevice.c:27:20: mydevice.h: No such file or di= rectory ../../../dev/mydevice/mydevice.c:28:44: mydevicekern.h: No such file o= r directory ../../../dev/mydevice/mydevice.c:29:49: mydeviceioctl.h: No such file = or directory mkdep: compile failed *** Error code 1 ... and the source code of mydevice.c is as follows: ... #include "sjy22b.h" #include "sjy22bkern.h"=20=20 #include "sjy22bioctl.h"=20 ... the three headers are just in the sys/dev/mydevice directory,I don't know w= hy this happened. Need your suggestion! Thanks Yong --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/ From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 16 20:14:22 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 583BF16A41F; Wed, 16 Nov 2005 20:14:22 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E5BA43D45; Wed, 16 Nov 2005 20:14:21 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.19.149]) ([10.251.19.149]) by a50.ironport.com with ESMTP; 16 Nov 2005 12:14:21 -0800 X-IronPort-Anti-Spam-Filtered: true Message-ID: <437B931C.9080107@elischer.org> Date: Wed, 16 Nov 2005 12:14:20 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yong Ma References: <20051116032001.7C66D1CE30A@ws1-6.us4.outblaze.com> In-Reply-To: <20051116032001.7C66D1CE30A@ws1-6.us4.outblaze.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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: Wed, 16 Nov 2005 20:14:22 -0000 Yong Ma wrote: > >Thank you! I did as that but came across some problems,these are the jobs and the errors: > > 1) I copyed the files to the sys/dev/mydevice and added "dev/mydevice/mydevice.c optinonal mydevice" in the file /usr/src/sys/conf/files.i386, > At one stage you could add your own file called "files.MYKERNEL", where MYKERNEL is in the name given in the 'ident' line of the "MYKERNEL" file. I have not checked if this still works, but it stops you frm having to edit the supplied "files" and "files.i386" files. From owner-freebsd-drivers@FreeBSD.ORG Thu Nov 17 02:34:15 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2163E16A41F; Thu, 17 Nov 2005 02:34:15 +0000 (GMT) (envelope-from mayong@mail.com) Received: from ws1-4.us4.outblaze.com (ws1-4.us4.outblaze.com [205.158.62.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id D82F543D49; Thu, 17 Nov 2005 02:34:14 +0000 (GMT) (envelope-from mayong@mail.com) Received: by ws1-4.us4.outblaze.com (Postfix, from userid 1001) id 8A2C21642FE; Thu, 17 Nov 2005 02:34:14 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: "M. Warner Losh" , jhb@freebsd.org Date: Wed, 16 Nov 2005 21:34:14 -0500 Received: from [159.226.5.225] by ws1-4.us4.outblaze.com with http for mayong@mail.com; Wed, 16 Nov 2005 21:34:14 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: ws1-4.us4.outblaze.com Message-Id: <20051117023414.8A2C21642FE@ws1-4.us4.outblaze.com> Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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, 17 Nov 2005 02:34:15 -0000 >=20 > Usually that's spelled '#include ' since it > is relative to one of the -I paths. In practice, however, it rarely > makes a difference. >=20 > Warner Yes,it works.I made it as a "standard".but I want to make it as a "optional= " so I can config it in the kernel configuration file(MYKERNEL) as "device= mydevice" to decide whether it will be load when system boots. It seemed not enough only add a line "dev/mydevice/mycevice.c optional= device" in sys/conf/files.i386 .There will be a syntax error when c= onfig MYKERNEL. Something else needed? Thanks a lot! Yong Ma --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/ From owner-freebsd-drivers@FreeBSD.ORG Thu Nov 17 10:26:29 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 89D8A16A420 for ; Thu, 17 Nov 2005 10:26:29 +0000 (GMT) (envelope-from nz@thiemo.net) Received: from excalibur.ronald.org (excalibur.ronald.org [83.120.8.12]) by mx1.FreeBSD.org (Postfix) with ESMTP id 47AEE43D75 for ; Thu, 17 Nov 2005 10:26:21 +0000 (GMT) (envelope-from nz@thiemo.net) Received: from styx.ham01.thiemo.net (port-212-202-20-213.dynamic.qsc.de [212.202.20.213]) by excalibur.ronald.org (8.12.10/8.12.10) with ESMTP id jAHAQJls023767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 17 Nov 2005 11:26:20 +0100 (CET) Received: from mygiea.ham01.thiemo.net (localhost [127.0.0.1]) by styx.ham01.thiemo.net (8.13.3/8.13.3) with ESMTP id jAHAQ63T099374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 17 Nov 2005 11:26:08 +0100 (CET) Received: (from thiemo@localhost) by mygiea.ham01.thiemo.net (8.13.3/8.13.3/Submit) id jAHAQ6Go099369 for freebsd-drivers@freebsd.org; Thu, 17 Nov 2005 11:26:06 +0100 (CET) Date: Thu, 17 Nov 2005 11:26:06 +0100 From: Thiemo Nordenholz To: freebsd-drivers@freebsd.org Message-ID: <20051117102606.GA98950@mygiea.ham01.thiemo.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Writing a driver for a card reader controller - how? 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, 17 Nov 2005 10:26:29 -0000 Hi there, First of all, thanks for providing a -drivers list (it seems to be quite new, isn't it?). Maybe this helps me getting into driver programming under FreeBSD :-} I am writing a device driver for a card reader controller which is installed in my notebook, using the Winbond W83L518D chip. However, when I attach it, it seems to allocate the resources port 0-0x7 irq 0 drq 4 on acpi0 which seems strange to me -- accessing registers in the respective SYS_RES_IOPORT seems to work, though. Now, as far as I understand the datasheet for the controller, I have to use another I/O port to access the SD card itself, to check if one is there, and finally to access it. How I do this, though, I have no idea. The datasheet lists two configuration registers that "select SD Card interface base address on 8-byte boundary" - but will my driver have to program an address into those registers? Does the bus framework somehow handle this? Does even BIOS do this? Or will I have to write one driver for the controller, have that act as a bus driver, and attach some SD card driver to that one? Maybe someone is willing to spend some time having a look at the datasheet and what I have done so far, and give me a little (or larger) clue-up... In return, I promise to write some documentation about how I have done it once it is ready, just in case someone else faces similar problems. A pointer to some driver programming documentation I have missed so far would be just as nice, of course. So far, I have tried using fdc and ppc as a guideline (after having found the spkr driver to be a bit too simple), and I _think_ I am doing just as those drivers do probing and resource allocation, but somehow they work, and mine does not. Link to the datasheet and some more description of what I have done so far (including my current state of source code) are at http://projects.thiemo.net/WbcrDriver Many thanks, and best regards, Thiemo -- Query a PGP key server (e.g. http://www.pgp.net/) for my public key 41068629. Strange sender address? Please see http://www.thiemo.net/misc/list-mail.shtml From owner-freebsd-drivers@FreeBSD.ORG Thu Nov 17 16:05:04 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3BEEE16A428; Thu, 17 Nov 2005 16:05:04 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 84CB143D46; Thu, 17 Nov 2005 16:05:03 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 2123115 for multiple; Thu, 17 Nov 2005 11:04:46 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.1/8.13.1) with ESMTP id jAHG4YTe022588; Thu, 17 Nov 2005 11:04:40 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: "Yong Ma" Date: Thu, 17 Nov 2005 10:55:46 -0500 User-Agent: KMail/1.8.2 References: <20051117023414.8A2C21642FE@ws1-4.us4.outblaze.com> In-Reply-To: <20051117023414.8A2C21642FE@ws1-4.us4.outblaze.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511171055.47539.jhb@freebsd.org> X-Spam-Status: No, score=-2.8 required=4.2 tests=ALL_TRUSTED autolearn=failed version=3.0.2 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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, 17 Nov 2005 16:05:04 -0000 On Wednesday 16 November 2005 09:34 pm, Yong Ma wrote: > > Usually that's spelled '#include ' since it > > is relative to one of the -I paths. In practice, however, it rarely > > makes a difference. > > > > Warner > > Yes,it works.I made it as a "standard".but I want to make it as a > "optional" so I can config it in the kernel configuration file(MYKERNEL) > as "device mydevice" to decide whether it will be load when system boots. > > It seemed not enough only add a line "dev/mydevice/mycevice.c optional > device" in sys/conf/files.i386 .There will be a syntax error when > config MYKERNEL. Something else needed? No, that's all that's needed. Perhaps you can post your diff against files.i386 and the line from MYKERNEL that is causing the error? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org From owner-freebsd-drivers@FreeBSD.ORG Fri Nov 18 01:34:39 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAE7716A41F for ; Fri, 18 Nov 2005 01:34:39 +0000 (GMT) (envelope-from mayong@mail.com) Received: from webmail-outgoing.us4.outblaze.com (webmail-outgoing2.us4.outblaze.com [205.158.62.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id CE21A43D45 for ; Fri, 18 Nov 2005 01:34:38 +0000 (GMT) (envelope-from mayong@mail.com) Received: from unknown (unknown [192.168.9.180]) by webmail-outgoing.us4.outblaze.com (Postfix) with QMQP id 4A6171800126 for ; Fri, 18 Nov 2005 01:34:38 +0000 (GMT) X-OB-Received: from unknown (205.158.62.55) by wfilter.us4.outblaze.com; 18 Nov 2005 01:34:38 -0000 Received: by ws1-3.us4.outblaze.com (Postfix, from userid 1001) id 3ACAE101E6; Fri, 18 Nov 2005 01:34:38 +0000 (GMT) Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 From: "Yong Ma" To: "John Baldwin" Date: Thu, 17 Nov 2005 20:34:37 -0500 Received: from [159.226.5.225] by ws1-3.us4.outblaze.com with http for mayong@mail.com; Thu, 17 Nov 2005 20:34:37 -0500 X-Originating-Ip: 159.226.5.225 X-Originating-Server: ws1-3.us4.outblaze.com Message-Id: <20051118013438.3ACAE101E6@ws1-3.us4.outblaze.com> Cc: freebsd-hackers@freebsd.org, freebsd-drivers@freebsd.org Subject: Re: How to make my new driver be configurable in the kernel configuration file? 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, 18 Nov 2005 01:34:39 -0000 ----- Original Message ----- From: "John Baldwin" To: "Yong Ma" Subject: Re: How to make my new driver be configurable in the kernel config= uration file? Date: Thu, 17 Nov 2005 10:55:46 -0500 >=20 > On Wednesday 16 November 2005 09:34 pm, Yong Ma wrote: > > > Usually that's spelled '#include ' since it > > > is relative to one of the -I paths. In practice, however, it rarely > > > makes a difference. > > > > > > Warner > > > > Yes,it works.I made it as a "standard".but I want to make it as a > > "optional" so I can config it in the kernel configuration file(MYKERNE= L) > > as "device mydevice" to decide whether it will be load when system boot= s. > > > > It seemed not enough only add a line "dev/mydevice/mycevice.c opti= onal > > device" in sys/conf/files.i386 .There will be a syntax error when > > config MYKERNEL. Something else needed? >=20 > No, that's all that's needed. Perhaps you can post your diff against > files.i386 and the line from MYKERNEL that is causing the error? >=20 > -- > John Baldwin <>< http://www.FreeBSD.org/~jhb/ > "Power Users Use the Power to Serve" =3D http://www.FreeBSD.org > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" Yes,and I got the reason:There wiil be a syntax error if the name behind 'd= evice' in MYKERNEL contains numbers(in the middle). so "device cryptcard" p= assed but "device sjy22b" caused error.=20 Thanks Yong --=20 ___________________________________________________ Play 100s of games for FREE! http://games.mail.com/ From owner-freebsd-drivers@FreeBSD.ORG Fri Nov 18 21:58:36 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3284516A420 for ; Fri, 18 Nov 2005 21:58:36 +0000 (GMT) (envelope-from mfatihakbulut@gmail.com) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by mx1.FreeBSD.org (Postfix) with ESMTP id C382043D45 for ; Fri, 18 Nov 2005 21:58:35 +0000 (GMT) (envelope-from mfatihakbulut@gmail.com) Received: by wproxy.gmail.com with SMTP id i32so95257wra for ; Fri, 18 Nov 2005 13:58:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=eaLXMNE40VJDefCpgjEDFDpZnxW0DhrI8YHTpgdw9+QxtoCNuLYKIvV878XeguS3AdBQGyxVGScydtpEhTIIrwl/TsyhjleyUb9hYL6cYsZXItV1PIf5qr+vuRdUxTMu29fyqku0Uq4jB8LgdxSgFgRL2/tUQEAJqu6hbLcGcBA= Received: by 10.64.203.1 with SMTP id a1mr304124qbg; Fri, 18 Nov 2005 13:58:35 -0800 (PST) Received: by 10.64.195.1 with HTTP; Fri, 18 Nov 2005 13:58:35 -0800 (PST) Message-ID: Date: Fri, 18 Nov 2005 23:58:35 +0200 From: Mehmet Fatih AKBULUT To: freebsd-drivers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: intel high definition audio support 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, 18 Nov 2005 21:58:36 -0000 hi all. now i am using freebsd 5.4 on my computer but i couldn't enable my sound :( didn't see much details about enabling high definition audio support for freebsd on the net :( therefore i am asking to you. although i installed all sound drivers, still i get no output when check which sound driver installed for my soundcard :( dont know if freebsd5.4 supports intel high definition audio or not ? is there anyone knows if freebsd6.0 supports my card or not ? the point is that if i upgraded my os will i be able to hear any sign of sound from my speakers or not ? and please help me on this subject ? thanks in advance. From owner-freebsd-drivers@FreeBSD.ORG Sat Nov 19 03:19:28 2005 Return-Path: X-Original-To: freebsd-drivers@freebsd.org Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 35A7716A41F for ; Sat, 19 Nov 2005 03:19:28 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id A427943D49 for ; Sat, 19 Nov 2005 03:19:27 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so337349nzo for ; Fri, 18 Nov 2005 19:19:27 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=EOllpDQ3lya8jg8SQeV8/s4UizN6HnGaa9eXjDhFl/tlyK/C7vfNKTsRaQ4rDYRM8VnIUk8S0ECFhp6QZ93RNttnQ3d7QhcJ8Vb9eSKQ3I8aT4CeWk5aAmT/3Pic7Yz8Rk6o/pDAIgRUnNGO3ZkS5ixFC6OGGyK4FpCg6EYk9cQ= Received: by 10.36.132.9 with SMTP id f9mr479177nzd; Fri, 18 Nov 2005 19:19:27 -0800 (PST) Received: from michelle.rndsoft.co.kr ( [211.32.202.217]) by mx.gmail.com with ESMTP id 19sm409343nzp.2005.11.18.19.19.23; Fri, 18 Nov 2005 19:19:26 -0800 (PST) Received: from michelle.rndsoft.co.kr (localhost.rndsoft.co.kr [127.0.0.1]) by michelle.rndsoft.co.kr (8.13.1/8.13.1) with ESMTP id jAJ3I4RP017810 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Nov 2005 12:18:04 +0900 (KST) (envelope-from yongari@gmail.com) Received: (from yongari@localhost) by michelle.rndsoft.co.kr (8.13.1/8.13.1/Submit) id jAJ3I3VK017809; Sat, 19 Nov 2005 12:18:03 +0900 (KST) (envelope-from yongari@gmail.com) Date: Sat, 19 Nov 2005 12:18:03 +0900 From: Pyun YongHyeon To: Mehmet Fatih AKBULUT Message-ID: <20051119031803.GA17546@rndsoft.co.kr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i Cc: freebsd-drivers@freebsd.org Subject: Re: intel high definition audio support X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Nov 2005 03:19:28 -0000 On Fri, Nov 18, 2005 at 11:58:35PM +0200, Mehmet Fatih AKBULUT wrote: > hi all. > now i am using freebsd 5.4 on my computer but i couldn't enable my sound :( > didn't see much details about enabling high definition audio support for > freebsd on the net :( > therefore i am asking to you. > although i installed all sound drivers, still i get no output when check > which sound driver installed for my soundcard :( > dont know if freebsd5.4 supports intel high definition audio or not ? > is there anyone knows if freebsd6.0 supports my card or not ? > the point is that if i upgraded my os will i be able to hear any sign of > sound from my speakers or not ? > and please help me on this subject ? > thanks in advance. ATM, Intel HDAs are not supported yet but most of them has legacy feature. The legacy audio might be supported with ich(4). Check multimedia@ ML archives for more details on Intel HDA. If my memory is right ariff@ is working on HDA support. -- Regards, Pyun YongHyeon