Nucleus
Barry Device file system 88d672a (3 years, 3 months ago)
/*
* This file controls the Virtual File System for the kernel. It implements a
* generic File System, which can hook other File Systems. This forms a key
* part of the kernel, and is used for loading programs and some higher-level
* IPC and device management.
*/
#include <sys/stat.h>
#include <nucleus/object.h>
#include <nucleus/vfs.h>
Inode *tmpfs_mount(FSType *type, int flags, const char *dev, void *data);
Inode *devfs_mount(FSType *type, int flags, const char *dev, void *data);
/* Initialise the Virtual File System */
void
init_vfs(void)
{
register_fstype("tmpfs", tmpfs_mount);
register_fstype("devfs", devfs_mount);
mount("tmpfs", NULL, "tmpfs", 0, NULL);
mkdir("dev", 0);
mount("devfs", "/dev", "devfs", 0, NULL);
}