OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 10:47 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: fail to read atapi on ahci
PostPosted: Sat Jul 03, 2021 3:39 pm 
Offline
Member
Member

Joined: Mon Mar 14, 2016 5:34 am
Posts: 40
I have so far created read / write functions on disk via the ahci interface but I cannot read on an atapi disk, here is the code I use to initialize the FIS, atapi command, and command table:
Code:
;préparer FIS
gs
mov byte[esi+zsata_cfis],27h     ;type de FIS: host to device
gs
mov byte[esi+zsata_cfis+1],080h   ;attribut     ????????????????????
gs
mov byte[esi+zsata_cfis+2],0A0h  ;commande  packet
gs
mov byte[esi+zsata_cfis+3],0     ;feature 1 ?????????????????
gs
mov byte[esi+zsata_cfis+4],0     ;LBA  (0-7)
gs
mov word[esi+zsata_cfis+5],16   ;LBA (8-23) nombre d'octet de la commande packet
gs
mov byte[esi+zsata_cfis+7],0     ;device
gs
mov byte[esi+zsata_cfis+8],0     ;LBA (24-31)
gs
mov word[esi+zsata_cfis+9],0     ;LBA (32-47)
gs
mov byte[esi+zsata_cfis+11],0    ;feature 2
gs
mov word[esi+zsata_cfis+12],0    ;count
gs
mov byte[esi+zsata_cfis+14],0    ;ICC
gs
mov byte[esi+zsata_cfis+15],0    ;controle
gs
mov dword[esi+zsata_cfis+16],0   ;auxilliaire

gs
mov eax,[esi+zsata_msb_adresse]
gs
mov dword[esi+zsata_msb_adresse],0
and ebp,00FFFFh
bswap eax
bswap ebx
bswap ebp

gs
mov byte[esi+zsata_acmd],88h     ;commande ATAPI lecture 16
gs
mov byte[esi+zsata_acmd+1],0     ;vide
gs
mov dword[esi+zsata_acmd+2],eax  ;adresse du secteur (MSB)
gs
mov dword[esi+zsata_acmd+6],ebx  ;adresse du secteur (LSB)
gs
mov dword[esi+zsata_acmd+10],ebp ;nb de secteur
gs
mov word[esi+zsata_acmd+14],0    ;vide


;préparer table commande
gs
mov byte[esi+zsata_liste],025h ;5dword de commande+ATAPI
gs
mov byte[esi+zsata_liste+1],04h ;Clear Busy upon R_OK
gs
mov word[esi+zsata_liste+2],1 ;nombre d'entrée dans la PRDT
gs
mov dword[esi+zsata_liste+4],0 ;
mov eax,esi
add eax,100000h+zsata_cfis
gs
mov [esi+zsata_liste+8],eax     ;lsb de l'adresse de la commande
gs
mov dword[esi+zsata_liste+12],0 ;msb adresse de la commande
gs
mov dword[esi+zsata_liste+16],0 ;réservé mais on vide quand même
gs
mov dword[esi+zsata_liste+20],0
gs
mov dword[esi+zsata_liste+24],0
gs
mov dword[esi+zsata_liste+28],0


do you see something in there that seems abnormal to you?


Top
 Profile  
 
 Post subject: Re: fail to read atapi on ahci
PostPosted: Mon Jul 05, 2021 9:31 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
nlg wrote:
I cannot read on an atapi disk

What happens instead of reading the disk?


Top
 Profile  
 
 Post subject: Re: fail to read atapi on ahci
PostPosted: Mon Jul 05, 2021 10:11 am 
Offline
Member
Member

Joined: Mon Mar 14, 2016 5:34 am
Posts: 40
from what it seems to me nothing, the bit corresponding to the command in the register port command issue does not go back to zero and the transferred byte counter in PRDT remains at zero
I consider that the command failed after 2s without change, on the same device I can make an identify packet device without problem


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], Google [Bot], MichaelPetch and 53 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group