Hacking Adding > 2TB support to WiiMC

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Ok so I have been going around trying to figure out why my 2.5TB usb drive crashes WiiMC.
I reported the bug over on the bugtracker at WiiMC.
It was then closed by Tantric with the comment:
QUOTE said:
From the trace, this is/was a bug in libext2fs-wii, not WiiMC:

8064b7d4 8064b744 80604224 805fec24 8015e350 8015e884 8015eddc 806206a0 80620650

??:0 - free()
??:0 - free()
??:0 - ext2fs_open2()
??:0 - ext2Mount()
wiimc/source/fileop.cpp:477
wiimc/source/fileop.cpp:577
wiimc/source/fileop.cpp:148
devkitpro/libogc/libogc/lwp_threads.c:215
devkitpro/libogc/libogc/lwp_threads.c:204

No idea if the June 6 update of libext2fs-wii will fix it (http://code.google.com/p/libext2fs-wii/source/list). Either way, not a WiiMC bug.

So then I reported the bug over at google code for libntfs and got a reply from [email protected] who said:
QUOTEThe library supports it. The problem is that WiiMC does not support it when searching for an NTFS partition. Report this issue on WiiMC. HBC does not support NTFS at all.
Also libogc has no function right now to get the sector size for a drive which is why it is not supported in WiiMC.

I made a custom USB handler and tested this. The library definately supports sector sizes of 4kb.

A size of > 2 TB is also not supported by the current libogc USB implementation. Nothing I can do about.

The bugs you mentioned are bugs not related to the filesystem and the libntfs library but the USB handles.

So it looks like > 2TB support won't happen through libntfs. It has been supported through cios d2x v6 though.
Is there any way of incorporating cios d2x v6 with WiiMC?
Or is there another way for WiiMC to support > 2TB hard drives?

I would also like to thank Tantric, psyblade, the devs over at libntfs and tueidj (sorry if i spelt that wrong) for putting up with me when I have been trying to figure out this problem.
 

scooby74029

wanttabe dev
Member
Joined
May 7, 2010
Messages
1,357
Trophies
1
Age
48
Location
oklahoma, USA
Website
www.wiithemer.org
XP
1,300
Country
United States
ill try to help you out man i first need to get wiimc set up to compile on my computer and i still havent been able to do that yet

as soon as i do ill let you know and we will see if we can add it for you

i would like to add a coverflow for covers also(for movies and music if possible)
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
I have already done that but I am no coder.
I guess its time to start learning though.
If USB Loader GX is able to use cios then I'm pretty sure WiiMC can too, just have to figure out how to make WiiMC use cIOS then working out the bugs.
 

alexh

Well-Known Member
Newcomer
Joined
May 18, 2009
Messages
47
Trophies
1
Location
Oxfordshire
XP
181
Country
United Kingdom
Windows XP does not support USB drives larger than 2.2TB where each sector is 512bytes because it uses a 32-bit LBA. USB hard drive makers have got around this limitation by changing the sector size of these USB drives to 4Kbytes. 32-bit LBA with a sector size of 4Kbytes has a limit of 17.6TB

Software has to have been written so that it reads the USB mode sense response (the USB command which returns the info which says what the sector size is) and does not always assume a 512byte sector size.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
alexh said:
Windows XP does not support USB drives larger than 2.2TB where each sector is 512bytes because it uses a 32-bit LBA. USB hard drive makers have got around this limitation by changing the sector size of these USB drives to 4Kbytes. 32-bit LBA with a sector size of 4Kbytes has a limit of 17.6TB

Software has to have been written so that it reads the USB mode sense response (the USB command which returns the info which says what the sector size is) and does not always assume a 512byte sector size.
scratch the USB
thats thue for all harddrives
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
This isnt new information. The new software would be cios d2x and I have already tested it with usb loader gx and it works.
What the question is, is how to go about making cios d2x work with wiimc. They are both open source right? Maybe talking to the usb loader gx devs will give us an idea of how hard it is.
But since wiimc never used cios, does that mean a lot more code re writing?
all these questions may be simple but they are new to me.
 

scooby74029

wanttabe dev
Member
Joined
May 7, 2010
Messages
1,357
Trophies
1
Age
48
Location
oklahoma, USA
Website
www.wiithemer.org
XP
1,300
Country
United States
crwys said:
This isnt new information. The new software would be cios d2x and I have already tested it with usb loader gx and it works.
What the question is, is how to go about making cios d2x work with wiimc. They are both open source right? Maybe talking to the usb loader gx devs will give us an idea of how hard it is.
But since wiimc never used cios, does that mean a lot more code re writing?
all these questions may be simple but they are new to me.

i know that old versions of wiimc used to use Cios 202 but when the ahbprot thing came out they changed to ios58 which sucks most of the time
 

shortz1994

Well-Known Member
Member
Joined
Jan 21, 2011
Messages
1,340
Trophies
0
XP
369
Country
United States
there is a beta build of wiimc with 202 support added back in. i hate 58 for wiimc, it's a lot slower. would post but not sure if it's cool to. it might be back up on the main wiimc page? you'll need to re add 202.
i had to in order to get it to work right.(follow the bunny. he's got my vote.).
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
I dont think ios 202 works with my drive though. Only ciosx d2x v6 does because it adds support for 4kb sector drives
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
scooby74029 said:
crwys said:
I dont think ios 202 works with my drive though. Only ciosx d2x v6 does because it adds support for 4kb sector drives

well you CAN use ModMii(Advanced Download section) and get Cios 249[56] d2x and change the slot to 202 install and run the 202 version and see what happens.

Thanks for the tip but as tueidj said "you can't run an app magically on top of an ios and expect it to work"
But i'll try it anyways.
 

shortz1994

Well-Known Member
Member
Joined
Jan 21, 2011
Messages
1,340
Trophies
0
XP
369
Country
United States
but to use d2x wiimc has to be able to read or support d2x.. an i think it only support 58, or if you grab the newer beta it's back to 202. could be wrong. just starting to play with coding. so i still have a lot to learn.
mellow.gif
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
shortz1994 said:
but to use d2x wiimc has to be able to read or support d2x.. an i think it only support 58, or if you grab the newer beta it's back to 202. could be wrong. just starting to play with coding. so i still have a lot to learn.
mellow.gif
You are right I am pretty sure.

I already tested the 202 versions with d2x202 and it resulted in the same code dump.
I will try d2x58 for the hell of it with 1.1.9, see what happens.
Thanks for trying to help everyone, but the only real solution is to edit the source and add support for cios21d2x for WiiMC.
And I don't think Trantric will do that so unless another good coder steps forward, it is going to take it a while to do it my self.

Edit:
Ok that was a bad idea lol.
First it broke the homebrew channel, when trying to load the homebrew channel it would just load the hackmii installer, then freeze.
I loaded WiiMC through bannerbomb, it loaded, but then it said "The current IOS is unsupported. Functionality and/or stability may be adversely affected." then the Wii crashed with the code dump.

I posted a video here of the result just for anyone who wants to see it.
http://www.youtube.com/watch?v=vtFquh-w5VU
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
Forget about the damn cios already, it is completely irrelevant.

crwys said:
Ok so I have been going around trying to figure out why my 2.5TB usb drive crashes WiiMC.
I reported the bug over on the bugtracker at WiiMC.
It was then closed by Tantric with the comment:
QUOTE said:
From the trace, this is/was a bug in libext2fs-wii, not WiiMC:

8064b7d4 8064b744 80604224 805fec24 8015e350 8015e884 8015eddc 806206a0 80620650

??:0 - free()
??:0 - free()
??:0 - ext2fs_open2()
??:0 - ext2Mount()
wiimc/source/fileop.cpp:477
wiimc/source/fileop.cpp:577
wiimc/source/fileop.cpp:148
devkitpro/libogc/libogc/lwp_threads.c:215
devkitpro/libogc/libogc/lwp_threads.c:204

No idea if the June 6 update of libext2fs-wii will fix it (http://code.google.com/p/libext2fs-wii/source/list). Either way, not a WiiMC bug.

So then I reported the bug over at google code for libntfs and got a reply from [email protected] who said:
QUOTEThe library supports it. The problem is that WiiMC does not support it when searching for an NTFS partition. Report this issue on WiiMC. HBC does not support NTFS at all.
Also libogc has no function right now to get the sector size for a drive which is why it is not supported in WiiMC.

I made a custom USB handler and tested this. The library definately supports sector sizes of 4kb.

A size of > 2 TB is also not supported by the current libogc USB implementation. Nothing I can do about.

The bugs you mentioned are bugs not related to the filesystem and the libntfs library but the USB handles.
Tantric is right, Dimok is wrong. The issue is in his ext2 library, not libntfs:
http://code.google.com/p/libext2fs-wii/sou...e/gekko_io.h#30
http://code.google.com/p/libext2fs-wii/sou...e/gekko_io.c#81
http://code.google.com/p/libext2fs-wii/sou...e/gekko_io.c#90
There's probably more bugs, but those are the ones that jumped out at me.

Saying libogc doesn't support large sector sizes or drives larger than 2TB is incorrect and I think he's probably aware of that (why would he have implemented it in libntfs if libogc didn't support it...) so I don't know why he said it.
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Tueidj, thanks again for the help.
I have been getting a lot of stories but I think I finally got a clear solution figured out now.
I reported the bug over at libext2fs-wii as well but no one over there has gotten back to me yet.
So fix the bugs in libext2fs-wii and then my drive will work. Hopefully the devs will do that soon.

If I could ask you some questios Tueidj...
You mentioned the bug in this link. This bug could be fixed by either changing it to
#define MAX_SECTOR_SIZE 4096
Or
#define BYTES_PER_SECTOR 4096
Both are the same correct? Because we are just "defining" something? Except in libext2fs, if the current define name is changed, I may have to change other parts of code in the source to recognize the new #define name?
The bugs you mentioned here and here,
struct ext2_super_block * super = (struct ext2_super_block *) mem_alloc(SUPERBLOCK_SIZE); //1024 bytes, so this is saying superblock_size is a structure and it is assigned to sectors of 1024 bytes, while this, if (!interface->readSectors(fd->startSector+SUPERBLOCK_OFFSET/BYTES_PER_SECTOR, SUPERBLOCK_SIZE/BYTES_PER_SECTOR, super)), piece of code is saying it divides 1024 making 512b which is the bug.
Correct me if I am wrong, but I understand this much, but changing simple values from 512 to 4096 and 1024 to 8192: Will this actually work?

In theory, if a nub coder like me, could easily fix the bugs in libext2fs by comparing the source with the libntfs source?
If you could answer these questions, that would be nice. Thank you.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: "Now I know why he took his own life"