Kernel: Add partial support for shell

We don't handle arrow keys, and the tty does not know how to clear
the screeen :D
This commit is contained in:
2023-04-05 01:30:58 +03:00
parent db076058b9
commit a423cd8bb3
5 changed files with 46 additions and 175 deletions

View File

@@ -222,25 +222,10 @@ static void init2(void* terminal_driver)
ASSERT(tty1);
DeviceManager::get().add_device(tty1);
MUST(Process::create_kernel(
[](void*)
{
MUST(Process::current()->init_stdio());
while (true)
{
char buffer[1024];
int n_read = MUST(Process::current()->read(STDIN_FILENO, buffer, sizeof(buffer)));
MUST(Process::current()->write(STDOUT_FILENO, buffer, n_read));
dprintln("{} bytes", n_read);
}
}, nullptr
));
return;
MUST(Process::create_kernel(
[](void*)
{
MUST(Process::current()->init_stdio());
Shell* shell = new Shell();
ASSERT(shell);
shell->run();