[FS, USER] Debug filesystem, fs syscalls

This commit is contained in:
2017-03-13 13:37:39 +01:00
parent 2fe66e4f80
commit fd782365b7
12 changed files with 204 additions and 39 deletions

View File

@@ -7,6 +7,9 @@ typedef struct process_st process_t;
#include <cpu.h>
#include <sync.h>
#include <mem.h>
#include <vfs.h>
#define PROC_NUMFP 20
struct procmm_mmap_st;
typedef struct process_st
@@ -20,6 +23,11 @@ typedef struct process_st
LIST(struct process_st, children);
LIST(struct process_st, siblings);
LIST(thread_t, threads);
struct {
file_t *file;
uint64_t flags;
uint64_t pos;
} fp[PROC_NUMFP];
} process_t;
#define PROC_STATE_READY 1

View File

@@ -40,8 +40,15 @@ typedef long (*syscall_handler_t)(long num, long, long, long, long, long, long);
#define SYSCALL_REGISTER(name, num) syscall_handlers[num] = syscall_##name
SYSCALL_DECL(open);
SYSCALL_DECL(close);
SYSCALL_DECL(read);
SYSCALL_DECL(write);
SYSCALL_DECL(isatty);
SYSCALL_DECL(seek);
SYSCALL_DECL(brk);
SYSCALL_DECL(fork);
SYSCALL_DECL(exit);
SYSCALL_DECL(wait);

View File

@@ -22,6 +22,7 @@ typedef struct dirent_st
#define FS_FILE 0x1
#define FS_DIR 0x2
#define FS_PIPE 0x3
#define FS_TTY 0x4
typedef struct fs_driver_st
{
@@ -56,3 +57,5 @@ void fs_mount(file_t *root, const char *path);
void fs_umount(const char *path);
file_t *fs_namef(const char *path);
file_t debug_file;