34 lines
570 B
C
34 lines
570 B
C
/*****
|
|
*
|
|
* Simulate a filesystem
|
|
* not necessarily a shell
|
|
*
|
|
*****/
|
|
|
|
#include<stdint.h>
|
|
#include<stdio.h>
|
|
#include<stdlib.h>
|
|
#include<string.h>
|
|
#include"err.h"
|
|
#include"fs.h"
|
|
#include"vfs.h"
|
|
#include"init.h"
|
|
|
|
int main(void)
|
|
{
|
|
if(init_mkrootfs()!=EOK)
|
|
printf("error: failed to initialize filesystem");
|
|
|
|
// allocate memory for virtual filesystem
|
|
// (VFS) and run commands to create inodes
|
|
// and then view their stats.
|
|
|
|
printf("mounted filesystem:\n");
|
|
fs_print(&filesystem);
|
|
|
|
init_releasefs();
|
|
|
|
printf("\nmounted filesystem:\n");
|
|
fs_print(&filesystem);
|
|
}
|