Showing posts with label solaris. Show all posts
Showing posts with label solaris. Show all posts

Sunday, March 25, 2007

Using 'prtpci' to list PCI devices

On Solaris, if you want to check the details of the hardware installed
in your PC, you can use the command 'prtconf -pv'. However, the output is
very long, and gives too great a level of detail. Sun's Dan Mick has written
a perl program, called 'prtpci' which gives a more useful summary.
Here is how I installed the program:

bash-3.00# wget ftp://playground.sun.com/pub/dmick/prtpci.tar.Z
--00:08:09-- ftp://playground.sun.com/pub/dmick/prtpci.tar.Z
=> `prtpci.tar.Z'
Resolving playground.sun.com... 192.9.5.5
Connecting to playground.sun.com|192.9.5.5|:21... connected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD /pub/dmick ... done.
==> PASV ... done. ==> RETR prtpci.tar.Z ... done.
Length: 163,050 (159K) (unauthoritative)

100%[====================================>] 163,050 57.69K/s

00:08:16 (57.54 KB/s) - `prtpci.tar.Z' saved [163050]

bash-3.00# gunzip < prtpci.tar.Z | tar xvf -
x prtpci, 5954 bytes, 12 tape blocks
x pciids/pci.ids, 349313 bytes, 683 tape blocks
x pciids/class.ids, 3445 bytes, 7 tape blocks
x pciids/getnew.pci.ids, 81 bytes, 1 tape blocks

bash-3.00# chown -R root:root prtpci pciids/

bash-3.00# ls -l
total 350
drwxr-xr-x 2 root root 512 Mar 25 00:10 pciids
-r-xr-xr-x 1 root root 5954 Jul 12 2005 prtpci
-rw-r--r-- 1 root root 163050 Mar 25 00:08 prtpci.tar.Z

bash-3.00# ls -l pciids/
total 714
-rw-rw-r-- 1 root root 3445 Mar 24 2002 class.ids
-rwxrwxr-x 1 root root 81 Mar 18 2005 getnew.pci.ids
-rw-rw-r-- 1 root root 349313 May 27 2005 pci.ids

And here is the (edited) output of what it shows
on my Dell Precision 380:

bash-3.00# ./prtpci
0/0x0/0 8086,2774 (1028,1a8) rev 0x0
Intel Corporation 955X Memory Controller Hub
class 6/0/0: Bridge/Host bridge

0/0x1/0 8086,2775 0 rev 0x0
Intel Corporation 955X PCI Express Graphics Port
class 6/4/0: Bridge/PCI bridge

1/0x0/0 1002,71d2 (1002,3b02) rev 0x0
ATI Technologies Inc
class 3/0/0: Display controller/VGA compatible controller
BAR[0]: prefetchable 64-bit memory 0xe0000000 0x10000000
BAR[2]: 64-bit memory 0xfe9e0000 0x10000
BAR[4]: I/O 0xdc00 0x100
legacy reg #3: aliased I/O 0x3b0 0xc
legacy reg #4: aliased I/O 0x3c0 0x20
legacy reg #5: 32-bit memory 0xa0000 0x20000

1/0x0/1 1002,71f2 (1002,3b03) rev 0x0
ATI Technologies Inc
class 3/80/0: Display controller/Display controller
BAR[0]: 64-bit memory 0xfe9f0000 0x10000

0/0x1c/0 8086,27d0 1 rev 0x0
Intel Corporation 82801G (ICH7 Family) PCI Express Port 1
class 6/4/0: Bridge/PCI bridge

4/0x0/0 14e4,1677 (1028,1a8) rev 0x1
Broadcom Corporation NetXtreme BCM5751 Gigabit Ethernet PCI Express
class 2/0/0: Network controller/Ethernet controller
BAR[0]: 64-bit memory 0xfe7f0000 0x10000

0/0x1f/0 8086,27b8 1 rev 0x0
Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge
class 6/1/0: Bridge/ISA bridge

0/0x1f/1 8086,27df (1028,1a8) rev 0x1
Intel Corporation 82801G (ICH7 Family) IDE Controller
class 1/1/8a: Mass storage controller/IDE interface
BAR[0]: I/O 0x1f0 0x8
BAR[1]: I/O 0x3f6 0x1
BAR[2]: I/O 0x170 0x8
BAR[3]: I/O 0x376 0x1
BAR[4]: I/O 0xffa0 0x10

0/0x1f/2 8086,27c1 (1028,1a8) rev 0x1
Intel Corporation 82801GR/GH (ICH7 Family) Serial ATA Storage Controllers cc=AHCI
class 1/6/1: Mass storage controller/
BAR[0]: I/O 0xfe00 0x8
BAR[1]: I/O 0xfe10 0x4
BAR[2]: I/O 0xfe20 0x8
BAR[3]: I/O 0xfe30 0x4
BAR[4]: I/O 0xfea0 0x10
BAR[5]: 32-bit memory 0xfebfbc00 0x400

0/0x1f/3 8086,27da (1028,1a8) rev 0x1
Intel Corporation 82801G (ICH7 Family) SMBus Controller
class c/5/0: Serial bus controller/SMBus
BAR[4]: I/O 0xece0 0x20

The above clearly shows the ATI graphics card, the Broadcom Gigabit Ethernet card, and the ICH7 SATA card (using AHCI).

Here's the link to the post on Dan Mick's blog.

Saturday, March 24, 2007

Using wget, gcc & gmake on Solaris, by fixing the PATH

Solaris has a number of useful commands, like gcc and wget, hidden away in
directory '/usr/sfw/bin'. But, by default, for user root, Solaris does not add this
directory to the path. So assuming you are using Bash as your shell,
try the following:

bash-3.00# echo $PATH
/usr/sbin:/usr/bin
bash-3.00# export PATH=$PATH:/usr/sfw/bin
bash-3.00# echo $PATH
/usr/sbin:/usr/bin:/usr/sfw/bin
bash-3.00# wget -V
GNU Wget 1.10.2
bash-3.00# gcc -v
gcc version 3.4.3 (csl-sol210-3_4-20050802)
bash-3.00# gmake -v
GNU Make 3.80
bash-3.00# uname -a
SunOS solaris 5.11 snv_57 i86pc i386 i86pc

Wednesday, February 21, 2007

Checking Solaris iScsi Performance with Dtrace

I've just discovered David Weibel's Blog and he has a couple of interesting posts regarding using dtrace(1M) to check performance issues with iScsi on Solaris.

David worked on the Solaris iScsi initiator code when he was at Sun Microsystems, Inc.

Wednesday, January 17, 2007

Using the NetBSD iScsi Target code on Solaris

The NetBSD iScsi target will, quite happily, compile and run on Solaris. The code was developed by Alistair Crooks, and is based on code released by Intel, under the BSD licence.

To try it out, I used the Belenix LiveCD distribution of OpenSolaris.
(root)# uname -a
SunOS belenix 5.11 BeleniX0.4.3 i86pc i386 i86pc
(root)# gcc -v
Reading specs from /usr/foss/lib/gcc/i386-pc-solaris2.10/3.4.3/specs
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
(root)# cd tmp
(root)# curl -O http://www.alistaircrooks.co.uk/src/netbsd-iscsi-20060526.tar.gz
(root)# ls -l netbsd-iscsi-20060526.tar.gz
-rw------- 1 root root 239964 May 27 22:21 netbsd-iscsi-20060526.tar.gz
(root)# gunzip < netbsd-iscsi-20060526.tar.gz | tar xvf -
(root)# cd iscsi
(root)# cd src
(root)# ./configure
(root)# make
(root)# cd ../bin
(root)# ls -l
-rwx------ 1 root root 226580 May 27 22:24 iscsi-harness
-rwx------ 1 root root 219028 May 27 22:24 iscsi-target

I just wanted to use the iScsi target to confirm if the Microsoft iScsi initiator would work ok with it, and take some Ethereal traces of the initial login sequence. So I just used the following simple configuration file, which exports out a 100 mega byte file.
(root)# cat /etc/iscsi/targets
extent0 /tmp/iscsi-target0 0 100MB

target0 rw extent0 0.0.0.0/0
(root)# ./iscsi-target &
(root)# ls -l /tmp/iscsi-target0
-rw------- 1 root root 104857601 May 27 23:17 /tmp/iscsi-target0

I tried the target with v2.03 of the Microdoft iScsi initiator, and and I can report that every thing I tried worked ok.

You can browse the source code of the iScsi target at the NetBSD CVS server. To get the latest version of the code, it may be best to get it from the CVS server.

I've just noted that Alistair make some further changes to the code at the start of 2007, which are noted at this digest.