forked from KolibriOS/kolibrios
sysfunction 70.5: get device size
git-svn-id: svn://kolibrios.org@6875 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
820687bfc3
commit
b27bd68162
@ -1379,18 +1379,12 @@ dyndisk_handler:
|
||||
cmp byte [esi], 0
|
||||
jnz .haspartition
|
||||
; 11. The fs operation wants to enumerate partitions.
|
||||
; 11a. Only "list directory" operation is applicable to /<diskname> path. Check
|
||||
; the operation code. If wrong, go to 13.
|
||||
cmp dword [ebx], 1
|
||||
jnz .access_denied
|
||||
; 11b. If the media is inserted, use 'fs_dyndisk_next' as an enumeration
|
||||
; procedure. Otherwise, use 'fs_dyndisk_next_nomedia'.
|
||||
; Check whether the media is inserted.
|
||||
mov esi, fs_dyndisk_next_nomedia
|
||||
test edx, edx
|
||||
jz @f
|
||||
mov esi, fs_dyndisk_next
|
||||
@@:
|
||||
; 11c. Let the procedure from fs_lfn.inc do the job.
|
||||
@@: ; Let the procedure from fs_lfn.inc do the job.
|
||||
jmp file_system_lfn.maindir_noesi
|
||||
|
||||
.root:
|
||||
|
@ -4231,7 +4231,7 @@ Architecture Software Developer's Manual, Volume 3, Appendix B);
|
||||
но без имени файла, за исключением корневого каталога.
|
||||
Замечания:
|
||||
* Для корневого каталога возвращается размер и имя раздела.
|
||||
* Функция не поддерживает виртуальные папки типа / и /rd.
|
||||
* Для устройства возвращается только размер.
|
||||
|
||||
---------------------- Константы для регистров: ----------------------
|
||||
eax - SF_FILE (70)
|
||||
|
@ -4186,8 +4186,8 @@ Information on file is returned in the BDFE format (block of data
|
||||
for folder entry), explained in the description of subfunction 1,
|
||||
but without filename, except the root folder.
|
||||
Remarks:
|
||||
* For the root folder returns size and name of partition.
|
||||
* The function does not support virtual folders such as / and /rd.
|
||||
* For the root folder returns the size and the volume label.
|
||||
* For the device returns only the size.
|
||||
|
||||
---------------------- Constants for registers: ----------------------
|
||||
eax - SF_FILE (70)
|
||||
|
@ -148,28 +148,32 @@ file_system_lfn:
|
||||
|
||||
.nextCD:
|
||||
test eax, eax ; partition number
|
||||
stc
|
||||
jnz @f ; no more partitions
|
||||
mov al, 1 ; /cdX/1
|
||||
clc
|
||||
jnz @f
|
||||
inc eax ; /cdX/1
|
||||
ret
|
||||
|
||||
@@:
|
||||
stc
|
||||
ret
|
||||
|
||||
.maindir: ; list partitions
|
||||
mov esi, .nextCD
|
||||
xor ecx, ecx
|
||||
.maindir_noesi: ; backjump from dyndisk_handler
|
||||
push ebp
|
||||
mov ebp, ecx
|
||||
call kernel_free
|
||||
cmp dword[ebx], 1
|
||||
jnz .access_denied ; read folder?
|
||||
mov edi, [ebx+16] ; buffer
|
||||
cmp byte [ebx], 5
|
||||
jz .deviceInfo
|
||||
cmp byte [ebx], 1 ; read folder?
|
||||
jnz .access_denied
|
||||
push ebp
|
||||
pushd [ebx+4] ; first block
|
||||
mov ebp, [ebx+12] ; the number of blocks to read
|
||||
mov edx, [ebx+16] ; buffer
|
||||
mov ebx, [ebx+8] ; flags
|
||||
mov ecx, 32/4
|
||||
mov edi, edx
|
||||
mov edx, edi
|
||||
xor eax, eax
|
||||
rep stosd
|
||||
mov byte [edx], 1 ; version
|
||||
@ -200,7 +204,7 @@ file_system_lfn:
|
||||
push edx
|
||||
test eax, eax
|
||||
jnz @b
|
||||
cmp ebx, 1
|
||||
cmp ebx, 2
|
||||
jz .uni
|
||||
@@:
|
||||
pop eax
|
||||
@ -209,6 +213,8 @@ file_system_lfn:
|
||||
test eax, eax
|
||||
jnz @b
|
||||
pop edi edx eax
|
||||
cmp ebx, 3
|
||||
jz @f
|
||||
add edi, 264
|
||||
jmp .maindir_loop
|
||||
|
||||
@ -219,6 +225,7 @@ file_system_lfn:
|
||||
test eax, eax
|
||||
jnz .uni
|
||||
pop edi edx eax
|
||||
@@:
|
||||
add edi, 520
|
||||
jmp .maindir_loop
|
||||
|
||||
@ -238,8 +245,23 @@ file_system_lfn:
|
||||
mov dword[image_of_eax], ERROR_ACCESS_DENIED
|
||||
ret
|
||||
|
||||
.deviceInfo:
|
||||
test ebp, ebp
|
||||
jz @f
|
||||
mov eax, dword[ebp+DISK.MediaInfo.Capacity]
|
||||
mov edx, dword[ebp+DISK.MediaInfo.Capacity+4]
|
||||
shld edx, eax, 9
|
||||
shl eax, 9
|
||||
mov [edi+36], edx
|
||||
mov [edi+32], eax
|
||||
@@:
|
||||
and dword[image_of_eax], 0
|
||||
ret
|
||||
|
||||
.rootdir: ; / - virtual root folder
|
||||
cmp dword[ebx], 1 ; read folder?
|
||||
cmp byte [ebx], 5
|
||||
jz @b
|
||||
cmp byte [ebx], 1 ; read folder?
|
||||
jnz .access_denied
|
||||
mov ebp, [ebx+12] ; number of blocks
|
||||
mov edx, [ebx+16] ; return area
|
||||
@ -273,7 +295,7 @@ file_system_lfn:
|
||||
rep stosd
|
||||
push edi
|
||||
lea esi, [esp+8]
|
||||
cmp ebx, 1
|
||||
cmp ebx, 2
|
||||
jz .uni2
|
||||
@@:
|
||||
lodsb
|
||||
@ -281,6 +303,8 @@ file_system_lfn:
|
||||
test eax, eax
|
||||
jnz @b
|
||||
pop edi eax
|
||||
cmp ebx, 3
|
||||
jz @f
|
||||
add edi, 264
|
||||
jmp .rootdir_loop
|
||||
|
||||
@ -290,6 +314,7 @@ file_system_lfn:
|
||||
test eax, eax
|
||||
jnz .uni2
|
||||
pop edi eax
|
||||
@@:
|
||||
add edi, 520
|
||||
jmp .rootdir_loop
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user