diff options
author | Conrad Pankoff <deoxxa@fknsrs.biz> | 2019-08-12 21:24:11 +1000 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-08-12 13:52:20 +0200 |
commit | 67a4256a983e38e11e628595818ab847f0e4c8c2 (patch) | |
tree | 1853d1bb6058386c79387d7210770c92a2dcdcea /Servers/TTYServer | |
parent | 072bf8cbb9f573288b1f001c4e95357018b50a51 (diff) | |
download | serenity-67a4256a983e38e11e628595818ab847f0e4c8c2.zip |
Server: Add TTYServer, a rudimentary text console manager
This should probably call out to a login program at some point. Right now
it just puts a root terminal on tty{1,2,3}.
Remember not to leave your Serenity workstation unattended!
Diffstat (limited to 'Servers/TTYServer')
-rw-r--r-- | Servers/TTYServer/Makefile | 23 | ||||
-rw-r--r-- | Servers/TTYServer/main.cpp | 16 |
2 files changed, 39 insertions, 0 deletions
diff --git a/Servers/TTYServer/Makefile b/Servers/TTYServer/Makefile new file mode 100644 index 0000000000..b65d1a8e65 --- /dev/null +++ b/Servers/TTYServer/Makefile @@ -0,0 +1,23 @@ +include ../../Makefile.common + +TTYSERVER_OBJS = \ + main.o + +APP = TTYServer +OBJS = $(TTYSERVER_OBJS) + +DEFINES += -DUSERLAND + +all: $(APP) + +$(APP): $(OBJS) + $(LD) -o $(APP) $(LDFLAGS) $(OBJS) -lc -lcore + +.cpp.o: + @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $< + +-include $(OBJS:%.o=%.d) + +clean: + @echo "CLEAN"; rm -f $(APP) $(OBJS) *.d + diff --git a/Servers/TTYServer/main.cpp b/Servers/TTYServer/main.cpp new file mode 100644 index 0000000000..f16c226c6d --- /dev/null +++ b/Servers/TTYServer/main.cpp @@ -0,0 +1,16 @@ +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char** argv) +{ + if (argc < 2) + return -1; + + dbgprintf("Starting console server on %s\n", argv[1]); + + while (true) { + dbgprintf("Running shell on %s\n", argv[1]); + int rc = system("/bin/Shell"); + dbgprintf("Shell on %s exited with code %d\n", argv[1], rc); + } +} |