mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 14:08:21 +00:00
Initrd parsing and more VFS funcs.
Finished the initrd_parse() function for now and added vfs_open(), vfs_close() and vfs_write()
This commit is contained in:
@@ -52,16 +52,18 @@ typedef struct _fscalls_t {
|
||||
// create a new file
|
||||
// args: parent, name, mode
|
||||
int (*create)(dirnode_t* parent, char* name, mode_t mode);
|
||||
// write to a file
|
||||
int (*write)(vnode_t* node, void* buff, size_t count, size_t offset);
|
||||
} fscalls_t;
|
||||
|
||||
|
||||
int vfs_mount(dirnode_t* ref, char* device, char* mountpoint, char* fs, int mountflags, void* fsinfo);
|
||||
int vfs_umount(dirnode_t* ref, char* mountpoint);
|
||||
int vfs_open(vnode_t* buf, dirnode_t* ref, char* path, int flags, mode_t mode);
|
||||
int vfs_open(vnode_t** buf, dirnode_t* ref, char* path);
|
||||
int vfs_close(vnode_t* node);
|
||||
int vfs_mkdir(dirnode_t* ref, char* path, mode_t mode);
|
||||
int vfs_create(dirnode_t* ref, char* path, mode_t mode);
|
||||
|
||||
int vfs_write(vnode_t* node, void* buff, size_t count, size_t offset);
|
||||
|
||||
void vfs_init();
|
||||
dirnode_t* vfs_root();
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#define TYPE_DIR 4
|
||||
#define TYPE_BLOCKDEV 6
|
||||
#define TYPE_REGULAR 8
|
||||
#define TYPE_IFLNK 10
|
||||
#define TYPE_IFSOCK 12
|
||||
#define TYPE_LINK 10
|
||||
#define TYPE_SOCKET 12
|
||||
|
||||
#define GETMODE(m) (0xFFF & m)
|
||||
#define GETTYPE(m) ((m >> 12) & 0xF)
|
||||
|
||||
Reference in New Issue
Block a user