diff options
author | dzwdz | 2021-09-12 13:30:48 +0200 |
---|---|---|
committer | dzwdz | 2021-09-12 13:30:48 +0200 |
commit | 4d49c81c3a6cb3457ee5635efd03a6a06bf6a14c (patch) | |
tree | 8e0699e5e57eaceb976083f05d0c274dab408d78 | |
parent | a66ce8238c08703bd1066a8094d6ab537e82b20e (diff) |
remove some useless code from init
-rw-r--r-- | src/init/main.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/init/main.c b/src/init/main.c index 01e2285..06e59a2 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -8,12 +8,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); - -#define mount(fd, path) _syscall_mount(fd, path, sizeof(path)-1) int main(void) { tty_fd = _syscall_open("/tty", sizeof("/tty") - 1); @@ -21,9 +16,7 @@ int main(void) { _syscall_exit(argify("couldn't open tty")); log(" opened /tty "); - misc_tests(); fs_test(); - _syscall_exit(argify("my job here is done.")); } @@ -31,7 +24,7 @@ void fs_test(void) { static char buf[64] __attribute__((section("text"))); int len = 64; handle_t front, back, file; - front = _syscall_fs_create((void*)&back); // TODO change user_ptr to void* + front = _syscall_fs_create(&back); if (_syscall_fork()) { // child: is the fs server @@ -46,24 +39,3 @@ void fs_test(void) { file = _syscall_open(argify("/mnt/test")); } } - -void misc_tests(void) { - int res; - res = _syscall_open(argify("/tty/nonexistant")); - if (res >= 0) log("test failed "); - res = _syscall_open(argify("/ttynonexistant")); - if (res >= 0) log("test failed "); - log("the \"tests\" went ok"); -} - -// takes a cstring and copies it right before a page boundary -const char *multipageify(const char *str) { - static char buf[0x2000] __attribute__((section("text"))); - - char *out = (void*)((uintptr_t)buf & ~0xFFF) + 0xFFF; - char *cur = out; - do { - *cur++ = *str; - } while (*str++ != '\0'); - return out; -} |