From owner-freebsd-questions@FreeBSD.ORG Sat Sep 29 18:54:03 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D90A2106564A for ; Sat, 29 Sep 2012 18:54:03 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id 987888FC08 for ; Sat, 29 Sep 2012 18:54:03 +0000 (UTC) Received: from r56.edvax.de (port-92-195-214-70.dynamic.qsc.de [92.195.214.70]) by mx02.qsc.de (Postfix) with ESMTP id AC0E827898; Sat, 29 Sep 2012 20:54:01 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q8TIs188002605; Sat, 29 Sep 2012 20:54:01 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 29 Sep 2012 20:54:01 +0200 From: Polytropon To: saeedeh motlagh Message-Id: <20120929205401.ac331836.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions Subject: Re: find slot number and number of ports for each card X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2012 18:54:04 -0000 On Sat, 29 Sep 2012 18:07:56 +0330, saeedeh motlagh wrote: > hello all > > i want to have statistics about my hardware specially the type of card > that are installed on my system, the number of ports that each card > has and the slot number which cards are installed. i can find the > slot number by tracing the output of dmesg but it's time consuming > job. You can use "pciconf -lv" to get a beter output for PCI cards. Note that this list does also contain "integrated components". Sadly, there is no direct relation to which "hardware slots" are occupied, because there is no real standard for communcating the physical layout of the machine to the OS, either through the BIOS, ACPI, or "more directly" by the OS itself. See "man pciconf" for details. Some non-PC systems (such as EISA-based computers, some Sun hardware, or the AS/400, or nearly anything from the mainframe sector) have means to "directly query" hardware resources. Today's cheap commodity consumer crap (sorry) doesn't have this feature. > more over, i don't know how to find the number of ports that each > card has. A lot of this data can be obtained by using "pciconf -lv". Here's an example output for a graphics card: vgapci0@pci0:2:0:0: class=0x030000 card=0x06201462 chip=0x039210de rev=0xa1 hdr=0x00 vendor = 'NVIDIA Corporation' device = 'NVIDIA GeForce 7600 GS (G73)' class = display subclass = VGA Of course, _what_ "pci0:2:0:0" is, depends on the mainboard in use. This particular machine also has a TV tuner card at "pci0:0:9:0" and "pci0:0:9:1", and a network card at "pci0:0:10:0". _Where_ those are located (which "hardware slots") is not obvious, as there aren't even _5_ of them on the mainboard! It cannot easily be concluded, especially considering the common lack of lower-level documentation. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...