VFS mount/umount + sys_open/close/read/fake write

This commit is contained in:
2026-04-10 14:31:38 +02:00
parent 17589d72cf
commit aff113d02b
10 changed files with 592 additions and 12 deletions
+13
View File
@@ -11,6 +11,7 @@
#include <config.h>
#include <stdint.h>
#include <limine.h>
#include <stdbool.h>
typedef enum {
READY,
@@ -18,6 +19,12 @@ typedef enum {
DEAD
} status_t;
struct process_fd {
bool used;
unsigned int drive_id;
int fs_fd;
};
struct process {
size_t pid;
char name[PROCESS_NAME_MAX];
@@ -26,6 +33,7 @@ struct process {
struct cpu_status* context;
void* root_page_table; // Process PML4 (should contain kernel PML4 in higher half [256-511]
void* kernel_stack; // Used for interrupts (syscall: int 0x80), defines the TSS RSP0
struct process_fd fds[PROCESS_FD_MAX];
struct process* next;
};
@@ -40,4 +48,9 @@ void process_display_list(struct process* processes_list);
void process_create_user(struct limine_file* file, char* name);
void process_fd_init(struct process* proc);
int process_fd_alloc(struct process* proc, unsigned int drive_id, int fs_fd);
int process_fd_get_fsfd(struct process* proc, int fd, unsigned int* drive_id, int* fs_fd);
int process_fd_release(struct process* proc, int fd);
#endif