Hacking Can we please get universal sector size support?

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
I interpreted it as removing support for everyone because I already explained that this particiular error can be avoided.
If libext2fs-wii is really the only problem there are many mays to do it.
I already mentioned that the programs can check sectorsize and or the ext magic bytes.
Or they could make it a option. Or try mounting as ext only if the other fs fail. Or fix the lib.
Afaik there is simply no need to remove ext2 support from the real build.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
After reading the source you problem does not make sense to me.
It should never try to mount as ext if there is a valid fat or ntfs partition.
Nevertheless here a small patch against 1.2.0 that should disable ext mounting.
Code:
Index: source/fileop.cpp
===================================================================
--- source/fileop.cpp   (revision 998)
+++ source/fileop.cpp   (working copy)
@@ -475,6 +475,7 @@
part[device][*devnum].name[0] = 0;
break;
case T_EXT2:
+					   return;
if(!ext2Mount(mount, disc, sector, 2, 128, EXT2_FLAG_64BITS | EXT2_FLAG_JOURNAL_DEV_OK))
return;
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
After reading the source you problem does not make sense to me.
It should never try to mount as ext if there is a valid fat or ntfs partition.
Nevertheless here a small patch against 1.2.0 that should disable ext mounting.
Code:
Index: source/fileop.cpp
===================================================================
--- source/fileop.cpp   (revision 998)
+++ source/fileop.cpp   (working copy)
@@ -475,6 +475,7 @@
part[device][*devnum].name[0] = 0;
break;
case T_EXT2:
+					   return;
if(!ext2Mount(mount, disc, sector, 2, 128, EXT2_FLAG_64BITS | EXT2_FLAG_JOURNAL_DEV_OK))
return;

Alright thanks, will try this out and report back what happens.



The app doesn't know the drive uses big sectors, just like libext2fs doesn't know.

So this is a problem on Tantric's end?
Should be an easy fix correct?

I should have mentioned this earlier but does it help if I mention that this drive does work on WiiMC through SMB?
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
Dang I really need another laptop, this netbook really is not made for compiling lol.
After a couple hours on waiting for the program to compile,
commenting out the lines:

part[device][*devnum].name[0] = 0;
break;
case T_EXT2:
+ return;
if(!ext2Mount(mount, disc, sector, 2, 128, EXT2_FLAG_64BITS | EXT2_FLAG_JOURNAL_DEV_OK))
return;
WORKED!

I even played a video to make sure, everything seemed to work.
Thank you so much for the help PsyBlade
Thank you as well Tueidj
So this was the only bug after all.
My compiled version does have one bug, for some reason it lists the sd card and usb slots twice.
This is not a big deal at all though.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
Im glad it works but there are some things still

that patch was meant to be applied automatically
it adds one line (the + one), nothing else
removing all those lines might instead might have all kinds of unintended consequences
if you want to apply it by hand try to make the output of "svn diff" match mine

the real bug is somewhere else
like I said it should simply not try to mount as ext in the first place
it trys the type indicated by the mbr first
if that fails it tries bruteforcing (with ext last)
since it can read your fs the ext try should never be reached

I would like to nail this down to get a single version everyone can use

there are some things that migt be usefull to fix this
- the first 4 meg of your drive, copy it with dd or whatever you windows guys use instead
- a diff of your changes ("svn diff")
- a trace of the crash with 1.2.0 vanilla
- wether my patch works or not
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
Im glad it works but there are some things still

that patch was meant to be applied automatically
it adds one line (the + one), nothing else
removing all those lines might instead might have all kinds of unintended consequences
if you want to apply it by hand try to make the output of "svn diff" match mine

the real bug is somewhere else
like I said it should simply not try to mount as ext in the first place
it trys the type indicated by the mbr first
if that fails it tries bruteforcing (with ext last)
since it can read your fs the ext try should never be reached

I would like to nail this down to get a single version everyone can use

there are some things that migt be usefull to fix this
- the first 4 meg of your drive, copy it with dd or whatever you windows guys use instead
- a diff of your changes ("svn diff")
- a trace of the crash with 1.2.0 vanilla
- wether my patch works or not
I didn't understand how to apply your patch to be honest. It matched the same as the source code, I just put 2 and 2 together and commented out the lines.

And yea me too. My compiled version doesn't seem to be completely stable. But so far so good.


- the first 4 meg of your drive, copy it with dd or whatever you windows guys use instead
- a diff of your changes ("svn diff")
- a trace of the crash with 1.2.0 vanilla
- wether my patch works or not
I do not understand this part.

Known bugs:
Displays duplicates of sd card and hard drives - http://imageshack.us...1110114407.jpg/
Some videos seemed to bug up. (Teen Titans played fine but Roseanne got really slow on frame rate (10 seconds or so into the video) but audio was fine) - To fix this I set frame dropping from Disabled to Auto

Another question:
Is it illegal to share my compiled WiiMC.dol?
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
Known bugs:

Displays duplicates of sd card and hard drives - http://imageshack.us...1110114407.jpg/
Some videos seemed to bug up. (Teen Titans played fine but Roseanne got really slow on frame rate (10 seconds or so into the video) but audio was fine) - To fix this I set frame dropping from Disabled to Auto
The first bug could very well be caused by this.
The second is more likely caused by other bugs or the limited resources of the wii.

Since you said you could compile it I expected you knew how to use subversion (aka svn) but I will explain it so you can do it manually.

Start with the original unchanged (aka vanilla) source again.
Compile and run it.
In the other thread you posted a trace of the crash. Do so again with this version (since I do not know which version you used back then)

Find the part of the file from the patch.
You will see that the "+" line is missing.
Add it(without the "+"), compile and run again.
See if it works as intended.

Find a way to copy the first 4 Megabytes of the drive (drive not partition) to a file.
I want to examin them to see what went wrong.
One way to do it is "dd" which seems to be available on windows as well.
I don't know how exactly the windows version is used, but Im going to test it later.


Generally the wii it not powerfull enough to decode (and downscale) high definition content.
But imho downscaling hd (since the wii is limited to sd) instead of simply starting with sd content produces worse quality anyway.
Another problem are modern codecs like h264. Use older ones like mpeg2 (dvd) or xvid instead.


EDIT:
I worked out how to use dd for windows.
DL from http://www.chrysocome.net/dd and unpack somewhere
run a commant prompt as admin and cd there

get you harddrives number
either from the windows partition manager (lower half, the "Disk n" on the right)
or by running "dd --list"

run "dd if=\\?\Device\Harddisk\Partition0 of= bs=4M count=1"
where is that number, and the file to write

pack and upload the file to somewhere



sharing wiimc is legally possible
the exact licence should be included in the source (GPL)
basically you are good as long as you share the soure alongside

but I would prefer if you do not share that particular version because of its brokenness
once I have your info and developed a better patch you can share it
but I intend to submit it upstream anyway, so that will not be neccessary
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
Ok hold on PsyBlade I am working on your instructions above.
As I said my laptop takes about 2 hours to compile WiiMC and I am a little busy today but I will get around to it today.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
Most build system can automatically recognise which parts did not change and limit compilation to the changed parts.
If you are lucky its done in under a minute.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
no generally make clean is not required

it is only needed if you want to start fresh
eg because the automatic screwed up, you use a different compiler, etc

if you only change some normal source files it should not be needed
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
Ok here is the crash from WiiMC 1.2.0
http://imageshack.us/f/253/20111101133018.jpg/

Your patched version works.


run "dd if=\\?\Device\Harddisk\Partition0 of= bs=4M count=1"
where is that number, and the file to write

This I do not understand. Does need to be changed as well? or only And what does it need to be changed to or 16. I keep on getting system can not find the file specified.
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
For Disk 16 you would need to run "dd if=\\?\Device\Harddisk16\Partition0 of=harddisk.img bs=4M count=1"
but 16 sounds to high to me, are you sure about that?

does my version still list partitions twice?


edit:
the format I wanted the error in was more like the stuff from the first post of the other thread

??: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
How did you get that?

edit2:
I see
tantric seems to have decoded it
Do you know how to do it?
alternatively you could send me the (crashing) file too, but I'm not exactly sure I know how to decode it.
 

crwys

Well-Known Member
OP
Member
Joined
Jun 26, 2008
Messages
1,146
Trophies
1
XP
612
Country
United States
dd --list shows this
http://imageshack.us...3/unledhvx.png/
j: is my drive. So what would be the command?

I get this in return:
Error native opening input file: 0 The operation completed successfully. I do not see any file created though.

Oh and yes, doubles of mounted sd cards and usb devices are gone now :)

Yea I reported the old code dump and Trantric gave that back to me. I do not know how to decode it.
Wouldn't a simple solution be is to see if both code dumps match?
Had to dig through my email but found the code dump Tantric decoded:
http://imageshack.us/f/855/20110819165631234.jpg/
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
Its harddisk1 (j is partition nr 16 (upper part), 16 is on disk 1 (lower part))
btw you can copy text from the command prompt (try r-click; mark; ...)


No they don't match. I will give decoding a try tomorrow.
But I can barely read it. Can you make a picture more like the first one?
Or if thats not possible write down the middle part (STACK DUMP:)
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
455
Country
Gambia, The
Thanks, the new picture will do.

But I still need the binary that produced the crash.
Afaik it will not match if I compile it myself.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: Lol