Hacking USB Loaders and 4096 sectors hard drives

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
I wonder why almost all usb loaders (except NeoGamma) don't work with new drives with 4096 physical sectors.
Is there any chance for a fix?

Thanks in advance
 

WiiPower

Well-Known Member
Member
Joined
Oct 17, 2008
Messages
8,165
Trophies
0
XP
345
Country
Gambia, The
I seriously doubt that NeoGamma has a different hardware compatibility than the other loaders. Well if the other loaders also use Waninkoko's cIOS. So if you have a HDD that only works in NeoGamma for you, select IOS249 in the others to make it work.
 

fig2k4

Well-Known Member
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
Standard libWBFS uses hardcoded values for the sector size (512) in the read a write sector routines. I noticed that you use a USBStorage_ReadSectors() function in NeoGamma, which uses the real sector size.

I haven't checked the source of other loaders, but if they use the same hardcoded values then it would explain why it works in NeoGamma and not others.

It's one thing I changed when I converted libWBFS to my Delphi code for WBM. I haven't had a drive to test it, but having a variable hd_sec_sz, then using 512 in the read and write routines is obviously wrong.
 

WiiPower

Well-Known Member
Member
Joined
Oct 17, 2008
Messages
8,165
Trophies
0
XP
345
Country
Gambia, The
fig2k4 said:
Standard libWBFS uses hardcoded values for the sector size (512) in the read a write sector routines. I noticed that you use a USBStorage_ReadSectors() function in NeoGamma, which uses the real sector size.

I haven't checked the source of other loaders, but if they use the same hardcoded values then it would explain why it works in NeoGamma and not others.

It's one thing I changed when I converted libWBFS to my Delphi code for WBM. I haven't had a drive to test it, but having a variable hd_sec_sz, then using 512 in the read and write routines is obviously wrong.

Hmm, when adding usb loading capability, i took the code as it was from Waninkoko's usb loader. So the other loaders should have the same code in them, if not they either used an older usb loader as base, changed the code on their own, or there was an "update" i missed.
 

fig2k4

Well-Known Member
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
I just check the CFG code, it uses the same function as NeoGamma so my theory was a bit off..
smile.gif
 

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
I tried USB Loader GX, Configurable USB Loader (ios 249 selected with Configurator and saved in the config file) but both give me ''Exception (ISI) occurred'', Uloader 4.1 says: USB Device Sectors Size must be 512 bytes.
Only NeoGamma works perfectly.

Any idea?
 

WiiPower

Well-Known Member
Member
Joined
Oct 17, 2008
Messages
8,165
Trophies
0
XP
345
Country
Gambia, The
SaintSeiya said:
I tried USB Loader GX, Configurable USB Loader (ios 249 selected with Configurator and saved in the config file) but both give me ''Exception (ISI) occurred'', Uloader 4.1 says: USB Device Sectors Size must be 512 bytes.
Only NeoGamma works perfectly.

Any idea?

What cIOS are you using? And did you try with the lastest versions configurable usb loader and GX with completely cleared config, no pictures on sd card and stuff?
 

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
WiiPower said:
SaintSeiya said:
I tried USB Loader GX, Configurable USB Loader (ios 249 selected with Configurator and saved in the config file) but both give me ''Exception (ISI) occurred'', Uloader 4.1 says: USB Device Sectors Size must be 512 bytes.
Only NeoGamma works perfectly.

Any idea?

What cIOS are you using? And did you try with the lastest versions configurable usb loader and GX with completely cleared config, no pictures on sd card and stuff?

cIOS38 rev17. I tried the latest versions of both loaders with cleared config. The sd is not empty but I used a pendrive without problems.
Today I tried WiFlow too but it displays always the same error.
 

WiiPower

Well-Known Member
Member
Joined
Oct 17, 2008
Messages
8,165
Trophies
0
XP
345
Country
Gambia, The
Ok, let's fix this. On configurable usb loader, you can use a wbfs formatted usb pen using IOS249. If you try the same with your wbfs formatted HDD, you get the exception?

If yes, gather all information that could be relevant and describe it as precise as you can in the configurable usb loader thread. Don't forget to tell that the same HDD works with the same cIOS on NeoGamma. I hope oggzee will pick this up then and fix it.

PS: Once it would be fixed on configurable usb loader, the other loaders devs could copy the necessary change of course
 

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
WiiPower said:
Ok, let's fix this. On configurable usb loader, you can use a wbfs formatted usb pen using IOS249. If you try the same with your wbfs formatted HDD, you get the exception?

If yes, gather all information that could be relevant and describe it as precise as you can in the configurable usb loader thread. Don't forget to tell that the same HDD works with the same cIOS on NeoGamma. I hope oggzee will pick this up then and fix it.

PS: Once it would be fixed on configurable usb loader, the other loaders devs could copy the necessary change of course

Ok, thanks.
wink.gif
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
Can you make a screenshot of the error and also let me know exactly when does it happen?
Is it during the intro screen or usb init or when?
Also can you add the option debug=1 and let me know after which step the exception occurs?
I will then make another debug version which should give me more details...
Also, were you using normal cfg boot.dol or cfg-fat.dol, can you try both?
 

tadija

New Member
Newbie
Joined
Dec 30, 2009
Messages
2
Trophies
0
XP
25
Country
oggzee said:
Can you make a screenshot of the error and also let me know exactly when does it happen?
Is it during the intro screen or usb init or when?
Also can you add the option debug=1 and let me know after which step the exception occurs?
I will then make another debug version which should give me more details...
Also, were you using normal cfg boot.dol or cfg-fat.dol, can you try both?

Ok, I have the same problem...
frown.gif


I have bought today transcend storejet 2.5 640gb which also has 4096 physical sectors.

With every loader I tried (cfg, gx, wiiflow - latest versions) I get same "exception isi occurred" error.

I couldn't format the drive to WBFS properly with any tool, so I tried FAT32 with WBFS folder and .wbfs files.

I tried cfg-fat.dol but it's the same error, I think it's going on at usb init (there's no error without drive attached), and it's after the intro screen.

Every loader worked on my wii with my old WD320 hdd which I don't have anymore.

I couldn't try Neogamma because it only support wbfs drive, and i couldn't format to wbfs (I don't know why?!),
but Neogamma didn't show any errors when I try load from usb (I don't know does it do usb init if there's FAT32 hdd attached).

If somene has any ideas, please...

Greetings to all
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
oggzee said:
Can you make a screenshot of the error and also let me know exactly when does it happen?
Is it during the intro screen or usb init or when?
Also can you add the option debug=1 and let me know after which step the exception occurs?
I will then make another debug version which should give me more details...
Also, were you using normal cfg boot.dol or cfg-fat.dol, can you try both?
What I suspect is the error might be caused when trying to mount fat partitions from USB, not when mounting WBFS partition... but that's a blind guess, that's why i'm asking for more details. Without those it's hard to start fixing it...
 

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
Here I am!
I did everything you've told me:
1. The error occurs right after the splash screen.
2. I tried revision 51, 52 and 52-fat with the same result.
3. I added option debug=1: in this case the error occurs after it has loaded ios 249, while it's accessing to hard drive.

Screenshot Debug (just before the error)
screenef.png


@tadija

WBFS Manager didn't work for me, try to use Wii Backup Manager 0.3.4. I'm sure you'll able to format your drive in wbfs and make it work with NeoGamma.
 

ViRGE

Well-Known Member
Member
Joined
Dec 4, 2004
Messages
373
Trophies
1
XP
973
Country
Perhaps I'm missing something here, but why do the loaders care about 4K drive sectors? All of these hardware vendors should be doing 512B4K translation (including read-modify-write for unaligned write operations) in their drive's firmware, so that the (S)ATA controller and the operating system see the drive as yet another 512B sector drive. The loaders shouldn't be seeing 4K sectors.
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
ViRGE said:
Perhaps I'm missing something here, but why do the loaders care about 4K drive sectors? All of these hardware vendors should be doing 512B4K translation (including read-modify-write for unaligned write operations) in their drive's firmware, so that the (S)ATA controller and the operating system see the drive as yet another 512B sector drive. The loaders shouldn't be seeing 4K sectors.
That's correct and that's what i will try.
The drive probably reports 4k sector, and that's what we use, but i will try what happens if we force it to 512.
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
@SaintSeiya:
@tadija:

Can you try this:

cfg52t2.dol (test)

It will print some hdd info like number of sectors, sector size, hdd size.
Can you make a screenshot of that.
Then press any button and let me know if it works or not, it will try to force the 512 sector size.
 

SaintSeiya

Member
OP
Newcomer
Joined
Feb 5, 2010
Messages
18
Trophies
0
Location
Naples
Website
Visit site
XP
6
Country
Italy
oggzee said:
@SaintSeiya:
@tadija:

Can you try this:

cfg52t2.dol (test)

It will print some hdd info like number of sectors, sector size, hdd size.
Can you make a screenshot of that.
Then press any button and let me know if it works or not, it will try to force the 512 sector size.

wbfs error: hd sector size doesn't match

I'm uploading a video of that.
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
SaintSeiya said:
wbfs error: hd sector size doesn't match

I'm uploading a video of that.
Please do post a screenshot of the hdd info screen too as requested, so that i can see the numbers, or write them down.
I need to see which size is calculated correctly...
Oh, and can you enter the partition selection screen now? can you make a screenshot of that too?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: https://stockanalysis.com/stocks/ntdoy/market-cap/ I think they'll be alright