Files
AnyPS5/docs/dev/debt/libSceUsbStorage.md
T
primesoul-web 4d98d9a2cd Merge upstream/main: adopt the restored UsbStorage ABI over the no-device path
Take main's restored signatures (the firmware-database sweep of 2026-10-21):
the typed UsbStorageCallback across the register/unregister family, the
UsbStorageDeviceInfo-typed device-info query, IsExist's three-argument bool
form (succeeds and reports non-existence with no device attached), and
RequestMap's six parameters with the trailing reserved pair dropped. The
no-device answers and the argument validation are unchanged; the guest test
passes an APS5_VABI callback and pins the exists out-parameter.
2026-10-22 07:49:05 +00:00

6.0 KiB

libSceUsbStorage technical debt

Silent stubs

  • sceUsbStorageInit, sceUsbStorageTerm (libSceUsbStorage) - no USB mass-storage device is ever attached, so there is nothing to initialize or tear down: both accept every call and keep no state, as shadPS4 does with its plain ORBIS_OK returns. A passthrough that lists devices must build its list in Init and free it in Term.

Unknown function info

Functional

  • the argument validation (libSceUsbStorage) - the null-pointer, null-callback, event-type and null-directory refusals with 0x80f40002, and the getdents read of a never-opened descriptor answering 0x80f40005 with zero bytes, follow shadPS4; the validation runs before the markers the register, unregister, unmap and getdents-close exports keep above. None of this is measured on a console.
  • the no-device answers (libSceUsbStorage) - AnyPS5 has no USB mass-storage passthrough, so no device is ever attached: the device list is empty, sceUsbStorageIsExist succeeds and reports non-existence for every device id and directory, and the device-info query and the map and getdents-open requests answer 0x80f40004 for every device id. A passthrough that lists devices follows shadPS4's virtual-device model at the same commit for the filled paths, including its packed dirent.
  • the device-info record (libSceUsbStorage) - the 0x338-byte record a passthrough fills for sceUsbStorageGetDeviceInfo is unverified on hardware; its layout follows SharpProspero, which recovered it from the module's own export and was checked against #6288's "volume size at 0x0": the u64 volume size at offset 0, the vendor, product and serial strings at 0x16, 0x120 and 0x228, and the flags field the service masks with 0xd0 at 0x330. shadPS4's record starts with a u32 device id at offset 0; filling it that way puts a device id where a title reads the volume size.
  • the prototypes of sceUsbStorageRequestMap and sceUsbStorageGetDeviceList (libSceUsbStorage) - the signatures follow the ABI restored on main (the firmware-database sweep of 2026-10-21), which matches shadPS4: RequestMap's six parameters, the typed UsbStorageCallback of the register/unregister family, IsExist's three-argument bool form and GetDeviceList's std::int32_t* count (the count also follows SharpProspero, whose earlier eight-parameter RequestMap reading carried the trailing reserved pair the restored ABI drops).