From 4d49c81c3a6cb3457ee5635efd03a6a06bf6a14c Mon Sep 17 00:00:00 2001 From: dzwdz Date: Sun, 12 Sep 2021 13:30:48 +0200 Subject: remove some useless code from init --- src/init/main.c | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) (limited to 'src') 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; -} -- cgit v1.2.3