From owner-freebsd-drivers@FreeBSD.ORG Tue Sep 13 10:36:10 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 256EF16A41F; Tue, 13 Sep 2005 10:36:10 +0000 (GMT) (envelope-from m.ehinger@ltur.de) Received: from posty.gateway-inter.net (posty.gateway-inter.net [213.144.19.86]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB85B43D45; Tue, 13 Sep 2005 10:36:09 +0000 (GMT) (envelope-from m.ehinger@ltur.de) In-Reply-To: <20050815063855.24333.qmail@web54407.mail.yahoo.com> Sensitivity: To: freebsd-drivers@freebsd.org, freebsd-hackers@freebsd.org, freebsd-questions@freebsd.org Message-ID: From: m.ehinger@ltur.de Date: Tue, 13 Sep 2005 12:35:03 +0200 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Cc: Subject: Thinkpad Accelerometer driver new Version 0.5 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, 13 Sep 2005 10:36:10 -0000 Hi, anyone who is interested can download the source at https://sourceforge.net/project/showfiles.php?group_id=138242&package_id=160977 Use at your own risk! I've tested it on my T42 M1G with FreeBSD 7.0-Current (Aug 10) only. It now provides a mouse like device (/dev/accelm), which could be used to play "neverball" e.g Please see CHANGELOG and README for further informations. Please let me know what you think. thanks maik From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 17 17:40:03 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 C973216A41F for ; Sat, 17 Sep 2005 17:40:03 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from ni-mail2.dna.utvinternet.net (mail2.u.tv [194.46.8.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 395AB43D49 for ; Sat, 17 Sep 2005 17:40:03 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from mail.cobbled.net (unverified [195.218.107.162]) by ni-mail2.dna.utvinternet.net (Vircom SMTPRS 4.1.361.18) with ESMTP id for ; Sat, 17 Sep 2005 18:39:56 +0100 Received: from eyore.cobbled.net (localhost [127.0.0.1]) by mail.cobbled.net (8.12.10/8.12.10) with ESMTP id j8HHdgm7007108 for ; Sat, 17 Sep 2005 18:39:42 +0100 (BST) (envelope-from fergus@eyore.public.cobbled.net) Received: (from fergus@localhost) by eyore.cobbled.net (8.12.10/8.12.10/Submit) id j8HHdgsT007107 for freebsd-drivers@freebsd.org; Sat, 17 Sep 2005 18:39:42 +0100 (BST) (envelope-from fergus) Date: Sat, 17 Sep 2005 18:39:41 +0100 From: n0g0013 To: freebsd-drivers@freebsd.org Message-ID: <20050917173941.GJ6440@eyore.cobbled.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: basic driver build environment 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: Sat, 17 Sep 2005 17:40:03 -0000 trying to write a PCI driver and finding it awkward to build it outside the source tree. will i have to wire in the new driver "sys" source tree to get a clean edit/build environment? currently i'm doing two things 1. merging my current kernel build directory with my new driver directory and building there. it produces a module but leaves a hell of a mess. the module reboots the system currently (no crash -- just reboot) but that may be something else. 2. getting a copy of CVS so i can wire into tree when i understand how if anyone could guide me on a. cleaner config for building modules in random directory (thought '-I' to make would work but it doesn't) b. how to actually wire in a new driver to the "sys" source tree (once i have a copy) i'd appreciate it. -- t t w From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 17 18:03:01 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 3F40B16A41F for ; Sat, 17 Sep 2005 18:03:01 +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 D52DA43D48 for ; Sat, 17 Sep 2005 18:03:00 +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 j8HI0HVY092389; Sat, 17 Sep 2005 12:00:17 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 17 Sep 2005 12:00:27 -0600 (MDT) Message-Id: <20050917.120027.32524785.imp@bsdimp.com> To: ttw@cobbled.net From: "M. Warner Losh" In-Reply-To: <20050917173941.GJ6440@eyore.cobbled.net> References: <20050917173941.GJ6440@eyore.cobbled.net> 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]); Sat, 17 Sep 2005 12:00:17 -0600 (MDT) Cc: freebsd-drivers@freebsd.org Subject: Re: basic driver build environment 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: Sat, 17 Sep 2005 18:03:01 -0000 In message: <20050917173941.GJ6440@eyore.cobbled.net> n0g0013 writes: : trying to write a PCI driver and finding it awkward to build it : outside the source tree. : : will i have to wire in the new driver "sys" source tree to get a : clean edit/build environment? : : currently i'm doing two things : : 1. merging my current kernel build directory with my : new driver directory and building there. it produces a : module but leaves a hell of a mess. the module reboots the : system currently (no crash -- just reboot) but that may be : something else. : : 2. getting a copy of CVS so i can wire into tree when i : understand how : : if anyone could guide me on : : a. cleaner config for building modules in random : directory (thought '-I' to make would work but it doesn't) : : b. how to actually wire in a new driver to the "sys" : source tree (once i have a copy) : : i'd appreciate it. When I'm developing a new module, I do the following: setenv SYSDIR /path/to/freebsd/src/sys make The Makefile looks like # Maybe have a .PATH here KMOD= foo SRCS= foo_a foo_b .include At work, we wrap setting SYSDIR in an include file, since our build system knows about it. As for building a kernel with the driver in it, I'll leave that to others. We haven't built modules into the kernel on FreeBSD since 2.2.8. Warner From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 17 18:32:11 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 E684D16A420 for ; Sat, 17 Sep 2005 18:32:11 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from ni-mail3.dna.utvinternet.net (mail3.u.tv [194.46.8.37]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3944543D46 for ; Sat, 17 Sep 2005 18:32:10 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from mail.cobbled.net (unverified [195.218.107.162]) by ni-mail3.dna.utvinternet.net (Vircom SMTPRS 4.1.361.20) with ESMTP id ; Sat, 17 Sep 2005 19:32:02 +0100 Received: from eyore.cobbled.net (localhost [127.0.0.1]) by mail.cobbled.net (8.12.10/8.12.10) with ESMTP id j8HIVcm7007205; Sat, 17 Sep 2005 19:31:40 +0100 (BST) (envelope-from fergus@eyore.public.cobbled.net) Received: (from fergus@localhost) by eyore.cobbled.net (8.12.10/8.12.10/Submit) id j8HIVWfw007204; Sat, 17 Sep 2005 19:31:32 +0100 (BST) (envelope-from fergus) Date: Sat, 17 Sep 2005 19:31:32 +0100 From: n0g0013 To: "M. Warner Losh" Message-ID: <20050917183132.GK6440@eyore.cobbled.net> References: <20050917173941.GJ6440@eyore.cobbled.net> <20050917.120027.32524785.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050917.120027.32524785.imp@bsdimp.com> Cc: freebsd-drivers@freebsd.org Subject: Re: basic driver build environment 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: Sat, 17 Sep 2005 18:32:12 -0000 On 17.09-12:00, M. Warner Losh wrote: [ ... ] > : a. cleaner config for building modules in random > : directory (thought '-I' to make would work but it doesn't) [ ... ] > When I'm developing a new module, I do the following: > > setenv SYSDIR /path/to/freebsd/src/sys > make > > The Makefile looks like > > # Maybe have a .PATH here > > KMOD= foo > SRCS= foo_a foo_b > > .include > > At work, we wrap setting SYSDIR in an include file, since our build > system knows about it. i get the following (plus more similar) error/s @/sys/bus.h:456:23: device_if.h: No such file or directory even when setting the SYSDIR to "/usr/src/sys". perhaps i'm missing something about the "wrap setting SYSDIR in an include file" to make it work??? if i understand correctly it's looking for the kernel architecture files from the kernel build (i.e in the 'obj' directory). apologies if i'm being braindamaged here. -- t t w From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 17 19:57:01 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 D612C16A41F for ; Sat, 17 Sep 2005 19:57:01 +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 73B5243D46 for ; Sat, 17 Sep 2005 19:57:01 +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 j8HJu0c7093051; Sat, 17 Sep 2005 13:56:00 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Sat, 17 Sep 2005 13:56:10 -0600 (MDT) Message-Id: <20050917.135610.68256548.imp@bsdimp.com> To: ttw@cobbled.net From: "M. Warner Losh" In-Reply-To: <20050917183132.GK6440@eyore.cobbled.net> References: <20050917173941.GJ6440@eyore.cobbled.net> <20050917.120027.32524785.imp@bsdimp.com> <20050917183132.GK6440@eyore.cobbled.net> 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]); Sat, 17 Sep 2005 13:56:00 -0600 (MDT) Cc: freebsd-drivers@freebsd.org Subject: Re: basic driver build environment 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: Sat, 17 Sep 2005 19:57:01 -0000 In message: <20050917183132.GK6440@eyore.cobbled.net> n0g0013 writes: : On 17.09-12:00, M. Warner Losh wrote: : [ ... ] : > : a. cleaner config for building modules in random : > : directory (thought '-I' to make would work but it doesn't) : [ ... ] : > When I'm developing a new module, I do the following: : > : > setenv SYSDIR /path/to/freebsd/src/sys : > make : > : > The Makefile looks like : > : > # Maybe have a .PATH here : > : > KMOD= foo : > SRCS= foo_a foo_b : > : > .include : > : > At work, we wrap setting SYSDIR in an include file, since our build : > system knows about it. : : i get the following (plus more similar) error/s : : @/sys/bus.h:456:23: device_if.h: No such file or directory : : even when setting the SYSDIR to "/usr/src/sys". perhaps i'm missing : something about the "wrap setting SYSDIR in an include file" to make : it work??? : : if i understand correctly it's looking for the kernel architecture : files from the kernel build (i.e in the 'obj' directory). : : apologies if i'm being braindamaged here. Add bus_if.h and device_if.h to your SRCS line. They are generated. If it is a pci device, you'll also need pci_if.h Warner From owner-freebsd-drivers@FreeBSD.ORG Sat Sep 17 21:32: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 7986216A41F for ; Sat, 17 Sep 2005 21:32:56 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from ni-mail2.dna.utvinternet.net (mail2.u.tv [194.46.8.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id CD74E43D48 for ; Sat, 17 Sep 2005 21:32:55 +0000 (GMT) (envelope-from fergus@cobbled.net) Received: from mail.cobbled.net (unverified [195.218.107.162]) by ni-mail2.dna.utvinternet.net (Vircom SMTPRS 4.1.361.18) with ESMTP id for ; Sat, 17 Sep 2005 22:32:50 +0100 Received: from eyore.cobbled.net (localhost [127.0.0.1]) by mail.cobbled.net (8.12.10/8.12.10) with ESMTP id j8HLWYm7007432 for ; Sat, 17 Sep 2005 22:32:35 +0100 (BST) (envelope-from fergus@eyore.public.cobbled.net) Received: (from fergus@localhost) by eyore.cobbled.net (8.12.10/8.12.10/Submit) id j8HLWUZc007431 for freebsd-drivers@freebsd.org; Sat, 17 Sep 2005 22:32:30 +0100 (BST) (envelope-from fergus) Resent-Message-Id: <200509172132.j8HLWUZc007431@eyore.cobbled.net> Date: Sat, 17 Sep 2005 21:56:04 +0100 From: n0g0013 To: "M. Warner Losh" Message-ID: <20050917205604.GL6440@eyore.cobbled.net> References: <20050917173941.GJ6440@eyore.cobbled.net> <20050917.120027.32524785.imp@bsdimp.com> <20050917183132.GK6440@eyore.cobbled.net> <20050917.135610.68256548.imp@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050917.135610.68256548.imp@bsdimp.com> Resent-From: fergus@cobbled.net Resent-Date: Sat, 17 Sep 2005 22:32:30 +0100 Resent-To: freebsd-drivers@freebsd.org Cc: freebsd-drivers@freebsd.org Subject: Re: basic driver build environment 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: Sat, 17 Sep 2005 21:32:56 -0000 On 17.09-13:56, M. Warner Losh wrote: [ ... ] > : i get the following (plus more similar) error/s > : > : @/sys/bus.h:456:23: device_if.h: No such file or directory > : [ ... ] > Add bus_if.h and device_if.h to your SRCS line. They are generated. > If it is a pci device, you'll also need pci_if.h knew it had to be something simple. thanks -- t t w