Subversion Repositories Kolibri OS

Rev

Rev 154 | Rev 379 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 154 Rev 364
Line 62... Line 62...
62
    ret
62
    ret
63
.IDE_Channel_2:
63
.IDE_Channel_2:
64
    mov [IDE_Channel_2],0
64
    mov [IDE_Channel_2],0
65
    ret
65
    ret
66
    
66
 
67
cd_status dd 0
67
uglobal    
-
 
68
cd_status dd 0
68
 
69
endg
-
 
70
 
Line 69... Line 71...
69
;----------------------------------------------------------------
71
;----------------------------------------------------------------
70
;
72
;
71
;  fs_CdRead - LFN variant for reading CD disk
73
;  fs_CdRead - LFN variant for reading CD disk
72
;
74
;
Line 208... Line 210...
208
        push    edi
210
        push    edi
209
        call    cd_find_lfn
211
        call    cd_find_lfn
210
        jnc     .found
212
        jnc     .found
211
        pop     edi
213
        pop     edi
212
        cmp   [DevErrorCode],0
214
        cmp     [DevErrorCode], 0
213
        jne     .noaccess_1
215
        jne     .noaccess_1
214
        or      ebx, -1
216
        or      ebx, -1
215
        mov     eax, ERROR_FILE_NOT_FOUND
217
        mov     eax, ERROR_FILE_NOT_FOUND
216
        ret
218
        ret
217
.found:
219
.found:
218
        mov    edi,[cd_current_pointer_of_input]
220
        mov     edi, [cd_current_pointer_of_input]
219
        test   byte [edi+25],10b    ; do not allow read directories
221
        test    byte [edi+25], 10b    ; do not allow read directories
220
        jnz     .found_dir
222
        jnz     .found_dir
221
        pop     edi
223
        pop     edi
222
.noaccess_1:
224
.noaccess_1:
223
        or      ebx, -1
225
        or      ebx, -1
224
        mov     eax, ERROR_ACCESS_DENIED
226
        mov     eax, ERROR_ACCESS_DENIED
225
        ret
227
        ret
226
.found_dir:
228
.found_dir:
227
        mov    eax,[edi+2]    ; eax=cluster
229
        mov     eax, [edi+2]    ; eax=cluster
228
        mov    [CDSectorAddress],eax
230
        mov     [CDSectorAddress], eax
229
        mov    eax,[edi+10] ; ðàçìåð äèðåêòðîðèè
231
        mov     eax, [edi+10]   ; ðàçìåð äèðåêòðîðèè
230
.doit:
232
.doit:
231
; init header
233
; init header
232
        push    eax ecx
234
        push    eax ecx
233
        mov     edi, edx
235
        mov     edi, edx
234
        mov     ecx, 32/4
236
        mov     ecx, 32/4
235
        xor     eax, eax
237
        xor     eax, eax
236
        rep     stosd
238
        rep     stosd
237
        pop     ecx eax
239
        pop     ecx eax
238
        mov     byte [edx], 1   ; version
240
        mov     byte [edx], 1   ; version
239
        mov     [cd_mem_location],edx
241
        mov     [cd_mem_location], edx
240
        add     [cd_mem_location],32 
242
        add     [cd_mem_location], 32 
241
; íà÷èíàåì ïåðåáðîñêó ÁÄÂÊ â ÓÑÂÊ
243
; íà÷èíàåì ïåðåáðîñêó ÁÄÂÊ â ÓÑÂÊ
242
;.mainloop:
244
;.mainloop:
243
        mov  [cd_counter_block],dword 0
245
        mov     [cd_counter_block], dword 0
244
        dec  dword [CDSectorAddress]
246
        dec     dword [CDSectorAddress]
245
        push ecx
247
        push    ecx
246
.read_to_buffer:
248
.read_to_buffer:
247
        inc  dword [CDSectorAddress]
249
        inc     dword [CDSectorAddress]
248
        mov  [CDDataBuf_pointer],CDDataBuf
250
        mov     [CDDataBuf_pointer], CDDataBuf
249
        call ReadCDWRetr         ; ÷èòàåì ñåêòîð äèðåêòîðèè
251
        call    ReadCDWRetr         ; ÷èòàåì ñåêòîð äèðåêòîðèè
250
        cmp   [DevErrorCode],0
252
        cmp     [DevErrorCode], 0
251
        jne   .noaccess_1
253
        jne     .noaccess_1
252
        call .get_names_from_buffer
254
        call    .get_names_from_buffer
253
        sub  eax,2048
255
        sub     eax,2048
254
; äèðåêòîðèÿ çàêîí÷èëàñü?
256
; äèðåêòîðèÿ çàêîí÷èëàñü?
255
        cmp  eax,0
257
        ja      .read_to_buffer
256
        ja   .read_to_buffer
-
 
257
        mov   edi,[cd_counter_block]
258
        mov     edi, [cd_counter_block]
258
        mov   [edx+8],edi
259
        mov     [edx+8], edi
259
        mov   edi,[ebx] 
260
        mov     edi, [ebx]
260
        sub   [edx+4],edi
261
        sub     [edx+4], edi
261
        pop     ecx edi
262
        xor     eax, eax
-
 
263
        dec     ecx
-
 
264
        js      @f
-
 
265
        mov     al, ERROR_END_OF_FILE
-
 
266
@@:
-
 
267
        pop     ecx edi
262
        mov     ebx, [edx+4]
268
        mov     ebx, [edx+4]
263
        mov     eax,ERROR_SUCCESS
269
        ret
264
        ret    
-
 
265
    
270
 
266
.get_names_from_buffer:
271
.get_names_from_buffer:
267
    mov     [cd_current_pointer_of_input_2],CDDataBuf
272
    mov     [cd_current_pointer_of_input_2],CDDataBuf
268
    push    eax esi edi edx
273
    push    eax esi edi edx
269
.get_names_from_buffer_1:
274
.get_names_from_buffer_1:
270
    call    cd_get_name
275
    call    cd_get_name
271
    jc    .end_buffer
276
    jc    .end_buffer
Line 656... Line 661...
656
; êîíåö ïóòè ôàéëà
661
; êîíåö ïóòè ôàéëà
657
        cmp    byte [esi-1], 0
662
        cmp    byte [esi-1], 0
658
        jz    .done
663
        jz    .done
659
        mov    eax,[cd_current_pointer_of_input]
664
        mov    eax,[cd_current_pointer_of_input]
660
        add    eax,2
665
        push    dword [eax+2]
661
        mov    eax,[eax]
-
 
662
        mov    [CDSectorAddress],eax ; íà÷àëî äèðåêòîðèè
666
        pop     dword [CDSectorAddress]       ; íà÷àëî äèðåêòîðèè
663
        add    eax,8
667
        mov    eax,[eax+2+8]  ; ðàçìåð äèðåêòîðèè
664
        mov    eax,[eax]  ; ðàçìåð äèðåêòîðèè
-
 
665
        jmp    .mainloop
668
        jmp    .mainloop
666
; óêàçàòåëü ôàéëà íàéäåí
669
; óêàçàòåëü ôàéëà íàéäåí
667
   .done:
670
   .done:
668
        pop  esi eax
671
        pop  esi eax
669
        clc
672
        clc
670
        ret
673
        ret