Index: kernel/febase.cc
===================================================================
--- kernel/febase.cc	(revision 7504ddfe25cbc97ca03089b2d7dd8c1a3ff1d050)
+++ kernel/febase.cc	(revision c722540c7b58ede1c51a513cbac110db441c9c7f)
@@ -44,5 +44,4 @@
 int     si_echo = 0;
 int     printlevel = 0;
-int     pagelength = 24;
 int     colmax = 80;
 char    prompt_char = '>'; /*1 either '>' or '.'*/
Index: kernel/fereadl.c
===================================================================
--- kernel/fereadl.c	(revision 7504ddfe25cbc97ca03089b2d7dd8c1a3ff1d050)
+++ kernel/fereadl.c	(revision c722540c7b58ede1c51a513cbac110db441c9c7f)
@@ -46,12 +46,4 @@
     #endif
 
-    #ifdef atarist
-      #include <ioctl.h>
-    #else
-      #ifdef NeXT
-        #include <sgtty.h>
-        #include <sys/ioctl.h>
-      #endif
-    #endif
   #endif
 
@@ -66,10 +58,5 @@
 #define feCTRL(C) ((C) & 0x1F)    /* <ctrl> character  */
 
-/* Use this variable to remember original terminal attributes. */
-#if defined( atarist ) || defined( NeXT )
-  struct sgttyb  fe_saved_attributes;
-#else
-  struct termios fe_saved_attributes;
-#endif
+struct termios fe_saved_attributes;
 
 static BOOLEAN fe_stdout_is_tty;
@@ -77,4 +64,6 @@
 BOOLEAN fe_use_fgets=FALSE;
 static BOOLEAN fe_is_initialized=FALSE;
+static int     pagelength = 24;
+
 FILE *  fe_echo; /*the output file for echoed characters*/
 
@@ -102,13 +91,5 @@
     if (fe_is_raw_tty)
     {
-      #ifdef atarist
-        stty(0, &fe_saved_attributes);
-      #else
-        #ifdef NeXT
-          ioctl(STDIN_FILENO, TIOCSETP, &fe_saved_attributes);
-        #else
-          tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
-        #endif
-      #endif
+      tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
       fe_is_raw_tty=0;
     }
@@ -132,13 +113,5 @@
   if (fe_is_raw_tty)
   {
-    #ifdef atarist
-      stty(0, &fe_saved_attributes);
-    #else
-      #ifdef NeXT
-        ioctl(STDIN_FILENO, TIOCSETP, &fe_saved_attributes);
-      #else
-        tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
-      #endif
-    #endif
+    tcsetattr (STDIN_FILENO, TCSANOW, &fe_saved_attributes);
     fe_is_raw_tty=0;
   }
@@ -148,42 +121,12 @@
   if(fe_is_raw_tty==0)
   {
-    #ifdef atarist
-      /*set line wrap mode*/
-      if(fe_stdout_is_tty)
-      {
-        printf("\033v");
-      }
-    #endif
-    #if defined( atarist ) || defined( NeXT )
-      struct sgttyb tattr;
-    #else
-      struct termios tattr;
-    #endif
+    struct termios tattr;
 
     /* Set the funny terminal modes. */
-    #ifdef atarist
-       gtty(0, &tattr);
-       tattr.sg_flags |= RAW;
-       tattr.sg_flags |= CBREAK;
-       tattr.sg_flags &= ~ECHO;
-       stty(0, &tattr);
-    #else
-      #ifdef NeXT
-        ioctl(STDIN_FILENO, TIOCGETP, &tattr);
-        //tattr.sg_flags |= RAW;
-        tattr.sg_flags |= CBREAK;
-        tattr.sg_flags &= ~ECHO;
-        ioctl(STDIN_FILENO, TIOCSETP, &tattr);
-        ioctl(STDOUT_FILENO, TIOCGETP, &tattr);
-        tattr.sg_flags |= CRMOD;
-        ioctl(STDOUT_FILENO, TIOCSETP, &tattr);
-      #else
-        tcgetattr (STDIN_FILENO, &tattr);
-        tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
-        tattr.c_cc[VMIN] = 1;
-        tattr.c_cc[VTIME] = 0;
-        tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
-      #endif
-    #endif
+    tcgetattr (STDIN_FILENO, &tattr);
+    tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
+    tattr.c_cc[VMIN] = 1;
+    tattr.c_cc[VTIME] = 0;
+    tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
     fe_is_raw_tty=1;
   }
@@ -213,23 +156,10 @@
     {
       fe_stdout_is_tty=0;
-      #ifdef atarist
-        fe_echo = fopen( "/dev/tty", "w" );
-      #else
-        fe_echo = fopen( ttyname(fileno(stdin)), "w" );
-      #endif
+      fe_echo = fopen( ttyname(fileno(stdin)), "w" );
     }
     /* Save the terminal attributes so we can restore them later. */
     {
-      #if defined( atarist ) || defined( NeXT )
-        struct sgttyb tattr;
-        #ifdef atarist
-          gtty(0, &fe_saved_attributes);
-        #else
-          ioctl(STDIN_FILENO, TIOCGETP, &fe_saved_attributes);
-        #endif
-      #else
-        struct termios tattr;
-        tcgetattr (STDIN_FILENO, &fe_saved_attributes);
-      #endif
+      struct termios tattr;
+      tcgetattr (STDIN_FILENO, &fe_saved_attributes);
       #ifdef HAVE_FEREAD
         #ifdef HAVE_ATEXIT
@@ -241,29 +171,10 @@
 
       /* Set the funny terminal modes. */
-      #ifdef atarist
-        gtty(0, &tattr);
-        tattr.sg_flags |= RAW;
-        tattr.sg_flags |= CBREAK;
-        tattr.sg_flags &= ~ECHO;
-        stty(0, &tattr);
-      #else
-        #ifdef NeXT
-          ioctl(STDIN_FILENO, TIOCGETP, &tattr);
-          //tattr.sg_flags |= RAW;
-          tattr.sg_flags |= CBREAK;
-          tattr.sg_flags &= ~ECHO;
-          ioctl(STDIN_FILENO, TIOCSETP, &tattr);
-          ioctl(STDOUT_FILENO, TIOCGETP, &tattr);
-          tattr.sg_flags |= CRMOD;
-          ioctl(STDOUT_FILENO, TIOCSETP, &tattr);
-        #else
-          tcgetattr (STDIN_FILENO, &tattr);
-          tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
-          tattr.c_cc[VMIN] = 1;
-          tattr.c_cc[VTIME] = 0;
-          tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
-        #endif
-        /*ospeed=cfgetospeed(&tattr);*/
-      #endif
+      tcgetattr (STDIN_FILENO, &tattr);
+      tattr.c_lflag &= ~(ICANON|ECHO); /* Clear ICANON and ECHO. */
+      tattr.c_cc[VMIN] = 1;
+      tattr.c_cc[VTIME] = 0;
+      tcsetattr (STDIN_FILENO, TCSAFLUSH, &tattr);
+      /*ospeed=cfgetospeed(&tattr);*/
     }
     if(term==NULL)
