From 844cd82f89e003a83d763402a6a20abc22252322 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Tue, 7 Sep 2021 18:33:56 +0200 Subject: implement fs_create(), front/back fs handles --- src/init/main.c | 7 +++++++ src/init/syscalls.c | 4 ++++ 2 files changed, 11 insertions(+) (limited to 'src/init') diff --git a/src/init/main.c b/src/init/main.c index 939f15f..deacb15 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -9,6 +9,7 @@ __attribute__((section("text"))) int tty_fd; void misc_tests(void); +void fs_test(void); // takes a cstring and copies it right before a page boundary const char *multipageify(const char *str); @@ -21,10 +22,16 @@ int main(void) { log(" opened /tty "); misc_tests(); + fs_test(); _syscall_exit(argify("my job here is done.")); } +void fs_test(void) { + handle_t front, back; + front = _syscall_fs_create((void*)&back); // TODO change user_ptr to void* +} + void misc_tests(void) { int res; res = _syscall_open(argify("/tty/nonexistant")); diff --git a/src/init/syscalls.c b/src/init/syscalls.c index 730a243..4c645c2 100644 --- a/src/init/syscalls.c +++ b/src/init/syscalls.c @@ -36,3 +36,7 @@ int _syscall_write(handle_t handle, user_ptr buf, int len) { int _syscall_close(handle_t handle) { return _syscall(_SYSCALL_CLOSE, handle, 0, 0); } + +handle_t _syscall_fs_create(user_ptr back) { + return _syscall(_SYSCALL_FS_CREATE, (int)back, 0, 0); +} -- cgit v1.2.3