[KERNEL] Added the "FsAdd" function for drivers on file systems.

TODO: added functions for lock\unlock partition and read\write sectors for user programs 

git-svn-id: svn://kolibrios.org@9894 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom
2023-01-21 18:07:32 +00:00
parent a1909c89a2
commit 2160c0e6f7
3 changed files with 140 additions and 1 deletions

View File

@@ -1241,7 +1241,7 @@ end virtual
add ebp, 8 ; ebp points to part of PARTITION structure
xor eax, eax ; first sector of the partition
call fs_read32_sys
push eax
;push eax
; 2. Run tests for all supported filesystems. If at least one test succeeded,
; go to 4.
; For tests:
@@ -1249,6 +1249,22 @@ end virtual
; [esp] = error code after bootsector read: 0 = ok, otherwise = failed,
; ebx points to the buffer for bootsector,
; ebx+[esi+DISK.MediaInfo.SectorSize] points to sector-sized buffer that can be used for anything.
mov ecx, [fs_list]
@@:
cmp ecx, fs_list
jz @f
push ecx eax
call dword[ecx + FileSystem.Creat_part]
pop ecx
test eax, eax
jnz .success
pop eax
mov ecx, [ecx]
jmp @b
@@:
push eax
call fat_create_partition
test eax, eax
jnz .success