]> wirehaze git hosting - BOS.git/blobdiff - kernel/vfs/vfs.asm

wirehaze git hosting

Update README.md
[BOS.git] / kernel / vfs / vfs.asm
index ab2f0facc35e1f91f131447278be0a42b30a5cd4..057132764221886491ef65042a551c04d5fd799f 100644 (file)
@@ -6,6 +6,7 @@
 ;                                                          ;
 ;----------------------------------------------------------;
 
+
     ;---------------------------------------------;
     ;   VFS main structure                        ;
     ;---------------------------------------------;
         sizeof.VFS_filesystem = $-$$
     end virtual
 
+    ;---------------------------------------------;
+    ;   VFS structure pointer                     ;
+    ;---------------------------------------------;
+    VFS_structure             dd 0
 
-VFS_structure VFS
 
 ;--------------------------------------------------------------;
 ;   init_vfs  -  detect connected drives                       ;
 ;--------------------------------------------------------------;
 ;                                                              ;
+;       out:                    cf = set if failed             ;
+;                                                              ;
+;--------------------------------------------------------------;
+init_vfs:
+        push   eax
+        push   ebx
+
+        mov    ebx, sizeof.VFS                        ; allocate structure size
+        call   allocate_mem
+        cmp    eax, 0
+        jne    .ok
+        stc                                           ; if error, set carry
+        mov    ebx, 0
+
+    .ok:
+        mov    dword [VFS_structure], ebx
+
+        pop    ebx
+        pop    eax
+        ret
+
+;--------------------------------------------------------------;
+;   add_media  -  add media driver                             ;
+;--------------------------------------------------------------;
+;                                                              ;
 ;       in:  reg = pointer to VFS drive info                   ;
 ;                                                              ;
 ;       out: reg = pointer to struct(s) if FAT12 found         ;
 ;                                                              ;
 ;--------------------------------------------------------------;
-init_vfs:
+add_media:
+        push   eax
+        ;...
+        pop    eax
+        ret
+
+;--------------------------------------------------------------;
+;   add_fs  -  add filesystem driver                           ;
+;--------------------------------------------------------------;
+;                                                              ;
+;       in:  reg = pointer to VFS drive info                   ;
+;                                                              ;
+;       out: reg = pointer to struct(s) if FAT12 found         ;
+;                                                              ;
+;--------------------------------------------------------------;
+add_fs:
         push   eax
-        ; a bit more code here 
+        ;...
         pop    eax
         ret
\ No newline at end of file