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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user