From owner-freebsd-drivers@FreeBSD.ORG Thu Nov 28 09:15:40 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EE27770 for ; Thu, 28 Nov 2013 09:15:40 +0000 (UTC) Received: from nm23-vm1.bullet.mail.bf1.yahoo.com (nm23-vm1.bullet.mail.bf1.yahoo.com [98.139.213.141]) by mx1.freebsd.org (Postfix) with SMTP id 906721FD1 for ; Thu, 28 Nov 2013 09:15:39 +0000 (UTC) Received: from [66.196.81.173] by nm23.bullet.mail.bf1.yahoo.com with NNFMP; 28 Nov 2013 09:13:38 -0000 Received: from [98.139.212.220] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 28 Nov 2013 09:13:38 -0000 Received: from [127.0.0.1] by omp1029.mail.bf1.yahoo.com with NNFMP; 28 Nov 2013 09:13:38 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 857278.85510.bm@omp1029.mail.bf1.yahoo.com Received: (qmail 44589 invoked by uid 60001); 28 Nov 2013 09:13:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1385630018; bh=9mKYZRFTWPv/CGjN+A2C8nFl23kIRwh3IqB23wXczsM=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=F5ODxK0umb0M408z/wuoBQnzTcnp7RnvfvOPFKUQc1YDm0QWY+AUFAmnv45cwK0ZJx5NpBonRdYjVmEGLim8tUk2hgH1nrXh04C+y4vfTmzGHgzjAfzw6vDlvYAsVrVpOXI1CDwijOcws/uNA5ltZXk31+1YCtpO5kAHpf2PSbY= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=NkXPsSu+u0IB+E28NJHPVEswe920Fsy2kT2y0R92B0Q923pd2vTkkhdvH3O17hYFAVEnevkHNt7XxiEd90OzE5FVVAqnK75Oqdr8FOYLi6xpYKUzYmQ+uDwWiMmeThvUNCwkhRT3nMez1oQDinTUMoQjbPsNJQUwCXl9GjJVKKE=; X-YMail-OSG: dS4sjTkVM1mQhvVkipb7IDuD9Eco7.SBrhHW0xA42dENuq1 68PTqXVecfc6awhh0MoWAugvJR6CxQsEPVFtRCdJ7WEYxs9J8iy_OD0i8oFe yB_wEpmPn6dsRINz7iCRKSuyKg4AM.KTAzXKDZtRHoL.Ac_JIp3yfcPoM0N5 WwzeHDQuZI82Jw1cJjOfARgNMV5AA.eH26_eLQ3IJEIEX64IL9lywNIkB9B. 1XXDBUHptH9uw2FQsGS1yJOUFKYfIHEYQerG_0owDpFweLonZLexovr1WH70 Q5crwdrDR2iXSho7oW7xllg09f4RY6dcKaSNmDIXWs3dshFoPnosL57pPChZ HLI11vQrw.Np1OenVs65qYAjh11ku7t5xKsxLG1OiEIHUudJW8N0xpin_hlV oaCjChXUsuOKkBZOTm7EDkfbuceAViv7sgcYdFAU6WJ06HG8K1F3mXYDA_r2 DODncZ_qV2a4dOSpK3Vb9xdf5mnuf5phUI4cY2qSYQpNqvGqQhmLmOJXtlsq B5vtG.tjwQeAzFXrvlOQ- Received: from [89.165.120.140] by web162701.mail.bf1.yahoo.com via HTTP; Thu, 28 Nov 2013 01:13:38 PST X-Rocket-MIMEInfo: 002.001, SGkgbGlzdApIb3cgY2FuIEkgZG8gc28_IEJ5IGhhcmR3YXJlIGluZm9ybWF0aW9ucyBJIG1lYW4gd2hpY2ggY2FyZCBpcyBsb2NhdGVkIG9uIHdoaWNoIHNsb3QsIGNhcmQgc2VyaWFsIG51bWJlciwgbWFudWZhY3R1cmVyIGFuZCAuLi4gLiBJIGtub3cgc29tZSB1dGlscyBkbyB0aGlzIGUuZy4gZG1lc2csIHBjaWNvbmYgYnV0IEkgd2FudCB0byB3cml0ZSBzb21ldGhpbmcgb24gbXkgb3duLgpBbnkgc3VnZ2VzdGlvbiBpcyBhcHByZWNpYXRlZC4BMAEBAQE- X-Mailer: YahooMailWebService/0.8.167.602 Message-ID: <1385630018.22673.YahooMailNeo@web162701.mail.bf1.yahoo.com> Date: Thu, 28 Nov 2013 01:13:38 -0800 (PST) From: Nomad Esst Subject: Access to hardware informations from an user-space program To: "freebsd-drivers@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.16 X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list Reply-To: Nomad Esst List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Nov 2013 09:15:40 -0000 Hi list How can I do so? By hardware informations I mean which card is located on which slot, card serial number, manufacturer and ... . I know some utils do this e.g. dmesg, pciconf but I want to write something on my own. Any suggestion is appreciated. From owner-freebsd-drivers@FreeBSD.ORG Sat Nov 30 04:37:36 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E474B21F for ; Sat, 30 Nov 2013 04:37:36 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BE632197A for ; Sat, 30 Nov 2013 04:37:36 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id rAU4bT5n057669 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 29 Nov 2013 20:37:30 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id rAU4bThV057668; Fri, 29 Nov 2013 20:37:29 -0800 (PST) (envelope-from jmg) Date: Fri, 29 Nov 2013 20:37:29 -0800 From: John-Mark Gurney To: Nomad Esst Subject: Re: Access to hardware informations from an user-space program Message-ID: <20131130043729.GA55638@funkthat.com> Mail-Followup-To: Nomad Esst , "freebsd-drivers@freebsd.org" References: <1385630018.22673.YahooMailNeo@web162701.mail.bf1.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385630018.22673.YahooMailNeo@web162701.mail.bf1.yahoo.com> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Fri, 29 Nov 2013 20:37:30 -0800 (PST) Cc: "freebsd-drivers@freebsd.org" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Nov 2013 04:37:37 -0000 Nomad Esst wrote this message on Thu, Nov 28, 2013 at 01:13 -0800: > Hi list > How can I do so? By hardware informations I mean which card is located on which slot, card serial number, manufacturer and ... . I know some utils do this e.g. dmesg, pciconf but I want to write something on my own. > Any suggestion is appreciated. dmesg just reads the kernel buffer, but you are correct that pci conf does read this info.. Why don't you read the source for pciconf? If you installed the source, it's availabe in /usr/src/usr.sbin/pciconf? Or you can read it on the web at: https://svnweb.freebsd.org/base/head/usr.sbin/pciconf/ -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."