IOS58 and its issues

Discussion in 'Wii - Hacking' started by sorgelig, Aug 18, 2010.

Aug 18, 2010

IOS58 and its issues by sorgelig at 9:42 AM (2,499 Views / 0 Likes) 9 replies

  1. sorgelig
    OP

    Member sorgelig GBAtemp Regular

    Joined:
    May 2, 2009
    Messages:
    170
    Country:
    Russia
    Trend now is to move to IOS58 and HW_AHBPROT flag, i've started to use IOS58 and latest SVN source of libogc.

    I'm developing launcher (UniiLoader if somebody remember it). Before it was pure USB loader. I've droped cIOS and software USB loading capability. I have WODE and can load both Wii and GC games from this hardware USB modchip without messing with cIOS. So, i was glad to throw away cIOS support code from my loader and stop fighting with system stability and game compatibility. Together with SNEEK it can manage big amount of channels and so on... Now i'm trying to integrate IOS58 and AHBPROT. And new issues started to appear...

    UniiLoader supports USB keyboard. And looks like either libogc or IOS58 has problem here. After reloading IOS58, you can initialize keyboard and it will work fine, any subsequent (de)initialization of keyboard won't work. Until you reload IOS. And it happens ONLY with IOS58. If i use for example IOS36 - reinitalizations of keyboard are working fine.
    You may ask: why it i can't simple reload IOS58 to fix problem?
    If i will realod IOS i will loose AHBPROT flag.

    So, every homebrew appliaction launched from my loader supporting keyboard and don't reload IOS, won't able to use keyboard.
    HBC doesn't use keyboard, and thus it's free from this issue.

    May be other developers here had such issue and even may be know how to fix it?
    I guess, something wrong in KEYBOARD_Deinit function (or one of functions it uses).

    I'm testing on real NAND (not SNEEK) and all used IOSes aren't patched or modified any way.

    Crazy idea: is there ultimate method to cleanup whole IOS usage besides IOS_RealoadIOS? I'm tracking all handles i'm using and carefully close all of them, but looks like something remains not closed - probably because of libogc. Before AHBPROT flag usage *ERA*, all aplications just reloaded IOS and nobody see/care if something remained not clean/closed. With ARBPROT applications loose IOS reloading ability if they want to use this flag...
     
  2. Jacobeian

    Member Jacobeian GBAtemp Advanced Maniac

    Joined:
    May 15, 2008
    Messages:
    1,879
    Country:
    Cuba
    AHBPROT is only required for DVD support, are you sure you need it ? You don't need it for USB2 support as long as you reload to IOS58.

    If there is a bug in libogc keyboard low-level library then submit it to sourceforge issue page. Can I ask you why you want to deinitialize keyboard then reinitialize it though ?
     
  3. tueidj

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    I suspect the applications that you are launching simply don't have IOS58 USB support, they will need to be recompiled.
     
  4. sorgelig
    OP

    Member sorgelig GBAtemp Regular

    Joined:
    May 2, 2009
    Messages:
    170
    Country:
    Russia
    I've compliled keyboard sample using latest SVN of libogc.
    Also my launcher uses latest SVN libogc.
    Both launched from launcher produce non-working keyboard.

    tueidj, i will try to compile 2 copies of USB keyboard sample where one copy will launch another.
    If it will produce the same problem, then i will post it here for detailed tests.

    P.S.: Most sources of apps i saw lack of deinitialization. For example this sample code: http://wiibrew.org/wiki/Libwiikeyboard
    Simple return at the end. Not sure if deinitialization routines are well tested.
     
  5. sorgelig
    OP

    Member sorgelig GBAtemp Regular

    Joined:
    May 2, 2009
    Messages:
    170
    Country:
    Russia
    By the way, USB-LAN adapter has no mentioned issue. It always works fine regardless IOS reloading.
    Probably, because USB-LAN functionality is handled by IOS itself?
     
  6. tueidj

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    Does your launcher call USB_Deinitialize() before passing off control?
     
  7. Jacobeian

    Member Jacobeian GBAtemp Advanced Maniac

    Joined:
    May 15, 2008
    Messages:
    1,879
    Country:
    Cuba
    yeah, I noticed that too:

    KEYBOARD_Init call USB_Initialize and USBKeyboard_Initialize
    while KEYBOARD_Deinit only call USBKeyboard_Deinitialize, most likely to not kill other USB devices

    you need to close the USB device as well before you leave the loader otherwise it remains open for the IOS loaded in memory and will return an error next time you call USB_Initialize
     
  8. sorgelig
    OP

    Member sorgelig GBAtemp Regular

    Joined:
    May 2, 2009
    Messages:
    170
    Country:
    Russia
    after closing keyboard and network, i added USB_Deinitialize().
    application hangs, never returns from this function.
     
  9. tueidj

    Member tueidj I R Expert

    Joined:
    Jan 8, 2009
    Messages:
    2,569
    Country:
    Did you shutdown WPADs as well?
     
  10. sorgelig
    OP

    Member sorgelig GBAtemp Regular

    Joined:
    May 2, 2009
    Messages:
    170
    Country:
    Russia
    Looks i've fixed this issue! [​IMG]

    I forgot that after USB_Deinitialize() other my function shutdown USB storage and hung there.
    So, i moved USB_Deinitialize() to a later stage and USB keyboard issue has been solved!

    thanks tueidj.
     

Share This Page