Hacking IOS58 and its issues

sorgelig

Well-Known Member
OP
Member
Joined
May 2, 2009
Messages
170
Trophies
0
Website
Visit site
XP
69
Country
Serbia, Republic of
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...
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
387
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 ?
 

sorgelig

Well-Known Member
OP
Member
Joined
May 2, 2009
Messages
170
Trophies
0
Website
Visit site
XP
69
Country
Serbia, Republic of
QUOTE said:
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.
My launcher supports WODE. It requires either DVD_LowUnencryptedRead patch in IOS, or direct access to DVD register in order to work with ISO list.
Also my launcher can run almost everything including Homebrew from SD/USB/Wiiload. Since i want to support as many homebrew apps as possible, i need to provide AHBPROT for launched application in case if it needs. As we see, newest apps already use AHBPROT.

QUOTE said:
Can I ask you why you want to deinitialize keyboard then reinitialize it though?
My application is launcher. Don't you understand that launching some homebrew app includes process of deinitialization (in launcher) and initialization (in new app) of the same devices.

QUOTE
I suspect the applications that you are launching simply don't have IOS58 USB support, they will need to be recompiled.
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.
 

sorgelig

Well-Known Member
OP
Member
Joined
May 2, 2009
Messages
170
Trophies
0
Website
Visit site
XP
69
Country
Serbia, Republic of
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?
 

Jacobeian

Well-Known Member
Member
Joined
May 15, 2008
Messages
1,893
Trophies
0
XP
387
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
 

sorgelig

Well-Known Member
OP
Member
Joined
May 2, 2009
Messages
170
Trophies
0
Website
Visit site
XP
69
Country
Serbia, Republic of
Looks i've fixed this issue!
smile.gif


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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    BakerMan @ BakerMan: @salazarcosplay yeah cod's still up