dukzcry / osx-goodies

Kernel extensions for macOS which I wrote
58 stars 21 forks source link

The current mfi driver does not support configuration changes. #11

Closed eweiman closed 6 years ago

eweiman commented 6 years ago

Is there a way you can make it so that the driver can change the configuration from inside OSX? Windows doesn't really boot reliably in this system, and I'd really like to not have Windows installed just to be a drive controller manager. And the BIOS configuration tool can't be invoked during boot to a BIOS based OS. This has always been an issue, just wishing it could be fixed. FWIW running macOS 10.13.4 at this point in time. 17.5.0 Darwin Kernel Version 17.5.0: Mon Mar 5 22:24:32 PST 2018; root:xnu-4570.51.1~1/RELEASE_X86_64 x86_64

Running this in a real Mac Pro 2008 (3,1).

macpro-osx:~ user$ mfiutil version mfiutil version 1.0.14 macpro-osx:~ user$ mfiutil show adapter mfi0 Adapter: Product Name: MegaRAID SAS 84016E Serial Number: W� Firmware: 7.0.1-0083 RAID Levels: JBOD, RAID0, RAID1, RAID5, RAID6, RAID10, RAID50 Battery Backup: not present NVRAM: 32K Onboard Memory: 256M Minimum Stripe: 8K Maximum Stripe: 1M

macpro-osx:~ user$ mfiutil show firmware mfi0 Firmware Package Version: 7.0.1-0083 mfi0 Firmware Images: Name Version Date Time Status BTBL R.2.3.15 May 20 2008 16:09:27 active BIOS MT33 active MPT1 MPTFW-01.18.172.00-IT 01/31/11 16:49:08 active APP 1.12.330-1300 Jun 10 2011 16:13:27 active BCON 1.1-33j-e_11-Rel Aug 20 2009 21:16:24 active CTLR 1.04-019A Aug 13 2007 23:21:34 active MPT3 MPTFW-01.18.172.00-IT 01/31/11 16:49:29 active PCLI 01.00-011:#%00001 Oct 10 2007 16:30:36 active

macpro-osx:~ user$ mfiutil show drives mfi0 Physical Drives: 0 ( 1863G) ONLINE <Hitachi HUA72202 A3MA serial=JK11SDFGAHVE12T> SATA E1:S0 1 ( 1863G) UNCONFIGURED GOOD <WDC WD20EARX-00P AB51 serial=WD-WCAGER601786> SATA E1:S1 2 ( 1863G) UNCONFIGURED GOOD <Hitachi HUA72202 A3MA serial=JK113SDRHKH0RU> SATA E1:S2

macpro-osx:~ user$ mfiutil show config mfi0 Configuration: 1 arrays, 1 volumes, 0 spares array 0 of 1 drives: drive 0 ( 1863G) ONLINE <Hitachi HUA72202 A3MA serial=JK1130YAHVE12T> SATA volume mfid0 (1862G) RAID-0 64K OPTIMAL <Test> spans: array 0

macpro-osx:~ user$ mfiutil show volumes mfi0 Volumes: Id Size Level Stripe State Cache Name mfid0 ( 1862G) RAID-0 64K OPTIMAL Enabled <Test>

macpro-osx:~ user$ mfiutil create raid0 1 2 mfiutil: The current mfi(4) driver does not support configuration changes.

macpro-osx:~ user$ kextstat |grep -i raid 71 0 0xffffff7f82e99000 0x6000 0x6000 com.apple.driver.SASMegaRAID (1) B0BE719F-82C0-3F9A-B372-088ADC14A6B8 <70 12 5 4 3 1>

02:0e.0 RAID bus controller [0104]: LSI Logic / Symbios Logic MegaRAID SAS 1068 [1000:0411] Subsystem: LSI Logic / Symbios Logic MegaRAID SAS 84016E [1000:1008] Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping+ SERR- FastB2B- DisINTx+ Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx- Latency: 64 (32000ns min), Cache Line Size: 256 bytes Interrupt: pin A routed to IRQ 16 Region 0: Memory at 94540000 (32-bit, prefetchable) Region 2: Memory at 94500000 (32-bit, non-prefetchable) Expansion ROM at ffff8000 [disabled] Capabilities: [c0] Power Management version 2 Flags: PMEClk- DSI- D1+ D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-) Status: D0 PME-Enable- DSel=0 DScale=0 PME- Capabilities: [d0] Message Signalled Interrupts: Mask- 64bit+ Queue=0/1 Enable+ Address: 00000000fee00000 Data: 4076 Capabilities: [e0] PCI-X non-bridge device Command: DPERE- ERO- RBC=512 OST=4 Status: Dev=02:0e.0 64bit+ 133MHz+ SCD- USC- DC=bridge DMMRBC=1024 DMOST=4 DMCRS=16 RSCEM- 266MHz- 533MHz- Capabilities: [100] #1000 Capabilities: [041] #00

macpro-osx:Extensions user$ md5 SASMegaRAID.kext/Contents/Info.plist MD5 (SASMegaRAID.kext/Contents/Info.plist) = 644b85690d147693a4b7a9d07a101139 macpro-osx:Extensions user$ md5 SASMegaRAID.kext/Contents/MacOS/SASMegaRAID MD5 (SASMegaRAID.kext/Contents/MacOS/SASMegaRAID) = 0b37bd5dbf35bcc96d29971a15653905

dukzcry commented 6 years ago

@eweiman

Is there a way you can make it so that the driver can change the configuration from inside OSX?

Unfortuntately I can't, I don't use Macs anymore. But patches from other people are welcome though.

eweiman commented 6 years ago

Thanks for the quick reply. I'm not sure where to begin to do it or if it was even feasible. As such, I'll close this out and if in the future someone knows they could re-open / comment.

dukzcry commented 6 years ago

@eweiman You should look at mfiutil source code, https://github.com/freebsd/freebsd/tree/master/usr.sbin/mfiutil particulary starting from https://github.com/freebsd/freebsd/blob/master/usr.sbin/mfiutil/mfi_cmd.c#L206 and also mfi driver https://github.com/freebsd/freebsd/tree/master/sys/dev/mfi Note that mfi driver and SASMegaRAID driver are different, so blind copy & paste will not work.