libusbhsfs 0.1.0

DarkMatterCore travaille, depuis un bon mois maintenant, en collaboration avec XorTroll et Rhys Koedijk, à la mise au point d’une librairie qui manquait cruellement au monde des homebrews sur Switch : le support des périphériques USB (qui restait jusqu’à présent l’apanage de SXOS). Et on peut dire que les avancées ont été rapides et spectaculaires ! Après avoir développé le support des formats de partition FAT, FAT32 et exFAT, c’est au tour du NTFS d’arriver (grâce à Rhys Koedijk) ! Certes, pour le commun des mortels, cette news n’est pas forcément des plus intéressantes, mais, plus concrètement, Tinleaf (mais aussi DBI) profite déjà de cette librairie, et il ne fait aucun doute que ça va se répandre comme une traînée de poudre sur une bonne partie des homebrews actuellement disponibles. Les prochaines semaines devraient être riches en nouveautés pour la scène homebrews Switch.

Pour éviter tout emballement ou quiproquo sur ce support des périphériques USB…ça ne concerne PAS Atmosphère, n’imaginez donc pas pouvoir installer des NSP sur un disque dur 😉
La position de SciresM a toujours été claire quant au piratage (copies légitimes ou pas, il met tout dans le même panier, même des forwarders pour homebrews ne peuvent être lancés sur un Atmosphère « vanilla », c’est pour dire !), n’espérez donc pas des avancées fracassantes à ce sujet…on pourrait néanmoins imaginer que Homebrew Launcher soit mis à jour pour supporter cette librairie…on l’espère du moins.

↓ Nouveautés / Corrections (cliquer pour voir) ↓

v0.1.0:

  • Built using libnx commit c51918a.
  • Implemented partition table parsing (MBR/GPT/VBR). The library now takes care of looking for boot sectors and/or partition tables on its own, and just passes volume LBAs to filesystem libraries. This makes it possible to mount multiple partitions from the same logical unit as individual devoptab devices.
  • Implemented NTFS support. Big thanks to Rhys Koedijk!
    • You must link your application against both libusbhsfs and NTFS-3G if you wish to use NTFS support. Please read the How to build section from the README to know how to build NTFS-3G and install it into the portlibs directory from devkitPro.
    • Certain limitations apply. Please read the Limitations section from the README for more information.
    • Dual licensing (ISC / GPLv2+) is now provided as a way to allow projects that don’t comply with the GPLv2+ license from NTFS-3G to keep using libusbhsfs, albeit with FAT support only. Please read the Licensing section from the readme for more information.
  • Improved safety checks in all internal devoptab functions.
  • Library API:
    • usbHsFsUnmountDevice() is now provided as a way to manually/safely unmount UMS devices at runtime before disconnecting them.
      • This has been always been automatically handled by usbHsFsExit() if there are any mounted UMS devices when the library interface is closed. So, depending on what you need, you should only call usbHsFsUnmountDevice() when absolutely necessary.
    • usbHsFsGetFileSystemMountFlags() and usbHsFsSetFileSystemMountFlags() are now provided as a way to get/set filesystem mount flags.
      • Please read include/usbhsfs.h for more information about these flags and what they do.
      • These flags only affect NTFS volume mounting at this moment, so they have no effect under ISC licensed builds of the library.
      • Furthermore, these functions have no effect at all under SX OS.
  • BOT driver:
    • Inquiry SCSI command is now retried if an unexpected CSW with no sense data is received.
    • Both peripheral qualifier and peripheral device type values from Inquiry data are now filtered. Thanks to ginkuji for reporting this issue.
    • Logical unit startup now returns right away if an optional SCSI command fails and a Medium Not Present additional sense code is reported by the UMS device.
    • A bus reset is now performed on all UMS devices that are already available when usbHsFsInitialize() is called. Fixes logical unit startup for drives that were stopped during a previous session, but not removed from the console. Thanks to FlyingBananaTree for reporting this issue.
    • Fixed potential memory corruption issues that could have taken place due to not updating LUN/FS context references after reallocating their buffers.
  • Debug build:
    • Implemented proper caching into debug logging code, making debug builds a lot faster now.
    • The logfile is now flushed each time a public API function that generates log messages is called.
  • SX OS:
    • The status change user-mode event is now signaled on every usbfs status change.
  • Example test application:
    • Updated to reflect all these changes.
    • Added more filesystem tests.
    • Rewrote input handling to match the new pad API from libnx.
    • Now using usbHsFsUnmountDevice() to safely unmount any UMS devices that have already been tested

 

Fait rare à signaler, Blawar, pourtant réputé pour être extrêmement fermé et avoir une vision très « personnelle » (c’est peu de le dire) des homebrews sur Switch, a apporté sa contribution. De nombreuses discussions avec DarkMatterCore, principalement sur GBAtemp, ont permis de faire avancer les choses. Il a également été l’un des premiers à utiliser cette librairie (notamment dans son fork de Goldleaf).

 

Github | GBAtemp