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