Subversion Repositories Kolibri OS

Rev

Rev 5363 | Rev 6468 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5363 Rev 6464
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2011-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2011-2015. 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: 5363 $
8
$Revision: 6464 $
9
 
9
 
10
; =============================================================================
10
; =============================================================================
11
; ================================= Constants =================================
11
; ================================= Constants =================================
Line 1142... Line 1142...
1142
@@:
1142
@@:
1143
; 11c. Let the procedure from fs_lfn.inc do the job.
1143
; 11c. Let the procedure from fs_lfn.inc do the job.
1144
        jmp     file_system_lfn.maindir_noesi
1144
        jmp     file_system_lfn.maindir_noesi
1145
.haspartition:
1145
.haspartition:
1146
; 12. The fs operation has specified some partition.
1146
; 12. The fs operation has specified some partition.
1147
; 12a. Store parameters for callback functions.
-
 
1148
        push    edx
1147
        push    edx
1149
        push    ecx
1148
        push    ecx
-
 
1149
        xor     eax, eax
-
 
1150
        lodsb
-
 
1151
        sub     eax, '0'
1150
; 12b. Store callback functions.
1152
        jz      .dyndisk_cleanup
-
 
1153
        cmp     eax, 10
-
 
1154
        jnc     .dyndisk_cleanup
-
 
1155
        mov     ecx, eax
-
 
1156
        lodsb
-
 
1157
        cmp     eax, '/'
-
 
1158
        jz      @f
-
 
1159
        test    eax, eax
1151
        push    dyndisk_cleanup
1160
        jnz     .dyndisk_cleanup
-
 
1161
        dec     esi
-
 
1162
@@:
-
 
1163
        cmp     byte [esi], 0
-
 
1164
        jnz     @f
-
 
1165
        test    ebp, ebp
-
 
1166
        jz      @f
-
 
1167
        mov     esi, ebp
-
 
1168
        xor     ebp, ebp
-
 
1169
@@:
1152
        push    fs_dyndisk
1170
        jmp     fs_dyndisk
-
 
1171
 
-
 
1172
.dyndisk_cleanup:
-
 
1173
        pop     esi
1153
        mov     edi, esp
1174
        pop     edx
1154
; 12c. Let the procedure from fs_lfn.inc do the job.
1175
        mov     dword [esp+32], ERROR_FILE_NOT_FOUND
1155
        jmp     file_system_lfn.found2
1176
        jmp     .cleanup_esi
-
 
1177
 
1156
.access_denied:
1178
.access_denied:
1157
; 13. Fail the operation with the appropriate code.
1179
; 13. Fail the operation with the appropriate code.
1158
        mov     dword [esp+32], ERROR_ACCESS_DENIED
1180
        mov     dword [esp+32], ERROR_ACCESS_DENIED
1159
.cleanup:
1181
.cleanup:
1160
; 14. Cleanup.
1182
; 14. Cleanup.
Line 1166... Line 1188...
1166
@@:
1188
@@:
1167
        call    disk_dereference
1189
        call    disk_dereference
1168
; 15. Return.
1190
; 15. Return.
1169
        ret
1191
        ret
Line 1170... Line -...
1170
 
-
 
1171
; This is a callback for cleaning up things called from file_system_lfn.found2.
-
 
1172
dyndisk_cleanup:
-
 
1173
        mov     esi, [edi+8]
-
 
1174
        mov     edx, [edi+12]
-
 
1175
        jmp     dyndisk_handler.cleanup_esi
-
 
1176
 
1192
 
1177
; This is a callback for enumerating partitions called from
1193
; This is a callback for enumerating partitions called from
1178
; file_system_lfn.maindir in the case of inserted media.
1194
; file_system_lfn.maindir in the case of inserted media.
1179
; It just increments eax until DISK.NumPartitions reached and then
1195
; It just increments eax until DISK.NumPartitions reached and then
1180
; cleans up.
1196
; cleans up.
-
 
1197
fs_dyndisk_next:
1181
fs_dyndisk_next:
1198
        mov     ecx, [esp+8]
1182
        cmp     eax, [ecx+DISK.NumPartitions]
1199
        cmp     eax, [ecx+DISK.NumPartitions]
1183
        jae     .nomore
1200
        jae     .nomore
1184
        inc     eax
1201
        inc     eax
1185
        clc
1202
        clc
Line 1201... Line 1218...
1201
        jae     .nomore
1218
        jae     .nomore
1202
        inc     eax
1219
        inc     eax
1203
        clc
1220
        clc
1204
        ret
1221
        ret
1205
.nomore:
1222
.nomore:
-
 
1223
        mov     ecx, [esp+8]
1206
        pusha
1224
        pusha
1207
        mov     esi, ecx
1225
        mov     esi, ecx
1208
        call    disk_dereference
1226
        call    disk_dereference
1209
        popa
1227
        popa
1210
        stc
1228
        stc
1211
        ret
1229
        ret
Line 1212... Line -...
1212
 
-
 
1213
; This is a callback for doing real work with selected partition.
-
 
1214
; Currently this is just placeholder, since no file systems are supported.
1230
 
1215
; edi = esp -> {dd fs_dyndisk, dd dyndisk_cleanup, dd pointer to DISK, dd media object}
1231
; esp -> {dd pointer to DISK, dd media object}
1216
; ecx = partition number, esi+ebp = ASCIIZ name
1232
; ecx = partition number, esi+ebp = ASCIIZ name
1217
fs_dyndisk:
1233
fs_dyndisk:
1218
        dec     ecx     ; convert to zero-based partition index
1234
        dec     ecx     ; convert to zero-based partition index
1219
        pop     edx edx edx ; edx = pointer to DISK, dword [esp] = NULL or edx
1235
        pop     edx     ; edx = pointer to DISK, dword [esp] = NULL or edx
1220
; If the driver does not support insert notifications and we are the only fs
1236
; If the driver does not support insert notifications and we are the only fs
1221
; operation with this disk, ask the driver whether the media
1237
; operation with this disk, ask the driver whether the media
1222
; was inserted/removed/changed. Otherwise, assume that media status is valid.
1238
; was inserted/removed/changed. Otherwise, assume that media status is valid.
1223
        test    byte [edx+DISK.DriverFlags], DISK_NO_INSERT_NOTIFICATION
1239
        test    byte [edx+DISK.DriverFlags], DISK_NO_INSERT_NOTIFICATION