Rev 6917 | Rev 7003 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6917 | Rev 6939 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License. ;; |
4 | ;; Distributed under terms of the GNU General Public License. ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 6917 $ |
8 | $Revision: 6939 $ |
9 | 9 | ||
10 | ; FAT external functions |
10 | ; FAT external functions |
11 | ; in: |
11 | ; in: |
Line 592... | Line 592... | ||
592 | cmp eax, [ebp+FAT.fat_in_cache] |
592 | cmp eax, [ebp+FAT.fat_in_cache] |
593 | je .inCache |
593 | je .inCache |
594 | cmp [ebp+FAT.fat_change], 0 |
594 | cmp [ebp+FAT.fat_change], 0 |
595 | je @f |
595 | je @f |
596 | call write_fat_sector |
596 | call write_fat_sector |
597 | jc .ret |
- | |
598 | @@: |
597 | @@: |
599 | mov [ebp+FAT.fat_in_cache], eax |
598 | mov [ebp+FAT.fat_in_cache], eax |
600 | call fs_read32_sys |
599 | call fs_read32_sys |
601 | test eax, eax |
600 | test eax, eax |
602 | jne .error |
601 | jne .error |
Line 652... | Line 651... | ||
652 | cmp eax, [ebp+FAT.fat_in_cache] |
651 | cmp eax, [ebp+FAT.fat_in_cache] |
653 | je .inCache |
652 | je .inCache |
654 | cmp [ebp+FAT.fat_change], 0 |
653 | cmp [ebp+FAT.fat_change], 0 |
655 | je @f |
654 | je @f |
656 | call write_fat_sector |
655 | call write_fat_sector |
657 | jc .ret |
- | |
658 | @@: |
656 | @@: |
659 | mov [ebp+FAT.fat_in_cache], eax |
657 | mov [ebp+FAT.fat_in_cache], eax |
660 | call fs_read32_sys |
658 | call fs_read32_sys |
661 | test eax, eax |
659 | test eax, eax |
662 | jnz .error |
660 | jnz .error |
Line 762... | Line 760... | ||
762 | mov ebx, [ebp+FAT.fat_cache_ptr] |
760 | mov ebx, [ebp+FAT.fat_cache_ptr] |
763 | mov ecx, [ebp+FAT.NUMBER_OF_FATS] |
761 | mov ecx, [ebp+FAT.NUMBER_OF_FATS] |
764 | .write_next_fat: |
762 | .write_next_fat: |
765 | push eax |
763 | push eax |
766 | call fs_write32_sys |
764 | call fs_write32_sys |
767 | test eax, eax |
- | |
768 | pop eax |
765 | pop eax |
769 | jnz @f |
- | |
770 | add eax, [ebp+FAT.SECTORS_PER_FAT] |
766 | add eax, [ebp+FAT.SECTORS_PER_FAT] |
771 | dec ecx |
767 | dec ecx |
772 | jnz .write_next_fat |
768 | jnz .write_next_fat |
773 | @@: |
769 | @@: |
774 | pop ecx ebx eax |
770 | pop ecx ebx eax |
Line 860... | Line 856... | ||
860 | cmp [ebp+FAT.fat_change], 0 |
856 | cmp [ebp+FAT.fat_change], 0 |
861 | jz .noChange |
857 | jz .noChange |
862 | cmp [ebp+FAT.fs_type], 12 |
858 | cmp [ebp+FAT.fs_type], 12 |
863 | jz .fat12 |
859 | jz .fat12 |
864 | call write_fat_sector |
860 | call write_fat_sector |
865 | jc .ret |
- | |
866 | .noChange: |
861 | .noChange: |
867 | mov esi, [ebp+PARTITION.Disk] |
862 | mov esi, [ebp+PARTITION.Disk] |
868 | call disk_sync |
863 | call disk_sync |
869 | .ret: |
- | |
870 | ret |
864 | ret |
Line 871... | Line 865... | ||
871 | 865 | ||
872 | .fat12: |
866 | .fat12: |
873 | mov esi, [ebp+FAT.fat12_unpacked_ptr] |
867 | mov esi, [ebp+FAT.fat12_unpacked_ptr] |
Line 2416... | Line 2410... | ||
2416 | mov ecx, [edi+28] |
2410 | mov ecx, [edi+28] |
2417 | cmp ecx, ebx |
2411 | cmp ecx, ebx |
2418 | ja .length_ok |
2412 | ja .length_ok |
2419 | push 0 |
2413 | push 0 |
2420 | .ret: |
2414 | .ret: |
2421 | pop eax |
2415 | pop eax eax eax ecx ecx |
2422 | sub edx, [esp+12] |
2416 | sub edx, ecx |
2423 | mov ebx, edx ; ebx=number of written bytes |
2417 | push eax edx |
2424 | call update_disk |
2418 | call update_disk |
2425 | test eax, eax |
- | |
2426 | jz @f |
- | |
2427 | mov byte [esp+4], ERROR_DEVICE |
- | |
2428 | @@: |
- | |
2429 | pop eax eax ecx edx |
- | |
2430 | .error: |
- | |
2431 | push eax |
2419 | pop ebx |
2432 | @@: |
2420 | @@: |
2433 | call fat_unlock |
2421 | call fat_unlock |
2434 | pop eax |
2422 | pop eax |
2435 | ret |
2423 | ret |
Line -... | Line 2424... | ||
- | 2424 | ||
- | 2425 | .error: |
|
- | 2426 | push eax |
|
- | 2427 | jmp @b |
|
2436 | 2428 | ||
2437 | .eof: |
2429 | .eof: |
2438 | push ERROR_END_OF_FILE |
2430 | push ERROR_END_OF_FILE |
2439 | xor ebx, ebx |
2431 | xor ebx, ebx |