X-Git-Url: https://git.wirehaze.ovh/BOS.git/blobdiff_plain/08bb2f475e10fda9373da243b2adcf37cfc6fcca..5e144deaab35e84b572c5374dcda25490dd5c737:/kernel/vfs/vfs.asm?ds=sidebyside diff --git a/kernel/vfs/vfs.asm b/kernel/vfs/vfs.asm index 30d5590..83cd127 100644 --- a/kernel/vfs/vfs.asm +++ b/kernel/vfs/vfs.asm @@ -7,12 +7,6 @@ ;----------------------------------------------------------; - ; file handles need to be dword, where the high - ; word contains drive number, and the low word - ; is the drive/FS specific handle. limits FS to - ; a max of 65535 opened files. should be alright. ;) - - ;---------------------------------------------; ; VFS main structure ; ;---------------------------------------------; @@ -56,6 +50,7 @@ struc VFS_filesystem { .data_pointer dd 0 ; internal driver data + .FSname db 0,0,0,0,0 ; 5 char filesystem name .init dd 0 ; pointer to init .deinit dd 0 ; remove driver .format dd 0 ; format drive @@ -64,9 +59,12 @@ .find dd 0 ; find file .findnext dd 0 ; get next match .open dd 0 ; open file, get handle + .close dd 0 ; close file from handle + .attrib dd 0 ; get/set attrib. and time .read dd 0 ; read file from handle .write dd 0 ; write file from handle .seek dd 0 ; seek from handle + .rename dd 0 ; rename file .remove dd 0 ; remove file/dir .create dd 0 ; create file/dir .ioctl dd 0 ; extra calls if exists @@ -136,4 +134,25 @@ add_fs: push eax ;... pop eax + ret + +;--------------------------------------------------------------; +; open_file - open file, return handle ; +;--------------------------------------------------------------; +; ; +; in: reg = ASCIIZ file name and such ; +; ; +; out: reg = dword file handle ; +; ; +;--------------------------------------------------------------; +open_file: + push eax + ; file handles need to be dword, where the high + ; word contains drive number, and the low word + ; is the drive/FS specific handle. meaning no internal + ; table in VFS, created dynamically with FS info. + ; limits FS to a max of 65535 opened files. most use fewer + ; as default. FAT12 driver has 32. + ; FS reports error if handle is invalid. + pop eax ret \ No newline at end of file