mirror of
https://github.com/drasko/codezero.git
synced 2026-02-19 05:13:15 +01:00
Finished adding untested bare functionality vfs
Finished adding untested shm syscalls. Finished adding untested l4 send/recv helpers Everything compiles. Now going to fix lots of bugs ;-)
This commit is contained in:
36
tasks/fs0/src/vfs.c
Normal file
36
tasks/fs0/src/vfs.c
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* High-level vfs implementation.
|
||||
*
|
||||
* Copyright (C) 2008 Bahadir Balban
|
||||
*/
|
||||
#include <fs.h>
|
||||
#include <vfs.h>
|
||||
|
||||
struct vnode *vfs_lookup(struct superblock *sb, char *path)
|
||||
{
|
||||
/* If it's just / we already got it. */
|
||||
if (!strcmp(path, "/"))
|
||||
return sb->root;
|
||||
|
||||
return sb->root->ops.lookup(sb->root, path);
|
||||
}
|
||||
|
||||
/*
|
||||
* /
|
||||
* /boot
|
||||
* /boot/images/mm0.axf
|
||||
* /boot/images/fs0.axf
|
||||
* /boot/images/test0.axf
|
||||
* /file.txt
|
||||
*/
|
||||
struct vfs_mountpoint vfs_root;
|
||||
|
||||
int vfs_mount_root(struct superblock *sb)
|
||||
{
|
||||
/* Lookup the root vnode of this superblock */
|
||||
vfs_root.pivot = vfs_lookup(sb, "/");
|
||||
vfs_root.sb = sb;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user