Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 648 → Rev 649

/kernel/trunk/fs/fat32.inc
293,7 → 293,6
 
get_free_FAT:
;-----------------------------------------------------------
; input : EAX = # cluster for start the searching
; output : if CARRY=0 EAX = # first cluster found free
; if CARRY=1 disk full
; Note : for more speed need to use fat_cache directly
301,10 → 300,14
push ecx
mov ecx,[LAST_CLUSTER] ; counter for full disk
sub ecx,2
mov eax,[fatStartScan]
cmp eax,2
jb gff_reset
 
gff_test:
cmp eax,[LAST_CLUSTER] ; if above last cluster start at cluster 2
jbe gff_in_range
gff_reset:
mov eax,2
 
gff_in_range:
328,6 → 331,8
ret
 
gff_found:
lea ecx,[eax+1]
mov [fatStartScan],ecx
pop ecx
clc
ret
671,6 → 676,8
jne add_not_fs
 
add [ebx+0x1e8],ecx
mov eax,[fatStartScan]
mov [ebx+0x1ec],eax
call hd_write
; cmp [hd_error],0
; jne add_not_fs
1478,7 → 1485,6
jmp fat_notroot_next_sector
fat_notroot_extend_dir:
push eax
mov eax, [eax]
call get_free_FAT
jnc .found
pop eax
1941,7 → 1947,6
mov esi, edx
test ecx, ecx
jz .done
mov eax, 2
call get_free_FAT
jc .diskfull
push eax
2392,7 → 2397,6
jae .extend_done
; add new cluster
push eax
mov eax, edx
call get_free_FAT
jc .disk_full
mov edx, [fatEND]
/kernel/trunk/fs/part_set.inc
49,6 → 49,8
fatEND dd 0x0FFFFFF8
fatMASK dd 0x0FFFFFFF
 
fatStartScan dd 2
 
fs_dependent_data_end:
file_system_data_size = $ - PARTITION_START
if file_system_data_size > 96
423,6 → 425,7
inc eax
mov [LAST_CLUSTER],eax
dec eax ; cluster count
mov [fatStartScan],2
 
; limits by Microsoft Hardware White Paper v1.03
cmp eax,4085 ; 0xff5
436,6 → 439,12
movzx eax,word [ebx+0x30] ; fs info sector
add eax,[PARTITION_START]
mov [ADR_FSINFO],eax
call hd_read
mov eax,[ebx+0x1ec]
cmp eax,-1
jz @f
mov [fatStartScan],eax
@@:
 
popad