--- /dev/null
+#include <stdio.h>
+#include <termios.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+
+#include "tape.h"
+
+static struct termios orgstate;
+static struct termios workstate;
+
+static int fd;
+
+void tapeclose ()
+{
+ tcsetattr (fd, TCSANOW, &orgstate);
+ close (fd);
+}
+
+void tapestart ()
+{
+ char a = 0x11; //xon;
+ write (fd, &a, 1);
+}
+
+void tapestop ()
+{
+ char a = 0x13; //xoff;
+ write (fd, &a, 1);
+}
+
+void tapeinit (int tapefd)
+{
+ fd = tapefd;
+ tcgetattr (tapefd, &orgstate);
+ tcgetattr (tapefd, &workstate);
+ workstate.c_iflag = 0;
+ workstate.c_oflag = 0;
+ workstate.c_cflag = CS8 | CREAD | CLOCAL | CRTSCTS | CSTOPB;
+ workstate.c_lflag = 0;
+ cfsetspeed (&workstate, B4800);
+ tcsetattr (tapefd, TCSANOW, &workstate);
+}
+
+// Ende.