*** /home/phil/min1.5ref/include/ar.h	Wed Nov 14 00:05:46 1990
--- include/ar.h	Sat Feb  9 22:48:53 1991
***************
*** 3,9 ****
  #ifndef _AR_H
  #define _AR_H
  
! #define	ARMAG	0177545
  #define _NAME_MAX    14
  
  struct ar_hdr {
--- 3,11 ----
  #ifndef _AR_H
  #define _AR_H
  
! #include <magic.h>
! /* #define	ARMAG	0177545 */
! #define ARMAG AR_MAGIC
  #define _NAME_MAX    14
  
  struct ar_hdr {
*** /home/phil/min1.5ref/include/curses.h	Wed Nov 14 00:05:46 1990
--- include/curses.h	Sat Feb  9 22:48:53 1991
***************
*** 28,35 ****
  _PROTOTYPE( void initscr, (void)					);
  _PROTOTYPE( void move, (int _y, int _x)					);
  /* WRONG, next is varargs. */
! _PROTOTYPE( void printw, (char *_fmt, char *_a1, char *_a2, char *_a3,
! 			  char *_a4, char *_a5)				);
  _PROTOTYPE( void outc, (int _c)						);
  _PROTOTYPE( void refresh, (void)					);
  _PROTOTYPE( void standend, (void)					);
--- 28,36 ----
  _PROTOTYPE( void initscr, (void)					);
  _PROTOTYPE( void move, (int _y, int _x)					);
  /* WRONG, next is varargs. */
! /*_PROTOTYPE( void printw, (char *_fmt, char *_a1, char *_a2, char *_a3,
! 			  char *_a4, char *_a5)				);*/
! _PROTOTYPE( void printw, (char *_fmt,...)				);
  _PROTOTYPE( void outc, (int _c)						);
  _PROTOTYPE( void refresh, (void)					);
  _PROTOTYPE( void standend, (void)					);
*** /home/phil/min1.5ref/include/limits.h	Wed Nov 14 00:05:47 1990
--- include/limits.h	Sat Feb  9 22:48:53 1991
***************
*** 20,29 ****
  #define SHRT_MAX       32767	/* maximum value of a short */
  #define USHRT_MAX     0xFFFF	/* maximum value of unsigned short */
  
! /* Definitions about ints (16 bits in MINIX for 8088, 80286, Atari etc) */
! #define INT_MIN   (-32767-1)	/* minimum value of an int */
! #define INT_MAX        32767	/* maximum value of an int */
! #define UINT_MAX      0xFFFF	/* maximum value of an unsigned int */
  
  /*Definitions about longs (32 bits in MINIX). */
  #define LONG_MIN (-2147483647-1)/* minimum value of a long */
--- 20,29 ----
  #define SHRT_MAX       32767	/* maximum value of a short */
  #define USHRT_MAX     0xFFFF	/* maximum value of unsigned short */
  
! /* Definitions about ints (32 bits in MINIX for NS32K) */
! #define INT_MIN (-2147483647-1) /* minimum value of an int */
! #define INT_MAX  2147483647L	/* maximum value of an int */
! #define UINT_MAX 4294967295L	/* maximum value of an unsigned int */
  
  /*Definitions about longs (32 bits in MINIX). */
  #define LONG_MIN (-2147483647-1)/* minimum value of a long */
*** /home/phil/min1.5ref/include/math.h	Wed Nov 14 00:05:47 1990
--- include/math.h	Sat Feb  9 22:48:53 1991
***************
*** 3,9 ****
  #ifndef _MATH_H
  #define _MATH_H
  
! #define HUGE_VAL	9.9e+999	/* though it will generate a warning */
  
  /* Function Prototypes. */
  #ifndef _ANSI_H
--- 3,9 ----
  #ifndef _MATH_H
  #define _MATH_H
  
! #define HUGE_VAL	1.701411733192644270e38
  
  /* Function Prototypes. */
  #ifndef _ANSI_H
*** /home/phil/min1.5ref/include/sgtty.h	Wed Nov 14 00:05:52 1990
--- include/sgtty.h	Sat Feb  9 22:48:53 1991
***************
*** 26,31 ****
--- 26,32 ----
  #define BITS7        0001000	/* 7 bits/char */
  #define BITS6        0000400	/* 6 bits/char */
  #define BITS5        0000000	/* 5 bits/char */
+ #define ANYP         0000300
  #define EVENP        0000200	/* even parity */
  #define ODDP         0000100	/* odd parity */
  #define RAW	     0000040	/* enable raw mode */
***************
*** 37,70 ****
  #define DCD          0100000	/* Data Carrier Detect */
  
  /* Line speeds */
! #define B0		   0	/* code for line-hangup */
! #define B110		   1
! #define B300		   3
! #define B1200		  12
! #define B2400		  24
! #define B4800		  48
! #define B9600 		  96
  
  #define TIOCGETP (('t'<<8) | 8)
  #define TIOCSETP (('t'<<8) | 9)
  #define TIOCGETC (('t'<<8) | 18)
  #define TIOCSETC (('t'<<8) | 17)
  #define TIOCFLUSH (('t'<<8) | 16)
! 
! /* Things Minix supports but not properly */
! /* the divide-by-100 encoding ain't too hot */
! #define ANYP         0000300
! #define B50                0
! #define B75                0
! #define B134               0
! #define B150               0
! #define B200               2
! #define B600               6
! #define B1800             18
! #define B3600             36
! #define B7200             72
! #define EXTA             192
! #define EXTB               0
  
  /* Things Minix doesn't support but are fairly harmless if used */
  #define NLDELAY      0001400
--- 38,75 ----
  #define DCD          0100000	/* Data Carrier Detect */
  
  /* Line speeds */
! #define B0		0x40	/* code for line-hangup */
! #define B50             0x00
! #define B75 		0x10
! #define B110		0x21
! #define B134            0x22
! #define B150            0x13
! #define B200            0x03
! #define B300		0x24
! #define B600            0x25
! #define B1050		0x07
! #define B1200		0x26
! #define B1800           0x1a
! #define B2000		0x17
! #define B2400		0x28
! #define B4800		0x29
! #define B7200           0x0a
! #define B9600 		0x2b
! #define EXTA            0x1c
! #define EXTB            0x0c
! #define B19200		0x1c
! #define B38400		0x0c
  
  #define TIOCGETP (('t'<<8) | 8)
  #define TIOCSETP (('t'<<8) | 9)
  #define TIOCGETC (('t'<<8) | 18)
  #define TIOCSETC (('t'<<8) | 17)
  #define TIOCFLUSH (('t'<<8) | 16)
! #define TIOSBRK  (('t'<<8) | 123)
! #define TIOCBRK  (('t'<<8) | 122)
! 
! /* not supported?  */
! #define B3600           0x60	/* An illegal code.. */
  
  /* Things Minix doesn't support but are fairly harmless if used */
  #define NLDELAY      0001400
*** /home/phil/min1.5ref/include/stdio.h	Wed Nov 14 00:05:53 1990
--- include/stdio.h	Sat Feb  9 22:48:53 1991
***************
*** 21,26 ****
--- 21,28 ----
  #define IOMYBUF     32
  #define PERPRINTF   64
  #define STRINGS    128
+ #define RDWRMODE   256
+ #define APPENDMODE 512
  
  #ifndef FILE
  
***************
*** 45,50 ****
--- 47,53 ----
  /* -------------- Prototypes copied from Earl Chew's stdio -----------------*/
  
  #include <ansi.h>
+ #include <stdarg.h>
  
  #if _ANSI
  #  define __STDIO_P__(__x) __x
***************
*** 60,66 ****
  #endif
  
  #define __fpos_t long
! #define __STDIO_VA_LIST__	void *
  
  /* ANSI Stdio Requirements */
  
--- 63,69 ----
  #endif
  
  #define __fpos_t long
! #define __STDIO_VA_LIST__	va_list
  
  /* ANSI Stdio Requirements */
  
***************
*** 97,112 ****
  
  int	ungetc		__STDIO_P__((int, FILE *));
  
! /* WRONG */
! void	printf		__STDIO_P__((const char * __STDIO_VA__));
! /* WRONG */
! void	fprintf		__STDIO_P__((FILE *, const char * __STDIO_VA__));
! /* WRONG */
! char	*sprintf	__STDIO_P__((char *, const char * __STDIO_VA__));
! int	vprintf		__STDIO_P__((const char *, __STDIO_VA_LIST__));
! int	vfprintf	__STDIO_P__((FILE *, const char *, __STDIO_VA_LIST__));
! /* WRONG */
! char 	*vsprintf	__STDIO_P__((char *, const char *, __STDIO_VA_LIST__));
  int	scanf		__STDIO_P__((char *nonconstfmt __STDIO_VA__));
  int	fscanf		__STDIO_P__((FILE *, char *nonconstfmt __STDIO_VA__));
  int	sscanf		__STDIO_P__((char *nonconststr, char *nonconstfmt __STDIO_VA__));
--- 100,111 ----
  
  int	ungetc		__STDIO_P__((int, FILE *));
  
! void	printf		__STDIO_P__((const char * __STDIO_VA__));
! void	fprintf		__STDIO_P__((FILE *, const char * __STDIO_VA__));
! char	*sprintf	__STDIO_P__((char *, const char * __STDIO_VA__));
! int	vprintf		__STDIO_P__((const char * __STDIO_VA__));
! int	vfprintf	__STDIO_P__((FILE *, const char * __STDIO_VA__));
! char 	*vsprintf	__STDIO_P__((char *, const char * __STDIO_VA__));
  int	scanf		__STDIO_P__((char *nonconstfmt __STDIO_VA__));
  int	fscanf		__STDIO_P__((FILE *, char *nonconstfmt __STDIO_VA__));
  int	sscanf		__STDIO_P__((char *nonconststr, char *nonconstfmt __STDIO_VA__));
*** /home/phil/min1.5ref/include/minix/boot.h	Wed Nov 14 00:05:45 1990
--- include/minix/boot.h	Sat Feb  9 22:48:54 1991
***************
*** 36,43 ****
    dev_t bp_rootdev;
    dev_t bp_ramimagedev;
    unsigned short bp_ramsize;
-   unsigned short bp_scancode;		/* still put into BX for kernel */
-   unsigned short bp_processor;
  };
  
  extern struct bparam_s boot_parameters;
--- 36,41 ----
*** /home/phil/min1.5ref/include/minix/com.h	Wed Nov 14 00:05:45 1990
--- include/minix/com.h	Sat Feb  9 22:48:54 1991
***************
*** 2,7 ****
--- 2,8 ----
  #define SEND		   1	/* function code for sending messages */
  #define RECEIVE		   2	/* function code for receiving messages */
  #define BOTH		   3	/* function code for SEND + RECEIVE */
+ 
  #define ANY   (NR_PROCS+100)	/* receive(ANY, buf) accepts from any source */
  
  /* Task numbers, function codes and reply codes. */
***************
*** 48,60 ****
   * to AMOEBA_CLASS  (ie. as AMOEBA_CLASS+n, for the nth task added).
   */
  
! #define IDLE (AMOEBA_CLASS+1)	/* task to run when there's nothing to run */
  
  #define PRINTER           -7		/* printer  I/O class */
  /* The printer uses the same commands as TTY. */
  
! #define WINCHESTER        -6	/* winchester (hard) disk class */
! #define FLOPPY            -5	/* floppy disk class */
  #	define DISK_READ   3	/* fcn code to DISK (must equal TTY_READ) */
  #	define DISK_WRITE  4	/* fcn code to DISK (must equal TTY_WRITE) */
  #	define DISK_IOCTL  5	/* fcn code for setting up RAM disk */
--- 49,60 ----
   * to AMOEBA_CLASS  (ie. as AMOEBA_CLASS+n, for the nth task added).
   */
  
! /*#define IDLE (AMOEBA_CLASS+1)*//* task to run when there's nothing to run */
  
  #define PRINTER           -7		/* printer  I/O class */
  /* The printer uses the same commands as TTY. */
  
! #define SCSI	          -5	/* winchester (hard) disk class */
  #	define DISK_READ   3	/* fcn code to DISK (must equal TTY_READ) */
  #	define DISK_WRITE  4	/* fcn code to DISK (must equal TTY_WRITE) */
  #	define DISK_IOCTL  5	/* fcn code for setting up RAM disk */
***************
*** 69,74 ****
--- 69,77 ----
  #if (CHIP == INTEL)
  #	define PORT_DEV    4	/* minor device for /dev/port */
  #endif
+ #ifdef RTC
+ #	define RTC_DEV	   4    /* minor device for /dev/rtc */
+ #endif
  
  #define CLOCK             -3	/* clock class */
  #	define SET_ALARM   1	/* fcn code to CLOCK, set up alarm */
***************
*** 93,98 ****
--- 96,104 ----
  #	define SYS_MEM    14	/* fcn code for sys_mem() */
  #	define SYS_TRACE  15	/* fcn code for sys_trace(req,pid,addr,data) */
  
+ #	define SYS_BREAK  16	/* new 32k */
+ #	define SYS_TRAP   17	/* new 32k */
+ 
  #define HARDWARE          -1	/* used as source on interrupt generated msgs*/
  
  /* Names of message fields for messages to CLOCK task. */
***************
*** 146,151 ****
--- 152,167 ----
  #define CANCEL             0    /* general request to force a task to cancel */
  #define SIG_MAP        m1_i2	/* used by kernel for passing signal bit map */
  
+ #define ENTRY_PTR      m1_p3	/* used by new sys_exec */
+ #define MAPPROC	       m2_i1	/* sys_newmap: slot */
+ #define TPGS	       m2_i2	/* sys_newmap: text pages */
+ #define DPGS	       m2_i3	/* sys_newmap: data pages */
+ #define BPGS	       m2_l1	/* sys_newmap: bss pages */
+ #define SBYTES	       m2_l2	/* sys_newmap: stack bytes */
+ #define SPTR	       m2_p1	/* sys_newmap: environ pointer */
+ #define ENTRY	       m1_i2	/* sys_exec: pc value */
+ #define TRACE	       m1_i3	/* sys_exec: traced flag */
+ 
  #ifdef AMOEBA
  
  /* Names of message fields for amoeba tasks */
*** /home/phil/min1.5ref/include/minix/const.h	Wed Nov 14 00:05:45 1990
--- include/minix/const.h	Sat Feb  9 22:48:54 1991
***************
*** 22,31 ****
  #ifdef AM_KERNEL
  #define NR_TASKS	  14	/* must be 5 more than without amoeba */
  #else
! #define NR_TASKS           9	/* number of tasks in the transfer vector */
! #endif
! 
! #define NR_PROCS          32	/* number of slots in proc table */
  #define NR_SEGS            3	/* # segments per process */
  #define T                  0	/* proc[i].mem_map[T] is for text */
  #define D                  1	/* proc[i].mem_map[D] is for data */
--- 22,31 ----
  #ifdef AM_KERNEL
  #define NR_TASKS	  14	/* must be 5 more than without amoeba */
  #else
! #define NR_TASKS           6	/* pc532: tty scsi mem clock sys idle */
! #endif
! 
! #define NR_PROCS         128	/* number of slots in proc table */
  #define NR_SEGS            3	/* # segments per process */
  #define T                  0	/* proc[i].mem_map[T] is for text */
  #define D                  1	/* proc[i].mem_map[D] is for data */
***************
*** 34,39 ****
--- 34,40 ----
  #define MAX_P_LONG  2147483647	/* maximum positive long, i.e. 2**31 - 1 */
  
  /* Memory is allocated in clicks. */
+ #if (MACHINE != PC532)
  #if (CHIP == INTEL) || (CHIP == M68000)
  #define CLICK_SIZE       256	/* unit in which memory is allocated */
  #define CLICK_SHIFT        8	/* log2 of CLICK_SIZE */
***************
*** 46,51 ****
--- 47,53 ----
  #else
  #define k_to_click(n) ((n) / (CLICK_SIZE / 1024))
  #endif
+ #endif /*(MACHINE != PC532)*/
  
  /* Process numbers of some important processes */
  #define MM_PROC_NR         0	/* process number of memory manager */
***************
*** 57,62 ****
--- 59,65 ----
  #define BYTE            0377	/* mask for 8 bits */
  #define TO_USER            0	/* flag telling to copy from fs to user */
  #define FROM_USER          1	/* flag telling to copy from user to fs */
+ #define MM_BEHALF	   2	/* rw_user() flag (allow write to rd-only pg) */
  #define READING            0	/* copy data to user */
  #define WRITING            1	/* copy data from user */
  
***************
*** 64,70 ****
  #define ABS             -999	/* this process means absolute memory */
  #endif
  
! #define WORD_SIZE          2	/* number of bytes per word */
  
  #define NIL_PTR   (char *) 0	/* generally useful expression */
  
--- 67,73 ----
  #define ABS             -999	/* this process means absolute memory */
  #endif
  
! #define WORD_SIZE          4	/* number of bytes per word */
  
  #define NIL_PTR   (char *) 0	/* generally useful expression */
  
*** /home/phil/min1.5ref/include/minix/type.h	Wed Nov 14 00:05:46 1990
--- include/minix/type.h	Sat Feb  9 22:48:54 1991
***************
*** 31,40 ****
  typedef long vir_bytes;		/* virtual addresses and lengths in bytes */
  #endif
  
! typedef unsigned vir_clicks;	/* virtual addresses and lengths in clicks */
! typedef long phys_bytes;	/* physical addresses and lengths in bytes */
! typedef unsigned phys_clicks;	/* physical addresses and lengths in clicks */
! typedef int signed_clicks;	/* same length as phys_clicks, but signed */
  
  /* Types relating to messages. */
  #define M1                 1
--- 31,45 ----
  typedef long vir_bytes;		/* virtual addresses and lengths in bytes */
  #endif
  
! #if (MACHINE == PC532)
! typedef long vir_bytes;
! #else
! typedef unsigned vir_clicks;	/* virtual addresses and lengths in clicks */
! typedef unsigned phys_clicks;	/* physical addresses and lengths in clicks */
! typedef int signed_clicks;	/* same length as phys_clicks, but signed */
! #endif /*(MACHINE != PC532)*/
! 
! typedef long phys_bytes;	/* physical addresses and lengths in bytes */
  
  /* Types relating to messages. */
  #define M1                 1
***************
*** 106,124 ****
  #define m6_f1  m_u.m_m6.m6f1
  
  struct mem_map {
!   vir_clicks mem_vir;		/* virtual address */
!   phys_clicks mem_phys;		/* physical address */
!   vir_clicks mem_len;		/* length */
  };
  
  struct copy_info {		/* used by sys_copy(src, dst, bytes) */
!   int cp_src_proc;
!   int cp_src_space;
!   vir_bytes cp_src_vir;
!   int cp_dst_proc;
!   int cp_dst_space;
!   vir_bytes cp_dst_vir;
!   vir_bytes cp_bytes;
  };
  
  struct iorequest_s {
--- 111,128 ----
  #define m6_f1  m_u.m_m6.m6f1
  
  struct mem_map {
!   long	ptb;			/* page table base (NULL iff unmapped) */
!   long	tlen;			/* text length bytes */
!   long	dlen;			/* data/bss length bytes */
!   long	slen;			/* stack length bytes */
  };
  
  struct copy_info {		/* used by sys_copy(src, dst, bytes) */
!   int	cp_src_proc;
!   long	cp_src_vadr;
!   int	cp_dst_proc;
!   long	cp_dst_vadr;
!   long	cp_bytes;
  };
  
  struct iorequest_s {
*** /home/phil/min1.5ref/include/sys/wait.h	Wed Nov 14 00:05:53 1990
--- include/sys/wait.h	Sat Feb  9 22:48:54 1991
***************
*** 29,35 ****
  #define WIFEXITED(s)	(_LOW(s) == 0)			    /* normal exit */
  #define WEXITSTATUS(s)	(_HIGH(s))			    /* exit status */
  #define WTERMSIG(s)	(_LOW(s) & 0177)		    /* sig value */
! #define WIFSIGNALED(s)	(((unsigned int)(x)-1 & 0xFFFF) < 0xFF) /* signaled */
  #define WIFSTOPPED(s)	(_LOW(s) == 0177)		    /* stopped */
  #define WSTOPSIG(s)	(_HIGH(s) & 0377)		    /* stop signal */
  
--- 29,35 ----
  #define WIFEXITED(s)	(_LOW(s) == 0)			    /* normal exit */
  #define WEXITSTATUS(s)	(_HIGH(s))			    /* exit status */
  #define WTERMSIG(s)	(_LOW(s) & 0177)		    /* sig value */
! #define WIFSIGNALED(s)	(((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
  #define WIFSTOPPED(s)	(_LOW(s) == 0177)		    /* stopped */
  #define WSTOPSIG(s)	(_HIGH(s) & 0377)		    /* stop signal */
  
