Rev 3174 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3174 | Rev 3598 | ||
---|---|---|---|
Line 42... | Line 42... | ||
42 | ;; 20.5.2002 Hd status check - VT ;; |
42 | ;; 20.5.2002 Hd status check - VT ;; |
43 | ;; 29.6.2002 Improved fat32 verification - VT ;; |
43 | ;; 29.6.2002 Improved fat32 verification - VT ;; |
44 | ;; ;; |
44 | ;; ;; |
45 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
45 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 46... | Line 46... | ||
46 | 46 | ||
Line 47... | Line 47... | ||
47 | $Revision: 3174 $ |
47 | $Revision: 3598 $ |
Line 48... | Line 48... | ||
48 | 48 | ||
Line 165... | Line 165... | ||
165 | ; The only reason to be invalid partition now is FAT12. Since the test for |
165 | ; The only reason to be invalid partition now is FAT12. Since the test for |
166 | ; FAT size requires knowledge of some calculated values, which are also used |
166 | ; FAT size requires knowledge of some calculated values, which are also used |
167 | ; in the normal operation, let's hope for the best and allocate data now; if |
167 | ; in the normal operation, let's hope for the best and allocate data now; if |
168 | ; it will prove wrong, just deallocate it. |
168 | ; it will prove wrong, just deallocate it. |
169 | push ebx |
169 | push ebx |
170 | push sizeof.FAT |
170 | movi eax, sizeof.FAT |
171 | pop eax |
- | |
172 | call malloc |
171 | call malloc |
173 | pop ebx |
172 | pop ebx |
174 | test eax, eax |
173 | test eax, eax |
175 | jz .return0 |
174 | jz .return0 |
176 | mov ecx, [ebp+8] |
175 | mov ecx, [ebp+8] |
Line 970... | Line 969... | ||
970 | jz @f |
969 | jz @f |
971 | cmp [fs_type], 1 |
970 | cmp [fs_type], 1 |
972 | jz ntfs_HdReadFolder |
971 | jz ntfs_HdReadFolder |
973 | cmp [fs_type], 2 |
972 | cmp [fs_type], 2 |
974 | jz ext2_HdReadFolder |
973 | jz ext2_HdReadFolder |
975 | push ERROR_UNSUPPORTED_FS |
974 | movi eax, ERROR_UNSUPPORTED_FS |
976 | pop eax |
- | |
977 | or ebx, -1 |
975 | or ebx, -1 |
978 | ret |
976 | ret |
979 | @@: |
977 | @@: |
980 | sub ebx, 4 |
978 | sub ebx, 4 |
981 | push ebp |
979 | push ebp |
Line 1657... | Line 1655... | ||
1657 | ; we need to save LFN <=> LFN is not equal to short name <=> generated name contains '~' |
1655 | ; we need to save LFN <=> LFN is not equal to short name <=> generated name contains '~' |
1658 | mov al, '~' |
1656 | mov al, '~' |
1659 | push ecx edi |
1657 | push ecx edi |
1660 | mov ecx, 8 |
1658 | mov ecx, 8 |
1661 | repnz scasb |
1659 | repnz scasb |
1662 | push 1 |
- | |
1663 | pop eax ; 1 entry |
1660 | movi eax, 1 ; 1 entry |
1664 | jnz .notilde |
1661 | jnz .notilde |
1665 | ; we need ceil(strlen(esi)/13) additional entries = floor((strlen(esi)+12+13)/13) total |
1662 | ; we need ceil(strlen(esi)/13) additional entries = floor((strlen(esi)+12+13)/13) total |
1666 | xor eax, eax |
1663 | xor eax, eax |
1667 | @@: |
1664 | @@: |
1668 | cmp byte [esi], 0 |
1665 | cmp byte [esi], 0 |
Line 2360... | Line 2357... | ||
2360 | .device_err3: |
2357 | .device_err3: |
2361 | pop edx |
2358 | pop edx |
2362 | jmp .device_err2 |
2359 | jmp .device_err2 |
2363 | .disk_full: |
2360 | .disk_full: |
2364 | pop eax edx esi |
2361 | pop eax edx esi |
2365 | push ERROR_DISK_FULL |
2362 | movi eax, ERROR_DISK_FULL |
2366 | pop eax |
- | |
2367 | stc |
2363 | stc |
2368 | ret |
2364 | ret |
Line 2369... | Line 2365... | ||
2369 | 2365 | ||
2370 | ;---------------------------------------------------------------- |
2366 | ;---------------------------------------------------------------- |
Line 2388... | Line 2384... | ||
2388 | jz @f |
2384 | jz @f |
2389 | cmp [fs_type], 1 |
2385 | cmp [fs_type], 1 |
2390 | jz ntfs_HdSetFileEnd |
2386 | jz ntfs_HdSetFileEnd |
2391 | cmp [fs_type], 2 |
2387 | cmp [fs_type], 2 |
2392 | jz ext2_HdSetFileEnd |
2388 | jz ext2_HdSetFileEnd |
2393 | push ERROR_UNKNOWN_FS |
2389 | movi eax, ERROR_UNKNOWN_FS |
2394 | pop eax |
- | |
2395 | ret |
2390 | ret |
2396 | @@: |
2391 | @@: |
2397 | sub ebx, 4 |
2392 | sub ebx, 4 |
2398 | push ebp |
2393 | push ebp |
2399 | mov ebp, [fs_dependent_data_start.partition] |
2394 | mov ebp, [fs_dependent_data_start.partition] |
Line 2564... | Line 2559... | ||
2564 | jnc @b |
2559 | jnc @b |
2565 | .device_err3: |
2560 | .device_err3: |
2566 | pop eax ecx eax edi |
2561 | pop eax ecx eax edi |
2567 | call update_disk |
2562 | call update_disk |
2568 | call fat_unlock |
2563 | call fat_unlock |
2569 | push ERROR_DEVICE |
2564 | movi eax, ERROR_DEVICE |
2570 | pop eax |
- | |
2571 | ret |
2565 | ret |
2572 | @@: |
2566 | @@: |
2573 | ; we will zero data at the end of last sector - remember it |
2567 | ; we will zero data at the end of last sector - remember it |
2574 | push ecx |
2568 | push ecx |
2575 | ; terminate FAT chain |
2569 | ; terminate FAT chain |
Line 2638... | Line 2632... | ||
2638 | jmp .pop_ret |
2632 | jmp .pop_ret |
2639 | .error_fat2: |
2633 | .error_fat2: |
2640 | pop eax ecx eax edi |
2634 | pop eax ecx eax edi |
2641 | call update_disk |
2635 | call update_disk |
2642 | call fat_unlock |
2636 | call fat_unlock |
2643 | push ERROR_FAT_TABLE |
2637 | movi eax, ERROR_FAT_TABLE |
2644 | pop eax |
- | |
2645 | ret |
2638 | ret |
Line 2646... | Line 2639... | ||
2646 | 2639 | ||
2647 | fs_HdGetFileInfo: |
2640 | fs_HdGetFileInfo: |
2648 | cmp [fs_type], 16 |
2641 | cmp [fs_type], 16 |
Line 2769... | Line 2762... | ||
2769 | jz @f |
2762 | jz @f |
2770 | cmp [fs_type], 1 |
2763 | cmp [fs_type], 1 |
2771 | jz ntfs_HdDelete |
2764 | jz ntfs_HdDelete |
2772 | cmp [fs_type], 2 |
2765 | cmp [fs_type], 2 |
2773 | jz ext2_HdDelete |
2766 | jz ext2_HdDelete |
2774 | push ERROR_UNKNOWN_FS |
2767 | movi eax, ERROR_UNKNOWN_FS |
2775 | pop eax |
- | |
2776 | ret |
2768 | ret |
2777 | @@: |
2769 | @@: |
2778 | sub ebx, 4 |
2770 | sub ebx, 4 |
2779 | push ebp |
2771 | push ebp |
2780 | mov ebp, [fs_dependent_data_start.partition] |
2772 | mov ebp, [fs_dependent_data_start.partition] |
Line 2864... | Line 2856... | ||
2864 | .err1: |
2856 | .err1: |
2865 | popad |
2857 | popad |
2866 | .err2: |
2858 | .err2: |
2867 | pop edi |
2859 | pop edi |
2868 | call fat_unlock |
2860 | call fat_unlock |
2869 | push ERROR_DEVICE |
2861 | movi eax, ERROR_DEVICE |
2870 | pop eax |
- | |
2871 | ret |
2862 | ret |
2872 | .error_fat: |
2863 | .error_fat: |
2873 | popad |
2864 | popad |
2874 | pop edi |
2865 | pop edi |
2875 | call fat_unlock |
2866 | call fat_unlock |
2876 | push ERROR_FAT_TABLE |
2867 | movi eax, ERROR_FAT_TABLE |
2877 | pop eax |
- | |
2878 | ret |
2868 | ret |
2879 | .notempty: |
2869 | .notempty: |
2880 | popad |
2870 | popad |
2881 | .access_denied2: |
2871 | .access_denied2: |
2882 | pop edi |
2872 | pop edi |
2883 | call fat_unlock |
2873 | call fat_unlock |
2884 | push ERROR_ACCESS_DENIED |
2874 | movi eax, ERROR_ACCESS_DENIED |
2885 | pop eax |
- | |
2886 | ret |
2875 | ret |
2887 | .empty: |
2876 | .empty: |
2888 | popad |
2877 | popad |
2889 | push eax ebx |
2878 | push eax ebx |
2890 | lea ebx, [ebp+FAT.buffer] |
2879 | lea ebx, [ebp+FAT.buffer] |