feat: Vfs and Ext2 support. Code style/attribute improvements
Added VFS and Ext2 support. Optimized attributes of methods to improve code highlighting. Printf attribute, malloc attribute, etc.
This commit is contained in:
36
include/myke/vfs/vfs-driver.h
Normal file
36
include/myke/vfs/vfs-driver.h
Normal file
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Created by rick on 19-09-21.
|
||||
//
|
||||
|
||||
#ifndef NEW_KERNEL_VFS_DRIVER_H
|
||||
#define NEW_KERNEL_VFS_DRIVER_H
|
||||
|
||||
#include <myke/driver.h>
|
||||
#include <myke/vfs/vfs.h>
|
||||
|
||||
typedef struct vfs_driver {
|
||||
char name[16];
|
||||
struct {
|
||||
} flags;
|
||||
|
||||
// api
|
||||
int (*vfs_mount)(vfs_mount_t *mount);
|
||||
|
||||
int (*open)(vfs_mount_t *mount, vfs_fd_t *dir, const char *path, int mode, vfs_fd_t *out);
|
||||
|
||||
int (*close)(vfs_mount_t *mount, vfs_fd_t *fd);
|
||||
|
||||
int (*fstat)(vfs_mount_t *mount, vfs_fd_t *fd, stat_t *target, int flags);
|
||||
|
||||
int (*fread)(vfs_mount_t *mount, vfs_fd_t *fd, void *target, size_t size);
|
||||
|
||||
int (*dgetent)(vfs_mount_t *mount, vfs_fd_t *fd, void *target, size_t size);
|
||||
|
||||
} __attribute__((__aligned__(STRUCT_ALIGNMENT))) vfs_driver_t;
|
||||
|
||||
void vfs_mk_dirent_record(vfs_dirent_t *ent, uint32_t inode, uint32_t cur_offset, uint8_t type, char *name,
|
||||
size_t name_length);
|
||||
|
||||
#define VFS_DRIVER(order) GENERIC_DRIVER(vfs_driver, order)
|
||||
|
||||
#endif //NEW_KERNEL_VFS_DRIVER_H
|
||||
Reference in New Issue
Block a user