Writing a simplistic telnet server is really easy. I did this in Minix ages ago.... on an Atari computer.

1) Open and listen to a socket
2) when connected, use a PTY and exec a shell with
the appropritate stdin/out connected / piped to the network socket.

Marius (Escort Cab + Mark II)