how do we read the return data of atatpi commands

  • Thread starter Thread starter shoeb
  • Start date Start date
S

shoeb

how do we read the return data of atatpi commands?INQUIRY command
returns 36
bytes but i am unable to figure out from where this return data is
read.
please help
Thanks
 
Previously shoeb said:
how do we read the return data of atatpi commands?INQUIRY command
returns 36
bytes but i am unable to figure out from where this return data is
read.
please help
Thanks

Give some context please....

Arno
 
Give some context please....

Arno

I have written following code:

BYTE WriteATAPI2(BYTE pChannel,BYTE pDevice,WORD pCommand,BYTE*
pPacket) //identify command 0xA1 _
{ _

if(pChannel==PRIMARY)
_

lBase=0x1F0; _
wait(lBase+STATUS,BSY,FALSE);//wait until BSY is
FALSE _
wait(lBase+STATUS,DRDY);//wait until drdy is not
TRUE _
outportb(lBase+DRIVE_HEAD,pDevice);//0 selects device 0 (master).
10h wou_
outportb(lBase+CONTROL,
0xA); _
outportb(lBase+COMMAND,
0xA0); _

delay(1);
_
wait(lBase+STATUS,BSY,FALSE);//wait until BSY is
FALSE _
wait(lBase+STATUS,DRQ);//wait until DRQ is
TRUE _

_DS=FP_SEG(pPacket);
_

_SI=FP_OFF(pPacket);
_

asm{CLD}
_
for(int i=0;i<6;i++)
{
asm{LODSW}
outport(lBase+DATA,_AX);
outport(lBase+ALT_STATUS,_AX);
asm{IN AL, DX}//wait one I/O cycl
}
if(ATAError()==FALSE)
wait(lBase+STATUS,DRQ);//wait unt
printf("\nData");
printf("\n**********\n");

for(i=0;i<255;i++)//read 256 words
{
printf("%c",inport(lBase+DATA));
}


but only 'P' is read from data register every time.


Thanks
-¤--- 143:1 -----
__________________________________________________________-+
F1 Help F2 Save F3 Open Alt-F9 Compile F9 Make F10 Menu
 
I have written following code:
BYTE WriteATAPI2(BYTE pChannel,BYTE pDevice,WORD pCommand,BYTE*
pPacket) //identify command 0xA1 _
{ _

if(pChannel==PRIMARY)
_

lBase=0x1F0; _
wait(lBase+STATUS,BSY,FALSE);//wait until BSY is
FALSE _
wait(lBase+STATUS,DRDY);//wait until drdy is not
TRUE _
outportb(lBase+DRIVE_HEAD,pDevice);//0 selects device 0 (master).
10h wou_
outportb(lBase+CONTROL,
0xA); _
outportb(lBase+COMMAND,
0xA0); _

delay(1);
_
wait(lBase+STATUS,BSY,FALSE);//wait until BSY is
FALSE _
wait(lBase+STATUS,DRQ);//wait until DRQ is
TRUE _

_DS=FP_SEG(pPacket);
_

_SI=FP_OFF(pPacket);
_

asm{CLD}
_
for(int i=0;i<6;i++)
{
asm{LODSW}
outport(lBase+DATA,_AX);
outport(lBase+ALT_STATUS,_AX);
asm{IN AL, DX}//wait one I/O cycl
}
if(ATAError()==FALSE)
wait(lBase+STATUS,DRQ);//wait unt
printf("\nData");
printf("\n**********\n");
for(i=0;i<255;i++)//read 256 words
{
printf("%c",inport(lBase+DATA));
}

but only 'P' is read from data register every time.

Sorry, too low-level for me. I can understand the
code, but I do not know how to programm an ATAPI
controller on register level. Mybe have a look into
the cinux kernel sources and see how they are doing it?

Arno
 
Idiot alert!!!!!!!!
Uhuh! And where exactly are the 'atatpi' commands in there, Einstein.

Sorry English is not your first language, so reading and understanding is
going to be a problem. Did you actually read the document?

8 Command descriptions........................................68

ad homien remarks are about you level of intelligence.
And what makes you think he meant ATAPI commands, and not ATASPI?

Read the original post where this is clearly stated or are you to ignorant
and full of your own self importance.

Jake


 
Back
Top