Rev 9894 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9894 | Rev 9930 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2011-2021. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2011-2021. 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: 9894 $ |
8 | $Revision: 9930 $ |
9 | 9 | ||
10 | ; ============================================================================= |
10 | ; ============================================================================= |
11 | ; ================================= Constants ================================= |
11 | ; ================================= Constants ================================= |
Line 1239... | Line 1239... | ||
1239 | mov ebx, [ebp-4] ; get buffer |
1239 | mov ebx, [ebp-4] ; get buffer |
1240 | add ebx, [esi+DISK.MediaInfo.SectorSize] ; advance over MBR data to bootsector data |
1240 | add ebx, [esi+DISK.MediaInfo.SectorSize] ; advance over MBR data to bootsector data |
1241 | add ebp, 8 ; ebp points to part of PARTITION structure |
1241 | add ebp, 8 ; ebp points to part of PARTITION structure |
1242 | xor eax, eax ; first sector of the partition |
1242 | xor eax, eax ; first sector of the partition |
1243 | call fs_read32_sys |
1243 | call fs_read32_sys |
1244 | ;push eax |
- | |
1245 | ; 2. Run tests for all supported filesystems. If at least one test succeeded, |
1244 | ; 2. Run tests for all supported filesystems. If at least one test succeeded, |
1246 | ; go to 4. |
1245 | ; go to 4. |
1247 | ; For tests: |
1246 | ; For tests: |
1248 | ; ebp -> first three fields of PARTITION structure, .start, .length, .disk; |
1247 | ; ebp -> first three fields of PARTITION structure, .start, .length, .disk; |
1249 | ; [esp] = error code after bootsector read: 0 = ok, otherwise = failed, |
1248 | ; [esp] = error code after bootsector read: 0 = ok, otherwise = failed, |
1250 | ; ebx points to the buffer for bootsector, |
1249 | ; ebx points to the buffer for bootsector, |
1251 | ; ebx+[esi+DISK.MediaInfo.SectorSize] points to sector-sized buffer that can be used for anything. |
1250 | ; ebx+[esi+DISK.MediaInfo.SectorSize] points to sector-sized buffer that can be used for anything. |
- | 1251 | ||
- | 1252 | ; lock fs list |
|
- | 1253 | ||
1252 | mov ecx, [fs_list] |
1254 | mov ecx, [fs_list] |
1253 | @@: |
1255 | @@: |
1254 | cmp ecx, fs_list |
1256 | cmp ecx, fs_list |
1255 | jz @f |
1257 | jz @f |
Line 1258... | Line 1260... | ||
1258 | call dword[ecx + FileSystem.Creat_part] |
1260 | call dword[ecx + FileSystem.Creat_part] |
1259 | pop ecx |
1261 | pop ecx |
1260 | test eax, eax |
1262 | test eax, eax |
1261 | jnz .success |
1263 | jnz .success |
Line -... | Line 1264... | ||
- | 1264 | ||
1262 | 1265 | mov eax, ecx |
|
1263 | pop eax |
1266 | pop ecx |
1264 | mov ecx, [ecx] |
1267 | mov ecx, [ecx] |
1265 | jmp @b |
1268 | jmp @b |
1266 | @@: |
1269 | @@: |
1267 | push eax |
1270 | push eax |
Line 1299... | Line 1302... | ||
1299 | .success: |
1302 | .success: |
1300 | .nothing: |
1303 | .nothing: |
1301 | sub ebp, 8 ; restore ebp |
1304 | sub ebp, 8 ; restore ebp |
1302 | ; 4. Return with eax = pointer to PARTITION or NULL. |
1305 | ; 4. Return with eax = pointer to PARTITION or NULL. |
1303 | pop ecx |
1306 | pop ecx |
- | 1307 | ||
- | 1308 | ; unlock fs list |
|
1304 | ret |
1309 | ret |
Line 1305... | Line 1310... | ||
1305 | 1310 | ||
1306 | iglobal |
1311 | iglobal |
1307 | align 4 |
1312 | align 4 |