1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 18:05:07 +00:00

Virtual consoles kinda work!

We now make three VirtualConsoles at boot: tty0, tty1, and tty2.
We launch an instance of /bin/sh in each one.
You switch between them with Alt+1/2/3

How very very cool :^)
This commit is contained in:
Andreas Kling 2018-10-30 15:33:37 +01:00
parent 68739dc43e
commit 7a7956a595
24 changed files with 251 additions and 103 deletions

View file

@ -201,15 +201,16 @@ ByteBuffer procfs$summary()
auto tasks = Task::allTasks();
auto buffer = ByteBuffer::createUninitialized(tasks.size() * 256);
char* ptr = (char*)buffer.pointer();
ptr += ksprintf(ptr, "PID OWNER STATE PPID NSCHED FDS NAME\n");
ptr += ksprintf(ptr, "PID OWNER STATE PPID NSCHED FDS TTY NAME\n");
for (auto* task : tasks) {
ptr += ksprintf(ptr, "% 5u % 4u % 8s % 5u % 10u % 3u %s\n",
ptr += ksprintf(ptr, "% 5u % 4u % 8s % 5u % 10u % 3u % 4s %s\n",
task->pid(),
task->uid(),
toString(task->state()),
task->parentPID(),
task->timesScheduled(),
task->fileHandleCount(),
task->tty() ? task->tty()->ttyName().characters() : "n/a",
task->name().characters());
}
*ptr = '\0';