Kernel: Shell now sleeps through Scheduler and doesn't 'hlt'

ls doesn't crash when trying to list file
This commit is contained in:
Bananymous 2023-02-26 02:57:27 +02:00
parent 04bb08d27f
commit 40cf68a22a
1 changed files with 4 additions and 2 deletions

View File

@ -59,7 +59,7 @@ namespace Kernel
TTY_PRINT("{}", m_prompt);
for (;;)
{
asm volatile("hlt");
Scheduler::get().set_current_thread_sleeping();
Input::update();
}
}
@ -273,7 +273,9 @@ argument_done:
if (directory_or_error.is_error())
return TTY_PRINTLN("{}", directory_or_error.error());
auto directory = directory_or_error.release_value();
ASSERT(directory->ifdir());
if (!directory->ifdir())
return TTY_PRINTLN("Given path does not point to a directory");
auto inodes_or_error = directory->directory_inodes();
if (inodes_or_error.is_error())