Skip to content
hackintosh-stuffPublic

About

IOKit kext for LSI/Avago MPI 2.0 SAS2 controllers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MPS — Fusion-MPT SAS2 for macOS

Date: 2026-11-15. Driver version: 0.1.0.

MPS is an IOKit kext for LSI/Avago MPI 2.0 SAS2 controllers. It adapts the FreeBSD mps controller protocol to macOS, using the adjacent MPR project's macOS scheduling and block-storage glue as a read-only reference. It has its own com.maz1.MPS bundle, MPSController, MPSBlockDev, MPSUserClient, boot arguments and management utility. MPR and MPS target different PCI IDs; MPR's historical SAS3008 results do not apply to this source.

Hardware and protocol scope

The exact FreeBSD mps_pci.c table contains 17 unique vendor 0x1000 IDs:

Family Device IDs
SAS2004 / SAS2008 0070, 0072
SAS2108 0074, 0076, 0077
SAS2116 0064, 0065
SAS2208 0080, 0081, 0082, 0083, 0084, 0085
SAS2308 0086, 0087, 006e
SSS6200 WarpDrive 007e

These are the implemented device IDs. Facts must report MPI 2.0. There are no SAS3 FastPath, IEEE SGE, NVMe, atomic-post, GEN35 or SEA paths. WarpDrive applies its Manufacturing Page 10 hide/expose policy and uses ordinary IR-volume I/O; the optional DirectDrive optimization is not implemented. IT/IR runtime mode must be determined from Facts/configuration pages.

All resident hardware DMA pools use the controller's retained per-device IOMapper through IODMACommand. They require a single aligned device-visible IOVA below 4 GiB and reject incompatible or bounced mappings without falling back to host physical addresses. The translated-mapper path has run under an IOMMU on the test machine.

Implemented source paths

  • Bounded diagnostic reset, doorbell handshake, MPI2 Facts/Init, credit-bound queues, one reply ring, interrupt delivery and a bounded polling fallback.
  • 12-byte MPI Simple64/Chain64 SGLs, DWORD chain offsets, per-command sense, direct client mappings and independently owned resident fallback buffers.
  • SAS/SATA and IR-volume discovery, member filtering, multi-LUN probing, bounded controller-local path selection, events/ACK and raw event history.
  • Per-LUN block nubs through IOBlockStorageDevice and the system's IOBlockStorageDriver: READ/WRITE(10)/(16), capacity, sense, cache flush, FUA policy and advertised-limit UNMAP.
  • Timeout/TMF escalation and IOC recovery without replaying writes whose completion is uncertain; DMA ownership survives timeout until completion or a proved IOC stop.
  • Immutable nub bindings checked at admission; media invalidation, removal, retirement, native power management and wake rebuild/revalidation.
  • Root/boot-gated native IOUserClient management and tools/mpsctl.py, with rebuilt SAS2 DMA descriptors rather than caller-provided physical pointers.

Runtime verification to date covers: controller attach and enumeration, block publication of a disk with a verified serial, raw read integrity matching Linux mpt3sas hashes, a request-size/queue-depth read matrix over both DMA paths, bounded writes verified and restored, filesystem-triggered SYNCHRONIZE CACHE, TMF ABORT/LUN/TARGET escalation and IOC-reset recovery, sleep/wake, shutdown, maintenance mode and the management refusal matrix, a sustained read soak, and a physical hotplug cycle: removal retires the target with a TARGET_RESET and a bounded IOC re-init, leaves a clean empty topology, and reinsertion re-probes the same identity into a republished medium with unchanged read hashes. Still unverified: SAS SSP, expanders, enclosures, IR arrays, multi-LUN, EEDP/TLR, and UNMAP/FUA traffic (no userspace or filesystem caller). Detailed implementation and honest gaps are in DEBUG.md and PLAN.md. PROTOCOL.md lists the SAS2 conversion boundaries. TESTING.md is the hardware test project, with risk, prerequisites, byte-level acceptance criteria and rollback.

Build

On a macOS x86_64 host with Command Line Tools:

python3 tools/validate-build-inputs.py
sh tools/build-noxcode.sh

The native script builds build/MPS.kext, checks kmod entry points and driver-symbol closure, validates the plist and applies an ad-hoc signature. It does not install, load, inject, modify an ESP or rebuild a kernel collection. The Xcode project is MPS.xcodeproj; MacKernelSDK is a separate dependency.

The host-only protocol and management decoders run on any machine with a C++17 compiler:

c++ -std=c++17 -Wall -Wextra -Werror -fsanitize=address,undefined \
    tools/test_sas2.cpp -o /tmp/mps-sas2-protocol
/tmp/mps-sas2-protocol
python3 tools/test_management.py

The independent decoder checks actual MPI bytes; it does not emulate a controller.

Runtime options

Diagnostics are silent by default. mps_debug=1 enables kernel messages and diagnostic IORegistry properties. mps_io_depth=N requests 1–32 asynchronous command windows, constrained further by Facts and available memory. mps_direct_dma=0 forces the resident fallback path for comparison.

mps_mgmt=1 enables the administrator control interface. mps_maintenance=1 also enables management and suppresses block-media publication. Media, firmware and array mutations require maintenance mode and the CLI's explicit mutation acknowledgement. Fault-injection switches are for a separately authorized recovery test only; they are never enabled by default.

python3 tools/mpsctl.py list
sudo python3 tools/mpsctl.py info --registry-id <registry-id>
sudo python3 tools/mpsctl.py targets --registry-id <registry-id>
sudo python3 tools/mpsctl.py events --registry-id <registry-id>

Installation boundary

Installation/loading, OpenCore edits, reboot/power operations and test-disk writes require explicit authorization for those operations. Installation uses only the ESP of an internal disk, EFI/OC/Kexts/MPS.kext and a validated Kernel > Add entry; never /Library/Extensions, another system volume or a USB EFI. Follow TESTING.md before deployment. Preserve the notices in NOTICE with binary redistribution.

About

IOKit kext for LSI/Avago MPI 2.0 SAS2 controllers

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages