diff options
author | dzwdz | 2022-04-07 23:13:00 +0200 |
---|---|---|
committer | dzwdz | 2022-04-07 23:13:00 +0200 |
commit | 6152d11ae205d4b4a9f03574cfcb0c24cb54b4b5 (patch) | |
tree | ed8ddd0e03f6a730e396cb2877517d05d3954fd7 /src/init/main.c | |
parent | ab74da4bfff9d37b7b5f5f98bda7edfc2ebc3ea6 (diff) |
init: two concurrent shells - serial & vga/ps2
Diffstat (limited to 'src/init/main.c')
-rw-r--r-- | src/init/main.c | 18 |
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(); |