wip vfs stubs

master
tcsullivan 6 years ago
parent 3a798edb83
commit 4fa4016807

@ -66,6 +66,18 @@ void SVC_Handler(void) {
*/ */
clock_svc(args); clock_svc(args);
break; break;
case 3: /* FS-related calls
* 0 - open
* 1 - read
* 2 - write
* 3 - close
* 4 - stat
* 5 - seek
* link/unlink?
*/
break;
default: default:
break; break;
} }

@ -1,15 +1,30 @@
#include "vfs.h" #include "vfs.h"
#include "task.h" #include "task.h"
typedef unsigned int size_t;
//static vfs_node vfs_root; //static vfs_node vfs_root;
int vfs_open(const char *path, int mode) int vfs_open(const char *path, int flags, int mode);
{ size_t vfs_read(int fd, void *buf, size_t count);
(void)path; size_t vfs_write(int fd, const void *buf, size_t count);
(void)mode; int vfs_close(int fd);
// vfs_node *cd = task_getcwd();
// if (cd == 0)
// cd = &vfs_root;
return 0; void vfs_svc(uint32_t *args)
{
switch (args[0]) {
case 0:
*((int *)args[4]) = vfs_open(args[1], args[2], args[3]);
break;
case 1:
*((int *)args[4]) = vfs_read(args[1], args[2], args[3]);
break;
case 2:
*((int *)args[4]) = vfs_write(args[1], args[2], args[3]);
break;
case 3:
*((int *)args[2]) = vfs_close(args[1]);
break;
}
} }

Loading…
Cancel
Save