1) Fix - sectors read with errors now are not brought in the cache.
2) Timeout at absence of the disk in ATAPI drive is reduced about 10 seconds without lowering reliability of reading at presence of the disk. Earlier time the waiting could make 1-1.5 minutes.


git-svn-id: svn://kolibrios.org@628 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2007-09-16 20:06:19 +00:00
parent f53429e2f8
commit 66417e61bd
2 changed files with 57 additions and 49 deletions

View File

@ -56,7 +56,6 @@ ReadCD:
; mov [PacketCommand+9],byte 0xF8
; Ïîäàòü êîìàíäó
call SendPacketDatCommand
; call test_mario79
popa
ret
@ -97,6 +96,9 @@ ReadCDWRetr:
pop edi
call ReadCDWRetr_1
cmp [DevErrorCode],0
jne .exit
mov [CDDataBuf_pointer],ebx
call cd_calculate_cache_1
lea esi,[edi*8+esi]
@ -113,6 +115,7 @@ ReadCDWRetr:
mov ecx,512 ;/4
cld
rep movsd ; move data
.exit:
popad
ret
@ -142,12 +145,12 @@ ReadCDWRetr_1:
jmp .wait
@@:
; Çàäåðæêà íà 2,5 ñåêóíäû
mov EAX,[timer_ticks]
add EAX,250 ;50
@@Wait:
call change_task
cmp EAX,[timer_ticks]
ja @@Wait
; mov EAX,[timer_ticks]
; add EAX,50 ;250
;@@Wait:
; call change_task
; cmp EAX,[timer_ticks]
; ja @@Wait
loop @@NextRetr
@@End_4:
popad
@ -189,6 +192,7 @@ CDDataBuf_pointer dd 0
;****************************************************
SendPacketDatCommand:
pushad
mov [DevErrorCode],0
; Çàäàòü ðåæèì CHS
mov [ATAAddressMode],0
; Ïîñëàòü ATA-êîìàíäó ïåðåäà÷è ïàêåòíîé êîìàíäû
@ -301,7 +305,6 @@ SendPacketDatCommand:
jmp @@End_8
@@Err6:
mov [DevErrorCode],6
@@End_8:
popad
ret
@ -319,6 +322,7 @@ SendPacketDatCommand:
;***********************************************
SendPacketNoDatCommand:
pushad
mov [DevErrorCode],0
; Çàäàòü ðåæèì CHS
mov [ATAAddressMode],0
; Ïîñëàòü ATA-êîìàíäó ïåðåäà÷è ïàêåòíîé êîìàíäû
@ -419,6 +423,7 @@ SendPacketNoDatCommand:
;****************************************************
SendCommandToHDD_1:
pushad
mov [DevErrorCode],0
; Ïðîâåðèòü çíà÷åíèå êîäà ðåæèìà
cmp [ATAAddressMode],1
ja @@Err2_4
@ -819,17 +824,15 @@ GetEvent_StatusNotification:
; Î÷èñòèòü áóôåð ïàêåòíîé êîìàíäû
call clear_packet_buffer
; Çàäàòü êîä êîìàíäû
mov [PacketCommand],word 4Ah
mov [PacketCommand],byte 4Ah
mov [PacketCommand+1],byte 00000001b
; Çàäàòü çàïðîñ êëàññà ñîîáùåíèé
mov [PacketCommand+4],byte 00010000b
; Çàäàòü çàïðîñ êëàññà ñîîáùåíèé
mov [PacketCommand+7],byte 8
mov [PacketCommand+8],byte 0
; Ðàçìåð âûäåëåííîé îáëàñòè
mov [PacketCommand+7],byte 8h
mov [PacketCommand+8],byte 0h
; Ïîäàòü êîìàíäó
; mov [timer_ticks_enable],0
call SendPacketDatCommand
; mov [timer_ticks_enable],1
popa
ret
@ -859,4 +862,3 @@ clear_packet_buffer:
mov [PacketCommand+4],dword 0
mov [PacketCommand+8],dword 0
ret

View File

@ -492,6 +492,7 @@ fs_CdGetFileInfo:
xor eax, eax
ret
;----------------------------------------------------------------
cd_find_lfn:
mov [cd_appl_data],0
; in: esi+ebp -> name
@ -501,6 +502,11 @@ cd_find_lfn:
; 16 ñåêòîð íà÷àëî íàáîðà äåñêðèïòîðîâ òîìîâ
mov [CDSectorAddress],dword 15
mov [CDDataBuf_pointer],CDDataBuf
call WaitUnitReady
cmp [DevErrorCode],0
jne .access_denied
call prevent_medium_removal
.start:
inc dword [CDSectorAddress]