Shell: Add builtin command for starting window server and test windows

This commit is contained in:
Bananymous 2024-06-02 17:27:40 +03:00
parent 05ee242b80
commit 6346d1b6c7
1 changed files with 11 additions and 0 deletions

View File

@ -331,6 +331,17 @@ BAN::Optional<int> execute_builtin(BAN::Vector<BAN::String>& args, int fd_in, in
while (*current)
fprintf(fout, "%s\n", *current++);
}
else if (args.front() == "start-gui"sv)
{
pid_t pid = fork();
if (pid == 0)
execl("/bin/WindowServer", "WindowServer", NULL);
if (fork() == 0)
execl("/bin/test-window", "test-window", NULL);
if (fork() == 0)
execl("/bin/test-window", "test-window", NULL);
waitpid(pid, nullptr, 0);
}
else if (args.front() == "page-fault-test"sv)
{
volatile int* ptr = nullptr;