From 4ebebf6d842e919db5c7499ee3b7cc738980cf25 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 11 Apr 2022 23:00:21 +0200 Subject: kernel: shutdown when init quits thanks to this it's easier to power off - instead of waiting for all processses to quit (which now involves writing `quit` both on serial and ps/2), one of those can just somehow kill init. currently this is just done by exiting from any shell - init will return from await and exit too --- src/init/main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/init') diff --git a/src/init/main.c b/src/init/main.c index 200d8bd..b5ef22f 100644 --- a/src/init/main.c +++ b/src/init/main.c @@ -56,10 +56,8 @@ int main(void) { __stdout = _syscall_open(argify("/com1")); if (__stdout < 0) __stdout = _syscall_open(argify("/vga_tty")); - for (;;) { - _syscall_await(); - printf("init: something quit\n"); - } + _syscall_await(); + printf("init: something quit\n"); _syscall_exit(0); } -- cgit v1.2.3