diff --git a/sys/teton/terminal.cpp b/sys/teton/terminal.cpp index 953cc32..992d0ad 100644 --- a/sys/teton/terminal.cpp +++ b/sys/teton/terminal.cpp @@ -3,6 +3,8 @@ #include #include #include +#include +#include void Terminal::HandleCharacter(char c) { console_.WriteChar(c); @@ -58,6 +60,16 @@ void Terminal::ExecuteCommand(const glcr::String& command) { console_.WriteChar('\n'); } } + } else if (cmd == "exec") { + if (tokens.size() != 2) { + console_.WriteString("Provide the name of an executable.\n>"); + return; + } + auto file = mmth::File::Open(tokens[1]); + + // TODO: Wait until the process exits. + mmth::SpawnProcessFromElfRegion((uint64_t)file.raw_ptr(), gInitEndpointCap); + } else { console_.WriteString("Unknown command: "); console_.WriteString(command);