1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +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

@ -20,7 +20,7 @@ class Task : public InlineLinkedListNode<Task> {
struct Subregion;
public:
static Task* createKernelTask(void (*entry)(), String&& name);
static Task* createUserTask(const String& path, uid_t, gid_t, pid_t parentPID, int& error, const char** args = nullptr);
static Task* createUserTask(const String& path, uid_t, gid_t, pid_t parentPID, int& error, const char** args = nullptr, TTY* = nullptr);
~Task();
static Vector<Task*> allTasks();
@ -90,7 +90,8 @@ public:
pid_t sys$getpid();
int sys$open(const char* path, int options);
int sys$close(int fd);
int sys$read(int fd, void* outbuf, size_t nread);
ssize_t sys$read(int fd, void* outbuf, size_t nread);
ssize_t sys$write(int fd, const void*, size_t);
int sys$lstat(const char*, Unix::stat*);
int sys$seek(int fd, int offset);
int sys$kill(pid_t pid, int sig);
@ -115,6 +116,8 @@ public:
static void taskDidCrash(Task*);
const TTY* tty() const { return m_tty; }
size_t regionCount() const { return m_regions.size(); }
const Vector<RetainPtr<Region>>& regions() const { return m_regions; }
size_t subregionCount() const { return m_regions.size(); }