Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
What happens if you test both drives individually but simultaneously? No RAID; run two instances of the benchmark concurrently.
I'll give that a try at some point...

When the 240GB was Mixed with the 256GB in HW RAID 0 under linux I got about 470MB/s.

So Mixing these drives puts both into 3.0GB/s mode under Linux set with LSIUtil.

I've not tested them mixed with OS X DiskUtility SW RAID 0.

If you check the AppleLSIMPT driver( Kext ) it has support for three cards, one is this card 1000,50 one is a LSI Fiber Channel RAID card and the last is a LSI SCSI card.

I think I know what the Apple shipped card is, I think it is this card, it has a battery pack, but for $90 I'm not buying one to find out. It's the only LSI SAS card I can find from a G5.

NOTE TO MODS: Not my auction.


Anyway the Linux driver doesn't like Apple SW RAID and can't detect the Logical Volume, and the OS X Driver doesn't like the LSI HW RAID and can't mount or even do a /dev/entry for the LSILogical Volume.

I'm sure if @joevt is able to get the LSIUtil working on Mac OS PPC it will be able to detect the drives and change the properties.

This is all so damed cool, I wish I could help @joetv with the LSIUtil, but that's over my head, I can build and beta test tho..

The LSIMPT driver from Leopard will likely work on Tiger too, we know Tiger server has one, so if the one from Leopard doesn't work, that one likely will.
 
If you type:

Code:
megaraid

On the OS X command line you'll get some interesting results, but not for this card, Apple used a LSI MegaRAID in something, we just have to figure out which cards.......
 
What happens if you test both drives individually but simultaneously? No RAID; run two instances of the benchmark concurrently.
Running two benchmarks concurrently doesn't usually give consistent results because they are not synced together so it may be that one benchmark is idling which allows the other benchmark to report higher results making the total bandwidth greater than possible.

ATTODiskBenchmark.app is the only benchmark I know that does multiple disks simultaneously but I don't think there's a PPC version.
 
  • Like
Reactions: Amethyst1
Guys, do you know you can test at least 3 types of LSI SAS cards in PowerMacs? LSI3041E-R (PCI Ex), LSI3081E-R (PCI-Ex), LSI3080X-R (PCI-X, usually HP-branded with 2 SFF-8484 ports) and one, forgot how is it marked, with 4 SATA ports, which you are using, I suppose? :D
(8-devices cards can be installed too ' you can connect all 8 drives to it, which requires of using several enclosures, 1 with 4 ports replacing DVD drive, two more - in regular HDD drives, which can handle 2 2,5" each. Just google models.)
 
So I ordered another 256GB drive and I'm hitting peak speeds of over 500MB/s in Raid 0 with these two drives.

They each were doing 250+MB/s before I raided them.

The cheap 240GB drives keep coming unmarried between reboots and only operate at SATA I speeds, even tho they are SATA III drives and backward compatible with SATA II.

These drives will just power my older Mac's that can't use the RAID card, and they work fine with the SiL3112.

Tho I never tried to RAID them with SW RAID on the SiL3112, so that maybe worth looking at.

If I add 4 drives to my RAID array on the LSI card I should get pretty near the 1064MB/s that is the Maximum theoretical speed of PCI-X 133.

I'm thinking four high quality 1TB SATA III SSD in RAID 0 will be fine for this Old G5.

I'll update with some benchmarks when I get my 4TB setup.
 
  • Like
Reactions: Amethyst1
I've updated my DirectHW, pciutils, and LSIUtil forks but I have no LSI card to test them with.
You should be able to build them for any macOS version (I've tried 10.4, 10.6, 10.13, and 13), PPC or Intel (Arm probably needs more work if it can work at all).
You probably need to unload the LSI kext before using lsiutil
 
  • Like
Reactions: LightBulbFun
I've updated my DirectHW, pciutils, and LSIUtil forks but I have no LSI card to test them with.
You should be able to build them for any macOS version (I've tried 10.4, 10.6, 10.13, and 13), PPC or Intel (Arm probably needs more work if it can work at all).
You probably need to unload the LSI kext before using lsiutil
I can't seem to get the permissions correct for DHW.kext.

What has always worked for me is:

Code:
sudo chown -R 0:0 /path/to/the/.kext
sudo chmod 755 /path/to/the/.kext

Also, I'm I going to need the DHW framework installed?
 
I can't seem to get the permissions correct for DHW.kext.

What has always worked for me is:

Code:
sudo chown -R 0:0 /path/to/the/.kext
sudo chmod 755 /path/to/the/.kext

Also, I'm I going to need the DHW framework installed?
You need to add -R because kext is a folder that contains other files that need the correct permissions.
Or use the commands in my kextutil.sh (git gist) script
https://gist.github.com/joevt/a4ef4cd2e1485d0dd595893007bdfd6a
which I included in my flashrom for Mac OS X 10.3, 10.4, 10.5 archive posted elsewhere.
https://forums.macrumors.com/thread...the-fruit-colored-imacs.2428418/post-33206738

You need to install the framework if you are building the source code.

Code:
mkdir -p ~/joevtstuff
cd ~/joevtstuff
git clone https://github.com/joevt/directhw joevt-directhw
git clone https://github.com/joevt/pciutils joevt-pciutils
git clone https://github.com/joevt/LSIUtil joevt-LSIUtil
curl -s -L https://gist.github.com/joevt/a4ef4cd2e1485d0dd595893007bdfd6a/raw -o KextUtil.sh

cd ~/joevtstuff/joevt-directhw/DirectHW
make clean
make 2>&1
sudo make install 2>&1

cd ~/joevtstuff/joevt-pciutils
make clean
make
sudo make install
sudo make install-lib
# Test it
sudo setpci -G -s 00:00.0 0.l
sudo lspci -G -nnvvv

cd ~/joevtstuff/joevt-LSIUtil/Source/1.70
if [[ -e lsiutil ]] rm lsiutil
if [[ -e lsiutil.dSYM ]] rm lsiutil.dSYM
make -f Makefile_Mac
# Test it
./lsiutil -help
sudo ./lsiutil -o 
sudo ./lsiutil
 
You need to add -R because kext is a folder that contains other files that need the correct permissions.
Or use the commands in my kextutil.sh (git gist) script
https://gist.github.com/joevt/a4ef4cd2e1485d0dd595893007bdfd6a
which I included in my flashrom for Mac OS X 10.3, 10.4, 10.5 archive posted elsewhere.
https://forums.macrumors.com/thread...the-fruit-colored-imacs.2428418/post-33206738

You need to install the framework if you are building the source code.

Code:
mkdir -p ~/joevtstuff
cd ~/joevtstuff
git clone https://github.com/joevt/directhw joevt-directhw
git clone https://github.com/joevt/pciutils joevt-pciutils
git clone https://github.com/joevt/LSIUtil joevt-LSIUtil
curl -s -L https://gist.github.com/joevt/a4ef4cd2e1485d0dd595893007bdfd6a/raw -o KextUtil.sh

cd ~/joevtstuff/joevt-directhw/DirectHW
make clean
make 2>&1
sudo make install 2>&1

cd ~/joevtstuff/joevt-pciutils
make clean
make
sudo make install
sudo make install-lib
# Test it
sudo setpci -G -s 00:00.0 0.l
sudo lspci -G -nnvvv

cd ~/joevtstuff/joevt-LSIUtil/Source/1.70
if [[ -e lsiutil ]] rm lsiutil
if [[ -e lsiutil.dSYM ]] rm lsiutil.dSYM
make -f Makefile_Mac
# Test it
./lsiutil -help
sudo ./lsiutil -o
sudo ./lsiutil
LSIUtil complains it can't load the DHW dynamic library from the DHW framework.

make 2>&1 just dumps a list of make commands for DHW.

make directhw dumps an error that there is no SDK specified at the SDKROOT path.

On Leapard 10.5.8 with Xcode 3.0

Trying to build in Xcode with the project file for 10.5 yields the same result, no SDKROOT.

I have the 10.5 and 10.4 SDK's installed in the /Developer dir.
 
How do I use this, I mean where does it expect the .kext to be?
Read the comments at the linked GitHub gist webpage for usage info.
The kext can be anywhere. See sample usage in the flashrom archive I linked in one of the .command files which you can view in a text editor or with the cat command.

LSIUtil complains it can't load the DHW dynamic library from the DHW framework.
I meant for LSIUtil to work without the DHW dynamic library by linking in the static library but I forgot to remove the framework from the link command in the make file. It's updated now.

make 2>&1 just dumps a list of make commands for DHW.
I think its dumping a list of commands that it's executing. Perhaps next time you can attach a zipped copy of the terminal log.
Make sure the path is {repository}/DirectHW and not just the root of the {repository}

make directhw dumps an error that there is no SDK specified at the SDKROOT path.

On Leapard 10.5.8 with Xcode 3.0

Trying to build in Xcode with the project file for 10.5 yields the same result, no SDKROOT.

I have the 10.5 and 10.4 SDK's installed in the /Developer dir.
I had updated the 10.4 and 10.6 and latest Xcode projects but not the 10.5 project. The 10.5 project is updated now.
 
Getting nowhere..

Code:
cd ~/joevtstuff/joevt-directhw/DirectHW
james-lyonss-power-mac-g5:DirectHW jam$ make clean
rm -rf build/build10.5
james-lyonss-power-mac-g5:DirectHW jam$ make 2>&1
xcodebuild -alltargets -project DirectHW10.5.xcodeproj    SYMROOT=build/build10.5
(NOTE: project DirectHW10.5 was written by a newer Xcode version (45) -- temporarily downgrading it (without modifying project file))

=== BUILDING NATIVE TARGET KEXT WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...
error: There is no SDK at specified SDKROOT path '/Users/jam/joevtstuff/joevt-directhw/DirectHW/macosx10.4'
** BUILD FAILED **
make: *** [main] Error 1
james-lyonss-power-mac-g5:DirectHW jam$
 
Last edited:
Getting nowhere..
Should be using Xcode 3.1.4 for Leopard at /Developer/Applications/Xcode.app

/Developer/SDKs should have at least MacOSX10.4u.sdk and MacOSX10.5.sdk

Code:
$ make clean
rm -rf build/build10.5

$ make 2>&1
xcodebuild -alltargets -project DirectHW10.5.xcodeproj    SYMROOT=build/build10.5
=== BUILDING NATIVE TARGET KEXT OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

=== BUILDING NATIVE TARGET DirectHW OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

=== BUILDING NATIVE TARGET libDirectHW OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

** BUILD SUCCEEDED **
cc DirectHW.c -dynamiclib -framework IOKit -o build/build10.5/Release/libDirectHW.dylib -g
In file included from DirectHW.c:19:
MacOSMacros.h:75:6: warning: #warning i386
MacOSMacros.h:89:6: warning: #warning SDK 10.5
DirectHW.c: In function 'MyIOConnectCallStructMethod':
DirectHW.c:115: warning: 'IOConnectMethodStructureIStructureO' is deprecated (declared at /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1314)
#cc -static -c DirectHW.c -o build/build10.5/Release/libDirectHW.a

$ sudo make install 2>&1
sudo mkdir -p /usr/local/lib
[[ -e /System/Library/Extensions/DirectHW.kext ]] && sudo rm -R /System/Library/Extensions/DirectHW.kext || :
sudo cp -p -R build/build10.5/Release/DirectHW.kext /System/Library/Extensions/
[[ -e /Library/Frameworks/DirectHW.framework ]] && sudo rm -R /Library/Frameworks/DirectHW.framework || :
sudo cp -p -R build/build10.5/Release/DirectHW.framework /Library/Frameworks/
sudo cp -p build/build10.5/Release/libDirectHW.a /usr/local/lib/
sudo cp -p build/build10.5/Release/libDirectHW.dylib /usr/local/lib/
sudo chmod -R 755 /System/Library/Extensions/DirectHW.kext
sudo chmod -R 755 /Library/Frameworks/DirectHW.framework
sudo chmod 644 /usr/local/lib/libDirectHW.a
sudo chmod 644 /usr/local/lib/libDirectHW.dylib
sudo chown -R root:wheel /System/Library/Extensions/DirectHW.kext
sudo chown -R root:wheel /Library/Frameworks/DirectHW.framework
sudo kextunload -v /System/Library/Extensions/DirectHW.kext || :
kextunload: unload kext /System/Library/Extensions/DirectHW.kext succeeded
sudo kextload -v /System/Library/Extensions/DirectHW.kext
kextload: extension /System/Library/Extensions/DirectHW.kext appears to be loadable
kextload: loading extension /System/Library/Extensions/DirectHW.kext
kextload: /System/Library/Extensions/DirectHW.kext loaded successfully
kextload: sending personalities to kernel:
kextload:     from extension /System/Library/Extensions/DirectHW.kext:
kextload:         DirectHWUserClient
kextload: sending 4 personalities to the kernel
kextload: matching started for /System/Library/Extensions/DirectHW.kext
sudo touch /System/Library/Extensions || :
command -v kmutil > /dev/null && sudo kmutil install --volume-root / --check-rebuild || :
 
Should be using Xcode 3.1.4 for Leopard at /Developer/Applications/Xcode.app

/Developer/SDKs should have at least MacOSX10.4u.sdk and MacOSX10.5.sdk

Code:
$ make clean
rm -rf build/build10.5

$ make 2>&1
xcodebuild -alltargets -project DirectHW10.5.xcodeproj    SYMROOT=build/build10.5
=== BUILDING NATIVE TARGET KEXT OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

=== BUILDING NATIVE TARGET DirectHW OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

=== BUILDING NATIVE TARGET libDirectHW OF PROJECT DirectHW10.5 WITH THE DEFAULT CONFIGURATION (Release) ===

Checking Dependencies...

...

** BUILD SUCCEEDED **
cc DirectHW.c -dynamiclib -framework IOKit -o build/build10.5/Release/libDirectHW.dylib -g
In file included from DirectHW.c:19:
MacOSMacros.h:75:6: warning: #warning i386
MacOSMacros.h:89:6: warning: #warning SDK 10.5
DirectHW.c: In function 'MyIOConnectCallStructMethod':
DirectHW.c:115: warning: 'IOConnectMethodStructureIStructureO' is deprecated (declared at /System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:1314)
#cc -static -c DirectHW.c -o build/build10.5/Release/libDirectHW.a

$ sudo make install 2>&1
sudo mkdir -p /usr/local/lib
[[ -e /System/Library/Extensions/DirectHW.kext ]] && sudo rm -R /System/Library/Extensions/DirectHW.kext || :
sudo cp -p -R build/build10.5/Release/DirectHW.kext /System/Library/Extensions/
[[ -e /Library/Frameworks/DirectHW.framework ]] && sudo rm -R /Library/Frameworks/DirectHW.framework || :
sudo cp -p -R build/build10.5/Release/DirectHW.framework /Library/Frameworks/
sudo cp -p build/build10.5/Release/libDirectHW.a /usr/local/lib/
sudo cp -p build/build10.5/Release/libDirectHW.dylib /usr/local/lib/
sudo chmod -R 755 /System/Library/Extensions/DirectHW.kext
sudo chmod -R 755 /Library/Frameworks/DirectHW.framework
sudo chmod 644 /usr/local/lib/libDirectHW.a
sudo chmod 644 /usr/local/lib/libDirectHW.dylib
sudo chown -R root:wheel /System/Library/Extensions/DirectHW.kext
sudo chown -R root:wheel /Library/Frameworks/DirectHW.framework
sudo kextunload -v /System/Library/Extensions/DirectHW.kext || :
kextunload: unload kext /System/Library/Extensions/DirectHW.kext succeeded
sudo kextload -v /System/Library/Extensions/DirectHW.kext
kextload: extension /System/Library/Extensions/DirectHW.kext appears to be loadable
kextload: loading extension /System/Library/Extensions/DirectHW.kext
kextload: /System/Library/Extensions/DirectHW.kext loaded successfully
kextload: sending personalities to kernel:
kextload:     from extension /System/Library/Extensions/DirectHW.kext:
kextload:         DirectHWUserClient
kextload: sending 4 personalities to the kernel
kextload: matching started for /System/Library/Extensions/DirectHW.kext
sudo touch /System/Library/Extensions || :
command -v kmutil > /dev/null && sudo kmutil install --volume-root / --check-rebuild || :
Ok let me update Xcode and I'll likely have more success, as this did build for me before.
 
Well updating Xcode did fix the build issues and I built all three and installed them as you outlined in post #33.

However anything that actually tries to use DirectHW just locks up my G5 and I have to do a hard reset is I run lspci -nnvvv or LSIUtil.

I did not unload the LSI cards .kext before trying to run LSIUtil so that could be the issue there, but same as the lspci I built before, it just locks up the Mac with no useful debug info, and upon reboot I do not get the message that comes with the error report to give us any idea why it's locking up.
 
Last edited:
Well updating Xcode did fix the build issues and I built all three and installed them as you outlined in post #33.

However anything that actually tries to use DirectHW just locks up my G5 and I have to do a hard reset is I run lspci -nnvvv or LSIUtil.

I did not unload the LSI cards .kext before trying to run LSIUtil so that could be the issue there, but same as the lspci I built before, it just locks up the Mac with no useful debug info, and upon reboot I do not get the message that comes with the error report to give us any idea why it's locking up.
Did you try the lsiutil -o command or the setpci command setpci?

Change the darwin3 pciutils code so it only scans bus 0? Do something...
 
With Power Macs, a hang can occur when probing a non-existent device or accessing certain bytes in config space of some devices.

For example, device 1191:0009 may hang if you try to read PCI config space register 0x54.

Probing non-existent devices connected to the built-in PCI-PCI bridge of a B&W G3 can cause a hang.

The 106b:0074 U4 HT Bridge of a Quad G5 requires offset adjustment for 1 and 2 byte accesses of all PCI config space registers.

DirectHW handles those three cases but it may need code to handle additional cases.

You can try lspci in Linux, or my lspci for Open Firmware script. #1 to see if either of those methods causes a hang.
 
@joevt Thank you for you work. I've successfully built lsiutil and the prerequisites on my PPC Mac and I have two different HBAs to test it with, but I didn't get too far. Lsiutil complains about no firmware being found, and unloading the driver kext doesn't seem to help. Do you have an idea what to try next?

Code:
user@home-dt-3 1.70 % sudo ./lsiutil

LSI Logic MPT Configuration Utility, Version 1.72, Sep 09, 2014

01/0a/00/0 (SAS1064E B3) is in RESET state, Doorbell is 00000024

01/07/08/0 (53C1020A A1) is in RESET state, Doorbell is 00000024

2 MPT Ports found

     Port Name         Chip Vendor/Type/Rev    MPT Rev  Firmware Rev  IOC
 1.  01/0a/00/0        LSI Logic SAS1064E B3     000      00000000     0
 2.  01/07/08/0        LSI Logic 53C1020A A1     000      00000000     0

Select a device:  [1-2 or 0 to quit] 2

The firmware on this 53C1020A A1 appears broken!
A valid firmware image is required to make this chip operational...

Enter firmware filename: ^C
user@home-dt-3 1.70 % sudo kextunload -v /System/Library/Extensions/LSIUltra320.kext
kextunload: unload kext /System/Library/Extensions/LSIUltra320.kext succeeded
user@home-dt-3 1.70 % sudo ./lsiutil                                               

LSI Logic MPT Configuration Utility, Version 1.72, Sep 09, 2014

01/0a/00/0 (SAS1064E B3) is in RESET state, Doorbell is 00000024

01/07/08/0: Failed to clear RESET ADAPTER

01/07/08/0 (53C1020A A1) is in UNKNOWN state, Doorbell is ffffffff

2 MPT Ports found

     Port Name         Chip Vendor/Type/Rev    MPT Rev  Firmware Rev  IOC
 1.  01/0a/00/0        LSI Logic SAS1064E B3     000      00000000     0

01/07/08/0: Failed to clear RESET ADAPTER
 2.  01/07/08/0        LSI Logic 53C1020A A1     000      00000000     0

Select a device:  [1-2 or 0 to quit]

Here's the lspci output for both adapters:

Code:
0001:07:08.0 SCSI storage controller [0100]: Broadcom / LSI 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI [1000:0030] (rev c1)
    Subsystem: Hewlett-Packard Company SC11Xe Ultra320 Single Channel PCIe x4 SCSI Host Bus Adapter (412911-B21) [103c:322a]
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 248 (4000ns min, 1500ns max), Cache Line Size: 512 bytes
    Interrupt: pin A routed to IRQ 0
    Region 0: I/O ports at 0000
    Region 1: Memory at 80120000 (64-bit, non-prefetchable)
    Region 3: Memory at 80100000 (64-bit, non-prefetchable)
    Expansion ROM at 80200000 [disabled]
    Capabilities: [50] Power Management version 2
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [58] MSI: Enable- Count=1/1 Maskable- 64bit+
        Address: 0000000000000000  Data: 0000
    Capabilities: [68] PCI-X non-bridge device
        Command: DPERE- ERO- RBC=512 OST=8
        Status: Dev=07:08.0 64bit+ 133MHz+ SCD- USC- DC=simple DMMRBC=2048 DMOST=8 DMCRS=16 RSCEM- 266MHz- 533MHz-

0001:0a:00.0 SCSI storage controller [0100]: Broadcom / LSI SAS1064ET PCI-Express Fusion-MPT SAS [1000:0056] (rev 08)
    Subsystem: Broadcom / LSI Device [1000:3090]
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 0, Cache Line Size: 512 bytes
    Interrupt: pin A routed to IRQ 0
    Region 0: I/O ports at 1000
    Region 1: Memory at 80300000 (64-bit, non-prefetchable)
    Region 3: Memory at 80310000 (64-bit, non-prefetchable)
    Expansion ROM at 80400000 [disabled]
    Capabilities: [50] Power Management version 2
        Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Capabilities: [68] Express (v1) Endpoint, IntMsgNum 0
        DevCap:    MaxPayload 4096 bytes, PhantFunc 0, Latency L0s <64ns, L1 <1us
            ExtTag+ AttnBtn- AttnInd- PwrInd- RBE- FLReset- SlotPowerLimit 0W TEE-IO-
        DevCtl:    CorrErr- NonFatalErr- FatalErr- UnsupReq-
            RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop+
            MaxPayload 128 bytes, MaxReadReq 512 bytes
        DevSta:    CorrErr+ NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
        LnkCap:    Port #0, Speed 2.5GT/s, Width x8, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
            ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
        LnkCtl:    ASPM Disabled; RCB 64 bytes, LnkDisable- CommClk-
            ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
        LnkSta:    Speed 2.5GT/s, Width x4 (downgraded)
            TrErr- Train- SlotClk- DLActive- BWMgmt- ABWMgmt-
    Capabilities: [98] MSI: Enable- Count=1/1 Maskable- 64bit+
        Address: 0000000000000000  Data: 0000
    Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Vector table: BAR=1 offset=00002000
        PBA: BAR=1 offset=00003000
 
Which PPC Mac and which Mac OS X version?
Are the cards PCI, PCI-X, or PCIe?

You didn't show what happened after the second Select a device: [1-2 or 0 to quit] prompt. Was the result the same as the first?

I have no way to test this.

Can you attach Xcode to the process to debug? This may be easier if you create an Xcode project to build the product. Makefile_Mac is small so it shouldn't be too difficult. The only compilable file is lsiutil.c - everything else is an include file (even if it has a .c file extension).

Alternatively, you can add debug code to determine where it's failing. Start from the main function.
Be careful of single line if, for, while, else statements that don't have braces. You need to add { and } if you want to add a printf to them.

Add debug code that shows why it produces the The firmware on this 53C1020A A1 appears broken! message.
That means add a printf for every line that accesses fw_image to see what's happening.

There's some fw_image code that is used only by low level versions of lsiutil (the DOS and EFI versions). I did make sure that the Mac OS X version had the same features as the DOS and EFI versions though I don't know if those features work or if those features are related to what you're doing.

If you have access to DOS or EFI, then I would use those versions of lsiutil to verify that this is a problem with the Mac OS X version. I don't know how to build the DOS or EFI versions.
 
Which PPC Mac and which Mac OS X version?
Are the cards PCI, PCI-X, or PCIe?
Both HBAs are PCIe. Although, the 53C1020A seems to use a PCI-X to PCIe bridge.

Here's what happens if I try to use lsiutil after unloading the kext for the 53C1020A. The kext for the SAS1064E I didn't unload as I'm booting off this device.

Code:
user@home-dt-3 1.70 % sudo kextunload -v /System/Library/Extensions/LSIUltra320.kext
kextunload: unload kext /System/Library/Extensions/LSIUltra320.kext succeeded
user@home-dt-3 1.70 % sudo ./lsiutil                                               

LSI Logic MPT Configuration Utility, Version 1.72, Sep 09, 2014

01/0a/00/0 (SAS1064E B3) is in RESET state, Doorbell is 00000024

01/07/08/0: Failed to clear RESET ADAPTER

01/07/08/0 (53C1020A A1) is in UNKNOWN state, Doorbell is ffffffff

2 MPT Ports found

     Port Name         Chip Vendor/Type/Rev    MPT Rev  Firmware Rev  IOC
 1.  01/0a/00/0        LSI Logic SAS1064E B3     000      00000000     0

01/07/08/0: Failed to clear RESET ADAPTER
 2.  01/07/08/0        LSI Logic 53C1020A A1     000      00000000     0

Select a device:  [1-2 or 0 to quit] 2

01/07/08/0: Failed to clear RESET ADAPTER

01/07/08/0 (53C1020A A1) is in UNKNOWN state, Doorbell is ffffffff

50.  Dump MPT registers
51.  Dump chip memory regions
52.  Read/modify chip memory locations
54.  Identify FLASH device
99.  Reset port

Main menu, select an option:  [1-99 or e/p/w or 0 to quit] 99

01/07/08/0: Failed to clear RESET ADAPTER

01/07/08/0 (53C1020A A1) is in UNKNOWN state, Doorbell is ffffffff

Resetting port...

01/07/08/0: Failed to clear RESET ADAPTER
Failed to reset port!

50.  Dump MPT registers
51.  Dump chip memory regions
52.  Read/modify chip memory locations
54.  Identify FLASH device
99.  Reset port

Main menu, select an option:  [1-99 or e/p/w or 0 to quit] 54

01/07/08/0: Failed to clear RESET ADAPTER

01/07/08/0 (53C1020A A1) is in UNKNOWN state, Doorbell is ffffffff

zsh: segmentation fault  sudo ./lsiutil

It seems to me that lsiutil fails to read anything from the devices in the first place, otherwise the PMT Rev and Firmware Rev fields wouldn't show zeros.

I tried to build it under Adelie Linux, but it failed due to a missing kmod as the dependency (which wouldn't be the last roadblock, I imagine). The old unmodified lsiutil binaries for Windows and DOS worked fine with those HBAs before on a PC. I built from your source again using Xcode 3.x on the PPC Mac and had to jump through some hoops to launch the binary as root from the IDE, but I'm not sure my project is set up correctly for debugging. If you have the time, please take a look (archive attached) and I'll try to be more helpful.
 

Attachments

  • lsiutil_xcode.zip
    916.4 KB · Views: 4
I would try building it with the Xcode compiler instead of using external build.
Start with a C++ sample project to create the project file. Close the project file. Move the project file into the lsiutil folder. Open it in Xcode. Adjust settings. Remove main.cpp.
Add all the lsiutil source files but don't add them to the target. Only add lsiutil.c to the lsiutil target.
Set the C Flags to those that are used by Makefile_Mac (add a -DMACOSX custom C flag)
Make sure optimizations is disabled for the Debug configuration.
Ask it to create symbols (dwarf and dSYM) (dSYM requires Xcode 4? gstabs is good enough).
Add the static libraries libpci.a and libDirectHW.a from your /usr/local/lib folder.
Add the IOKit framework from the SDK (System/Library/Frameworks/IOKit.framework).
Add the z dynamic library from the SDK (usr/lib/libz.dylib)
Make sure all file references use relative paths (except the static libraries which are absolute but that just means relative to /)

I added an Xcode project file to GitHub. I think it has everything required from above.

I don't think old Xcode allows launching apps as root? Therefore, you may need to launch the app and then tell Xcode to attach to the app (process) while the app is waiting at its prompt.

Or, you can run Xcode as root:
Code:
sudo /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
 
I added an Xcode project file to GitHub. I think it has everything required from above.
Thanks, I'll give it a try.

I tried launching Xcode as root from the shell first just as you suggested, but it errors out. So, the only way is using remote debugging via ssh to root@localhost.
 
My experience with C is pretty limited, but I managed to do preliminary debugging with breakpoints. Right after the breakpoint on the screenshot, the call stack collapses to main function, which then proceeds to print out Port, Name and the rest of the values for the adapter. At the breakpoint the relevant variables in the port structure (e.g., fwVersion) are still empty. Lsiutil is running as root, ofc.

To rule out issues with DirectHW, I tried reading some registers from the same device with setpci and it worked.

Picture 6.png
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.