IOS_ReloadIOS doesn't work in binary from MEM2 August 18, 2010 10:58PM | Registered: 13 years ago Posts: 28 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 19, 2010 10:29AM | Registered: 15 years ago Posts: 276 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 23, 2010 11:32AM | Registered: 13 years ago Posts: 28 |
IOS_RealoadIOS doesn't cause crash. It sticks in libogc's ios.c code mentioned above in while() loop. Yep, i understand what 0x80003140 address means. But it doesn't explain why IOS doesn't finish loading.Quote
I guess that more details on the way you are loading the DOL that is crashing and the exact address it is running from might help.
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 11:49AM | Registered: 14 years ago Posts: 686 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 12:55PM | Registered: 15 years ago Posts: 276 |
Quote
I saw in some places of libogc: it sets stack for some threads using static allocation inside data section of binary which looks terrible for me. Probably libogc does some similar nasty things while IOS reloading...
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 05:07PM | Registered: 13 years ago Posts: 28 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 05:10PM | Registered: 13 years ago Posts: 28 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 06:55PM | Registered: 15 years ago Posts: 276 |
Quote
sorg
ekeeke,
you can check thread in libwiikeyboard (keyboard.c)..
static u8 *_kbd_stack[KBD_THREAD_STACKSIZE] ATTRIBUTE_ALIGN(8); static u8 *_kbd_buf_stack[KBD_THREAD_STACKSIZE] ATTRIBUTE_ALIGN(8);
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 24, 2010 10:20PM | Registered: 13 years ago Posts: 28 |
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 25, 2010 02:56AM | Registered: 14 years ago Posts: 686 |
So how do you propose IOS loads a new kernel? Does it somehow magically load new code over the top of itself while it is running?Quote
sorg
tueidj,
i did one experiment: filled MEM2 with some value, executed IOS_ReloadIOS() and dumped MEM2. Nothing has been changed these besides around 256 bytes at the end of MEM2 space, just before IOS protected area.
So, nothing has been trashed.
LOAD:FFFF136E LDR R0, =0x10100000 LOAD:FFFF1370 LDR R1, =0x1FFFFFFF LOAD:FFFF1372 LDR R3, =(protect_MEM2+1) LOAD:FFFF1374 BLX R3First it enables MEM2 protection on this range (I quoted the wrong address before, it's 0x10100000 instead of 0x11000000). Then it gets a handle to the new IOS kernel file (using IOS_Open), checks the size and a few other things, then this:
LOAD:FFFF13B2 LDR R3, =(os_device_read+1) LOAD:FFFF13B4 ADDS R0, R5, #0 LOAD:FFFF13B6 LDR R1, =0x10100000 LOAD:FFFF13B8 BLX R3Which places the new kernel blob at 0x10100000 in memory. Then it does some more setup stuff and jumps to it, which runs the loader stub that pushes the new IOS into starlet's SRAM. Anything at 0x10100000 in MEM2 is going to be overwritten. If you say you verified that it doesn't, you must have done something wrong.
Re: IOS_ReloadIOS doesn't work in binary from MEM2 August 25, 2010 09:45AM | Registered: 15 years ago Posts: 276 |
Quote
sorg
Initialized or not, it's static and resides inside executable address space instead of heap or stack area.
I don't think it's normal and good style.
That's why I'm thinking that some similar "tricks" can cause hang using IOS_ReloadIOS from MEM2