*** /home/phil/min1.5ref/commands/sh/sh.h	Wed Nov 14 00:06:53 1990
--- commands/sh/sh.h	Tue Dec  4 16:48:09 1990
***************
*** 4,10 ****
   */
  
  #define NULL    0
! #define	LINELIM	1000
  #define	NPUSH	8	/* limit to input nesting */
  
  #define	NOFILE	20	/* Number of open files */
--- 4,10 ----
   */
  
  #define NULL    0
! #define	LINELIM	4000
  #define	NPUSH	8	/* limit to input nesting */
  
  #define	NOFILE	20	/* Number of open files */
***************
*** 348,350 ****
--- 348,352 ----
  #define	NEW(type) (type *)getcell(sizeof(type))
  #define	DELETE(obj)	freecell((char *)obj)
  
+ /* Last resort.... */
+ #define NAME_MAX DIRSIZ
*** /home/phil/min1.5ref/commands/sh/sh3.c	Wed Nov 14 00:06:54 1990
--- commands/sh/sh3.c	Wed Dec  5 22:00:23 1990
***************
*** 17,38 ****
   */
  
  static	char	*signame[] = {
! 	"Signal 0",
! 	"Hangup",
! 	(char *)NULL,	/* interrupt */
! 	"Quit",
! 	"Illegal instruction",
! 	"Trace/BPT trap",
! 	"Abort",
! 	"EMT trap",
! 	"Floating exception",
! 	"Killed",
! 	"Bus error",
! 	"Memory fault",
! 	"Bad system call",
! 	(char *)NULL,	/* broken pipe */
! 	"Alarm clock",
! 	"Terminated",
  };
  #define	NSIGNAL (sizeof(signame)/sizeof(signame[0]))
  
--- 17,43 ----
   */
  
  static	char	*signame[] = {
! 	"Signal 0",			/* 0 */
! 	"Hangup",			/* 1 */
! 	(char *)NULL,			/* 2 interrupt */
! 	"Quit",				/* 3 */
! 	"Illegal instruction",		/* 4 */
! 	/*"Trace/BPT trap",*/		/* 5 */
! 	"Trace",			/* 5 */
! 	/*"Abort",*/			/* 6 */
! 	"Out of memory",		/* 6 */
! 	/*"EMT trap",*/			/* 7 */
! 	"Divide by zero",		/* 7 */
! 	"Floating exception",		/* 8 */
! 	"Killed",			/* 9 */
! 	"Bus error",			/* 10 */
! 	/*"Memory fault",*/		/* 11 */
! 	"Flag trap",			/* 11 */
! 	/*"Bad system call",*/		/* 12 */
! 	"Breakpoint",			/* 12 */
! 	(char *)NULL,			/* 13 broken pipe */
! 	"Alarm clock",			/* 14 */
! 	"Terminated",			/* 15 */
  };
  #define	NSIGNAL (sizeof(signame)/sizeof(signame[0]))
  
***************
*** 863,869 ****
  
  setsig(n, f)
  register n;
! int (*f)();
  {
  	if (n == 0)
  		return;
--- 868,874 ----
  
  setsig(n, f)
  register n;
! void (*f)();
  {
  	if (n == 0)
  		return;
*** /home/phil/min1.5ref/commands/tar.c	Wed Nov 14 00:06:55 1990
--- commands/tar.c	Wed Nov 14 01:16:36 1990
***************
*** 376,382 ****
  		dmajor = (int) convert(header.dbuf.devmajor, INT_TYPE);
  		dminor = (int) convert(header.dbuf.devminor, INT_TYPE);
  		mode = (header.dbuf.typeflag == '3' ? S_IFCHR : S_IFBLK);
! 		if (mknod(file, mode, (dmajor << 8 | dminor), 0) == 0) {
  			if (verbose_flag) string_print(NIL_PTR,
  					     "made %s special file major %s minor %s\n",
  				      (header.dbuf.typeflag == '3' ?
--- 376,382 ----
  		dmajor = (int) convert(header.dbuf.devmajor, INT_TYPE);
  		dminor = (int) convert(header.dbuf.devminor, INT_TYPE);
  		mode = (header.dbuf.typeflag == '3' ? S_IFCHR : S_IFBLK);
! 		if (mknod(file, mode, (dmajor << 8 | dminor)) == 0) {
  			if (verbose_flag) string_print(NIL_PTR,
  					     "made %s special file major %s minor %s\n",
  				      (header.dbuf.typeflag == '3' ?
*** /home/phil/min1.5ref/commands/tsort.c	Wed Dec  5 21:17:38 1990
--- commands/tsort.c	Thu Nov  1 14:27:47 1990
***************
*** 44,50 ****
          fputs("Out of memory.\n",stderr);
          exit(1);
      }
-     return(rval);
  }
  
  /*
--- 44,49 ----
***************
*** 190,196 ****
  ** topo - do a topological sort of the dependency graph.
  */
  topo() {
!     vertex *x;
      edge *e;
      vertex *outq = NULL,*tmp;
  #define insq(x) ((x->next = outq),(outq = x))
--- 189,195 ----
  ** topo - do a topological sort of the dependency graph.
  */
  topo() {
!     vertex *x = vset,*n;
      edge *e;
      vertex *outq = NULL,*tmp;
  #define insq(x) ((x->next = outq),(outq = x))
***************
*** 201,207 ****
      ** Since it break the next links to insert x into the queue,
      ** x->next is saved before insq, to resume the list traversal.
      */
!     for(x = vset; x != NULL; x = x->next)
          if(x->indegree == 0) {
              insq(x);
              pushname(x->key);       
--- 200,206 ----
      ** Since it break the next links to insert x into the queue,
      ** x->next is saved before insq, to resume the list traversal.
      */
!     for(n = x->next; x != NULL; x = n, n = x->next)
          if(x->indegree == 0) {
              insq(x);
              pushname(x->key);       
*** /home/phil/min1.5ref/commands/atrun.c	Wed Nov 14 00:07:01 1990
--- commands/atrun.c	Sun Nov  4 13:34:26 1990
***************
*** 43,50 ****
  				if (link(procname, procpast) == 0) {	/* link ok? */
  					unlink(procname);
  					stat(procpast, &sbuf);
! 					setgid(sbuf.st_uid);
! 					setuid(sbuf.st_gid);
  					execl("/bin/sh", "sh", procpast, (char *) 0);
  					fprintf(stderr, "proc %s can't start\n", procpast);
  					exit(1);
--- 43,50 ----
  				if (link(procname, procpast) == 0) {	/* link ok? */
  					unlink(procname);
  					stat(procpast, &sbuf);
! 					setgid(sbuf.st_gid);
! 					setuid(sbuf.st_uid);
  					execl("/bin/sh", "sh", procpast, (char *) 0);
  					fprintf(stderr, "proc %s can't start\n", procpast);
  					exit(1);
*** /home/phil/min1.5ref/commands/stty.c	Wed Nov 14 00:07:02 1990
--- commands/stty.c	Sun Feb 10 17:51:48 1991
***************
*** 20,25 ****
--- 20,29 ----
  #define clr1 args.sg_flags &= ~(BITS5 | BITS6 | BITS7 | BITS8)
  #define clr2 args.sg_flags &= ~(EVENP | ODDP)
  
+ /* function definitions. */
+ char optchar (char *str);
+ 
+ 
  main(argc, argv)
  int argc;
  char *argv[];
***************
*** 63,70 ****
    pr(mode & ODDP, 5);
    pr(mode & EVENP, 6);
  
!   ispeed = 100 * ((int) args.sg_ispeed & BYTE);
!   ospeed = 100 * ((int) args.sg_ospeed & BYTE);
    prints("\nkill = ");
    prctl(args.sg_kill);
    prints("\nerase = ");
--- 67,74 ----
    pr(mode & ODDP, 5);
    pr(mode & EVENP, 6);
  
!   ispeed =  speed2baud ((int) args.sg_ispeed & BYTE);
!   ospeed =  speed2baud ((int) args.sg_ospeed & BYTE);
    prints("\nkill = ");
    prctl(args.sg_kill);
    prints("\nerase = ");
***************
*** 76,82 ****
    if (ispeed > 0) {
  	prints("\nspeed = ");
  	switch (ispeed) {
! 	    case 100:	prints("110");	break;
  	    case 200:	prints("200");	break;
  	    case 300:	prints("300");	break;
  	    case 600:	prints("600");	break;
--- 80,89 ----
    if (ispeed > 0) {
  	prints("\nspeed = ");
  	switch (ispeed) {
! 	    case  50:   prints("50");   break;
! 	    case  75:   prints("50");   break;
! 	    case 110:	prints("110");	break;
! 	    case 150:	prints("150");	break;
  	    case 200:	prints("200");	break;
  	    case 300:	prints("300");	break;
  	    case 600:	prints("600");	break;
***************
*** 87,93 ****
  	    case 4800:	prints("4800");	break;
  	    case 7200:	prints("7200");	break;
  	    case 9600:	prints("9600");	break;
! 	    case 19200:	prints("19200");	break;
  	    default:	prints("unknown");
  	}
  	switch (mode & BITS8) {
--- 94,101 ----
  	    case 4800:	prints("4800");	break;
  	    case 7200:	prints("7200");	break;
  	    case 9600:	prints("9600");	break;
! 	    case 19200:	prints("19200"); break;
! 	    case 38400:	prints("38400"); break;
  	    default:	prints("unknown");
  	}
  	switch (mode & BITS8) {
***************
*** 171,195 ****
  	return;
    }
    if (match(opt, "kill")) {
! 	args.sg_kill = *next;
  	k++;
  	return;
    }
    if (match(opt, "erase")) {
! 	args.sg_erase = *next;
  	k++;
  	return;
    }
    if (match(opt, "int")) {
! 	tch.t_intrc = *next;
  	k++;
  	return;
    }
    if (match(opt, "quit")) {
! 	tch.t_quitc = *next;
  	k++;
  	return;
    }
    if (match(opt, "5")) {
  	clr1;
  	args.sg_flags |= BITS5;
--- 179,218 ----
  	return;
    }
    if (match(opt, "kill")) {
! 	args.sg_kill = optchar(next);
  	k++;
  	return;
    }
    if (match(opt, "erase")) {
! 	args.sg_erase = optchar(next);
  	k++;
  	return;
    }
    if (match(opt, "int")) {
! 	tch.t_intrc = optchar(next);
  	k++;
  	return;
    }
    if (match(opt, "quit")) {
! 	tch.t_quitc = optchar(next);
  	k++;
  	return;
    }
+   if (match(opt, "eof")) {
+ 	tch.t_eofc = optchar(next);
+ 	k++;
+ 	return;
+   }
+   if (match(opt, "start")) {
+ 	tch.t_startc = optchar(next);
+ 	k++;
+ 	return;
+   }
+   if (match(opt, "stop")) {
+ 	tch.t_stopc = optchar(next);
+ 	k++;
+ 	return;
+   }
    if (match(opt, "5")) {
  	clr1;
  	args.sg_flags |= BITS5;
***************
*** 210,221 ****
  	args.sg_flags |= BITS8;
  	return;
    }
    if (match(opt, "110")) {
  	speed(B110);
  	return;
    }
!   if (match(opt, "200")) {
! 	speed(2);
  	return;
    }
    if (match(opt, "300")) {
--- 233,256 ----
  	args.sg_flags |= BITS8;
  	return;
    }
+   if (match(opt, "50")) {
+ 	speed(B50);
+ 	return;
+   }
+   if (match(opt, "75")) {
+ 	speed(B75);
+ 	return;
+   }
    if (match(opt, "110")) {
  	speed(B110);
  	return;
    }
!   if (match(opt, "150")) {
! 	speed(B150);
! 	return;
!   }
!   if (match(opt, "200")) {
! 	speed(B200);
  	return;
    }
    if (match(opt, "300")) {
***************
*** 223,229 ****
  	return;
    }
    if (match(opt, "600")) {
! 	speed(6);
  	return;
    }
    if (match(opt, "1200")) {
--- 258,264 ----
  	return;
    }
    if (match(opt, "600")) {
! 	speed(B600);
  	return;
    }
    if (match(opt, "1200")) {
***************
*** 231,237 ****
  	return;
    }
    if (match(opt, "1800")) {
! 	speed(18);
  	return;
    }
    if (match(opt, "2400")) {
--- 266,272 ----
  	return;
    }
    if (match(opt, "1800")) {
! 	speed(B1800);
  	return;
    }
    if (match(opt, "2400")) {
***************
*** 239,245 ****
  	return;
    }
    if (match(opt, "3600")) {
! 	speed(36);
  	return;
    }
    if (match(opt, "4800")) {
--- 274,280 ----
  	return;
    }
    if (match(opt, "3600")) {
! 	speed(B3600);
  	return;
    }
    if (match(opt, "4800")) {
***************
*** 247,253 ****
  	return;
    }
    if (match(opt, "7200")) {
! 	speed(72);
  	return;
    }
    if (match(opt, "9600")) {
--- 282,288 ----
  	return;
    }
    if (match(opt, "7200")) {
! 	speed(B7200);
  	return;
    }
    if (match(opt, "9600")) {
***************
*** 255,261 ****
  	return;
    }
    if (match(opt, "19200")) {
! 	speed(192);
  	return;
    }
    if (match(opt, "default")) {
--- 290,300 ----
  	return;
    }
    if (match(opt, "19200")) {
! 	speed(B19200);
! 	return;
!   }
!   if (match(opt, "38400")) {
! 	speed(B38400);
  	return;
    }
    if (match(opt, "default")) {
***************
*** 300,302 ****
--- 339,381 ----
    else
  	prints("%c", c);
  }
+ 
+ 
+ /* This will allow for ^x specification of characters. */
+ char optchar(str)
+ char *str;
+ {
+   if (str[1] == 0) return *str;
+   if (match(str,"DEL")) return 0177;
+   if (str[0] != '^') return *str;
+   if (str[1] >= 'a' && str[1] <= 'z') return (str[1]-'a'+1);
+   if (str[1] >= 'A' && str[1] <= 'Z') return (str[1]-'A'+1);
+   return (0);
+ }
+ 
+ /*  A way to get the baud rate independant of the settings of 
+     the Bxxxx parameters. */
+ 
+ int speed2baud ( speed )
+  char speed;
+  {
+     switch(speed) {
+ 	case B50:   return(50);
+ 	case B75:   return(75);
+ 	case B110:  return(110);
+ 	case B150:  return(150);
+ 	case B200:  return(200);
+ 	case B300:  return(300);
+ 	case B600:  return(600);
+ 	case B1200: return(1200);
+ 	case B1800: return(1800);
+ 	case B2400: return(2400);
+ 	case B3600: return(3600);
+ 	case B4800: return(4800);
+ 	case B7200: return(7200);
+ 	case B9600: return(9600);
+ 	case B19200: return(19200); 
+ 	case B38400: return(38400); 
+ 	default: return(0);
+     }
+ }
*** /home/phil/min1.5ref/commands/compress.c	Wed Nov 14 00:07:04 1990
--- commands/compress.c	Wed Nov 14 19:53:37 1990
***************
*** 78,84 ****
  #ifdef AZTECBITS
  # define BITS   AZTECBITS
  #else
! # define BITS 13
  #endif
  # undef USERMEM
  #endif /* AZTEC86 */
--- 78,84 ----
  #ifdef AZTECBITS
  # define BITS   AZTECBITS
  #else
! # define BITS 16
  #endif
  # undef USERMEM
  #endif /* AZTEC86 */
***************
*** 1390,1399 ****
  		timep[1] = statbuf.st_mtime;
  #endif
  		utime(ofname, timep);	/* Update last accessed and modified times */
! /*
! 		if (unlink(ifname))
! 		    perror(ifname);
! */
  		if(!quiet)
  		    if(do_decomp == 0)
  			fprintf(stderr, " -- compressed to %s", ofname);
--- 1390,1399 ----
  		timep[1] = statbuf.st_mtime;
  #endif
  		utime(ofname, timep);	/* Update last accessed and modified times */
! 
! 		if (unlink(ifname))
! 		    perror(ifname);
! 
  		if(!quiet)
  		    if(do_decomp == 0)
  			fprintf(stderr, " -- compressed to %s", ofname);
*** /home/phil/min1.5ref/commands/cpdir.c	Wed Nov 14 00:07:04 1990
--- commands/cpdir.c	Wed Nov 14 01:16:24 1990
***************
*** 220,226 ****
  	       sp->st_rdev >> 8, sp->st_rdev & 0177);
  	printf(" Mode = %o.\n", sp->st_mode);
    }
!   if (mknod(d, sp->st_mode, sp->st_rdev, 0) < 0) {
  	perror("mknod");
  	nonfatal("Cannot create special file %s.\n", d);
    }
--- 220,226 ----
  	       sp->st_rdev >> 8, sp->st_rdev & 0177);
  	printf(" Mode = %o.\n", sp->st_mode);
    }
!   if (mknod(d, sp->st_mode, sp->st_rdev) < 0) {
  	perror("mknod");
  	nonfatal("Cannot create special file %s.\n", d);
    }
*** /home/phil/min1.5ref/commands/pc532/ps.c	Wed Nov 14 00:34:31 1990
--- commands/pc532/ps.c	Sun Nov  4 13:51:41 1990
***************
*** 6,21 ****
   * those first few bytes are, i.e. where Minix was loaded.  The
   * default it 0x200000.  Other load addresses may be given as a parameter.
   */
! #include <h/const.h>
! #include <h/type.h>
! #include <kernel/proc.h>
! #include <mm/const.h>
! #include <mm/mproc.h>
  #include <stdio.h>
  #include <fcntl.h>
  
  #undef  printf
! /*#define LD_ADR		0x200000*/	/* where Minix is loaded */
  #define PROC_OFF	0x10		/* where to find proc address */
  #define MPROC_OFF	0x14		/* where to find mproc address */
  #define FREE_OFF	0x20
--- 6,20 ----
   * those first few bytes are, i.e. where Minix was loaded.  The
   * default it 0x200000.  Other load addresses may be given as a parameter.
   */
! #include "kernel-1.3/kernel.h"
! #include "kernel-1.3/proc.h"
! #include "mm/const.h"
! #include "mm/mproc.h"
  #include <stdio.h>
  #include <fcntl.h>
  
  #undef  printf
! #define LD_ADR		0x2000		/* where Minix is loaded */
  #define PROC_OFF	0x10		/* where to find proc address */
  #define MPROC_OFF	0x14		/* where to find mproc address */
  #define FREE_OFF	0x20
***************
*** 122,128 ****
  {
    char *p, *end;
  
!   for (p = mp->mp_name, end = mp->mp_name + NAME_SIZE; *p && p < end; ++p)
      putchar (*p);
  }
  
--- 121,127 ----
  {
    char *p, *end;
  
!   for (p = mp->mp_name, end = mp->mp_name + NAME_MAX; *p && p < end; ++p)
      putchar (*p);
  }
  
*** /home/phil/min1.5ref/commands/pc532/ncat.c	Wed Nov 14 00:34:06 1990
--- commands/pc532/ncat.c	Sun Nov  4 13:51:43 1990
***************
*** 3,8 ****
--- 3,9 ----
   * at any offset.  Unlike dd, always reads big chunks.
   */
  #include <stdio.h>
+ #include <sys/types.h>
  #include <fcntl.h>
  #define BUFSZ	0x8000
  #define ALL	0x7fffffff
*** /home/phil/min1.5ref/commands/pc532/postmort.c	Wed Nov 14 00:34:19 1990
--- commands/pc532/postmort.c	Sun Nov  4 13:51:43 1990
***************
*** 2,11 ****
   * Note: compile with -DNS32K
   * Bruce Culbertson
   */
! #include <stdio.h>
! #include <const.h>
! #include <core.h>
! #include <fcntl.h>
  
  #define DEFAULT_CORE	"core"
  #define NM		"nm"
--- 2,13 ----
   * Note: compile with -DNS32K
   * Bruce Culbertson
   */
! 
! #include <minix/const.h>
! #include <sys/types.h>
! #include <stdio.h>
! #include <fcntl.h>
! #include <core.h>
  
  #define DEFAULT_CORE	"core"
  #define NM		"nm"
*** /home/phil/min1.5ref/commands/pc532/ar.c	Wed Nov 14 00:35:16 1990
--- commands/pc532/ar.c	Sun Nov  4 13:51:56 1990
***************
*** 50,61 ****
  #include <stdio.h>
  
  struct i_ar_hdr {		/* local version, maybe different padding */
!   char ar_name[14];
!   long ar_date;
!   char ar_uid;
!   char ar_gid;
!   int ar_mode;
!   long ar_size;
  };
  
  
--- 50,61 ----
  #include <stdio.h>
  
  struct i_ar_hdr {		/* local version, maybe different padding */
!   char  ar_name[14];
!   long  ar_date;
!   char  ar_uid;
!   char  ar_gid;
!   short ar_mode;
!   long  ar_size;
  };
  
  
***************
*** 103,110 ****
  #define BUFFERSIZE	4096
  #define WRITE		2	/* both read & write */
  #define READ		0
! #define MAGICSIZE	sizeof(short)	/* size of magic number in file */
! #define SIZEOF_AR_HDR	((size_t) 26)
  
  /* Option switches */
  char verbose = 0;
--- 103,110 ----
  #define BUFFERSIZE	4096
  #define WRITE		2	/* both read & write */
  #define READ		0
! #define MAGICSIZE	sizeof(MAGIC_TYPE)	/* size of magic number in file */
! #define SIZEOF_AR_HDR	sizeof(struct ar_hdr)
  
  /* Option switches */
  char verbose = 0;
***************
*** 113,118 ****
--- 113,119 ----
  char only = 0;
  char Major = 0;
  char Minor = 0;
+ char debug = 0;
  
  /* Global variables */
  char *tmp1;
***************
*** 135,141 ****
  extern char *mktemp(), *rindex();
  extern int strncmp();
  extern print_date();
! extern user_abort(), usage();
  extern char *basename();
  
  int main(argc, argv)
--- 136,143 ----
  extern char *mktemp(), *rindex();
  extern int strncmp();
  extern print_date();
! extern void user_abort();
! extern usage();
  extern char *basename();
  
  int main(argc, argv)
***************
*** 178,183 ****
--- 180,188 ----
  		Major |= TABLE;
  		++opts_seen;
  		break;
+ 	    case 'D':
+ 		debug++;
+ 		break;
  	    case 'l':	local |= LOCAL;	break;
  	    case 'a':	Minor |= AFTER;	break;
  	    case 'i':
***************
*** 199,208 ****
    } else if (only & ONLY)
  	if (!(Major & REPLACE)) usage();
  
!   if (local)
! 	tmp1 = mktemp("./ar.1.XXXXXX");
!   else
! 	tmp1 = mktemp("/tmp/ar.1.XXXXXX");
  
    /* Now if Minor says AFTER or BEFORE - then get posname */
    if (Minor & (AFTER | BEFORE) && argc >= 4) {
--- 204,214 ----
    } else if (only & ONLY)
  	if (!(Major & REPLACE)) usage();
  
!   tmp1 = malloc (17);
!   if (local)
! 	tmp1 = mktemp(strcpy(tmp1,"./ar.1.XXXXXX"));
!   else
! 	tmp1 = mktemp(strcpy(tmp1,"/tmp/ar.1.XXXXXX"));
  
    /* Now if Minor says AFTER or BEFORE - then get posname */
    if (Minor & (AFTER | BEFORE) && argc >= 4) {
***************
*** 250,262 ****
    exit(1);
  }
  
! user_abort()
  {
    unlink(tmp1);
    exit(1);
  }
  
! insert_abort()
  {
    unlink(tmp1);
    unlink(tmp2);
--- 256,268 ----
    exit(1);
  }
  
! void user_abort()
  {
    unlink(tmp1);
    exit(1);
  }
  
! void insert_abort()
  {
    unlink(tmp1);
    unlink(tmp2);
***************
*** 276,287 ****
  
  /* Convert int to pdp-11 order char array */
  
! int_to_p2(cp, n)
! char *cp;
! int n;
! {
!   cp[0] = n;
!   cp[1] = n >> 8;
  }
  
  /* Convert long to pdp-11 order char array */
--- 282,293 ----
  
  /* Convert int to pdp-11 order char array */
  
! short_to_p2(cp, n)
! char *cp;
! short n;
! {
!   cp[0] = n;
!   cp[1] = n >> 8; 
  }
  
  /* Convert long to pdp-11 order char array */
***************
*** 293,304 ****
    cp[2] = n;
    cp[3] = n >> 8;
    cp[0] = n >> 16;
!   cp[1] = n >> 24;
  }
  
  /* Convert char array regarded as a pdp-11 order int to an int */
  
! int p2_to_int(cp)
  unsigned char *cp;
  {
    return(cp[0] + 0x100 * cp[1]);
--- 299,310 ----
    cp[2] = n;
    cp[3] = n >> 8;
    cp[0] = n >> 16;
!   cp[1] = n >> 24; 
  }
  
  /* Convert char array regarded as a pdp-11 order int to an int */
  
! short p2_to_short(cp)
  unsigned char *cp;
  {
    return(cp[0] + 0x100 * cp[1]);
***************
*** 331,337 ****
    int ret;
    static struct i_ar_hdr member;
    struct ar_hdr xmember;
! 
    if ((ret = read(fd, (char *) &xmember, (unsigned) SIZEOF_AR_HDR)) <= 0)
  	return((struct i_ar_hdr *) NULL);
    if (ret != SIZEOF_AR_HDR) {
--- 337,345 ----
    int ret;
    static struct i_ar_hdr member;
    struct ar_hdr xmember;
!   long location;
! 
!   if (debug) location = lseek (fd, 0, SEEK_CUR);
    if ((ret = read(fd, (char *) &xmember, (unsigned) SIZEOF_AR_HDR)) <= 0)
  	return((struct i_ar_hdr *) NULL);
    if (ret != SIZEOF_AR_HDR) {
***************
*** 346,353 ****
    member.ar_date = p4_to_long(xmember.ar_date);
    member.ar_uid = xmember.ar_uid;
    member.ar_gid = xmember.ar_gid;
!   member.ar_mode = p2_to_int(xmember.ar_mode);
!   member.ar_size = p4_to_long(xmember.ar_size);
    return(&member);
  }
  
--- 354,364 ----
    member.ar_date = p4_to_long(xmember.ar_date);
    member.ar_uid = xmember.ar_uid;
    member.ar_gid = xmember.ar_gid;
!   member.ar_mode = p2_to_short(xmember.ar_mode);
!   member.ar_size = p4_to_long(xmember.ar_size);
!   if (debug)
!     printf("member=%s, location=%d, size=%d\n",member.ar_name,
! 		location, member.ar_size);
    return(&member);
  }
  
***************
*** 355,361 ****
  char *filename;
  int opt;
  {
!   static unsigned short magic;
    int fd, omode;
  
    /* To_create can have values of 0,1,2 */
--- 366,372 ----
  char *filename;
  int opt;
  {
!   static MAGIC_TYPE magic;
    int fd, omode;
  
    /* To_create can have values of 0,1,2 */
***************
*** 513,519 ****
    long_to_p4(xmember.ar_date, member->ar_date);
    xmember.ar_uid = member->ar_uid;
    xmember.ar_gid = member->ar_gid;
!   int_to_p2(xmember.ar_mode, member->ar_mode);
    long_to_p4(xmember.ar_size, member->ar_size);
  
    mwrite(outfd, (char *) &xmember, (int) SIZEOF_AR_HDR);
--- 524,530 ----
    long_to_p4(xmember.ar_date, member->ar_date);
    xmember.ar_uid = member->ar_uid;
    xmember.ar_gid = member->ar_gid;
!   short_to_p2(xmember.ar_mode, member->ar_mode);
    long_to_p4(xmember.ar_size, member->ar_size);
  
    mwrite(outfd, (char *) &xmember, (int) SIZEOF_AR_HDR);
***************
*** 576,585 ****
    int cnt, want, a, newfd;
    struct i_ar_hdr *member;
  
!   if (local)
! 	tmp2 = mktemp("./ar.2.XXXXXX");
!   else
! 	tmp2 = mktemp("/tmp/ar.2.XXXXXX");
  
    close(oldfd);			/* close old temp file */
    signal(SIGINT, insert_abort);	/* set new signal handler */
--- 587,597 ----
    int cnt, want, a, newfd;
    struct i_ar_hdr *member;
  
!   tmp2 = malloc (17);
!   if (local)
! 	tmp2 = mktemp(strcpy(tmp2,"./ar.2.XXXXXX"));
!   else
! 	tmp2 = mktemp(strcpy(tmp2,"/tmp/ar.2.XXXXXX"));
  
    close(oldfd);			/* close old temp file */
    signal(SIGINT, insert_abort);	/* set new signal handler */
***************
*** 630,639 ****
    int cnt, want, a, newfd;
    struct i_ar_hdr *member;
  
!   if (local)
! 	tmp2 = mktemp("./ar.2.XXXXXX");
!   else
! 	tmp2 = mktemp("/tmp/ar.2.XXXXXX");
  
    close(oldfd);			/* close old temp file */
    signal(SIGINT, insert_abort);	/* set new signal handler */
--- 642,652 ----
    int cnt, want, a, newfd;
    struct i_ar_hdr *member;
  
!   tmp2 = malloc (17);
!   if (local)
! 	tmp2 = mktemp(strcpy(tmp2,"./ar.2.XXXXXX"));
!   else
! 	tmp2 = mktemp(strcpy(tmp2,"/tmp/ar.2.XXXXXX"));
  
    close(oldfd);			/* close old temp file */
    signal(SIGINT, insert_abort);	/* set new signal handler */
*** /home/phil/min1.5ref/commands/pc532/term.c	Wed Nov 14 01:00:00 1990
--- commands/pc532/term.c	Thu Feb  7 21:14:19 1991
***************
*** 17,22 ****
--- 17,28 ----
   *
   * 11 Oct 88 BDE: Cleaned up baud rates and parity stripping.
   *
+  * Dec 1990 and after (PAN): Changes added to make it work on a
+  *    pc532 with the serial lines as the control terminal.
+  *
+  * Feb 1991 PAN: Added zmodem transfers.  Source for some changes comes
+  *    from Bob Best.
+  *
   * Example usage:
   *	term			: baud, bits/char, parity from /dev/tty1
   *	term 9600 7 even	: 9600 baud, 7 bits/char, even parity
***************
*** 36,72 ****
  #define CHUNK 1024		/* how much to read at once */
  #define NULL     0
  
! /* Hack some new baud rates for Minix. Minix uses a divide-by-100 encoding. */
! #define B200     2
! #define B600     6
! #define B1800   18
! #define B3600   36
! #define B7200   72
! #define B19200 192
! #define EXTA   192
! /* We can't handle some standard (slow) V7 speeds and speeds above 25500 since
!  * since the speed is packed into a char :-(. Trap them with an illegal value.
!  */
! #define B50      0
! #define B75      0
! #define B134     0
! #define EXTB     0
! #define B38400   0
! #define B57600   0
! #define B115200  0
! 
! int commfd;			/* open file no. for comm device */
! int readpid;			/* pid of child reading commfd */
! struct sgttyb sgcommfd;		/* saved terminal parameters for commfd */
! struct sgttyb sgstdin;		/* saved terminal parameters for stdin */
  int writepid;			/* pid of child writing commfd */
  
  #if (MACHINE == ATARI)
  char endseq[] = "Ou";	/* sequence to leave simulator */
! #else
! char endseq[] = "\033[G";	/* sequence to leave simulator */
! #endif
!  /* Keypad '5', and must arrive in 1 piece */
  struct param_s {
    char *pattern;
    int value;
--- 42,66 ----
  #define CHUNK 1024		/* how much to read at once */
  #define NULL     0
  
! int commfd;			/* open file no. for comm device */
! struct sgttyb sgcommfd;		/* saved terminal parameters for commfd */
! struct sgttyb sgstdin;		/* saved terminal parameters for stdin */
! int readpid;			/* pid of child reading commfd */
  int writepid;			/* pid of child writing commfd */
  
  #if (MACHINE == ATARI)
  char endseq[] = "Ou";	/* sequence to leave simulator */
! #endif
! #if (MACHINE == IBM_PC)
! /* Keypad '5', and must arrive in 1 piece */
! char endseq[] = "\033[G";	/* sequence to leave simulator */
! #endif
! #if (MACHINE == PC532)
! char last_char = ' ';   /* Last character. */
! #define CMD_CHAR '~'    /* Character to start a command sequence. */
! char endseq[] = "~q";	/* sequence to leave simulator, change with CMD_CHAR */
! #endif
! 
  struct param_s {
    char *pattern;
    int value;
***************
*** 107,119 ****
    "EXTA", EXTA, SPEED,
    "EXTB", EXTB, SPEED,
    "38400", B38400, SPEED,
!   "57600", B57600, SPEED,
!   "115200", B115200, SPEED,
    "", 0, BAD,			/* BAD type to end list */
  };
  unsigned char strip_parity = 1;	/* nonzero to strip high bits before output */
  
! int quit();			/* forward declare signal handler */
  
  main(argc, argv)
  int argc;
--- 101,114 ----
    "EXTA", EXTA, SPEED,
    "EXTB", EXTB, SPEED,
    "38400", B38400, SPEED,
! /*"57600", B57600, SPEED,
!   "115200", B115200, SPEED,   */
    "", 0, BAD,			/* BAD type to end list */
  };
  unsigned char strip_parity = 1;	/* nonzero to strip high bits before output */
  
! void quit();			/* forward declare signal handler */
! void pipequit();
  
  main(argc, argv)
  int argc;
***************
*** 148,154 ****
  
    /* Main body of the terminal simulator. */
    signal(SIGINT, quit);
!   signal(SIGPIPE, quit);
    if (pipe(pipefd) < 0) error("Can't create pipe", "");
    switch ((writepid = fork())) {
        case -1:
--- 143,149 ----
  
    /* Main body of the terminal simulator. */
    signal(SIGINT, quit);
!   signal(SIGPIPE, pipequit);
    if (pipe(pipefd) < 0) error("Can't create pipe", "");
    switch ((writepid = fork())) {
        case -1:
***************
*** 240,245 ****
--- 235,266 ----
    ioctl(fd, TIOCSETP, &sgtty);
  }
  
+ #if (MACHINE == PC532)
+ /* For use with zmodem transfers, stops one process while zmodem runs. */
+ 
+ int was_sig_int;
+ int was_stopped;
+ 
+ void dummy()	/* dummy process to to catch "continue" signal */
+    { was_sig_int = 0; }
+ 
+ void int_dummy()	/* dummy process to to catch "interrupt" signal */
+    { was_sig_int = 0; }
+ 
+ void child_suspend()
+ {
+    /* wait for a new signal, then continue */
+    signal (SIGUSR2, dummy);
+    was_sig_int = 1;
+    while (was_sig_int) {	
+       signal (SIGINT, int_dummy);
+       pause();
+    }
+    signal (SIGUSR2, child_suspend);
+    signal (SIGINT, SIG_DFL);
+    was_stopped = 1;
+ }
+ #endif
  
  copy(in, inname, out, outname, end)
  int in;
***************
*** 262,280 ****
    int len;
  
    len = strlen(end);
!   while (1) {
! 	if ((count = read(in, buf, CHUNK)) <= 0) {
  		write2sn("Can't read from ", inname);
  		quit();
  	}
! 	if (count == len && strncmp(buf, end, count) == 0) quit();
  	if (strip_parity) for (bufp = buf, bufend = bufp + count;
  		     bufp < bufend; ++bufp)
  			*bufp &= 0x7F;
! 	if (write(out, buf, count) != count) {
! 		write2sn("Can't write to ", outname);
! 		quit();
! 	}
    }
  }
  
--- 283,308 ----
    int len;
  
    len = strlen(end);
!   if (len == 0) signal(SIGUSR2, child_suspend);
!   while (1) {
! 	was_stopped = 0;
! 	if ((count = read(in, buf, CHUNK)) <= 0 && !was_stopped) {
  		write2sn("Can't read from ", inname);
  		quit();
  	}
! #if (MACHINE != PC532)
! 	if (count == len && strncmp(buf, end, count) == 0) quit();
! #else
! 	if (len != 0 && count > 0) do_commands(buf,&count);
! #endif
  	if (strip_parity) for (bufp = buf, bufend = bufp + count;
  		     bufp < bufend; ++bufp)
  			*bufp &= 0x7F;
! 	if (count > 0) 
! 	    if (write(out, buf, count) != count) {
! 		write2sn("Can't write to ", outname);
! 		quit();
! 	    }
    }
  }
  
***************
*** 287,299 ****
    exit(1);
  }
  
! 
  nicequit()
  {
    exit(0);
  }
  
! 
  quit()
  {
    ioctl(commfd, TIOCSETP, &sgcommfd);
--- 315,327 ----
    exit(1);
  }
  
! void
  nicequit()
  {
    exit(0);
  }
  
! void
  quit()
  {
    ioctl(commfd, TIOCSETP, &sgcommfd);
***************
*** 303,308 ****
--- 331,343 ----
    nicequit();
  }
  
+ void
+ pipequit()
+ {
+   printf ("Main program: got SIGPIPE.\n");
+   quit();
+ }
+ 
  
  write2sn(s1, s2)
  {
***************
*** 310,312 ****
--- 345,449 ----
    write(1, s2, strlen(s2));
    write(1, "\r\n", 2);
  }
+ 
+ 
+ 
+ #if (MACHINE == PC532)
+ static char inbuf [CHUNK];
+ 
+ int do_commands (buf,count)
+   char *buf;
+   int *count;
+ {
+   char *buf_in, *buf_out;
+   int  in_indx, out_indx;
+ 
+   /* Look through the buffer for commands. */
+   in_indx = 0;
+   out_indx = 0;
+   buf_in = buf_out = buf;
+   if (last_char == CMD_CHAR && *count != 1) {
+     strncpy (inbuf, buf, *count);
+     buf_in = inbuf;
+   }
+   while (in_indx < *count) {
+     if ( last_char == CMD_CHAR ) {
+       switch (*buf_in) {
+         case '.':	quit();
+         case CMD_CHAR:  *buf_out++ = CMD_CHAR;
+ 			out_indx++;
+ 			break;
+ 	case 'r':	run_program("rz");
+ 			break;
+ 	case 's':	run_program("sz");
+ 			break;
+ 	case '?':	printf ("~. quit\n\r~r rz\n\r~s sz\n\r~? help\n\r");
+ 			break;
+ 	default:	*buf_out++ = CMD_CHAR;
+ 			*buf_out++ = *buf_in;
+ 			out_indx += 2;
+       }
+       last_char = ' ';
+     } else {
+       last_char = *buf_in;
+       if (last_char != CMD_CHAR) {
+         *buf_out++ = last_char;
+ 	out_indx++;
+       }
+     }
+     buf_in++;
+     in_indx++;
+   }
+   *count = out_indx;
+   *buf_out = 0;
+   return 0;
+ }
+ 
+ run_program(prog)
+     char *prog;
+ {
+   char argline [255];
+   char execline [300];
+   int count, progpid, ret_val, status;
+ 
+   /* Tell the reader and writer to suspend. */
+   kill (readpid, SIGUSR2);
+   kill (writepid, SIGUSR2);
+ 
+   /* Get ready for the command. */
+   ioctl(0, TIOCSETP, &sgstdin);
+   printf ("arguments for %s: ",prog);
+   if ((count = read(0, argline, 254)) <= 0) {
+      printf ("Can't read from standard in.\n");
+      quit();
+   }
+   argline[count] = 0;
+ 
+   /* do the command. */
+   if ((progpid = fork()) == 0) {
+      dup2 (commfd,0);
+      dup2 (commfd,1);
+      close (commfd);
+      /* Let sh expand wild cards ...   Could be a security hole...*/
+      sprintf (execline, "%s %s", prog, argline);
+      execl ("/bin/sh", "sh", "-c", execline, (char *) 0);
+      exit (0);
+   }
+ 
+   signal (SIGINT, dummy);
+   ret_val = wait(&status);
+   if (ret_val == -1) {
+      printf ("Problem with the Children!\n");
+      quit ();
+   }
+ 
+   /* Clean up after the command is completed. */
+   signal (SIGINT, quit);
+   set_mode(0, -1, -1, -1, &sgstdin);	/* RAW mode on stdin, others
+ 					 * current */
+   /* Tell the reader and writer to resume. */
+   kill (readpid, SIGUSR2);
+   kill (writepid, SIGUSR2);
+ }
+ 
+ #endif
*** /home/phil/min1.5ref/commands/login.c	Wed Nov 14 00:07:15 1990
--- commands/login.c	Tue Feb 12 23:12:56 1991
***************
*** 55,60 ****
--- 55,61 ----
  #define MOTD 		    "/etc/motd"
  #define TTY  		         "tty?"
  #define CONS 		         "tty0"
+ #define BADLOG
  
  static char *Version = "@(#) LOGIN 1.13 (02/10/90)";
  int time_out;
***************
*** 197,202 ****
--- 198,204 ----
    char password[30];
    char ttyname[16];
    int bad, n, ttynr, ap;
+   int namearg;
    struct sgttyb args;
    struct passwd *pwd;
    struct stat statbuf;
***************
*** 229,236 ****
  
  	if (argc > 1) {
  		strcpy(name, argv[1]);
! 		argc = 1;
! 	} else {
  		do {
  			write(1, "login: ", 7);
  			n = read(0, name, 30);
--- 231,240 ----
  
  	if (argc > 1) {
  		strcpy(name, argv[1]);
! 		namearg = 1;
! 		argc = 1;
! 	} else {
! 		namearg = 0;
  		do {
  			write(1, "login: ", 7);
  			n = read(0, name, 30);
***************
*** 269,274 ****
--- 273,280 ----
  			addlog(name, password, ttyname);
  #endif /* BADLOG */
  			write(1, "Login incorrect\n", 16);
+                         /* If getty started us, exit to getty. */
+ 			if (namearg) exit(0);
  			continue;
  		}
  	}
*** /home/phil/min1.5ref/commands/ls.c	Wed Nov 14 00:07:15 1990
--- commands/ls.c	Thu Nov  1 14:28:02 1990
***************
*** 32,38 ****
   * predefines.
   */
  
! #define ONECOLUMN		/* default is 1 column listings */
  #define major(x) ( (x>>8) & 0377)
  #define minor(x) (x & 0377)
  
--- 32,38 ----
   * predefines.
   */
  
! /* #define ONECOLUMN		/* default is 1 column listings */
  #define major(x) ( (x>>8) & 0377)
  #define minor(x) (x & 0377)
  
*** /home/phil/min1.5ref/commands/mknod.c	Wed Nov 14 00:07:16 1990
--- commands/mknod.c	Wed Nov 14 01:15:12 1990
***************
*** 19,25 ****
    size = (*argv[2] == 'b' ? atoi(argv[5]) : 0);
    if (major < 0 || minor < 0) badcomm();
    dev =  (major << 8) | minor;
!   if (mknod(argv[1], mode, dev, size) < 0) perror("mknod");
    exit(0);
  }
  
--- 19,25 ----
    size = (*argv[2] == 'b' ? atoi(argv[5]) : 0);
    if (major < 0 || minor < 0) badcomm();
    dev =  (major << 8) | minor;
!   if (mknod4(argv[1], mode, dev, size) < 0) perror("mknod");
    exit(0);
  }
  
*** /home/phil/min1.5ref/commands/more.c	Wed Nov 14 00:07:17 1990
--- commands/more.c	Thu Nov  1 14:28:04 1990
***************
*** 41,61 ****
  #include <sys/param.h>
  #include <sys/file.h>
  #endif
! #include <a.out.h>
! 
! /* varargs ------- */
! /*  varargs.h  */
! 
! typedef char *va_list;
! 
! #define  va_dcl		int va_alist;
! #define  va_start(p)	(p) = (va_list) &va_alist;
! #define  va_arg(p,type)	( (type *) ((p)+=sizeof(type)) )[-1]
! #define  va_end(p)
! 
! #define  vfPrintf	_doPrintf
! #define  vPrintf(fmt,args)	vfPrintf(stdout,fmt,args)
! /* end of varargs.h -------- */
  
  #ifdef _MINIX
  #include <limits.h>
--- 41,49 ----
  #include <sys/param.h>
  #include <sys/file.h>
  #endif
! 
! #include <a.out.h>
! /* #include <varargs.h> */
  
  #ifdef _MINIX
  #include <limits.h>
***************
*** 613,628 ****
  
  /* Simplified Printf function */
  
! int Printf (fmt, va_alist)
! register char *fmt;
! va_dcl
  {
  	va_list ap;
  	register char ch;
  	register int ccount;
  
  	ccount = 0;
! 	va_start(ap);
  	while (*fmt) {
  		while ((ch = *fmt++) != '%') {
  			if (ch == '\0')
--- 601,615 ----
  
  /* Simplified Printf function */
  
! int Printf (fmt)
! char *fmt;
  {
  	va_list ap;
  	register char ch;
  	register int ccount;
  
  	ccount = 0;
! 	va_start(ap,fmt);
  	while (*fmt) {
  		while ((ch = *fmt++) != '%') {
  			if (ch == '\0')
***************
*** 1409,1418 ****
  }
  
  /*VARARGS2*/
! execute (filename, cmd, va_alist)
! char *filename;
! char *cmd;
! va_dcl
  {
  	int id;
  	int n;
--- 1396,1404 ----
  }
  
  /*VARARGS2*/
! execute (filename, cmd)
! char *filename;
! char *cmd;
  {
  	int id;
  	int n;
***************
*** 1427,1433 ****
  		close(0);
  		open("/dev/tty", O_RDONLY);
  	    }
! 	    va_start(argp);
  	    execv (cmd, argp);
  	    write (2, "exec failed\n", 12);
  	    exit (1);
--- 1413,1419 ----
  		close(0);
  		open("/dev/tty", O_RDONLY);
  	    }
! 	    va_start(argp,cmd);
  	    execv (cmd, argp);
  	    write (2, "exec failed\n", 12);
  	    exit (1);
*** /home/phil/min1.5ref/commands/roff.c	Wed Nov 14 00:07:19 1990
--- commands/roff.c	Thu Nov  1 14:28:12 1990
***************
*** 69,75 ****
  FILE *Save;
  long int teller[MAXDEPTH], ftell();
  char *strcat(), *strcpy(), *strend(), *strhas();
! char *sprintf();
  char *request[] = {
  	   "ad", "ar", "bl", "bp", "br", "cc", "ce", "de",
  	 "ds", "ef", "eh", "fi", "fo", "hc", "he", "hx", "hy", "ig",
--- 69,75 ----
  FILE *Save;
  long int teller[MAXDEPTH], ftell();
  char *strcat(), *strcpy(), *strend(), *strhas();
! /* char *sprintf(); */
  char *request[] = {
  	   "ad", "ar", "bl", "bp", "br", "cc", "ce", "de",
  	 "ds", "ef", "eh", "fi", "fo", "hc", "he", "hx", "hy", "ig",
*** /home/phil/min1.5ref/commands/make/make.c	Wed Nov 14 00:07:28 1990
--- commands/make/make.c	Sun Nov  4 23:50:17 1990
***************
*** 110,115 ****
--- 110,116 ----
  		q++;		   /*  Not part of the command  */
  	}
  
+ 	if (!domake) ssilent = FALSE;  /* not silent in the -n case. */
  	for (p=q; *p; p++) {
  		if (*p == '\n' && p[1] != '\0') {
  			*p = ' ';
*** /home/phil/min1.5ref/commands/tset.c	Wed Nov 14 00:07:30 1990
--- commands/tset.c	Wed Nov  7 07:46:52 1990
***************
*** 87,96 ****
--- 87,109 ----
  char *terminal;
  {
    char termcap[TC_BUFFER];
+   char *is;
+   char buf [ 1024 ];
+   char *bufptr[3];
+   char **area;
  
    if (tgetent(termcap, terminal) != 1)
  	Error("No termcap for your terminal type");
  
+   /* Initialization string? */
+   bufptr[0] = & buf[0];
+   bufptr[1] = & buf[256];
+   bufptr[2] = & buf[512];
+   area = &bufptr[0];
+   is = tgetstr ("is",area);
+   if (is != NULL)
+     fprintf (stderr, "%s\n", is);
+   
    /* In real Unix the $TERMCAP would also be returned here  */
    printf("TERM=%s;\n", terminal);
  }
*** /home/phil/min1.5ref/commands/de/de.c	Wed Nov 14 00:08:03 1990
--- commands/de/de.c	Thu Dec  6 14:26:34 1990
***************
*** 7,12 ****
--- 7,13 ----
  /****************************************************************/
  /*  origination         1989-Jan-15        Terrence W. Holm	*/
  /****************************************************************/
+ /* Changed for the PC532...  Eyal Lebedinsky and Phil Nelson    */
  
  
  #include <minix/config.h>
***************
*** 787,798 ****
--- 788,801 ----
  				break;
  
  		  case 'm' :	{
+ #if	CHIP == INTEL
  				char *tty = ttyname( 0 );
  
  				if ( tty == NULL  ||
  				    strcmp( tty, "/dev/tty0" ) != 0 )
  				  Warning( "Must be at console" );
  				else
+ #endif
  				  s->mode = MAP;
  
  				break;
*** /home/phil/min1.5ref/commands/de/de.h	Wed Nov 14 00:08:03 1990
--- commands/de/de.h	Thu Dec  6 14:25:00 1990
***************
*** 7,12 ****
--- 7,13 ----
  /****************************************************************/
  /*  origination         1989-Jan-15        Terrence W. Holm	*/
  /****************************************************************/
+ /* Changed for the PC532...  Eyal Lebedinsky and Phil Nelson    */
  
  
  /****************************************************************/
***************
*** 88,93 ****
--- 89,98 ----
  #define   SPLIT	   0x0B20
  #endif
  
+ #if (CHIP == NS32532)
+ #define   A_OUT    0x9ec0
+ #endif
+ 
  
  /*  Each buffer is 1k.  In WORD mode 16 words (32 bytes) can be	*/
  /*  displayed at once. In BLOCK mode 1K bytes can be displayed.	*/
***************
*** 139,145 ****
  #define   BOX_BOT	'\334'		/*  Filled lower half   */
  #endif
  
! #if (CHIP == M68000)
  /*  Please change these.  */
  #define   BOX_CLR	' '		/*  Empty box		*/
  #define   BOX_ALL	'='		/*  Filled box		*/
--- 144,150 ----
  #define   BOX_BOT	'\334'		/*  Filled lower half   */
  #endif
  
! #if (CHIP == M68000 || CHIP == NS32532)
  /*  Please change these.  */
  #define   BOX_CLR	' '		/*  Empty box		*/
  #define   BOX_ALL	'='		/*  Filled box		*/
*** /home/phil/min1.5ref/commands/de/de_stdout.c	Wed Nov 14 00:08:04 1990
--- commands/de/de_stdout.c	Thu Dec  6 14:26:52 1990
***************
*** 7,13 ****
  /****************************************************************/
  /*  origination         1989-Jan-15        Terrence W. Holm	*/
  /****************************************************************/
! 
  
  #include <minix/config.h>
  #include <sys/types.h>
--- 7,13 ----
  /****************************************************************/
  /*  origination         1989-Jan-15        Terrence W. Holm	*/
  /****************************************************************/
! /* Changed for the PC532...  Eyal Lebedinsky and Phil Nelson    */
  
  #include <minix/config.h>
  #include <sys/types.h>
***************
*** 622,631 ****
--- 622,633 ----
  
            Goto( INFO_COLUMN, INFO_LINE + 1 );
  
+ #if (CHIP != NS32532)
  	  if ( second == SPLIT )
  	    printf( "separate I & D" );
  	  else
  	    printf( "combined I & D" );
+ #endif
  	  }
  	}
        }
*** /home/phil/min1.5ref/commands/fsck.c	Wed Nov 14 00:08:06 1990
--- commands/fsck.c	Thu Nov  1 14:28:59 1990
***************
*** 31,37 ****
  
  #include <stdio.h>
  
! #if INTEL_32BITS
  #define BITSHIFT	  5	/* = log2(#bits(int)) */
  #else
  #define BITSHIFT	  4	/* = log2(#bits(int)) */
--- 31,37 ----
  
  #include <stdio.h>
  
! #if INTEL_32BITS || NS32K
  #define BITSHIFT	  5	/* = log2(#bits(int)) */
  #else
  #define BITSHIFT	  4	/* = log2(#bits(int)) */
*** /home/phil/min1.5ref/commands/patch/common.h	Wed Nov 14 00:08:26 1990
--- commands/patch/common.h	Wed Feb 13 19:00:50 1991
***************
*** 151,158 ****
--- 151,160 ----
  long atol();
  long lseek();
  char *mktemp();
+ #ifndef _ANSI
  #ifdef CHARSPRINTF
  char *sprintf();
  #else
  int sprintf();
  #endif
+ #endif
*** /home/phil/min1.5ref/commands/modem.c	Wed Nov 14 00:08:36 1990
--- commands/modem.c	Tue Feb 12 06:45:12 1991
***************
*** 58,63 ****
--- 58,64 ----
    ioctl(fd, TIOCSETP, &new);
  
    /* Say hello to the modem. */
+   sleep(2);
    write(fd, "+++", 3);
    sleep(2);
  
***************
*** 65,79 ****
    write(fd, "AT Z\n", 5);  
    sleep(1);
  
!   /* Create the ANSWER string. */
!   strcpy(buff, "AT S0=");
    strcat(buff, itoa(rings));
    strcat(buff, "\n");
    write(fd, buff, strlen(buff));
  
    /* Restore the old terminal parameters. */
    ioctl(fd, TIOCSETP, &old);
  
    close(fd);
    return(1);
  }
--- 66,85 ----
    write(fd, "AT Z\n", 5);  
    sleep(1);
  
!   /* Create the ANSWER string and no Echo on commands. */
!   strcpy(buff, "AT E0 S0=");
    strcat(buff, itoa(rings));
    strcat(buff, "\n");
    write(fd, buff, strlen(buff));
  
+  /* Get rid of any echo. */
+   sleep(2);
+   ioctl(fd, TIOCFLUSH, 0);
+ 
    /* Restore the old terminal parameters. */
    ioctl(fd, TIOCSETP, &old);
  
+ 
    close(fd);
    return(1);
  }
***************
*** 109,123 ****
    ioctl(fd, TIOCSETP, &new);
  
    /* Say hello to the modem. */
    write(fd, "+++", 3);
    sleep(2);
  
    /* Reset the modem. */
!   write(fd, "AT Z\n", 5);  
!   sleep(1);
! 
!   /* Send the NO-ANSWER string. */
!   write(fd, "AT S0=0\n", 8);
  
    /* Restore the old terminal parameters. */
    ioctl(fd, TIOCSETP, &old);
--- 115,134 ----
    ioctl(fd, TIOCSETP, &new);
  
    /* Say hello to the modem. */
+   sleep(2);
    write(fd, "+++", 3);
    sleep(2);
  
    /* Reset the modem. */
!   write(fd, "ATZ\nATZ\n", 8);  
!   sleep(1);
! 
!   /* Send the NO-ANSWER string and Echo commands. */
!   write(fd, "AT E1 S0=0\n", 11);
! 
!   /* Get rid of any echo. */
!   sleep(2);
!   ioctl(fd, TIOCFLUSH, 0);
  
    /* Restore the old terminal parameters. */
    ioctl(fd, TIOCSETP, &old);
***************
*** 152,158 ****
  		    case 'g':	/* GETTY mode */
  			rings = -1;
  			break;
! 		    case 'i':	/* DIAL-IN mode: suspend GETTY and
  				 * call modem */
  			s++;
  			if (*s != '\0')
--- 163,169 ----
  		    case 'g':	/* GETTY mode */
  			rings = -1;
  			break;
! 		    case 'i':	/* DIAL-IN mode: restart GETTY and
  				 * call modem */
  			s++;
  			if (*s != '\0')
***************
*** 160,166 ****
  			else
  				rings = atoi(argv[++st]);
  			break;
! 		    case 'o':	/* DIAL-OUT mode: restart GETTY and
  				 * call modem */
  			rings = 0;
  			break;
--- 171,177 ----
  			else
  				rings = atoi(argv[++st]);
  			break;
! 		    case 'o':	/* DIAL-OUT mode: suspend GETTY and
  				 * call modem */
  			rings = 0;
  			break;
***************
*** 181,186 ****
--- 192,199 ----
  	exit(-1);
    }
    while (read(fd, &entry, sizeof(struct utmp)) == sizeof(struct utmp)) {
+         if (debug) printf ("line=%s, pid=%d, type=%1\n",entry.ut_line,
+ 				entry.ut_pid, entry.ut_type);
  	if (!strcmp(entry.ut_line, tty)) {
  		close(fd);
  		tty = entry.ut_line;
