PS2ATAD

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
R0
Posts: 7
Joined: Sat Oct 02, 2004 6:38 am

PS2ATAD

Post by R0 »

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: Select all

	if ((nsector != 1) || (nsector != 1))
		return;
It seems one of variables was left unchecked.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

That looks like the C equivalent of double-checking your work.
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

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.
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Re: PS2ATAD

Post by mrbrown »

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: Select all

	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.
dlanor
Posts: 258
Joined: Thu Oct 28, 2004 6:28 pm
Location: Stockholm, Sweden

Post by dlanor »

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
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

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.
R0
Posts: 7
Joined: Sat Oct 02, 2004 6:38 am

Post by R0 »

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.
Post Reply