summaryrefslogtreecommitdiff
path: root/Servers
diff options
context:
space:
mode:
Diffstat (limited to 'Servers')
-rw-r--r--Servers/TTYServer/Makefile23
-rw-r--r--Servers/TTYServer/main.cpp16
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);
+ }
+}