summaryrefslogtreecommitdiff
path: root/src/init/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init/main.c')
-rw-r--r--src/init/main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/init/main.c b/src/init/main.c
index 661ee64..5b106df 100644
--- a/src/init/main.c
+++ b/src/init/main.c
@@ -30,24 +30,30 @@ int main(void) {
MOUNT("/bind", fs_passthru(NULL));
if (!_syscall_fork()) {
- __tty_fd = _syscall_open(argify("/com1"));
- if (__tty_fd < 0) _syscall_exit(1);
+ __stdin = __stdout = _syscall_open(argify("/com1"));
+ if (__stdout < 0) _syscall_exit(1);
shell_loop();
_syscall_exit(1);
}
if (!_syscall_fork()) {
- __tty_fd = _syscall_open(argify("/vga_tty"));
- if (__tty_fd < 0) _syscall_exit(1);
+ __stdout = _syscall_open(argify("/vga_tty"));
+ if (__stdout < 0) _syscall_exit(1);
+
+ __stdin = _syscall_open(argify("/keyboard"));
+ if (__stdin < 0) {
+ printf("couldn't open /keyboard\n");
+ _syscall_exit(1);
+ }
shell_loop();
_syscall_exit(1);
}
// try to find any working output
- __tty_fd = _syscall_open(argify("/com1"));
- if (__tty_fd < 0) __tty_fd = _syscall_open(argify("/vga_tty"));
+ __stdout = _syscall_open(argify("/com1"));
+ if (__stdout < 0) __stdout = _syscall_open(argify("/vga_tty"));
for (;;) {
_syscall_await();