Official libiosuhax - PPC IPC library for communication to /dev/iosuhax

Discussion in 'Wii U - Homebrew' started by dimok, Nov 17, 2016.

  1. icw35

    icw35 GBAtemp Fan

    Member
    480
    108
    Sep 22, 2010
    Nvm. I just found the release notes on how to include :)
     


  2. icw35

    icw35 GBAtemp Fan

    Member
    480
    108
    Sep 22, 2010
    So, I compiled everything and got it all working. Wow. Simply wow. FTP everywhere...auto mount of SD everything works nicely!

    FanBloodyTastic.

    Thank you Dimok for this wonderful tool.
     
    QuarkTheAwesome likes this.
  3. dimok
    OP

    dimok GBAtemp Advanced Fan

    Member
    721
    2,079
    Jan 11, 2009
    United States
    Yep basically that's how it works yes. You can use the FSA_RawOpen() / Read/Write/Close functions of libiosuhax to access it even from PPC and dump whatever device you want in raw form to a file on the SD card.
     
  4. brienj

    brienj Trying to avoid getting cancer

    Member
    1,232
    1,691
    Jan 3, 2016
    United States
    I echo your sentiment. I've been pretty non-existent for two months for a variety of reasons, and they aren't all because I've been busy ...

    I hope to at least get something contributed soon, it all depends on a few things though.
     
    QuarkTheAwesome and Billy Acuña like this.
  5. ploggy

    ploggy WAKA! WAKA!

    Member
    1,178
    664
    Aug 29, 2007
    Is there any chance you could add this new lib to Retroarch please? Retroarch WiiU is pretty good already but file loading times are deadly lol
    and if this new lib could help even a little, it will be worth it :)

    Thanks
     
  6. Plasma816

    Plasma816 Advanced Member

    Newcomer
    68
    8
    Aug 9, 2016
    United States
    What happens if I turn the Wii U off while something in ft2sd is dumping?
     
  7. lordelan

    lordelan GBAtemp Maniac

    Member
    1,423
    394
    Jan 4, 2015
    Gambia, The
    Dumping is a read process not a write process so your dump might be corrupted but the Wii U should still be fine.
     
    AboodXD likes this.
  8. Plasma816

    Plasma816 Advanced Member

    Newcomer
    68
    8
    Aug 9, 2016
    United States
    Didn't really care about dumping stuff THAT much anyway, so thanks.
     
  9. efen3001

    efen3001 GBAtemp Regular

    Member
    153
    36
    Apr 21, 2011
    United States
    Thank you!
     
  10. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    I successfully compiled the static library libiosuhax.a but I'm having trouble linking against it:
    Code:
    D:\Consoles\WiiU\Applications\Browser\tcpgecko>make
    linking ... tcpgecko.elf
    c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.8.2/../../../../powerpc-eabi/bin/ld.exe: cannot find -liosuhax
    collect2.exe: error: ld returned 1 exit status
    make[1]: *** [/d/Consoles/WiiU/Applications/Browser/tcpgecko/tcpgecko.elf] Error 1
    make: *** [build] Error 2
    The way I edited the Makefile is as follows:
    Code:
    LIBS    := -lz -liosuhax # the last part has been added
    And I placed the libiosuhax.a in the project root directory:
    Warning: Spoilers inside!
    I also tried placing it in the src folder/build folder and renaming but it always gave me the same compilation error. This might be pretty nooby but help is appreciated, thanks. My repository is here.
     
    Last edited by BullyWiiPlaza, Mar 31, 2017
  11. Zarklord

    Zarklord GBAtemp Regular

    Member
    172
    57
    May 13, 2016
    United States
    you do "make install" after doing "make", which copies the files into the correct devkitPPC folder, and then do make on your project, you don't need to copy libiosuhax.a anywhere manually.
     
  12. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    It doesn't seem like it copied itself there, why are you saying that? dimok said you need to edit the makefile and according to you, it works without but it doesn't:
    Code:
    D:\Consoles\WiiU\Applications\Browser\haxchi\installer>make
    main.c
    d:/Consoles/WiiU/Applications/Browser/haxchi/installer/src/main.c:14:21: fatal error: iosuhax.h: No such file or directory
     #include <iosuhax.h>
                         ^
    compilation terminated.
    make[1]: *** [main.o] Error 1
    make: *** [build] Error 2
     
    Last edited by BullyWiiPlaza, Mar 31, 2017
  13. Zarklord

    Zarklord GBAtemp Regular

    Member
    172
    57
    May 13, 2016
    United States
    this is what happens for me when i run those commands and then it works perfectly fine upload_2017-3-31_15-31-13.png
     
  14. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    Nevermind, sorry
     
  15. nexusmtz

    nexusmtz GBAtemp Maniac

    Member
    1,201
    405
    Feb 17, 2016
    United States
    DRIVE-BY observation: Wouldn't you either specify the lib before the switches, or put the name of the library after the -l? Without looking at everything else, I'd have used -liosuhax if the lib was named iosuhax.a. Basically, look to see where it's finding z, and do that.
     
    BullyWiiPlaza likes this.
  16. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    Uh, so I installed the library, included it in the current source file and used one function from it but I get that the function is undefined?
    Code:
    #include <iosuhax.h>
    // ... random stuff inbetween
    int res = IOSUHAX_Open(NULL);
    Code:
    D:\Consoles\WiiU\Applications\Browser\tcpgecko>make
    pygecko.c
    linking ... tcpgecko.elf
    pygecko.o: In function `rungecko':
    pygecko.c:(.text.rungecko+0x850): undefined reference to `IOSUHAX_Open'
    collect2.exe: error: ld returned 1 exit status
    make[1]: *** [/d/Consoles/WiiU/Applications/Browser/tcpgecko/tcpgecko.elf] Error 1
    make: *** [build] Error 2
    
    The iosuhax.h file says this:
    Code:
    int IOSUHAX_Open(const char *dev);  // if dev == NULL the default path /dev/iosuhax will be used
     
    Last edited by BullyWiiPlaza, Mar 31, 2017
  17. Zarklord

    Zarklord GBAtemp Regular

    Member
    172
    57
    May 13, 2016
    United States
    hmm :unsure: did you run "make clean" and then "make" just to make sure it wasnt some weird compile bug?
     
  18. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    I just did that and it doesn't fix it...
     
    Last edited by BullyWiiPlaza, Mar 31, 2017
  19. Zarklord

    Zarklord GBAtemp Regular

    Member
    172
    57
    May 13, 2016
    United States
    how odd...
    just to double check you have
    1. done "make" then "make install" in libiosuhax directory
    2. -liosuhax is in your makefile
    if thats all true and correct then i really have zero ideas
     
  20. BullyWiiPlaza

    BullyWiiPlaza Nintendo Hacking <3

    Member
    1,611
    1,325
    Aug 2, 2014
    Gambia, The
    I realized I had to edit the Makefile still but another error:
    Code:
    LIBS    := -lz -liosuhax
    Code:
    c:/devkitPro/portlibs/ppc/lib\libiosuhax.a(iosuhax.o): In function `IOSUHAX_Open':
    iosuhax.c:(.text.IOSUHAX_Open+0x3e): undefined reference to `IOS_Open'
    iosuhax.c:(.text.IOSUHAX_Open+0x42): undefined reference to `IOS_Open'
    iosuhax.c:(.text.IOSUHAX_Open+0x72): undefined reference to `IOS_Ioctl'
    iosuhax.c:(.text.IOSUHAX_Open+0x76): undefined reference to `IOS_Ioctl'
    iosuhax.c:(.text.IOSUHAX_Open+0xaa): undefined reference to `IOS_Close'
    iosuhax.c:(.text.IOSUHAX_Open+0xb2): undefined reference to `IOS_Close'
    collect2.exe: error: ld returned 1 exit status
    make[1]: *** [/d/Consoles/WiiU/Applications/Browser/tcpgecko/tcpgecko.elf] Error 1
    make: *** [build] Error 2
    
    It doesn't find the IOSU functions referenced in the library which is odd. How come?
     
    Last edited by BullyWiiPlaza, Mar 31, 2017