mirror of
https://github.com/JannisHeydemann/BoredOS.git
synced 2026-05-30 02:16:58 +00:00
FEAT: VFS overhaul
This commit is contained in:
32
src/sys/kernel_subsystem.h
Normal file
32
src/sys/kernel_subsystem.h
Normal file
@@ -0,0 +1,32 @@
|
||||
#ifndef KERNEL_SUBSYSTEM_H
|
||||
#define KERNEL_SUBSYSTEM_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define MAX_SUBSYSTEMS 16
|
||||
#define MAX_SUBSYSTEM_FILES 32
|
||||
|
||||
typedef struct {
|
||||
char name[64];
|
||||
int (*read)(char *buffer, int size, int offset);
|
||||
int (*write)(const char *buffer, int size, int offset);
|
||||
} subsystem_file_t;
|
||||
|
||||
typedef struct {
|
||||
char name[64];
|
||||
subsystem_file_t files[MAX_SUBSYSTEM_FILES];
|
||||
int file_count;
|
||||
} kernel_subsystem_t;
|
||||
|
||||
void subsystem_register(const char *name, kernel_subsystem_t **out_sub);
|
||||
void subsystem_add_file(kernel_subsystem_t *sub, const char *name,
|
||||
int (*read)(char*, int, int),
|
||||
int (*write)(const char*, int, int));
|
||||
|
||||
kernel_subsystem_t* subsystem_get_by_name(const char *name);
|
||||
int subsystem_get_count(void);
|
||||
kernel_subsystem_t* subsystem_get_by_index(int index);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user