| View previous topic :: View next topic |
| Author |
Message |
R0
Joined: 02 Oct 2004 Posts: 7
|
Posted: Sat Jun 25, 2005 2:26 am Post subject: PS2ATAD |
|
|
I managed to find a suspicious code in PS2ATAD module. There is a function ata_device_probe() in the file ps2atad.c with possible bug in it. I think following code is incorrect:
| Code: | if ((nsector != 1) || (nsector != 1))
return;
|
It seems one of variables was left unchecked. |
|
| Back to top |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Sat Jun 25, 2005 2:39 am Post subject: |
|
|
| That looks like the C equivalent of double-checking your work. |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Sat Jun 25, 2005 4:50 am Post subject: |
|
|
Checking into sony's atad.irx should help. Somebody have it somewhere ? I don't think I do, apart of my bios, no ? _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Sat Jun 25, 2005 6:06 am Post subject: Re: PS2ATAD |
|
|
| R0 wrote: | I managed to find a suspicious code in PS2ATAD module. There is a function ata_device_probe() in the file ps2atad.c with possible bug in it. I think following code is incorrect:
| Code: | if ((nsector != 1) || (nsector != 1))
return;
|
It seems one of variables was left unchecked. |
The second check should be "sector" instead of "nsector". The ATA spec should have more info. |
|
| Back to top |
|
 |
dlanor
Joined: 28 Oct 2004 Posts: 269 Location: Stockholm, Sweden
|
Posted: Sat Jun 25, 2005 6:16 am Post subject: |
|
|
| pixel wrote: | Checking into sony's atad.irx should help. Somebody have it somewhere ? I don't think I do, apart of my bios, no ?
| Is our ps2atad really so closely related to the Sony atad module, that we can expect code snippets like this to even exist in similar form ?
I had the impression that ps2atad was more independently written, which also seemed the only reasonable explanation why we use a different module name for it. ("atad_driver" as opposed to the simple "atad" used in modules I've seen with commercial games.)
I understood (or thought I did) that our modules (ps2dev9, ps2atad, ps2hdd) perform the same basic purpose as corresponding Sony modules (dev9, atad, hdd) but were independently developed. So while each group of modules work well together, individual modules are NOT direct replacements for those in the other group, which was the motivation for having different internal module names. (adding our "_driver" string to the corresponding names used by Sony)
Are you now saying that this understanding is wrong ?
If that is true, then we must reevaluate our position on some issues, and should also definitely change our module naming scheme.
I'm rather confused now, so I hope you can straighten this out for me.
Best regards: dlanor |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Sat Jun 25, 2005 6:28 am Post subject: |
|
|
mrbrown: okay, posting a fix if you don't.
dlanor: half of the hdd stuff was disassembled, and the other half was rewritten from various "common knowledge" specs. _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
R0
Joined: 02 Oct 2004 Posts: 7
|
Posted: Sat Jun 25, 2005 8:08 am Post subject: |
|
|
| Quote: | | Is our ps2atad really so closely related to the Sony atad module, that we can expect code snippets like this to even exist in similar form ? |
Both ps2dev9 and ps2atad are very close to SCE's modules. ps2dev9 differs from dev9 in some functions: dma transfer (sema vs polling), initialization (ps2dev9 has no some smap-initialization code), exports (dev9 has two additional functions). ps2atad also differs from atad in some cases - exports (last function), initialization (no check for SCE genuine hdd) and few other minor differences. |
|
| Back to top |
|
 |
|