summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authordzwdz2021-09-07 18:33:56 +0200
committerdzwdz2021-09-07 18:33:56 +0200
commit844cd82f89e003a83d763402a6a20abc22252322 (patch)
tree7144f7c7aa4fad572759dbc05b2374f999ffa0d4 /src/init
parente447090093a01fea0b27c4340fcb54bbf9ae3396 (diff)
implement fs_create(), front/back fs handles
Diffstat (limited to 'src/init')
-rw-r--r--src/init/main.c7
-rw-r--r--src/init/syscalls.c4
2 files changed, 11 insertions, 0 deletions
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);
+}