From owner-freebsd-hackers@FreeBSD.ORG Thu May 5 09:58:02 2005 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9CCB716A4CE for ; Thu, 5 May 2005 09:58:02 +0000 (GMT) Received: from kalypso.opteqint.net (kalypso.opteqint.net [160.124.112.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1E2D343D4C for ; Thu, 5 May 2005 09:58:02 +0000 (GMT) (envelope-from cole@opteqint.net) Received: from rrba-165-32-77.telkomadsl.co.za ([165.165.32.77] helo=deadmind) by kalypso.opteqint.net with esmtpsa (TLSv1:RC4-MD5:128) (Exim 4.43 (FreeBSD)) id 1DTd71-000Lms-At for freebsd-hackers@freebsd.org; Thu, 05 May 2005 11:57:46 +0200 Message-ID: <000901c55159$da7fe080$4206000a@deadmind> From: "Cole" To: Date: Thu, 5 May 2005 12:04:37 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4922.1500 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4939.300 X-Spam-Score: -100.0 (---------------------------------------------------) X-Spam-Report: Spam detection software, running on the system "kalypso.opteqint.net", hasmessagelabel similar future email. If you have any questions, see the administrator of that system for details.writes to the IOPORT BAR's of a pci card. I can find the card and all that would [...] Content analysis details: (-100.0 points, 4.2 required) pts rule name description -------------------------------------------------- -100 USER_IN_WHITELIST From: address is in the user's white-list Subject: Pci Question X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Cole List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 May 2005 09:58:02 -0000 Hi Im trying to write a userland program that writes to the IOPORT BAR's of a pci card. I can find the card and all that fine. But im a bit lost on exactly what address the IOPORT BAR's would be then? Im using the /dev/pci and pci(4) functions to find the card. Ive seen in the linux version of those code, that they take the base_address's and then & ~0x03 them, and use that value for reading and writing with inb_l and outb_l. Ive tried using that on FreeBSD, but with outl and inl, as well as writel and readl, but I keep getting "Bus error". Is there perhaps something that I am missing or forgetting, also im running the program as root. If anyone has any suggestions, they would be most welcome. Thanks /Cole