loading initrd now...
This commit is contained in:
23
kernel/vfs.h
23
kernel/vfs.h
@@ -2,9 +2,13 @@
|
||||
#define KVFS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define VFS_FILE 0x01
|
||||
#define VFS_DIRECTORY 0x02
|
||||
#define VFS_FILE 0x01
|
||||
#define VFS_DIRECTORY 0x02
|
||||
#define VFS_CHARDEVICE 0x03
|
||||
#define VFS_BLOCKDEVICE 0x04
|
||||
#define VFS_PIPE 0x05
|
||||
|
||||
struct vfs_node;
|
||||
|
||||
@@ -16,15 +20,24 @@ typedef struct vfs_node {
|
||||
char name[128];
|
||||
uint32_t flags; // File, directory, device, etc.
|
||||
uint32_t size; // Size of file in bytes
|
||||
uint32_t inode; // Unique identifier managed by the specific filesystem
|
||||
|
||||
read_type_t read;
|
||||
write_type_t write;
|
||||
finddir_type_t finddir;
|
||||
|
||||
struct vfs_node* mount;
|
||||
struct vfs_node* ptr;
|
||||
} vfs_node_t;
|
||||
|
||||
void vfs_create_root();
|
||||
typedef struct {
|
||||
vfs_node_t* node; // The actual CPIO/VFS node
|
||||
uint32_t offset; // Current read/write cursor position
|
||||
uint32_t flags; // Permissions (O_RDONLY, etc.)
|
||||
} file_t;
|
||||
|
||||
vfs_node_t* vfs_create_root();
|
||||
|
||||
void mount(vfs_node_t* _mnt, vfs_node_t* _fs);
|
||||
int open(const char* path, int flags);
|
||||
int read(int fd, void* buf, size_t sz);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user