BarinkOS/kernel/storage/vfs/vfs.h
Nigel e6901f0526 We can now open and read files on the harddisk through a messy virtual filesystem
The uri has to contain 8.3 filenames for now as I have not yet figured out
how to convert from that to regular filenaming for the name comparison.

reading files is still limited to 1 sector
2023-02-26 13:44:41 +01:00

33 lines
803 B
C++

#pragma once
#include <stdint-gcc.h>
#include "../../../CoreLib/Path.h"
#include "vfs_types.h"
#include "vfs_types.h"
class VirtualFileSystem
{
public:
static void initialize();
static void Mount(filesystem* fs, const char* name);
static int register_filesystem(struct filesystem* fs);
static FILE* open(const char* pathname, int flags);
static int close(struct FILE* file);
static int write(struct FILE* file, const void* buf, unsigned int len);
static int read(struct FILE* file, void* buf, unsigned int len);
private:
static vfsmount* rootfs;
static int mount_number;
static int superblock_number;
static int filesystem_number;
static filesystem* filesystems[];
static FS_SUPER* superblocks[];
static vfsmount* mounts[];
};