Rev 1376 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1376 | Rev 2382 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2009. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2009. 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: 1376 $ |
8 | $Revision: 2382 $ |
9 | 9 | ||
Line 10... | Line 10... | ||
10 | 10 | ||
11 | image_of_eax EQU esp+36 |
11 | image_of_eax EQU esp+32 |
Line 12... | Line 12... | ||
12 | image_of_ebx EQU esp+24 |
12 | image_of_ebx EQU esp+20 |
Line 83... | Line 83... | ||
83 | ;********************************************** |
83 | ;********************************************** |
84 | dd 0 |
84 | dd 0 |
Line 85... | Line 85... | ||
85 | 85 | ||
86 | fs_additional_handlers: |
86 | fs_additional_handlers: |
- | 87 | dd biosdisk_handler, biosdisk_enum_root |
|
87 | dd biosdisk_handler, biosdisk_enum_root |
88 | dd dyndisk_handler, dyndisk_enum_root |
88 | ; add new handlers here |
89 | ; add new handlers here |
Line 89... | Line 90... | ||
89 | dd 0 |
90 | dd 0 |
90 | - | ||
91 | endg |
91 | |
92 | 92 | endg |
|
93 | file_system_lfn: |
93 | file_system_lfn: |
94 | ; in: eax->fileinfo block |
94 | ; in: ebx->fileinfo block |
95 | ; operation codes: |
95 | ; operation codes: |
96 | ; 0 : read file |
96 | ; 0 : read file |
97 | ; 1 : read folder |
97 | ; 1 : read folder |
Line 103... | Line 103... | ||
103 | ; 7 : start application |
103 | ; 7 : start application |
104 | ; 8 : delete file |
104 | ; 8 : delete file |
105 | ; 9 : create directory |
105 | ; 9 : create directory |
Line 106... | Line 106... | ||
106 | 106 | ||
107 | ; parse file name |
- | |
108 | xchg ebx, eax |
107 | ; parse file name |
109 | lea esi, [ebx+20] |
108 | lea esi, [ebx+20] |
110 | lodsb |
109 | lodsb |
111 | test al, al |
110 | test al, al |
112 | jnz @f |
111 | jnz @f |
Line 167... | Line 166... | ||
167 | mov esi, [edi+4] |
166 | mov esi, [edi+4] |
168 | .maindir_noesi: |
167 | .maindir_noesi: |
169 | cmp dword [ebx], 1 |
168 | cmp dword [ebx], 1 |
170 | jnz .access_denied |
169 | jnz .access_denied |
171 | xor eax, eax |
170 | xor eax, eax |
172 | mov ebp, [ebx+12] |
171 | mov ebp, [ebx+12] ;количество блоков для считывания |
173 | mov edx, [ebx+16] |
172 | mov edx, [ebx+16] ;куда записывать рузельтат |
174 | ; add edx, std_application_base_address |
173 | ; add edx, std_application_base_address |
175 | push dword [ebx+4] ; first block |
174 | push dword [ebx+4] ; first block |
176 | mov ebx, [ebx+8] ; flags |
175 | mov ebx, [ebx+8] ; flags |
177 | ; ebx=flags, [esp]=first block, ebp=number of blocks, edx=return area, esi='Next' handler |
176 | ; ebx=flags, [esp]=first block, ebp=number of blocks, edx=return area, esi='Next' handler |
178 | mov edi, edx |
177 | mov edi, edx |
Line 383... | Line 382... | ||
383 | ret |
382 | ret |
Line 384... | Line 383... | ||
384 | 383 | ||
385 | .notfounda: |
384 | .notfounda: |
386 | cmp edi, esp |
385 | cmp edi, esp |
- | 386 | jnz .notfound |
|
387 | jnz .notfound |
387 | call dword [edi+4] |
388 | add esp, 8 |
388 | add esp, 16 |
Line 389... | Line 389... | ||
389 | jmp .notfound |
389 | jmp .notfound |
390 | 390 | ||
391 | .found1: |
391 | .found1: |
Line 535... | Line 535... | ||
535 | call free_hd_channel |
535 | call free_hd_channel |
536 | and [hd1_status], 0 |
536 | and [hd1_status], 0 |
537 | mov dword [image_of_eax], 5 ; not found |
537 | mov dword [image_of_eax], 5 ; not found |
538 | ret |
538 | ret |
539 | @@: |
539 | @@: |
540 | mov [fat32part], ecx |
540 | mov [known_part], ecx ; mov [fat32part], ecx |
541 | push ebx esi |
541 | push ebx esi |
542 | call choice_necessity_partition_1 |
542 | call choice_necessity_partition_1 |
543 | pop esi ebx |
543 | pop esi ebx |
544 | mov ecx, [ebx+12] |
544 | mov ecx, [ebx+12] |
545 | mov edx, [ebx+16] |
545 | mov edx, [ebx+16] |
Line 850... | Line 850... | ||
850 | jnz @f |
850 | jnz @f |
851 | mov esi, fs_BdNext |
851 | mov esi, fs_BdNext |
852 | jmp file_system_lfn.maindir_noesi |
852 | jmp file_system_lfn.maindir_noesi |
853 | @@: |
853 | @@: |
854 | push ecx |
854 | push ecx |
- | 855 | push ecx |
|
- | 856 | push biosdisk_cleanup |
|
855 | push fs_OnBd |
857 | push fs_OnBd |
856 | mov edi, esp |
858 | mov edi, esp |
857 | jmp file_system_lfn.found2 |
859 | jmp file_system_lfn.found2 |
Line 858... | Line 860... | ||
858 | 860 | ||
859 | fs_BdNext: |
861 | fs_BdNext: |
860 | cmp eax, [BiosDiskPartitions+ecx*4] |
862 | cmp eax, [BiosDiskPartitions+ecx*4] |
861 | inc eax |
863 | inc eax |
- | 864 | cmc |
|
862 | cmc |
865 | biosdisk_cleanup: |
Line 863... | Line 866... | ||
863 | ret |
866 | ret |
864 | 867 | ||
865 | fs_OnBd: |
868 | fs_OnBd: |
866 | pop edx edx |
869 | pop edx edx edx edx |
867 | ; edx = disk number, ecx = partition number |
870 | ; edx = disk number, ecx = partition number |
868 | ; esi+ebp = name |
871 | ; esi+ebp = name |
869 | call reserve_hd1 |
872 | call reserve_hd1 |
Line 902... | Line 905... | ||
902 | ret |
905 | ret |
903 | .end: |
906 | .end: |
904 | xor eax, eax |
907 | xor eax, eax |
905 | ret |
908 | ret |
906 | .big: |
909 | .big: |
907 | push ecx |
910 | push ecx edx |
908 | push -'0' |
911 | push -'0' |
909 | mov ecx, 10 |
912 | mov ecx, 10 |
910 | @@: |
913 | @@: |
911 | xor edx, edx |
914 | xor edx, edx |
912 | div ecx |
915 | div ecx |
Line 917... | Line 920... | ||
917 | @@: |
920 | @@: |
918 | pop eax |
921 | pop eax |
919 | add al, '0' |
922 | add al, '0' |
920 | stosb |
923 | stosb |
921 | jnz @b |
924 | jnz @b |
922 | pop ecx |
925 | pop edx ecx |
923 | pop eax |
926 | pop eax |
924 | inc eax |
927 | inc eax |
925 | ret |
928 | ret |
Line 926... | Line 929... | ||
926 | 929 | ||
Line 1013... | Line 1016... | ||
1013 | 1016 | ||
1014 | mov al,'/' ;start string with '/' |
1017 | mov al, '/' ;start string with '/' |
1015 | stosb |
1018 | stosb |
1016 | mov ecx,edx |
1019 | mov ecx, edx |
1017 | rep movsb ;copy string |
1020 | rep movsb ;copy string |
- | 1021 | .ret: |
|
Line -... | Line 1022... | ||
- | 1022 | ret |
|
1018 | .ret: ret |
1023 | |
1019 | 1024 | .error: |
|
1020 | .error: add esp,8 |
1025 | add esp, 8 |
1021 | or dword [esp+32],-1 ;error not found zerro at string ->[eax+APPDATA.cur_dir] |
1026 | or dword [esp+32], -1 ;error not found zerro at string ->[eax+APPDATA.cur_dir] |
1022 | ret |
1027 | ret |
1023 | .set: |
1028 | .set: |