modified some syscall code in rlibc, fs stuff

This commit is contained in:
2026-06-29 17:00:07 -05:00
parent 97357f3170
commit 432d160b7a
285 changed files with 4223 additions and 3957 deletions

30
kernel/vfs.h Normal file
View File

@@ -0,0 +1,30 @@
#ifndef KVFS_H
#define KVFS_H
#include <stdint.h>
#define VFS_FILE 0x01
#define VFS_DIRECTORY 0x02
struct vfs_node;
typedef uint32_t (*read_type_t)(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);
typedef uint32_t (*write_type_t)(struct vfs_node* node, uint32_t offset, uint32_t size, uint8_t* buffer);
typedef struct vfs_node* (*finddir_type_t)(struct vfs_node* node, const char* name);
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;
} vfs_node_t;
void vfs_create_root();
#endif