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