[comp.os.minix] psfix for MACMINIX

archetyp@uxh.cso.uiuc.edu (Joseph R Pickert) (11/07/90)

Enclosed is a shar file that has the fixes for ps for MACMINIX.

Joe Pickert

#------- CUT HERE --------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README a.out.h.cdif memory.c.cdif ps.c.cdif
# Wrapped by pickert@s11.csrd.uiuc.edu on Tue Nov  6 16:45:42 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f README -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"README\"
else
echo shar: Extracting \"README\" \(965 characters\)
sed "s/^X//" >README <<'END_OF_README'
X#
X# This shell script will fix ps as ditributes with MACMINIX 1.5.10.
X# run it as "sh < README"
X# IT IS ASSUMED YOU HAVE ALREADY COMPILED kernel,mm,fs
X#
X# apply patches
Xpatch /usr/include/a.out.h < a.out.h.cdif
Xpatch /usr/src/commands/ps.c < ps.c.cdif
Xpatch /usr/src/kernel/memory.c < memory.c.cdif
X# Recompile nlist.c
X(cd /usr/src/lib/other; make f=nlist; ar r /usr/lib/libc.a nlist.o)
X# Recompile nm,strip,ps
X(cd /usr/src/commands; make f=nm; mv bin/nm /usr/bin)
X(cd /usr/bin; chown bin nm; chgrp bin nm; chmod 755 nm)
X(cd /usr/src/commands; make f=strip; mv bin/strip /usr/bin)
X(cd /usr/bin; chown bin strip; chgrp bin strip; chmod 755 strip)
X(cd /usr/src/commands; make f=ps; mv bin/ps /usr/bin)
X(cd /usr/bin; chown bin ps; chgrp bin ps; chmod 755 ps)
X# Recompile kernel
X(cd /usr/src/kernel; make)
X# Build NEWmacboot.
X(cd /usr/src/tools; make)
Xecho Complete!
X# Logout, leave MACMINIX, and restart using new boot program (NEWmacboot)
X# Then login and type ps -U
END_OF_README
if test 965 -ne `wc -c <README`; then
    echo shar: \"README\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f a.out.h.cdif -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"a.out.h.cdif\"
else
echo shar: Extracting \"a.out.h.cdif\" \(602 characters\)
sed "s/^X//" >a.out.h.cdif <<'END_OF_a.out.h.cdif'
X*** ../1.5.10/include/a.out.h	Mon Jan  1 09:21:54 1990
X--- ../1.5.10.1/include/a.out.h	Tue Nov  6 08:51:22 1990
X***************
X*** 24,31 ****
X  	long		a_dbase;	/* data relocation base */
X  };
X  
X! #define A_MAGIC0	(unsigned char) 0x01
X! #define A_MAGIC1	(unsigned char) 0x03
X  #define BADMAG(X)	((X).a_magic[0] != A_MAGIC0 ||\
X  			 (X).a_magic[1] != A_MAGIC1)
X  
X--- 24,31 ----
X  	long		a_dbase;	/* data relocation base */
X  };
X  
X! #define A_MAGIC0	(unsigned char) 0x04
X! #define A_MAGIC1	(unsigned char) 0x10
X  #define BADMAG(X)	((X).a_magic[0] != A_MAGIC0 ||\
X  			 (X).a_magic[1] != A_MAGIC1)
X  
END_OF_a.out.h.cdif
if test 602 -ne `wc -c <a.out.h.cdif`; then
    echo shar: \"a.out.h.cdif\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f memory.c.cdif -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"memory.c.cdif\"
else
echo shar: Extracting \"memory.c.cdif\" \(831 characters\)
sed "s/^X//" >memory.c.cdif <<'END_OF_memory.c.cdif'
X*** ../1.5.10/kernel/memory.c	Thu Nov  1 09:59:28 1990
X--- ../1.5.10.1/kernel/memory.c	Tue Nov  6 08:49:40 1990
X***************
X*** 51,59 ****
X    int r, caller, proc_nr;
X  
X    /* Initialize this task. */
X!   ram_origin[KMEM_DEV] = numap(SYSTASK, (vir_bytes) 0, (vir_bytes) 1);
X!   ram_limit[KMEM_DEV] = ((phys_bytes) sizes[1] << CLICK_SHIFT) +
X!                         ram_origin[KMEM_DEV];
X  #if (CHIP == INTEL)
X    if (!protected_mode)
X  	ram_limit[MEM_DEV] = 0x100000;	/* above 1M em_xfer word count fails */
X--- 51,58 ----
X    int r, caller, proc_nr;
X  
X    /* Initialize this task. */
X!   ram_origin[KMEM_DEV] = code_base;
X!   ram_limit[KMEM_DEV]  = code_base + ((sizes[0] + sizes[1]) << CLICK_SHIFT);
X  #if (CHIP == INTEL)
X    if (!protected_mode)
X  	ram_limit[MEM_DEV] = 0x100000;	/* above 1M em_xfer word count fails */
END_OF_memory.c.cdif
if test 831 -ne `wc -c <memory.c.cdif`; then
    echo shar: \"memory.c.cdif\" unpacked with wrong size!
fi
# end of overwriting check
fi
if test -f ps.c.cdif -a "${1}" != "-c" ; then 
  echo shar: Will not over-write existing file \"ps.c.cdif\"
else
echo shar: Extracting \"ps.c.cdif\" \(1445 characters\)
sed "s/^X//" >ps.c.cdif <<'END_OF_ps.c.cdif'
X*** ../1.5.10/commands/ps.c	Mon Apr 23 10:04:57 1990
X--- ../1.5.10.1/commands/ps.c	Tue Nov  6 08:55:31 1990
X***************
X*** 107,115 ****
X--- 107,121 ----
X  
X  /* default paths for system binaries */
X  #if (CHIP == M68000)
X+ #if (MACHINE == MACINTOSH)
X+ #define KERNEL_PATH	"/usr/src/kernel/kernel"
X+ #define MM_PATH		"/usr/src/mm/mm"
X+ #define FS_PATH		"/usr/src/fs/fs"
X+ #else
X  #define KERNEL_PATH	"/usr/src/kernel/kernel.mix"
X  #define MM_PATH		"/usr/src/mm/mm.mix"
X  #define FS_PATH		"/usr/src/fs/fs.mix"
X+ #endif
X  #else
X  #define KERNEL_PATH	"/usr/src/kernel/kernel"
X  #define MM_PATH		"/usr/src/mm/mm"
X***************
X*** 346,356 ****
X--- 352,370 ----
X  	/* get mm/fs tables */
X  	if ((memfd = open(MEM_PATH, O_RDONLY)) == -1)
X  		err(MEM_PATH);
X+ #if (MACHINE == MACINTOSH)
X+ 	if (addrread(memfd, PROC[NR_TASKS + MM_PROC_NR].p_map[T].mem_phys,
X+ #else
X  	if (addrread(memfd, PROC[NR_TASKS + MM_PROC_NR].p_map[D].mem_phys,
X+ #endif
X  		     (vir_bytes) sysinfo.mm_mproc[0].n_value,
X  		     (char *) MPROC, sizeof(MPROC)) != sizeof(MPROC))
X  		err("Can't get mm proc table from /dev/mem");
X+ #if (MACHINE == MACINTOSH)
X+ 	if (addrread(memfd, PROC[NR_TASKS + FS_PROC_NR].p_map[T].mem_phys,
X+ #else
X  	if (addrread(memfd, PROC[NR_TASKS + FS_PROC_NR].p_map[D].mem_phys,
X+ #endif
X  		     (vir_bytes) sysinfo.fs_fproc[0].n_value,
X  		     (char *) FPROC, sizeof(FPROC)) != sizeof(FPROC))
X  		err("Can't get fs proc table from /dev/mem");
END_OF_ps.c.cdif
if test 1445 -ne `wc -c <ps.c.cdif`; then
    echo shar: \"ps.c.cdif\" unpacked with wrong size!
fi
# end of overwriting check
fi
echo shar: End of shell archive.
exit 0