kernel - various changes
+ vmm: higher half should not be identify-mapped + panic: now displays current process + kernel: fix physical addresses (ḑ̷̩̜̦̥̰͔̻͔̖͎̳̗̫̓̓͊́̒͜ơ̸͙͎̠͎̩̤̭̬̙͚̬̣͇̤̼̑̐̿̿͆͠͝ ̷̗̟̘͎̥̤̭̂͛͆́͂͝͠ͅN̴̨̛̥̩̺͚̺̠͙̼̙̯̱͚̫̊̐̅̀̌̏͆̋̕͜͝͠ͅö̵̪͚̞̞̜͎͉̦́́̍̀̃̋̇̄̓͊̎͝t̶̡͍̩̤̹̤̂̑̓͌͂̾̑̈́͒̾̾́͐͆͊͂ ̴̨̫̺̦̊̍̒͛͌̌͂͘̚̚͘͘͝I̶̥͚̯̖̙̩͂́͜d̸̢̡̗͉̠̹̒͠e̸̡̪̺͎͖͚̗̟̟̥͍͑̈̋̉̋̓̐̊̚͘͜n̸̡̍͐͗̈͌̀̓̃́́͠t̶̢͈͈̦̻̰͎̪̰̒̄͒̃̐͜ĩ̴͕̼̻͓͚͕̲̬̤͈̜̣̐̍́̾̀̏̏̑͒̚ͅf̷̡̨̼̻̠̠͔̪͍͛y̴͉͓̓͒̆̎̚ ̶̟͙͖̙̟͍̟͕̞̥̹͇̌̉́̑͗͋̀̕ͅͅM̷͙̬̲̓a̶̫̰̞̺̖̍̀p̶̡̨̡̗̖̹̩̫̯̞̬͋͂̏̍̾̽͜ͅ ̶̧̨̧̫͉̝̮̳͎͍̱̟̪̝̀̽͑̂̿̄̈̇̓͘Ḫ̶̨̨̗̣̪͓̺͙͈͙̀ḭ̶̧̡͇̹͙̩͍͎̮̤̦̜̻͎̞̔̐̇̉̓͒͛̅̿͊̍͆͘̕g̷͖͙͍͓̯̪̩̑̑͋̈́͌͐̊̀͝͠͝ĥ̴̢̡̫̪̟̞̭̟͕̖͎͊͑͛̆͝e̴̡̨̗̱̱͙͔̻̤͎͆̒̾̾̓̈͊̓ͅr̵̛͈̩͍̔̌̃̇͊̽̀̉̽̊͌̿́ ̷̨̡̛̩̹̹̇̇̈́̑̍̊͒̄́͛H̷̨̪̜̤͍̻͎̲̜͋́̆͋̂̚͘͘͜͠ą̷̠͓̫̲́́̽̉̒͌́̓ͅl̴̢̛͈̤̺̱̙̬̆̎̄̊̈́̐̾̏̿̕f̸̢̰͓̦̺̰̯͚̣̙͔̺̂͜͜)
This commit is contained in:
parent
a8e919b033
commit
b2ec036055
32 changed files with 265 additions and 265 deletions
|
@ -1,19 +1,19 @@
|
|||
#include "fs/vfs.h"
|
||||
#include "lib/string.h"
|
||||
#include "mm/liballoc/liballoc.h"
|
||||
#include "mm/memop.h"
|
||||
#include "lib/string.h"
|
||||
|
||||
vnode_t *vfs_create_node(char *name, vnode_type_t type) {
|
||||
vnode_t *node = (vnode_t *)malloc(sizeof(vnode_t));
|
||||
if (!node) {
|
||||
return NULL;
|
||||
}
|
||||
memset(node, 0, sizeof(vnode_t));
|
||||
strncpy(node->name, name, sizeof(node->name) - 1);
|
||||
node->type = type;
|
||||
node->ops = NULL;
|
||||
//node->parent = NULL;
|
||||
//node->child = NULL;
|
||||
//node->next = NULL;
|
||||
return node;
|
||||
vnode_t *node = (vnode_t *)malloc(sizeof(vnode_t));
|
||||
if (!node) {
|
||||
return NULL;
|
||||
}
|
||||
memset(node, 0, sizeof(vnode_t));
|
||||
strncpy(node->name, name, sizeof(node->name) - 1);
|
||||
node->type = type;
|
||||
node->ops = NULL;
|
||||
// node->parent = NULL;
|
||||
// node->child = NULL;
|
||||
// node->next = NULL;
|
||||
return node;
|
||||
}
|
|
@ -6,41 +6,41 @@
|
|||
struct vnode;
|
||||
|
||||
#define VN_FILE 1
|
||||
#define VN_DIR 2
|
||||
#define VN_DIR 2
|
||||
|
||||
typedef uint32_t vnode_type_t;
|
||||
|
||||
typedef struct vnode_ops {
|
||||
int (*read)(struct vnode* vn, void* buf, size_t off, size_t size);
|
||||
struct vnode* (*lookup)(struct vnode* vn, const char* name);
|
||||
int (*read)(struct vnode *vn, void *buf, size_t off, size_t size);
|
||||
struct vnode *(*lookup)(struct vnode *vn, const char *name);
|
||||
} vnode_ops_t;
|
||||
|
||||
typedef struct vnode {
|
||||
char name[256];
|
||||
vnode_type_t type;
|
||||
uint32_t refcount;
|
||||
//struct vnode* parent;
|
||||
//struct vnode* child;
|
||||
//struct vnode* next;
|
||||
char name[256];
|
||||
vnode_type_t type;
|
||||
uint32_t refcount;
|
||||
// struct vnode* parent;
|
||||
// struct vnode* child;
|
||||
// struct vnode* next;
|
||||
|
||||
struct vnode_ops* ops;
|
||||
void* internal;
|
||||
struct vnode_ops *ops;
|
||||
void *internal;
|
||||
} vnode_t;
|
||||
|
||||
typedef struct mountpoint {
|
||||
char name[32];
|
||||
struct fs* fs;
|
||||
vnode_t* mountpoint;
|
||||
char name[32];
|
||||
struct fs *fs;
|
||||
vnode_t *mountpoint;
|
||||
} mountpoint_t;
|
||||
|
||||
typedef struct fs {
|
||||
char name[32];
|
||||
struct vnode* root;
|
||||
int (*mount)(struct vnode* mountpoint);
|
||||
char name[32];
|
||||
struct vnode *root;
|
||||
int (*mount)(struct vnode *mountpoint);
|
||||
} fs_t;
|
||||
|
||||
void vfs_init(void);
|
||||
int vfs_mount(char *path, fs_t* fs);
|
||||
int vfs_mount(char *path, fs_t *fs);
|
||||
int vfs_unmount(char *path);
|
||||
int vfs_open(const char* path, vnode_t** result);
|
||||
int vfs_read(vnode_t* vn, void* buf, size_t off, size_t size);
|
||||
int vfs_open(const char *path, vnode_t **result);
|
||||
int vfs_read(vnode_t *vn, void *buf, size_t off, size_t size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue