[vfs] Fix some things
This commit is contained in:
parent
f6c73d0229
commit
2809921449
@ -8,6 +8,13 @@
|
||||
extern uintptr_t end;
|
||||
uintptr_t placement_pointer = &end;
|
||||
|
||||
void
|
||||
kmalloc_startat(
|
||||
uintptr_t address
|
||||
) {
|
||||
placement_pointer = address;
|
||||
}
|
||||
|
||||
/*
|
||||
* kmalloc() is the kernel's dumb placement allocator
|
||||
*/
|
||||
|
13
include/fs.h
13
include/fs.h
@ -9,6 +9,8 @@
|
||||
#define FS_SYMLINK 0x06
|
||||
#define FS_MOUNTPOINT 0x08
|
||||
|
||||
struct fs_node;
|
||||
|
||||
typedef uint32_t (*read_type_t)(struct fs_node*, uint32_t, uint32_t, uint8_t *);
|
||||
typedef uint32_t (*write_type_t)(struct fs_node*, uint32_t, uint32_t, uint8_t *);
|
||||
typedef void (*open_type_t)(struct fs_node*, uint8_t read, uint8_t write);
|
||||
@ -16,11 +18,6 @@ typedef void (*close_type_t)(struct fs_node*);
|
||||
typedef struct dirent * (*readdir_type_t)(struct fs_node*, uint32_t);
|
||||
typedef struct fs_node * (*finddir_type_t)(struct fs_node*, char *name);
|
||||
|
||||
struct dirent {
|
||||
char name[256];
|
||||
uint32_t ino;
|
||||
};
|
||||
|
||||
typedef struct fs_node {
|
||||
char name[256];
|
||||
uint32_t mask;
|
||||
@ -39,6 +36,12 @@ typedef struct fs_node {
|
||||
struct fs_node *ptr;
|
||||
} fs_node_t;
|
||||
|
||||
struct dirent {
|
||||
char name[256];
|
||||
uint32_t ino;
|
||||
};
|
||||
|
||||
|
||||
extern fs_node_t *fs_root;
|
||||
|
||||
uint32_t read_fs(fs_node_t *node, uint32_t offset, uint32_t size, uint8_t *buffer);
|
||||
|
@ -86,6 +86,7 @@ extern void kprintf(const char *fmt, ...);
|
||||
|
||||
/* Memory Management */
|
||||
extern uintptr_t placement_pointer;
|
||||
extern void kmalloc_startat(uintptr_t address);
|
||||
extern uintptr_t kmalloc_real(size_t size, int align, uintptr_t * phys);
|
||||
extern uintptr_t kmalloc(size_t size);
|
||||
extern uintptr_t kvmalloc(size_t size);
|
||||
|
Loading…
Reference in New Issue
Block a user