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
tueidj said:
Possibly, since they both use gekko_io.c/.h files you might be able see which bits need changing.
Ok. Don't want to sound greedy or anything lol, but can you answer these questions as well?

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?
 

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
tueidj said:
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.
Why am I wrong? I never said libext2fs supports sector sizes > 512. If you read the post, you will see I was only saying that libntfs supports it. This quote was only meant for the libntfs svn issue and not for libext2fs. The crash he reported for libntfs results from wiimc because libntfs is tested with sector sizes > 512. On the libext2fs svn issue I gave another respond. Read it up because it shows up the limitations set by libogc to the lib and other reasons why libext2fs does not yet support that.
tueidj said:
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.
I said that because his issue was not only sector size crash related. From what I understood he was talking about partition sizes > 2TB on drives with the "normal" sector size too (512).
QUOTE
1. Plug in a 2.5tb hard drive that is 2tb or larger or that has 4kb sector size.
The 'or' made me think that at least.
As you know this is not supported by libogc because of the 32 bit sector offsets limitation. That is why I said that.
 

tueidj

I R Expert
Member
Joined
Jan 8, 2009
Messages
2,569
Trophies
0
Website
Visit site
XP
999
Country
dimok: I said you were wrong for two reasons:
A) You said the problem was in WiiMC when it isn't
B) You also said libogc doesn't support disks larger than 2TB - why would you assume he was talking about a drive with 512B sectors when the issue was titled "4KB USB (2.5tb or 3tb) Sector Size Support?"

If you want a quick and easy way to find the sector size of a drive without using USBStorage_ReadCapacity just memset a 4KB block to a known byte value, read a single sector into it and see how many bytes change. To avoid the risk of false results do it twice using different values for the memset (but reading the same sector).
 

dimok

Well-Known Member
Member
Joined
Jan 11, 2009
Messages
728
Trophies
3
XP
2,635
Country
United States
Like I said I did not know that he had an ext partition at that time. I only saw the NTFS issue. I knew libntfs works with it and assumed it was WiiMC....Now I know it was the libext2fs.

The solution with reading a sector would work but I don't really like it. It's a dirty little workaround. I would rather add a function to the disc interface struct and use that.
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Has there been any developments on this?
Also quoting from here:
http://code.google.com/p/libext2fs-wii/issues/detail?id=2

Additionally a function is required to read out the bytes per sector from the device. One exists in libogc but it's a private function and I can't use it currently. A new pointer must be added into the DISC_INTERAFCE struct pointing to that private function. Many changes have to be done on libogc and all other FS libraries have to be adapted to that "new" function. It would take some time.


So does this mean WiiMC is going to have to change their code to make use of this new libex2tfs?
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States

wilsoff

Well-Known Member
Member
Joined
Dec 29, 2008
Messages
292
Trophies
0
XP
183
Country
United States
Like I said I did not know that he had an ext partition at that time. I only saw the NTFS issue. I knew libntfs works with it and assumed it was WiiMC....Now I know it was the libext2fs.

The solution with reading a sector would work but I don't really like it. It's a dirty little workaround. I would rather add a function to the disc interface struct and use that.
Hope to see a fix for this soon. Thanks for the help everyone and thank you Dimok.
Does this update from Dimok help fix the problem?

Libextfs Changelog v1.0.3 November 05, 2011
  • Sync with git snapshot 2011-10-17 / ext2fs 1.42-WIP-1016
  • Fixed symlink follow
  • Added support for drives with greater than 512 bytes per sector
  • Some speed up in read/write
Source: http://wiibrew.org/w...mber_05.2C_2011
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Yea me and Dimok sat in his IRC channel a couple weeks ago and I was the tester and he fixed it.
For some reason WiiMC still crashes when I try to compile it with the new libext2fs.
I might be doing something wrong, but my Drive did work in WiiXplorer.
Me and PsyBlade did a temp fix here
http://gbatemp.net/t...rt/page__st__30
By disabling mounting of ext2. That made WiiMC work with my drive which is why I don't understand why compiling the new libext2fs won't work.
This temp fix is great but still has some bugs:
Pausing then resuming (at any time) will result in code dump. It will code dump if you press Home then click Resume, or if you press A to pause it then Press A to resume.
Clicking Right or Left more than once will result in code dump. (To fast forward)
Some videos do not play right. Audio sync is off when it really shouldn't be.

These bugs are not too bad, I am just glad I got WiiMC working with my drive finally.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
Me and PsyBlade did a temp fix here
http://gbatemp.net/t...rt/page__st__30
This temp fix is great but still has some bugs:
Afaict the mentioned bugs are not caused by the "fix", but its not impossible.

I still do not understand why it tries to mount as ext2, and have basically given up hope that I can find and fix it.

Afaik wiimc might not expect that the mount as ext2 fails (independent of the reason of the failture).
Even if the ext2 lib can now work with big sectors, mounting ntfs with it will still not work.
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Its fine PsyBlade I am more than happy with the help you have given me. :)
Can anyone else compile the latest libext2fs with WiiMC and send it to me.
This should fix the bug? (Bug with original WiiMC)
Or am I wrong?
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
637
Country
United States
Well I tried and it still code dumps. I guess there is another bug or something. idk...
I think Tantric may need to configure WiiMC to use the latest libext2fs.
Because I know libext2fs is fixed. Dimok sent me a version of WiiXplorer that loaded my drive and loaded ext2, ext3, ect. drives. (I didnt have any ext partitions in the first place but he wanted me to make one to make sure it could mount ext and ntfs and fat.)
So libext2fs supports 4kb sector drives
libntfs supports 4kb sector drives
There is something else wrong...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    BigOnYa @ BigOnYa: Just between me and you, I mostly believe they honestly do. Even though they are selling...