forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PS2ATAD

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
R0



Joined: 02 Oct 2004
Posts: 7

PostPosted: Sat Jun 25, 2005 2:26 am    Post subject: PS2ATAD Reply with quote

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
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Sat Jun 25, 2005 2:39 am    Post subject: Reply with quote

That looks like the C equivalent of double-checking your work.
Back to top
View user's profile Send private message Visit poster's website
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sat Jun 25, 2005 4:50 am    Post subject: Reply with quote

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
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jun 25, 2005 6:06 am    Post subject: Re: PS2ATAD Reply with quote

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
View user's profile Send private message
dlanor



Joined: 28 Oct 2004
Posts: 269
Location: Stockholm, Sweden

PostPosted: Sat Jun 25, 2005 6:16 am    Post subject: Reply with quote

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
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Sat Jun 25, 2005 6:28 am    Post subject: Reply with quote

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
View user's profile Send private message
R0



Joined: 02 Oct 2004
Posts: 7

PostPosted: Sat Jun 25, 2005 8:08 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group