mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:17:35 +00:00
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!
This commit is contained in:
parent
072bf8cbb9
commit
67a4256a98
5 changed files with 63 additions and 1 deletions
23
Servers/TTYServer/Makefile
Normal file
23
Servers/TTYServer/Makefile
Normal file
|
@ -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
|
||||
|
16
Servers/TTYServer/main.cpp
Normal file
16
Servers/TTYServer/main.cpp
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue