[comp.os.minix] V1.3 posting #18, mm directory diffs

ast@cs.vu.nl (Andy Tanenbaum) (06/28/88)

: This is a shar archive.  Extract with sh, not csh.
: This archive ends with exit, so do not worry about trailing junk.
: --------------------------- cut here --------------------------
PATH=/bin:/usr/bin:/usr/ucb
echo Extracting 'LISTING'
sed 's/^X//' > 'LISTING' << '+ END-OF-FILE ''LISTING'
Xtotal 30
X-rw-r--r--  1 ast             0 Jun 27 22:48 LISTING
X-rw-r--r--  1 ast           189 Jun 27 22:47 alloc.c.diff
X-rw-r--r--  1 ast          1284 Jun 27 22:47 break.c.diff
X-rw-r--r--  1 ast           264 Jun 27 22:47 const.h.diff
X-rw-r--r--  1 ast          6621 Jun 27 22:47 exec.c.diff
X-rw-r--r--  1 ast          3020 Jun 27 22:47 forkexit.c.diff
X-rw-r--r--  1 ast           108 Jun 27 22:47 glo.h.diff
X-rw-r--r--  1 ast          2170 Jun 27 22:47 main.c.diff
X-rw-r--r--  1 ast          3807 Jun 27 22:47 makefile.diff
X-rw-r--r--  1 ast           223 Jun 27 22:48 mm.log
X-rw-r--r--  1 ast          4452 Jun 27 22:47 signal.c.diff
X-rw-r--r--  1 ast           669 Jun 27 22:47 table.c.diff
X-rw-r--r--  1 ast           173 Jun 27 22:47 utility.c.diff
+ END-OF-FILE LISTING
chmod 'u=rw,g=r,o=r' 'LISTING'
set `wc -c 'LISTING'`
count=$1
case $count in
755)	:;;
*)	echo 'Bad character count in ''LISTING' >&2
		echo 'Count should be 755' >&2
esac
echo Extracting 'alloc.c.diff'
sed 's/^X//' > 'alloc.c.diff' << '+ END-OF-FILE ''alloc.c.diff'
X100c100
X< 	/* Block to be freed goes on front of hole list. */
X---
X> 	/* Block to be freed goes on front of the hole list. */
X169c169
X<    * succesor into it.
X---
X>    * successor into it.
+ END-OF-FILE alloc.c.diff
chmod 'u=rw,g=r,o=r' 'alloc.c.diff'
set `wc -c 'alloc.c.diff'`
count=$1
case $count in
189)	:;;
*)	echo 'Bad character count in ''alloc.c.diff' >&2
		echo 'Count should be 189' >&2
esac
echo Extracting 'break.c.diff'
sed 's/^X//' > 'break.c.diff' << '+ END-OF-FILE ''break.c.diff'
X2c2
X<  * the combined text, data, and stack segements.  The amount used for a child
X---
X>  * the combined text, data, and stack segments.  The amount used for a child
X40,43c40,41
X<  * anybody noticing it.    For a file not using separate I & D space,
X<  * the parameter, 'addr' is to the total size, text + data.  For a file using
X<  * separate text and data spaces, it is just the data size. Files using
X<  * separate I & D space have the SEPARATE bit in mp_flags set.
X---
X>  * anybody noticing it.
X>  * The parameter, 'addr' is the new virtual address in D space.
X52c50
X<   v = (vir_bytes) addr;		/* 'addr' is the new data segment size */
X---
X>   v = (vir_bytes) addr;
X53a52,56
X>   if (new_clicks < rmp->mp_seg[D].mem_vir) {
X> 	res_ptr = (char *) -1;
X> 	return(ENOMEM);
X>   }
X>   new_clicks -= rmp->mp_seg[D].mem_vir;
X57c60
X<   return(r);			/* return new size or -1 */
X---
X>   return(r);			/* return new address or -1 */
X115c118
X< 	if (changed) sys_newmap(rmp - mproc, rmp->mp_seg);
X---
X> 	if (changed) sys_newmap((int)(rmp - mproc), rmp->mp_seg);
X147a151
X> #ifndef ATARI_ST
X158a163
X> #endif
X181c186,189
X<   sys_getsp(rmp - mproc, &new_sp);
X---
X>   sys_getsp((int)(rmp - mproc), &new_sp);
X> #ifdef ATARI_ST
X>   new_sp -= CLICK_SIZE;		/* one click margin between D and S */
X> #endif
+ END-OF-FILE break.c.diff
chmod 'u=rw,g=r,o=r' 'break.c.diff'
set `wc -c 'break.c.diff'`
count=$1
case $count in
1284)	:;;
*)	echo 'Bad character count in ''break.c.diff' >&2
		echo 'Count should be 1284' >&2
esac
echo Extracting 'const.h.diff'
sed 's/^X//' > 'const.h.diff' << '+ END-OF-FILE ''const.h.diff'
X5a6
X> #ifdef i8088
X10a12,15
X> #endif
X> #ifdef ATARI_ST
X> #define MM_STACK_BYTES	MAX_ISTACK_BYTES + ZEROBUF_SIZE + 2048
X> #endif
X17d21
X< #define HDR_SIZE	  32	/* # bytes in the exec file header */
X19a24
X> #define HDR_SIZE	  32	/* # bytes in the exec file header */
+ END-OF-FILE const.h.diff
chmod 'u=rw,g=r,o=r' 'const.h.diff'
set `wc -c 'const.h.diff'`
count=$1
case $count in
264)	:;;
*)	echo 'Bad character count in ''const.h.diff' >&2
		echo 'Count should be 264' >&2
esac
echo Extracting 'exec.c.diff'
sed 's/^X//' > 'exec.c.diff' << '+ END-OF-FILE ''exec.c.diff'
X30a31
X> #define SYMB               7	/* location of symbol size in header */
X31a33,36
X> #ifdef ATARI_ST
X> PUBLIC long lseek();
X> #endif
X> 
X37c42
X< /* Perform the exece(name, argv, envp) call.  The user library builds a
X---
X> /* Perform the execve(name, argv, envp) call.  The user library builds a
X51a57
X>   long sym_bytes;
X73c79
X<   m = read_header(fd, &ft, &text_bytes, &data_bytes, &bss_bytes, &tot_bytes,sc);
X---
X>   m = read_header(fd, &ft, &text_bytes, &data_bytes, &bss_bytes, &tot_bytes, &sym_bytes, sc);
X97a104,105
X>   vsp += (vir_bytes) rmp->mp_seg[S].mem_len << CLICK_SHIFT;
X>   vsp -= stk_bytes;
X105a114,119
X> #ifdef ATARI_ST
X>   if (lseek(fd, sym_bytes, 1) < 0)
X> 	;	/* error */
X>   if (relocate(fd, mbuf) < 0)
X> 	;	/* error */
X> #endif
X131c145
X< PRIVATE int read_header(fd, ft, text_bytes, data_bytes, bss_bytes, tot_bytes,sc)
X---
X> PRIVATE int read_header(fd, ft, text_bytes, data_bytes, bss_bytes, tot_bytes, sym_bytes, sc)
X137a152
X> long *sym_bytes;		/* place to return symbol table size */
X156,158c171,173
X<    *	7: 0x00000000L
X<    * The longs are represented low-order byte first and high-order byte last.
X<    * The first byte of the header is always 0x01, followed by 0x03.
X---
X>    *	7: size of symbol table in bytes
X>    * The longs are represented in a machine dependent order,
X>    * little-endian on the 8088, big-endian on the 68000.
X169a185,189
X>   *bss_bytes = (vir_bytes) buf[BSSB];	/* bss size in bytes */
X>   *sym_bytes = buf[SYMB];	/* symbol table size in bytes */
X>   *tot_bytes = buf[TOTB];	/* total bytes to allocate for program */
X>   if (*tot_bytes == 0) return(ENOEXEC);
X> 
X170a191
X> #ifndef ATARI_ST
X173a195,210
X> #else
X> 	/*
X> 	 * Treating text as data increases the shadowing overhead.
X> 	 * Under the assumption that programs DO NOT MODIFY TEXT
X> 	 * we can share the text between father and child processes.
X> 	 * This is similar to the UNIX V7 -n option of ld(1).
X> 	 * However, for MINIX the linker did not provide alignment
X> 	 * to click boundaries, so an incomplete text click at the end
X> 	 * must be treated as data.
X> 	 * Correct tot_bytes, since it excludes the text segment.
X> 	 */
X> 	*data_bytes += *text_bytes;
X> 	*text_bytes = (*text_bytes >> CLICK_SHIFT) << CLICK_SHIFT;
X> 	*data_bytes -= *text_bytes;
X> 	*tot_bytes -= *text_bytes;
X> #endif
X176,179d212
X<   /* Get bss and total sizes. */
X<   *bss_bytes = (vir_bytes) buf[BSSB];	/* bss size in bytes */
X<   *tot_bytes = buf[TOTB];	/* total bytes to allocate for program */
X<   if (*tot_bytes == 0) return(ENOEXEC);
X182,183c215,216
X<   tc = (*text_bytes + CLICK_SHIFT - 1) >> CLICK_SHIFT;
X<   dc = (*data_bytes + *bss_bytes + CLICK_SHIFT - 1) >> CLICK_SHIFT;
X---
X>   tc = (*text_bytes + CLICK_SIZE - 1) >> CLICK_SHIFT;
X>   dc = (*data_bytes + *bss_bytes + CLICK_SIZE - 1) >> CLICK_SHIFT;
X212,213d244
X<   char *rzp;
X<   vir_bytes vzb;
X215,216c246
X<   phys_clicks new_base, old_clicks;
X<   phys_bytes bytes, base, count, bss_offset;
X---
X>   phys_clicks new_base;
X218a249,256
X> #ifdef ATARI_ST
X>   phys_clicks base, size;
X> #else
X>   char *rzp;
X>   vir_bytes vzb;
X>   phys_clicks old_clicks;
X>   phys_bytes bytes, base, count, bss_offset;
X> #endif
X240c278,280
X<   old_clicks = (phys_clicks) rmp->mp_seg[S].mem_vir + rmp->mp_seg[S].mem_len;
X---
X> #ifndef ATARI_ST
X>   old_clicks = (phys_clicks) rmp->mp_seg[S].mem_len;
X>   old_clicks += (rmp->mp_seg[S].mem_vir - rmp->mp_seg[D].mem_vir);
X242a283
X> #endif
X249d289
X<   rmp->mp_seg[T].mem_vir = 0;
X252d291
X<   rmp->mp_seg[D].mem_vir = 0;
X255d293
X<   rmp->mp_seg[S].mem_vir = rmp->mp_seg[D].mem_vir + data_clicks + gap_clicks;
X257a296,309
X> #ifdef ATARI_ST
X>   rmp->mp_seg[T].mem_vir = rmp->mp_seg[T].mem_phys;
X>   rmp->mp_seg[D].mem_vir = rmp->mp_seg[D].mem_phys;
X>   rmp->mp_seg[S].mem_vir = rmp->mp_seg[S].mem_phys;
X> #else
X>   rmp->mp_seg[T].mem_vir = 0;
X>   rmp->mp_seg[D].mem_vir = 0;
X>   rmp->mp_seg[S].mem_vir = rmp->mp_seg[D].mem_vir + data_clicks + gap_clicks;
X> #endif
X> #ifdef ATARI_ST
X>   sys_fresh(who, rmp->mp_seg, (phys_clicks)(data_bytes >> CLICK_SHIFT),
X> 			&base, &size);
X>   free_mem(base, size);
X> #else
X276a329
X> #endif
X335d387
X<   if (seg_bytes == 0) return;	/* text size for combined I & D is 0 */
X337,339c389,398
X<   ubuf_ptr = (char *) (mp->mp_seg[seg].mem_vir << CLICK_SHIFT);
X<   bytes = (int) seg_bytes;
X<   read(new_fd, ubuf_ptr, bytes);
X---
X>   ubuf_ptr = (char *) ((vir_bytes)mp->mp_seg[seg].mem_vir << CLICK_SHIFT);
X>   while (seg_bytes) {
X> 	bytes = 31*1024;		/* <= 32767 */
X> 	if (seg_bytes < bytes)
X> 		bytes = (int)seg_bytes;
X> 	if (read(new_fd, ubuf_ptr, bytes) != bytes)
X> 		break;		/* error */
X> 	ubuf_ptr += bytes;
X> 	seg_bytes -= bytes;
X>   }
X340a400,469
X> 
X> #ifdef ATARI_ST
X> /*===========================================================================*
X>  *				relocate				     *
X>  *===========================================================================*/
X> PRIVATE int relocate(fd, buf)
X> int fd;				/* file descriptor to read from */
X> char *buf;			/* borrowed from do_exec() */
X> {
X>   register n;
X>   register char *p;
X>   register c;
X>   register phys_bytes off;
X>   register phys_bytes adr;
X>   register struct mproc *rmp = mp;
X> 
X>   /* Read in relocation info from the exec file and relocate.
X>    * Relocation info is in GEMDOS format. Only longs can be relocated.
X>    *
X>    * The GEMDOS format starts with a long L: the offset to the
X>    * beginning of text for the first long to be relocated.
X>    * If L==0 then no relocations have to be made.
X>    *
X>    * The long is followed by zero or more bytes. Each byte B is
X>    * processed separately, in one of the following ways:
X>    *
X>    * B==0:
X>    *	end of relocation
X>    * B==1:
X>    *	no relocation, but add 254 to the current offset
X>    * B==0bWWWWWWW0:
X>    *	B is added to the current offset and the long addressed
X>    *	is relocated. Note that 00000010 means 1 word distance.
X>    * B==0bXXXXXXX1:
X>    *	illegal
X>    */
X>   off = (phys_bytes)rmp->mp_seg[T].mem_phys << CLICK_SHIFT;
X>   p = buf;
X>   n = read(fd, p, MAX_ISTACK_BYTES);
X>   if (n < sizeof(long))
X> 	return(-1);	/* error */
X>   if (*((long *)p) == 0)
X> 	return(0);	/* ok */
X>   adr = off + *((long *)p);
X>   n -= sizeof(long);
X>   p += sizeof(long);
X> 
X>   for (;;) {			/* once per relocation */
X> 	*((long *)adr) += off;
X> 	for (;;) {		/* once per byte */
X> 		if (--n < 0) {
X> 			p = buf;
X> 			n = read(fd, p, MAX_ISTACK_BYTES);
X> 			if (--n < 0)
X> 				return(-1);	/* error */
X> 		}
X> 		c = *p++ & 0xFF;
X> 		if (c != 1)
X> 			break;
X> 		adr += 254;
X> 	}
X> 	if (c == 0)
X> 		break;
X> 	if (c & 1)
X> 		return(-1);	/* error */
X> 	adr += c;
X>   }
X>   return(0);	/* ok */
X> }
X> #endif
+ END-OF-FILE exec.c.diff
chmod 'u=rw,g=r,o=r' 'exec.c.diff'
set `wc -c 'exec.c.diff'`
count=$1
case $count in
6621)	:;;
*)	echo 'Bad character count in ''exec.c.diff' >&2
		echo 'Count should be 6621' >&2
esac
echo Extracting 'forkexit.c.diff'
sed 's/^X//' > 'forkexit.c.diff' << '+ END-OF-FILE ''forkexit.c.diff'
X15a16
X> 
X28d28
X< PRIVATE process_group = 1;		/* next process grp to be assigned */
X43d42
X<   long prog_bytes;
X45d43
X<   long parent_abs, child_abs;
X46a45,48
X> #ifndef ATARI_ST
X>   long prog_bytes;
X>   long parent_abs, child_abs;
X> #endif
X57,61c59,62
X<   prog_clicks = (phys_clicks) rmp->mp_seg[T].mem_len + rmp->mp_seg[D].mem_len +
X< 						      rmp->mp_seg[S].mem_len;
X< #ifdef i8088
X<   prog_clicks += rmp->mp_seg[S].mem_vir - rmp->mp_seg[D].mem_len; /* gap too */
X< #endif
X---
X>   prog_clicks = (phys_clicks) rmp->mp_seg[S].mem_len;
X>   prog_clicks += (rmp->mp_seg[S].mem_vir - rmp->mp_seg[D].mem_vir);
X> #ifndef ATARI_ST
X>   if (rmp->mp_flags & SEPARATE) prog_clicks += rmp->mp_seg[T].mem_len;
X62a64
X> #endif
X64a67
X> #ifndef ATARI_ST
X69a73
X> #endif
X76c80
X<   child_nr = rmc - mproc;	/* slot number of the child */
X---
X>   child_nr = (int)(rmc - mproc);	/* slot number of the child */
X83,85d86
X<   /* Set process group. */
X<   if (who == INIT_PROC_NR) rmc->mp_procgrp = process_group++;
X< 
X86a88
X> #ifndef ATARI_ST
X90a93
X> #endif
X99c102
X< 		if (rmp->mp_pid == next_pid) {
X---
X> 		if (rmp->mp_pid == next_pid || rmp->mp_procgrp == next_pid) {
X105a109,111
X>   /* Set process group. */
X>   if (who == INIT_PROC_NR) rmc->mp_procgrp = rmc->mp_pid;
X> 
X106a113,115
X> #ifdef ATARI_ST
X>   sys_fork(who, child_nr, rmc->mp_pid, child_base);
X> #else
X108c117
X<   tell_fs(FORK, who, child_nr, 0);
X---
X> #endif
X109a119,121
X>   tell_fs(FORK, who, child_nr, rmc->mp_pid);
X> 
X> #ifndef ATARI_ST
X111a124
X> #endif
X141a155,159
X> #ifdef ATARI_ST
X>   phys_clicks base, size;
X> #endif
X>   phys_clicks s;
X>   register int proc_nr = (int)(rmp - mproc);
X154c172
X<   if (rmp->mp_flags & ALARM_ON) set_alarm(rmp - mproc, (unsigned) 0);
X---
X>   if (rmp->mp_flags & ALARM_ON) set_alarm(proc_nr, (unsigned) 0);
X155a174,178
X> #ifdef AM_KERNEL
X> /* see if an amoeba transaction was pending or a putrep needed to be done */
X>   am_check_sig(proc_nr, 1);
X> #endif
X> 
X157,158c180,195
X<   sys_xit(rmp->mp_parent, rmp - mproc);
X<   tell_fs(EXIT, rmp - mproc, 0, 0);  /* file system can free the proc slot */
X---
X> #ifdef ATARI_ST
X>   sys_xit(rmp->mp_parent, proc_nr, &base, &size);
X>   free_mem(base, size);
X> #else
X>   sys_xit(rmp->mp_parent, proc_nr);
X> #endif
X>   tell_fs(EXIT, proc_nr, 0, 0);  /* file system can free the proc slot */
X> 
X> #ifndef ATARI_ST
X>   /* Release the memory occupied by the child. */
X>   s = (phys_clicks) rmp->mp_seg[S].mem_len;
X>   s += (rmp->mp_seg[S].mem_vir - rmp->mp_seg[D].mem_vir);
X>   if (rmp->mp_flags & SEPARATE) s += rmp->mp_seg[T].mem_len;
X>   free_mem(rmp->mp_seg[T].mem_phys, s);	/* free the memory */
X> #endif
X> 
X219a257
X> #ifndef ATARI_ST
X220a259
X> #endif
X222c261
X<   child_nr = child - mproc;
X---
X>   child_nr = (int)(child - mproc);
X229,233d267
X< 
X<   /* Release the memory occupied by the child. */
X<   s = (phys_clicks) child->mp_seg[S].mem_vir + child->mp_seg[S].mem_len;
X<   if (child->mp_flags & SEPARATE) s += child->mp_seg[T].mem_len;
X<   free_mem(child->mp_seg[T].mem_phys, s);	/* free the memory */
+ END-OF-FILE forkexit.c.diff
chmod 'u=rw,g=r,o=r' 'forkexit.c.diff'
set `wc -c 'forkexit.c.diff'`
count=$1
case $count in
3020)	:;;
*)	echo 'Bad character count in ''forkexit.c.diff' >&2
		echo 'Count should be 3020' >&2
esac
echo Extracting 'glo.h.diff'
sed 's/^X//' > 'glo.h.diff' << '+ END-OF-FILE ''glo.h.diff'
X10c10
X< EXTERN int mm_call;		/* caller's proc number */
X---
X> EXTERN int mm_call;		/* system call number */
+ END-OF-FILE glo.h.diff
chmod 'u=rw,g=r,o=r' 'glo.h.diff'
set `wc -c 'glo.h.diff'`
count=$1
case $count in
108)	:;;
*)	echo 'Bad character count in ''glo.h.diff' >&2
		echo 'Count should be 108' >&2
esac
echo Extracting 'main.c.diff'
sed 's/^X//' > 'main.c.diff' << '+ END-OF-FILE ''main.c.diff'
X77d76
X<   if (who < HARDWARE || who >= NR_PROCS) panic("MM called by", who);
X165,168c164,169
X<   printf("%c 8%c~0",033, 033);	/* go to top of screen and clear screen */
X<   printf("Memory size = %dK     ", mem1);
X<   printf("MINIX = %dK     ", mem2);
X<   printf("RAM disk = %dK     ", mem3);
X---
X> #ifndef ATARI_ST
X>   printf("%c[H%c[J",033, 033);	/* go to top of screen and clear screen */
X> #endif
X>   printf("Memory size = %3dK     ", mem1);
X>   printf("MINIX = %3dK     ", mem2);
X>   printf("RAM disk = %3dK     ", mem3);
X181d181
X<   rmp->mp_seg[S].mem_vir  = init_clicks;
X182a183,189
X> #ifdef ATARI_ST
X>   rmp->mp_seg[T].mem_vir  = rmp->mp_seg[T].mem_phys;
X>   rmp->mp_seg[D].mem_vir  = rmp->mp_seg[D].mem_phys;
X>   rmp->mp_seg[S].mem_vir  = rmp->mp_seg[S].mem_phys;
X> #else
X>   rmp->mp_seg[S].mem_vir  = init_clicks;
X> #endif
X188c195
X< 
X---
X> #ifdef ATARI_ST
X190c197
X<  *				set_map	   				     *
X---
X>  *				get_tot_mem				     *
X192,195c199,203
X< PRIVATE set_map(proc_nr, base, clicks)
X< int proc_nr;			/* whose map to set? */
X< phys_clicks base;		/* where in memory does the process start? */
X< phys_clicks clicks;		/* total size in clicks (sep I & D not used) */
X---
X> /*
X>  * Current memory size is set by TOS in variable 'phystop'.
X>  * The TOS variable '_memtop' compensates for VIDEO memory.
X>  */
X> PUBLIC phys_clicks get_tot_mem()
X197c205
X< /* Set up the memory map as part of the system initialization. */
X---
X>   long i;
X199,213c207,213
X<   register struct mproc *rmp;
X<   vir_clicks vclicks;
X< 
X<   rmp = &mproc[proc_nr];
X<   vclicks = (vir_clicks) clicks;
X<   rmp->mp_seg[T].mem_vir = 0;
X<   rmp->mp_seg[T].mem_len = 0;
X<   rmp->mp_seg[T].mem_phys = base;
X<   rmp->mp_seg[D].mem_vir = 0;
X<   rmp->mp_seg[D].mem_len = vclicks;
X<   rmp->mp_seg[D].mem_phys = base;
X<   rmp->mp_seg[S].mem_vir = vclicks;
X<   rmp->mp_seg[S].mem_len = 0;
X<   rmp->mp_seg[S].mem_phys = base + vclicks;
X<   sys_newmap(proc_nr, rmp->mp_seg);
X---
X>   if (mem_copy(
X> 	HARDWARE, D, (long)0x0436,	/* TOS variable _memtop */
X> 	MM_PROC_NR, D, (long)&i,
X> 	(long)sizeof(i)
X>   ) != OK)
X> 	panic("get_tot_mem", NO_NUM);
X>   return((phys_clicks)(i >> CLICK_SHIFT));
X214a215
X> #endif
+ END-OF-FILE main.c.diff
chmod 'u=rw,g=r,o=r' 'main.c.diff'
set `wc -c 'main.c.diff'`
count=$1
case $count in
2170)	:;;
*)	echo 'Bad character count in ''main.c.diff' >&2
		echo 'Count should be 2170' >&2
esac
echo Extracting 'makefile.diff'
sed 's/^X//' > 'makefile.diff' << '+ END-OF-FILE ''makefile.diff'
X1c1,6
X< CFLAGS= -Di8088 -O
X---
X> # On a PC, cpp and cem are in /lib and will be removed to make space while
X> # linking the kernel.  On an AT, they are in /usr/lib are are not removed.
X> # This is because they have to be in /lib on a PC; the diskette is too small
X> # for them to be in /usr/lib.
X> #
X> 
X3c8,9
X< l=../lib
X---
X> l=/usr/lib
X> CFLAGS = -Di8088  -F 
X5,6c11,12
X< obj =	main.o forkexit.o break.o exec.o signal.o getset.o  \
X< 	alloc.o utility.o table.o putc.o 
X---
X> obj =	main.s forkexit.s break.s exec.s signal.s getset.s  \
X> 	alloc.s utility.s table.s putc.s
X8,11c14,17
X< mm:	makefile  $l/head.o $(obj) $l/libc.a $l/end.o
X< 	@echo "Start linking MM"
X< 	@ld -o mm $l/head.o $(obj) $l/libc.a $l/end.o
X< 	@echo "MM done"
X---
X> mm:	makefile    $l/head.s $(obj) $l/libc.a $l/end.s
X> 	@echo "Start linking MM."
X> 	@asld -o mm $l/head.s $(obj) $l/libc.a $l/end.s
X> 	@echo "MM done. "
X12a19,20
X> clean:
X> 	rm -f $(obj)
X14c22
X< alloc.o:	const.h $h/const.h $h/type.h
X---
X> alloc.s:	const.h $h/const.h $h/type.h
X16,21c24,29
X< break.o:	const.h $h/const.h $h/type.h
X< break.o:	$h/error.h
X< break.o:	$h/signal.h
X< break.o:	glo.h
X< break.o:	mproc.h
X< break.o:	param.h
X---
X> break.s:	const.h $h/const.h $h/type.h
X> break.s:	$h/error.h
X> break.s:	$h/signal.h
X> break.s:	glo.h
X> break.s:	mproc.h
X> break.s:	param.h
X23,29c31,37
X< exec.o:		const.h $h/const.h $h/type.h
X< exec.o:		$h/callnr.h
X< exec.o:		$h/error.h
X< exec.o:		$h/stat.h
X< exec.o:		glo.h
X< exec.o:		mproc.h
X< exec.o:		param.h
X---
X> exec.s:		const.h $h/const.h $h/type.h
X> exec.s:		$h/callnr.h
X> exec.s:		$h/error.h
X> exec.s:		$h/stat.h
X> exec.s:		glo.h
X> exec.s:		mproc.h
X> exec.s:		param.h
X31,36c39,44
X< forkexit.o:	const.h $h/const.h $h/type.h
X< forkexit.o:	$h/callnr.h
X< forkexit.o:	$h/error.h
X< forkexit.o:	glo.h
X< forkexit.o:	mproc.h
X< forkexit.o:	param.h
X---
X> forkexit.s:	const.h $h/const.h $h/type.h
X> forkexit.s:	$h/callnr.h
X> forkexit.s:	$h/error.h
X> forkexit.s:	glo.h
X> forkexit.s:	mproc.h
X> forkexit.s:	param.h
X38,43c46,51
X< getset.o:	const.h $h/const.h $h/type.h
X< getset.o:	$h/callnr.h
X< getset.o:	$h/error.h
X< getset.o:	glo.h
X< getset.o:	mproc.h
X< getset.o:	param.h
X---
X> getset.s:	const.h $h/const.h $h/type.h
X> getset.s:	$h/callnr.h
X> getset.s:	$h/error.h
X> getset.s:	glo.h
X> getset.s:	mproc.h
X> getset.s:	param.h
X45,51c53,59
X< main.o:		const.h $h/const.h $h/type.h
X< main.o:		$h/callnr.h
X< main.o:		$h/com.h
X< main.o:		$h/error.h
X< main.o:		glo.h
X< main.o:		mproc.h
X< main.o:		param.h
X---
X> main.s:		const.h $h/const.h $h/type.h
X> main.s:		$h/callnr.h
X> main.s:		$h/com.h
X> main.s:		$h/error.h
X> main.s:		glo.h
X> main.s:		mproc.h
X> main.s:		param.h
X53,54c61,62
X< putc.o:		$h/const.h $h/type.h
X< putc.o:		$h/com.h
X---
X> putc.s:		$h/const.h $h/type.h
X> putc.s:		$h/com.h
X56,64c64,72
X< signal.o:	const.h $h/const.h $h/type.h
X< signal.o:	$h/callnr.h
X< signal.o:	$h/com.h
X< signal.o:	$h/error.h
X< signal.o:	$h/signal.h
X< signal.o:	$h/stat.h
X< signal.o:	glo.h
X< signal.o:	mproc.h
X< signal.o:	param.h
X---
X> signal.s:	const.h $h/const.h $h/type.h
X> signal.s:	$h/callnr.h
X> signal.s:	$h/com.h
X> signal.s:	$h/error.h
X> signal.s:	$h/signal.h
X> signal.s:	$h/stat.h
X> signal.s:	glo.h
X> signal.s:	mproc.h
X> signal.s:	param.h
X66,70c74,78
X< table.o:	const.h $h/const.h $h/type.h
X< table.o:	$h/callnr.h
X< table.o:	glo.h
X< table.o:	mproc.h
X< table.o:	param.h
X---
X> table.s:	const.h $h/const.h $h/type.h
X> table.s:	$h/callnr.h
X> table.s:	glo.h
X> table.s:	mproc.h
X> table.s:	param.h
X72,78c80,86
X< utility.o:	const.h $h/const.h $h/type.h
X< utility.o:	$h/callnr.h
X< utility.o:	$h/com.h
X< utility.o:	$h/error.h
X< utility.o:	$h/stat.h
X< utility.o:	glo.h
X< utility.o:	mproc.h
X---
X> utility.s:	const.h $h/const.h $h/type.h
X> utility.s:	$h/callnr.h
X> utility.s:	$h/com.h
X> utility.s:	$h/error.h
X> utility.s:	$h/stat.h
X> utility.s:	glo.h
X> utility.s:	mproc.h
+ END-OF-FILE makefile.diff
chmod 'u=rw,g=r,o=r' 'makefile.diff'
set `wc -c 'makefile.diff'`
count=$1
case $count in
3807)	:;;
*)	echo 'Bad character count in ''makefile.diff' >&2
		echo 'Count should be 3807' >&2
esac
echo Extracting 'signal.c.diff'
sed 's/^X//' > 'signal.c.diff' << '+ END-OF-FILE ''signal.c.diff'
X5c5
X<  * can be signalled.  The actual signalling is done by sig_proc().
X---
X>  * can be signaled.  The actual signaling is done by sig_proc().
X11c11
X<  *   sig_proc:	interrupt or terminate a signalled process
X---
X>  *   sig_proc:	interrupt or terminate a signaled process
X17a18
X> 
X35a37,40
X> #ifdef AM_KERNEL
X> PRIVATE int Tfs;		/* if true then Tell file server to unpause */
X> #endif
X> 
X45a51
X>   int sigign = mp->mp_ignore;
X62a69,70
X> 
X>   if (sigign & mask) return(1);
X85c93
X<  * As soon is MM is awaiting new work, the kernel sends MM a message containing
X---
X>  * As soon as MM is awaiting new work, the kernel sends MM a message containing
X91c99
X<   int i, proc_id, proc_nr, id;
X---
X>   int i, j, proc_id, proc_nr, id;
X94,95c102,104
X<   /* Only kernel and FS may make this call. */
X<   if (who != HARDWARE && who != FS_PROC_NR) return(EPERM);
X---
X>   /* Only kernel may make this call. */
X>   if (who != HARDWARE) return(EPERM);
X>   dont_reply = TRUE;		/* don't reply to the kernel */
X106c115
X<   if (sig_map == 1 << (STACK_FAULT - 1)) {
X---
X>   if (sig_map == 1 << (STACK_FAULT - 1))
X108,109d116
X< 	return(OK);
X<   }
X114c121
X<    * and SIGQUIT, use proc_id 0, since multiple processes may have to signalled.
X---
X>    * and SIGQUIT, use proc_id 0, since multiple processes may have to signaled.
X116,119c123,126
X<   for (i = 0; i < NR_SIGS; i++) {
X< 	id= (i+1 == SIGINT || i+1 == SIGQUIT ? 0 : proc_id);
X< 	if (i + 1 == SIGKILL) id = -1;	/* simulate kill -1 9 */
X< 	if ( (sig_map >> i) & 1) check_sig(id, i + 1, SUPER_USER);
X---
X>   for (i = 0, j = 1; i < NR_SIGS - 1; i++, j++) {
X> 	id = (j == SIGINT || j == SIGQUIT) ? 0 : proc_id;
X> 	if (j == SIGKILL) id = -1;	/* simulate kill -1 9 */
X> 	if ( (sig_map >> i) & 1) check_sig(id, j, SUPER_USER);
X122d128
X<   dont_reply = TRUE;		/* don't reply to the kernel */
X151c157
X<    *	- if specific process requested (i.e., 'procpid' > 0, check for match
X---
X>    *	- if specific process requested (i.e., 'procpid' > 0), check for match
X170c176
X< 		rmp->mp_flags &= ~ALARM_ON;
X---
X> 		if (send_sig) rmp->mp_flags &= ~ALARM_ON;
X173c179
X< 	if (send_sig == FALSE || rmp->mp_ignore & mask) continue;
X---
X> 	if (send_sig == FALSE) continue;
X174a181
X> 	if (rmp->mp_ignore & mask) continue;
X175a183,187
X> #ifdef AM_KERNEL
X> 	/* see if an amoeba transaction should be signalled */
X> 	Tfs = am_check_sig(rmp - mproc, 0);
X> #endif
X> 
X180,181c192,193
X< 	unpause(rmp - mproc);	/* check to see if process is paused */
X< 	if (proc_id > 0) break;	/* only one process being signalled */
X---
X> 	unpause((int)(rmp - mproc));	/* check to see if process is paused */
X> 	if (proc_id > 0) break;	/* only one process being signaled */
X194c206
X< register struct mproc *rmp;	/* pointer to the process to be signalled */
X---
X> register struct mproc *rmp;	/* pointer to the process to be signaled */
X213c225
X< 	sys_getsp(rmp - mproc, &new_sp);
X---
X> 	sys_getsp((int)(rmp - mproc), &new_sp);
X216c228
X< 		sys_sig(rmp - mproc, sig_nr, rmp->mp_func);
X---
X> 		sys_sig((int)(rmp - mproc), sig_nr, rmp->mp_func);
X252c264
X< /* This routine is used by do_alarm() to set the alarm timer.  It is also
X---
X> /* This routine is used by do_alarm() to set the alarm timer.  It is also used
X289c301
X< PUBLIC unpause(pro)
X---
X> PRIVATE unpause(pro)
X292c304
X< /* A signal is to be sent to a process.  It that process is hanging on a
X---
X> /* A signal is to be sent to a process.  If that process is hanging on a
X303c315
X<   /* Check to see if process is hanging on PAUSE call. */
X---
X>   /* Check to see if process is hanging on a PAUSE call. */
X312c324
X< 	rmp->mp_flags &= ~ WAITING;	/* turn off WAITING bit */
X---
X> 	rmp->mp_flags &= ~WAITING;	/* turn off WAITING bit */
X316a329,332
X> #ifdef AM_KERNEL
X>   /* if it was an amoeba transaction, it is already tidied up by now. */
X>   if (Tfs)
X> #endif
X318c334
X<   tell_fs(UNPAUSE, pro, 0, 0);
X---
X> 	tell_fs(UNPAUSE, pro, 0, 0);
X336c352,353
X<   long len, a, c, ct, dest;
X---
X>   long len;
X>   long a, c, ct, dest;
X342c359
X<   slot = rmp - mproc;
X---
X>   slot = (int)(rmp - mproc);
X366,372c383,386
X< 	/* First loop through segments and write each length on core file. */
X< 	for (i = 0; i < NR_SEGS; i++) {
X< 		len = rmp->mp_seg[i].mem_len << CLICK_SHIFT;
X< 		if (write(r, (char *) &len, sizeof len) < 0) {
X< 			close(r);
X< 			return;
X< 		}
X---
X> 	/* First write the memory map of all segments on core file. */
X> 	if (write(r, (char *) rmp->mp_seg, sizeof(rmp->mp_seg)) < 0) {
X> 		close(r);
X> 		return;
+ END-OF-FILE signal.c.diff
chmod 'u=rw,g=r,o=r' 'signal.c.diff'
set `wc -c 'signal.c.diff'`
count=$1
case $count in
4452)	:;;
*)	echo 'Bad character count in ''signal.c.diff' >&2
		echo 'Count should be 4452' >&2
esac
echo Extracting 'table.c.diff'
sed 's/^X//' > 'table.c.diff' << '+ END-OF-FILE ''table.c.diff'
X18a19,23
X> #ifdef ATARI_ST
X> /*
X>  * Creating core files is disabled, except for SIGQUIT and SIGIOT.
X>  * Set core_bits to 0x0EFC if you want compatibility with UNIX V7.
X>  */
X19a25,27
X> #else
X> unshort core_bits = 0x0EFC;	/* which signals cause core images */
X> #endif
X26c34
X< extern no_sys(), unpause(), do_ksig(), do_brk2();
X---
X> extern no_sys(), do_ksig(), do_brk2();
X27a36,39
X> #ifdef AM_KERNEL
X> extern do_amoeba();
X> #endif
X> 
X98c110,117
X< 	no_sys		/* 68 = TASK_REPLY	*/
X---
X> 	no_sys,		/* 68 = TASK_REPLY	*/
X> #ifdef i8088
X> #ifdef AM_KERNEL
X> 	do_amoeba,	/* 69 = AMOEBA SYSTEM CALL */
X> #else
X> 	no_sys,		/* 69 = AMOEBA SYSTEM CALL */
X> #endif
X> #endif i8088
+ END-OF-FILE table.c.diff
chmod 'u=rw,g=r,o=r' 'table.c.diff'
set `wc -c 'table.c.diff'`
count=$1
case $count in
669)	:;;
*)	echo 'Bad character count in ''table.c.diff' >&2
		echo 'Count should be 669' >&2
esac
echo Extracting 'utility.c.diff'
sed 's/^X//' > 'utility.c.diff' << '+ END-OF-FILE ''utility.c.diff'
X116c116
X<  * inconsistency is detected, e.g., a programm_ing error or illegal value of a
X---
X>  * inconsistency is detected, e.g., a programming error or illegal value of a
+ END-OF-FILE utility.c.diff
chmod 'u=rw,g=r,o=r' 'utility.c.diff'
set `wc -c 'utility.c.diff'`
count=$1
case $count in
173)	:;;
*)	echo 'Bad character count in ''utility.c.diff' >&2
		echo 'Count should be 173' >&2
esac
exit 0