[comp.os.minix] Minix diff's for Turbo C Part 1 of 2

aiv@euraiv1.UUCP (Eelco van Asperen) (07/31/87)

TaTaTaTaTaTaTa !! Here it is at last !! The Minix diff's for Turbo C !!

Sigh, am I glad I've got all files ready for shipping at last; my Unix-box
has been crashing all week and our LAN had some problems that took about
99% of my time to repair. 

The total size of my posting is just over 100K so I've split the posting
into 2 parts; part 1 contains some batch-files, a readme and the diff's
for commands, fs, mm and lib. Part 2 contains the kernel and tools changes
as they required most work.

I hope I haven't forgotten anything; if not, I'm afraid of what it will
do to my mailbox....

Good luck,

Eelco van Asperen.

-----------------------------------------+-------------------------------------
Erasmus University Rotterdam             |uucp:mcvax!{eurifb,olnl1}!euraiv1!aiv 
Fac. of Economics, Computer Science Dept.|earn:asperen@hroeur5
PO.box  1738 / 3000 DR  Rotterdam        |       
T H E    N E T H E R L A N D S           |(this space intentionally left blank)
-----------------------------------------+-------------------------------------

# 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
for dir in commands fs kernel lib mlib mm tools 
do
	if test -f ${dir}
	then	echo Removing   ${dir}
		rm ${dir}
	fi
	if test -d ${dir}
	then	:
	else	echo Creating   ${dir}
		mkdir ${dir}
	fi
	chmod 'u=rwx,g=rx,o=rx' ${dir}
done
echo Extracting readme
sed 's/^X//' > readme << '+ END-OF-FILE 'readme
X
X
XThis file describes how to change the MINIX sources so that you can
Xuse the Turbo C compiler from Borland as a cross-development system.
XThese changes are relative to the 1.1 release !
X
XTo patch MINIX you have to load all the sources on to your hard disk
X(preferably) or make copies on diskettes as described in the book 
X("Setting Up", pg.415+); you'll have to use the doswrite utility to
Xconvert all the files to MS-DOS format (don't forget the -a option
Xfor ascii files). If you want to build the root- and usr-disks from
XDOS, you'll also have to copy asld, cem, cpp and login as their 
Xsources were not included. Also, don't use the -a option to copy 
Xthe message, passwd, rc, ttys files or you'll be in trouble when 
Xyou try to boot MINIX.
X
XIn the following, I'll assume you're using a hard disk system; if not,
Xyou're in for some copying much like the way you would have to when
Xusing Minix as a development system. 
X
XFurthermore, the makefiles I use may not be right for you; especially
Xthe location of the Turbo C libraries, include files etc. may have to
Xbe changed. Check before use with MAKE -N to see if things are ok.
X
XCreate a subdirectory under your MINIX directory (say UPDATE) that has
Xthe following subdirectories:  commands fs kernel lib mlib mm tools.
X
XUnshar this file and copy the files that don't have the .DIF-suffix
Xto their respective directories.
X
XThe files with the .DIF suffix have been created with the DIFF-program
Xwritten by Eric Baalbergen and included in the release 1.2 update that
XAndy Tanenbaum posted to the net recently. To apply the patches, you'll
Xneed the FIX-program that was included as well; in case you missed the
Xposting, I've included it here. Compile FIX with Turbo C and put it 
Xin a place where DOS can find it.
X
XYou MUST be in the directory under which you put the mm, fs, kernel etc.
Xdirectories when you execute the following commands so CD to it.
X
XFirst, create a directory named MLIB which is where the Minix library
Xwill be put (since the LIB-directory is rather full and DOS gets
Xslooooow on large directories, it's not wise to put it there).
X
XNow, to save original files, execute the SAVETHEM.BAT file which will
Xrename all the files to patch to the .OLD-suffix. To patch all the
Xfiles you can use the PATCHEM.BAT file; pass the directory in which
Xyou placed the patches as a parameter on the commandline.
X
XSo:	PATCHEM update
X
XIf everything went ok then you're now ready to build the Minix library;
Xthis is done by compiling the files in the LIB-directory. You can do
Xthis by typing MAKE ALL but this will load TCC for every file. As the
Xsource for the library consist of a lot of small files, it is
Xnot very efficient to reload TCC for every file. To speed things up,
Xyou could use MAKE -N ALL to see the options passed to TCC and then
Xtype  TCC ..options.. *.C
X(you could also add this as an extra target (say FAST) to the makefile.)
X
XCopy the  HEAD.OBJ  and  CRTSO.OBJ  files to the MLIB-directory.
XWhen Turbo C does long arithmetic, it uses a number of library
Xroutines that are unique to Turbo C and therefore not included 
Xin the Minix library; these modules will have to be retrieved 
Xfrom the CS.LIB that came with your Turbo C compiler.
XTo do this, you'll need the LIB-program; unfortunately, Borland did
Xnot distribute such a beast with their compiler so I hope you have the
XMicrosoft Macro-Assembler or something else that does. (the one used
Xby Lattice is no good.) If you don't have LIB and can't find someone
Xnear you that does, please drop me a line and I'll send the .OBJ-files
Xto you by mail. I don't include them here since I'm not quite sure
Xwhether that is allowed (copyrights and the like...); I don't think
Xit will be a problem since these routines are also used in binaries of
Xprograms one writes using Turbo C and you are allowed to distribute
Xthose.
X
XAssuming you have LIB, now use it to extract the following modules from
Xthe CS.LIB;
X	ldiv
X	lrsh
X	lxmul
X	spush
X	scopy
X
XFor example;
X(you are supposed to type the stuff that is displayed in UPPERcase)
X
X	C> CD \MINIX\LIB
X
X	C> LIB
X	(bla bla bla)
X	Library file: \TC\LIB\CS
X	Operations:   *LDIV *LRSH *LXMUL *SPUSH *SCOPY
X	Listing file: 
X
XAfter this, you'll have the corresponding .OBJ-files so you can build
Xthe Minix library. Change directory to the MLIB-directory and execute
XMKLIB.BAT to generate MINIX.LIB.
X
XHaving created the library, you can proceed and compile FS, MM and the
XKERNEL by going to their respective directories and using MAKE to
Xcompile it all. The diffs for xt_wini.c in kernel are for the version
Xwith the patches for WD-controllers applied; the only change was to
Xadd the 's' to copy_params().
X
XNext items are the files in the TOOLS directory; to write a boot-disk
Xyou'll need to compile BUILD, INIT and FSCK. Use MAKE IMAGE to compile
Xthese and to build a boot-disk; MAKE IMAGE also calls the formatter
Xprior to actually writing the image. It expects the diskette to be in
Xdrive A: and the standard pathname for the formatter is \ETC\FORMAT (I
Xput it there so I can not invoke it by accident as \ETC is not in my
Xpath).
X
XAfter experiencing some trouble in creating a bootable Minix, I found
Xout that Andy's advice to use a "Blank, formatted diskette" should be
Xtaken literaly; the disk should not have been used for anything else
Xsince it what formatted. Of course, this may depend on the computer,
XDOS version, ROM version etc. etc. etc. By the way, I use an Olivetti
XM21 PC (this is a luggable version of the Olivetti M24 aka. the AT&T
X6300 in the USA.), 640K ram, 1x360K floppy, 1x20M hard disk and a NEC
XV30 instead of the usual 8086; BIOS version 1.43 and MS-DOS 3.10.
X
XTo create file-systems for Minix from DOS, you'll need MKFS; it's in
Xthe COMMANDS directory. Just copy it to the TOOLS dir and compile it
Xwith  -DTURBO -DDOS  added to the standard options; beware to link it
Xwith the Turbo C library, not the Minix one !!
X
XIf you are going to recompile the files in the COMMANDS directory,
Xplease note that the standard proto-files for MKFS expect to find the
X.OUT-files in COMMANDS\BIN while the makefile just puts them in
XCOMMANDS. You'll have to move them by hand or change the makefile.
XAlso note that the COMMANDS directory is huge (>70 source files) and
Xthat DOS gets slooow when using big directories. That's another reason
Xto put those .OUT-files in COMMANDS\BIN and not to generate .MAP-files.
X
XI have not tried all commands yet but there is at least one with
Xproblems and that's MINED; sometimes it starts and hangs after a few
Xcharacters and sometimes it issues a "Out of memory. Error 12" message
Xand quits. You're invited to have look at this and share your
Xexperiences with us on the net. Also, any program containing setjmp()
Xand longjmp() MUST repeat MUST be compiled with the -r- option (note:
Xthat's "-r-" !) as Turbo C doesn't store it's register variables into
Xmemory before a setjmp()/longjmp(). This is a documented "feature" as
Xin the standard Turbo C library version of setjmp() you can use it to
Ximplement a sort of task-switches (co-routines).
X
XThe test programs AST provided on the user-disk all run fine and
Xthey're a nice test to ensure that everything went ok in building the
Xkernel. I also tried the tests using the -O (optimize) compiler flag
Xand they ran fine with it; I haven't had any time yet to try using -O on
Xthe kernel but I don't expect too much problems there.
X
XIn the part of the book concerned with using DOS as a development-system
Xfor Minix, AST mentions the routines csv and cret. So far, I have used
XTurbo C with stack-overflow testing OFF so I haven't needed them. In
Xcase you would like to do this sort of checking, all you have to do is
Xwrite a replacement for the OVERFLOW@ routine that is called just
Xafter the routine is entered. You cannot use the Turbo C version since
Xit does a direct DOS call if my memory is correct. You can however use
Xthat version as a basis for further development; best thing to do is
Xto compile a short program with Stack Overflow Test ON and Map File ON
Xand then use SYMDEB or something like that to peek at the code
Xgenerated.
X
XI hope I haven't forgotten anything essential and that you'll find
Xsome use for this. I had a lot of fun doing this and consider it a
Xnice way to contribute to the usage of Minix as an educational tool.
X
XOf course, lots of credit should go to AST & helpers for creating and
Xdistributing Minix (I won't mention P-H here....).
X
XPlease post any changes, extensions etc. to the net so we can all benefit.
X
XGood luck and have fun,
X
XEelco van Asperen
X
XErasmus Universiteit Rotterdam  
X Faculty of Economic Science	uucp: seismo!mcvax!eurifb!euraiv1!evas 
X  Dept. of Computer Science	earn/bitnet: asperen@hroeur5
X         Rotterdam
XT H E   N E T H E R L A N D S
+ END-OF-FILE readme
chmod 'u=rw,g=r,o=r' readme
set `sum readme`
sum=$1
case $sum in
46852)	:;;
*)	echo 'Bad sum in 'readme >&2
esac
echo Extracting fix.c
sed 's/^X//' > fix.c << '+ END-OF-FILE 'fix.c
X/* fix - combine file and diff listing	Author: Erik Baalbergen */
X
X/* Notes:
X   * files old and old.fix are equal after the following commands
X	   diff old new > difflist
X	   fix old difflist > old.fix
X   * the diff output is assumed to be produced by my diff program.
X   * the difflist has the following form:
X	   difflist ::= chunk*
X	   chunk ::= append | delete | change ;
X	   append ::= n1 'a' n2 [',' n3]? '\n' ['> ' line '\n'](n3 - n2 + 1)
X	   delete ::= n1 [',' n2]? 'd' n3 '\n' ['< ' line '\n'](n2 - n1 + 1)
X	   change ::= n1 [',' n2]? 'c' n3 [',' n4]? '\n'
X		      ['< ' line '\n'](n2 - n1 + 1)
X		      '---\n'
X		      ['> ' line '\n'](n4 - n3 + 1)
X	   where
X	   - n[1234] is an unsigned integer
X	   - "[pat](expr)" means "(expr) occurences of pat"
X	   - "[pat]?" means "either pat or nothing"
X   * the information in the diff listing is checked against the file to which
X     it is applied; an error is printed if there is a conflict
X*/
X
X#include <stdio.h>
X
Xextern char *fgets();
Xextern FILE *fopen();
X#define LINELEN	1024
X
Xchar *prog = 0;
X
Xchar *
Xgetline(fp, b)
X	FILE *fp;
X	char *b;
X{
X	if (fgets(b, LINELEN, fp) == NULL)
X		fatal("unexpected eof");
X	return b;
X}
X
X#define copy(str) printf("%s", str)
X
Xmain(argc, argv)
X	char **argv;
X{
X	char cmd, *fl, *fd, obuf[LINELEN], nbuf[LINELEN];
X	int o1, o2, n1, n2, here; 
X	FILE *fpf, *fpd;
X
X	prog = argv[0];
X	if (argc != 3)
X		fatal("use: %s original-file diff-list-file", prog);
X	if ((fpf = fopen(argv[1], "r")) == NULL)
X		fatal("can't read %s", argv[1]);
X	if ((fpd = fopen(argv[2], "r")) == NULL)
X		fatal("can't read %s", argv[2]);
X	here = 0;
X	while (getcommand(fpd, &o1, &o2, &cmd, &n1, &n2)) {
X		while (here < o1 - 1) {
X			here++;
X			copy(getline(fpf, obuf));
X		}
X		switch (cmd) {
X		case 'c':
X		case 'd':
X			if (cmd == 'd' && n1 != n2)
X				fatal("delete count conflict");
X			while (o1 <= o2) {
X				fl = getline(fpf, obuf);
X				here++;
X				fd = getline(fpd, nbuf);
X				if (strncmp(fd, "< ", 2))
X					fatal("illegal delete line");
X				if (strcmp(fl, fd + 2))
X					fatal("delete line conflict");
X				o1++;
X			}
X			if (cmd == 'd')
X				break;
X			if (strcmp(getline(fpd, nbuf), "---\n"))
X				fatal("illegal separator in chunk");
X			/*FALLTHROUGH*/
X		case 'a':
X			if (cmd == 'a') {
X				if (o1 != o2)
X					fatal("append count conflict");
X				copy(getline(fpf, obuf));
X				here++;
X			}
X			while (n1 <= n2) {
X				if (strncmp(getline(fpd, nbuf), "> ", 2))
X					fatal("illegal append line");
X				copy(nbuf + 2);
X				n1++;
X			}
X			break;
X		}
X	}
X	while (fgets(obuf, LINELEN, fpf) != NULL)
X		copy(obuf);
X	exit(0);
X}
X
Xisdigit(c)
X	char c;
X{
X	return c >= '0' && c <= '9';
X}
X
Xchar *
Xrange(s, p1, p2)
X	char *s;
X	int *p1, *p2;
X{
X	register int v1 = 0, v2;
X
X	while (isdigit(*s))
X		v1 = 10 * v1 + *s++ - '0';
X	v2 = v1;
X	if (*s == ',') {
X		s++;
X		v2 = 0;
X		while (isdigit(*s))
X			v2 = 10 * v2 + *s++ - '0';
X	}
X	if (v1 == 0 || v2 == 0 || v1 > v2)
X		fatal("illegal range");
X	*p1 = v1;
X	*p2 = v2;
X	return s;
X}
X
Xgetcommand(fp, o1, o2, pcmd, n1, n2)
X	FILE *fp;
X	int *o1, *o2, *n1, *n2;
X	char *pcmd;
X{
X	char buf[LINELEN];
X	register char *s;
X	char cmd;
X	
X	if ((s = fgets(buf, LINELEN, fp)) == NULL)
X		return 0;
X	s = range(s, o1, o2);
X	if ((cmd = *s++) != 'a' && cmd != 'c' && cmd != 'd')
X		fatal("illegal command");
X	s = range(s, n1, n2);
X	if (*s != '\n' && s[1] != '\0')
X		fatal("extra characters at end of command: %s", s);
X	*pcmd = cmd;
X	return 1;
X}
X
Xfatal(s, a)
X	char *s, *a;
X{
X	fprintf(stderr, "%s: fatal: ", prog);
X	fprintf(stderr, s, a);
X	fprintf(stderr, "\n");
X	exit(1);
X}
+ END-OF-FILE fix.c
chmod 'u=rw,g=r,o=r' fix.c
set `sum fix.c`
sum=$1
case $sum in
50180)	:;;
*)	echo 'Bad sum in 'fix.c >&2
esac
echo Extracting patchem.bat
sed 's/^X//' > patchem.bat << '+ END-OF-FILE 'patchem.bat
Xfix COMMANDS\DF.old %1\COMMANDS\DF.dif >COMMANDS\DF.c
Xfix COMMANDS\LN.old %1\COMMANDS\LN.dif >COMMANDS\LN.c
Xfix COMMANDS\MKFS.old %1\COMMANDS\MKFS.dif >COMMANDS\MKFS.c
Xfix COMMANDS\WC.old %1\COMMANDS\WC.dif >COMMANDS\WC.c
Xfix FS\OPEN.old %1\FS\OPEN.dif >FS\OPEN.c
Xfix KERNEL\KLIB88.old %1\KERNEL\KLIB88.dif >KERNEL\KLIB88.asm
Xfix KERNEL\MXP88.old %1\KERNEL\MXP88.dif >KERNEL\MXP88.asm
Xfix KERNEL\XT_WINI.old %1\KERNEL\XT_WINI.dif >KERNEL\XT_WINI.c
Xfix LIB\GETPWENT.old %1\LIB\GETPWENT.dif >LIB\GETPWENT.c
Xfix LIB\REGEXP.old %1\LIB\REGEXP.dif >LIB\REGEXP.c
Xfix TOOLS\BUILD.old %1\TOOLS\BUILD.dif >TOOLS\BUILD.c
Xfix TOOLS\FSCK.old %1\TOOLS\FSCK.dif >TOOLS\FSCK.C
Xfix TOOLS\FSCK1.old %1\TOOLS\FSCK1.dif >TOOLS\FSCK1.ASM
+ END-OF-FILE patchem.bat
chmod 'u=rw,g=r,o=r' patchem.bat
set `sum patchem.bat`
sum=$1
case $sum in
54067)	:;;
*)	echo 'Bad sum in 'patchem.bat >&2
esac
echo Extracting savethem.bat
sed 's/^X//' > savethem.bat << '+ END-OF-FILE 'savethem.bat
Xren COMMANDS\DF.c COMMANDS\DF.old
Xren COMMANDS\LN.c COMMANDS\LN.old
Xren COMMANDS\MKFS.c COMMANDS\MKFS.old
Xren COMMANDS\WC.c COMMANDS\WC.old
Xren FS\LINKLIST FS\LINKLIST.old
Xren FS\MAKEFILE FS\MAKEFILE.old
Xren FS\OPEN.c FS\OPEN.old
Xren KERNEL\KLIB88.asm KERNEL\KLIB88.old
Xren KERNEL\LINKLIST KERNEL\LINKLIST.old
Xren KERNEL\MAKEFILE KERNEL\MAKEFILE.old
Xren KERNEL\MXP88.asm KERNEL\MXP88.old
Xren KERNEL\XT_WINI.c KERNEL\XT_WINI.old
Xren LIB\CATCHSIG.ASM LIB\CATCHSIG.old
Xren LIB\CRTSO.ASM LIB\CRTSO.old
Xren LIB\GETPWENT.c LIB\GETPWENT.old
Xren LIB\GETUTIL.ASM LIB\GETUTIL.old
Xren LIB\HEAD.ASM LIB\HEAD.old
Xren LIB\MAKEFILE LIB\MAKEFILE.old
Xren LIB\PROLOGUE.H LIB\PROLOGUE.old
Xren LIB\REGEXP.c LIB\REGEXP.old
Xren LIB\SENDREC.ASM LIB\SENDREC.old
Xren LIB\SETJMP.ASM LIB\SETJMP.old
Xren MM\LINKLIST MM\LINKLIST.old
Xren MM\MAKEFILE MM\MAKEFILE.old
Xren TOOLS\BUILD.c TOOLS\BUILD.old
Xren TOOLS\FSCK.C TOOLS\FSCK.old
Xren TOOLS\FSCK1.ASM TOOLS\FSCK1.old
Xren TOOLS\MAKEFILE TOOLS\MAKEFILE.old
+ END-OF-FILE savethem.bat
chmod 'u=rw,g=r,o=r' savethem.bat
set `sum savethem.bat`
sum=$1
case $sum in
8666)	:;;
*)	echo 'Bad sum in 'savethem.bat >&2
esac
echo Extracting commands/df.dif
sed 's/^X//' > commands/df.dif << '+ END-OF-FILE 'commands/df.dif
X146a147,148
X>   extern char *itoa(int);
X> 
+ END-OF-FILE commands/df.dif
chmod 'u=rw,g=r,o=r' commands/df.dif
set `sum commands/df.dif`
sum=$1
case $sum in
2973)	:;;
*)	echo 'Bad sum in 'commands/df.dif >&2
esac
echo Extracting commands/linklist
sed 's/^X//' > commands/linklist << '+ END-OF-FILE 'commands/linklist
X..\mlib\head+
Xmain+open+read+write+pipe+device+path+
Xmount+link+super+inode+cache+filedes+stadir+
Xprotect+time+misc+utility+table+putc
Xfs
Xfs
X..\mlib\minix
+ END-OF-FILE commands/linklist
chmod 'u=rw,g=r,o=r' commands/linklist
set `sum commands/linklist`
sum=$1
case $sum in
14350)	:;;
*)	echo 'Bad sum in 'commands/linklist >&2
esac
echo Extracting commands/ln.dif
sed 's/^X//' > commands/ln.dif << '+ END-OF-FILE 'commands/ln.dif
X11a12
X>   char *last_comp(char *);
+ END-OF-FILE commands/ln.dif
chmod 'u=rw,g=r,o=r' commands/ln.dif
set `sum commands/ln.dif`
sum=$1
case $sum in
2550)	:;;
*)	echo 'Bad sum in 'commands/ln.dif >&2
esac
echo Extracting commands/makefile
sed 's/^X//' > commands/makefile << '+ END-OF-FILE 'commands/makefile
XCC=tcc
XCCOPTS=-A -mt -I..\include -Di8088 -DTURBO
X
XOBJS=	write.obj cache.obj device.obj filedes.obj \
X	inode.obj main.obj link.obj misc.obj mount.obj open.obj \
X	path.obj pipe.obj protect.obj putc.obj read.obj stadir.obj \
X	super.obj table.obj time.obj utility.obj
X
Xfs:	$(OBJS) ..\mlib\head.obj
X	link /m @linklist
X	dos2out -d fs
X
X.c.obj:
X	$(CC) $(CCOPTS) -c $<
X
+ END-OF-FILE commands/makefile
chmod 'u=rw,g=r,o=r' commands/makefile
set `sum commands/makefile`
sum=$1
case $sum in
29502)	:;;
*)	echo 'Bad sum in 'commands/makefile >&2
esac
echo Extracting commands/mkfs.dif
sed 's/^X//' > commands/mkfs.dif << '+ END-OF-FILE 'commands/mkfs.dif
X0a1
X> 
X25c26,33
X< #include "/lib/c86/stdio.h"
X---
X> # ifdef TURBO
X> #  undef printf		/* defined as printk in ../fs/const.h ! */
X> #  include <stdio.h>
X> #  include <fcntl.h>
X> #  include <sys/stat.h>
X> # else
X> #  include "/lib/c86/stdio.h"
X> # endif
X64,65c72,78
X< #  define BREAD		     4
X< #  define BWRITE	     5
X---
X> # ifdef TURBO
X> #  define BREAD		     O_RDONLY|O_BINARY
X> #  define BWRITE	     S_IREAD|S_IWRITE
X> # else
X> #  define BREAD		     4
X> #  define BWRITE	     5
X> # endif
X622c635,639
X<   for (k = 0; k < MAX_TOKEN; k++) parse[k] = 0;
X---
X>   /* EVAS: MAX_TOKENS used to read MAX_TOKEN;
X>   * this will work if you only have 9 or less significant
X>   * characters for identifiers.
X>   */
X>   for (k = 0; k < MAX_TOKENS; k++) parse[k] = 0;
X664a682,684
X> 	/* with Turbo C, we could use getftime() and difftime() to
X> 	* compute the time in seconds from 1/1/1970.
X> 	*/
+ END-OF-FILE commands/mkfs.dif
chmod 'u=rw,g=r,o=r' commands/mkfs.dif
set `sum commands/mkfs.dif`
sum=$1
case $sum in
62096)	:;;
*)	echo 'Bad sum in 'commands/mkfs.dif >&2
esac
echo Extracting commands/open.dif
sed 's/^X//' > commands/open.dif << '+ END-OF-FILE 'commands/open.dif
X39c39
X<   extern struct inode *new_node();
X---
X>   struct inode *new_node();
X94a95
X>   struct inode *new_node();
+ END-OF-FILE commands/open.dif
chmod 'u=rw,g=r,o=r' commands/open.dif
set `sum commands/open.dif`
sum=$1
case $sum in
8883)	:;;
*)	echo 'Bad sum in 'commands/open.dif >&2
esac
echo Extracting commands/wc.dif
sed 's/^X//' > commands/wc.dif << '+ END-OF-FILE 'commands/wc.dif
X4c4
X< #define isdigit(c) (c >= '0' && c <= '9)
X---
X> #define isdigit(c) (c >= '0' && c <= '9')
+ END-OF-FILE commands/wc.dif
chmod 'u=rw,g=r,o=r' commands/wc.dif
set `sum commands/wc.dif`
sum=$1
case $sum in
5923)	:;;
*)	echo 'Bad sum in 'commands/wc.dif >&2
esac
echo Extracting mm/linklist
sed 's/^X//' > mm/linklist << '+ END-OF-FILE 'mm/linklist
X..\mlib\head+
Xmain+forkexit+break+exec+signal+
Xgetset+alloc+utility+table+putc
Xmm
Xmm
X..\mlib\minix
+ END-OF-FILE mm/linklist
chmod 'u=rw,g=r,o=r' mm/linklist
set `sum mm/linklist`
sum=$1
case $sum in
9069)	:;;
*)	echo 'Bad sum in 'mm/linklist >&2
esac
echo Extracting mm/makefile
sed 's/^X//' > mm/makefile << '+ END-OF-FILE 'mm/makefile
XOBJS=	exec.obj alloc.obj break.obj forkexit.obj \
X	getset.obj main.obj putc.obj signal.obj table.obj utility.obj
X
Xmm:	$(OBJS) ..\mlib\head.obj
X	link /m @linklist
X	dos2out mm
X
X.c.obj:
X	tcc -A -mt -I..\include -Di8088 -DTURBO -c $<
+ END-OF-FILE mm/makefile
chmod 'u=rw,g=r,o=r' mm/makefile
set `sum mm/makefile`
sum=$1
case $sum in
18748)	:;;
*)	echo 'Bad sum in 'mm/makefile >&2
esac
echo Extracting fs/linklist
sed 's/^X//' > fs/linklist << '+ END-OF-FILE 'fs/linklist
X..\mlib\head+
Xmain+open+read+write+pipe+device+path+
Xmount+link+super+inode+cache+filedes+stadir+
Xprotect+time+misc+utility+table+putc
Xfs
Xfs
X..\mlib\minix
X
+ END-OF-FILE fs/linklist
chmod 'u=rw,g=r,o=r' fs/linklist
set `sum fs/linklist`
sum=$1
case $sum in
14360)	:;;
*)	echo 'Bad sum in 'fs/linklist >&2
esac
echo Extracting fs/makefile
sed 's/^X//' > fs/makefile << '+ END-OF-FILE 'fs/makefile
XCC=tcc
XCCOPTS=-A -mt -I..\include -Di8088 -DTURBO
X
XOBJS=	write.obj cache.obj device.obj filedes.obj \
X	inode.obj main.obj link.obj misc.obj mount.obj open.obj \
X	path.obj pipe.obj protect.obj putc.obj read.obj stadir.obj \
X	super.obj table.obj time.obj utility.obj
X
Xfs:	$(OBJS) ..\mlib\head.obj
X	link /m @linklist
X	dos2out -d fs
X
X.c.obj:
X	$(CC) $(CCOPTS) -c $<
X
+ END-OF-FILE fs/makefile
chmod 'u=rw,g=r,o=r' fs/makefile
set `sum fs/makefile`
sum=$1
case $sum in
29502)	:;;
*)	echo 'Bad sum in 'fs/makefile >&2
esac
echo Extracting fs/open.dif
sed 's/^X//' > fs/open.dif << '+ END-OF-FILE 'fs/open.dif
X39c39
X<   extern struct inode *new_node();
X---
X>   struct inode *new_node();
X94a95
X>   struct inode *new_node();
+ END-OF-FILE fs/open.dif
chmod 'u=rw,g=r,o=r' fs/open.dif
set `sum fs/open.dif`
sum=$1
case $sum in
8883)	:;;
*)	echo 'Bad sum in 'fs/open.dif >&2
esac
echo Extracting lib/catchsig.asm
sed 's/^X//' > lib/catchsig.asm << '+ END-OF-FILE 'lib/catchsig.asm
Xtitle catchsig  -  C86 version; now TurboC version [EVAS]
Xpage,132
X
Xinclude	prologue.h
X
X_DATA	segment	para public 'DATA'
X
X	extrn  _vectab:word, _M:word
X
X	dummy	 DW	 0
X
X_DATA	ends
X
X
X_TEXT	segment	byte public 'CODE'
X
X	assume	CS:_TEXT,DS:DGROUP
X
X	public _begsig
X
X
XMTYPE = 2			; M+mtype =  &M.m_type
X
X_begsig	proc near
X
X	push ax			; after interrupt, save all regs
X	push bx
X	push cx
X	push dx
X	push si
X	push di
X	push bp
X	push ds
X	push es
X
X	mov bp,sp
X	mov bx,18[bp]		; bx = signal number
X	dec bx			; vectab[0] is for sig 1
X	add bx,bx		; pointers are two bytes on 8088
X	mov bx,_vectab[bx]	; bx = address of routine to call
X	push _M+mtype		; push status of last system call
X	push ax			; func called with signal number as arg
X	call bx
Xback:
X	pop ax			; get signal number off stack
X	pop _M+mtype		; restore status of previous system call
X	pop es			; signal handling finished
X	pop ds
X	pop bp
X	pop di
X	pop si
X	pop dx
X	pop cx
X	pop bx
X	pop ax
X	pop dummy		; remove signal number from stack
X
X	iret
X
X_begsig	endp
X
X_TEXT	ends
X
X
X	END	; end of assembly-file
+ END-OF-FILE lib/catchsig.asm
chmod 'u=rw,g=r,o=r' lib/catchsig.asm
set `sum lib/catchsig.asm`
sum=$1
case $sum in
18236)	:;;
*)	echo 'Bad sum in 'lib/catchsig.asm >&2
esac
echo Extracting lib/crtso.asm
sed 's/^X//' > lib/crtso.asm << '+ END-OF-FILE 'lib/crtso.asm
XTitle $MAIN    C-86 run-time start-off for Minix; Now for Turbo C [EVAS]
Xpage,132
X
X
X	PAGE	60,132
X;[]------------------------------------------------------------[]
X;|      start-up module for using Turbo C under MINIX; 		|
X;|	derived from:						|
X;|								|
X;|	C0.ASM -- Start Up Code					|
X;|								|
X;|	Turbo-C Run Time Library	version 1.0		|
X;|								|
X;|	Copyright (c) 1987 by Borland International Inc.	|
X;|	All Rights Reserved.					|
X;[]------------------------------------------------------------[]
X
Xinclude	prologue.h
X
X	ASSUME	CS:_TEXT, DS:DGROUP
X
X;	External References
X
X
XPUBLIC	__end, _brksize, edata, $main, _environ, kamikaze
X
X
XSTACKSIZE EQU 2560	; default stack is 5 Kb (2K words)
X
X_DATA	segment	para public 'DATA'
X
X_brksize	DW	offset dgroup:__end+2  	; dynamic changeable end of bss
X_environ	DW	0			; save environment pointer here
X
X_DATA	ends
X
X
X_DATAEND	segment	para public 'DATA'
X
X; _DATAEND holds nothing. The label just tells us where
X; the initialized data (.data) ends.
X
Xedata	label byte
X
X_DATAEND ENDS
X
X_BSSEND SEGMENT BYTE PUBLIC 'BSS'
X
X; _BSSEND holds nothing. The label in the segment just tells
X; us where the data+bss ends.
X
X__end	label	byte
X
X_BSSEND ENDS
X
X
X@STACK	SEGMENT	BYTE STACK 'STACK'
X	DW	STACKSIZE dup(?)	; add stack segment to bss
X@STACK	ENDS
X
X
X_TEXT	segment	byte public 'CODE'
X	ASSUME	CS:_TEXT,DS:DGROUP
X
XEXTRN   _main:NEAR, _exit:NEAR
X
X; This is the C run-time start-off routine.  It's job is to take the
X; arguments as put on the stack by EXEC, and to parse them and set them up the
X; way main expects them.
X;
X
X$main:
X	mov	ax,DGROUP	; force relocation of data & bss
X	mov	bx,sp		; set stackframe pointer (ds=ss)
X	mov	cx,[bx]		; get argc
X	add	bx,2		; point at next parameter
X	mov	ax,cx
X	inc	ax		; calculate envp
X	shl	ax,1
X	add	ax,bx
X	mov	_environ,ax	; save envp
X	push	ax		; stack envp
X	push	bx		; stack argv
X	push	cx		; stack argc
X
X	call	_main		; call _main(arc,argv,envp)
X
X	add	sp,6
X	push	ax		; stack program-termination status
X	call	_exit		; this will never return
X
X	; DEBUG from here on
X
Xkamikaze: 	int 3
X		ret
X
X_TEXT	ENDS
X
X
X	END	$main	; program entry-point (could be anywhere)
+ END-OF-FILE lib/crtso.asm
chmod 'u=rw,g=r,o=r' lib/crtso.asm
set `sum lib/crtso.asm`
sum=$1
case $sum in
30524)	:;;
*)	echo 'Bad sum in 'lib/crtso.asm >&2
esac
echo Extracting lib/getpwent.dif
sed 's/^X//' > lib/getpwent.dif << '+ END-OF-FILE 'lib/getpwent.dif
X78,90c78,90
X< 	pwd.name = _buf;
X< 	skip_period ();
X< 	pwd.passwd = _buf;
X< 	skip_period ();
X< 	pwd.uid = atoi (_buf);
X< 	skip_period ();
X< 	pwd.gid = atoi (_buf);
X< 	skip_period ();
X< 	pwd.gecos = _buf;
X< 	skip_period ();
X< 	pwd.dir = _buf;
X< 	skip_period ();
X< 	pwd.shell = _buf;
X---
X> 	pwd.pw_name = _buf;
X> 	skip_period ();
X> 	pwd.pw_passwd = _buf;
X> 	skip_period ();
X> 	pwd.pw_uid = atoi (_buf);
X> 	skip_period ();
X> 	pwd.pw_gid = atoi (_buf);
X> 	skip_period ();
X> 	pwd.pw_gecos = _buf;
X> 	skip_period ();
X> 	pwd.pw_dir = _buf;
X> 	skip_period ();
X> 	pwd.pw_shell = _buf;
X102c102
X< 		if (!strcmp (pwd -> name, name))
X---
X> 		if (!strcmp (pwd -> pw_name, name))
X118c118
X< 		if (pwd -> uid == uid)
X---
X> 		if (pwd -> pw_uid == uid)
X
+ END-OF-FILE lib/getpwent.dif
chmod 'u=rw,g=r,o=r' lib/getpwent.dif
set `sum lib/getpwent.dif`
sum=$1
case $sum in
54770)	:;;
*)	echo 'Bad sum in 'lib/getpwent.dif >&2
esac
echo Extracting lib/getutil.asm
sed 's/^X//' > lib/getutil.asm << '+ END-OF-FILE 'lib/getutil.asm
Xtitle GetUtil  -  C86 version; now for Turbo C [EVAS]
Xpage,132
X
Xinclude	prologue.h
X
X	PUBLIC _get_base, _get_size, _get_tot_mem
X
X	EXTRN  __end:byte
X
X
X_TEXT	SEGMENT byte public 'CODE'
X
X	ASSUME	CS:_TEXT,DS:DGROUP
X
X;========================================================================
X;                           utilities                                     
X;========================================================================
X
X_get_base:			; return click at which prog starts
X	mov ax,ds
X	ret
X
X_get_size:			   ; return prog size in bytes [text+data+bss]
X	mov ax,offset dgroup:__end  ; end is label at end of bss
X	ret
X
X; Find out how much memory the machine has, including vectors, kernel MM, etc.
X_get_tot_mem:
X	cli
X	push es
X	push di
X	mov ax,8192		; start search at 128K [8192 clicks]
X	sub di,di
Xy1:	mov es,ax
X	mov es:[di],0A5A4h	; write random bit pattern to memory
X	xor bx,bx
X	mov bx,es:[di]		; read back pattern just written
X	cmp bx,0A5A4h		; compare with expected value
X	jne y2			; if different, no memory present
X	add ax,4096		; advance counter by 64K
X	cmp ax,0A000h		; stop seaching at 640K
X	jne y1
Xy2:	pop di
X	pop es
X	sti
X	ret
X
X_TEXT	ENDS
X
X	END	; end of assembly-file
+ END-OF-FILE lib/getutil.asm
chmod 'u=rw,g=r,o=r' lib/getutil.asm
set `sum lib/getutil.asm`
sum=$1
case $sum in
24012)	:;;
*)	echo 'Bad sum in 'lib/getutil.asm >&2
esac
echo Extracting lib/head.asm
sed 's/^X//' > lib/head.asm << '+ END-OF-FILE 'lib/head.asm
Xtitle Head  -  Start-off for initt, mm and fs (C86-compiler); now for Turbo C [EVAS]
Xpage ,132
X
Xinclude	prologue.h
X
XEXTRN _main:NEAR
XPUBLIC $main, _data_org,	brksize, sp_limit, __end
XEXTRN  _stackpt:word
X
X
X_TEXT	SEGMENT byte public 'CODE'
X
X	assume	cs:_TEXT,ds:DGROUP
X
X$main:	jmp	short L0
X
X	ORG 10h			; kernel uses this area	as stack for inital IRET
XL0: 	mov	sp,dgroup:_stackpt
X	call	_main
XL1:    	jmp L1			; this will never be executed
X	mov	ax,DGROUP	; force	relocation for dos2out (never executed)
X
X_TEXT	ENDS
X
X
X_DATA	SEGMENT
X				; fs needs to know where build stuffed table
X_data_org DW 0DADAh		; 0xDADA is magic number for build
X	 DW 7 dup(0)		; first 8 words of MM, FS, INIT are for stack
Xbrksize	 DW	offset dgroup:__end  ; first free memory
Xsp_limit DW	0
X
X_DATA	ENDS
X
X_BSSEND SEGMENT
X
X; _BSSEND holds nothing. The label in the segment just tells
X; us where the data+bss ends.
X
X__end	label	byte
X
X_BSSEND ENDS
X
X
X@STACK	SEGMENT	BYTE STACK 'STACK'
X@STACK	ENDS				; Add stack to satisfy DOS-linker
X
X	END	$main			; end of assembly & entry-point
X
+ END-OF-FILE lib/head.asm
chmod 'u=rw,g=r,o=r' lib/head.asm
set `sum lib/head.asm`
sum=$1
case $sum in
17073)	:;;
*)	echo 'Bad sum in 'lib/head.asm >&2
esac
echo Extracting lib/makefile
sed 's/^X//' > lib/makefile << '+ END-OF-FILE 'lib/makefile
XCCOPTS=-A -mt -I..\include -Di8088 -DTURBO
XCC=tcc
X
XASM=	GETUTIL.ASM HEAD.ASM SENDREC.ASM SETJMP.ASM \
X	END.ASM CATCHSIG.ASM CSV.ASM BRKSIZE.ASM
X
XOBJ1=	ABORT.OBJ ABS.OBJ ACCESS.OBJ ALARM.OBJ ATOI.OBJ ATOL.OBJ \
X	BCOPY.OBJ BRK.OBJ BRK2.OBJ CALL.OBJ CHDIR.OBJ CHMOD.OBJ \
X	CHOWN.OBJ CHROOT.OBJ CLEANUP.OBJ CLOSE.OBJ CREAT.OBJ CRYPT.OBJ \
X	CTYPE.OBJ DOPRINTF.OBJ DUP.OBJ  DUP2.OBJ EXEC.OBJ \
X	EXIT.OBJ FCLOSE.OBJ FFLUSH.OBJ FGETS.OBJ FOPEN.OBJ \
X	FORK.OBJ FPRINTF.OBJ FPUTS.OBJ FREAD.OBJ FREOPEN.OBJ \
X	FSEEK.OBJ FSTAT.OBJ FTELL.OBJ FWRITE.OBJ GETC.OBJ \
X	GETEGID.OBJ GETENV.OBJ GETEUID.OBJ GETGID.OBJ GETGRENT.OBJ \
X	GETPASS.OBJ GETPID.OBJ GETPWENT.OBJ GETS.OBJ GETUID.OBJ \
X	INDEX.OBJ IOCTL.OBJ ISATTY.OBJ ITOA.OBJ KILL.OBJ LINK.OBJ \
X	LSEEK.OBJ MALLOC.OBJ MESSAGE.OBJ MKNOD.OBJ MKTEMP.OBJ
X
XOBJ2=	MOUNT.OBJ OPEN.OBJ PAUSE.OBJ PERROR.OBJ PIPE.OBJ \
X	PRINTDAT.OBJ PRINTK.OBJ PRINTS.OBJ PROLOGUE.H PUTC.OBJ \
X	RAND.OBJ READ.OBJ REGEXP.OBJ REGSUB.OBJ RINDEX.OBJ \
X	SCANF.OBJ SETBUF.OBJ SETGID.OBJ SETUID.OBJ \
X	SIGNAL.OBJ SLEEP.OBJ SPRINTF.OBJ STAT.OBJ STB.OBJ  \
X	STDERR.OBJ STIME.OBJ STRCAT.OBJ STRCMP.OBJ STRCPY.OBJ \
X	STRLEN.OBJ STRNCAT.OBJ STRNCMP.OBJ STRNCPY.OBJ SYNC.OBJ \
X	SYSLIB.OBJ TIME.OBJ TIMES.OBJ UMASK.OBJ UMOUNT.OBJ \
X	UNGETC.OBJ UNLINK.OBJ UTIME.OBJ \
X	WAIT.OBJ WRITE.OBJ 
X
X.c.obj:
X		$(CC) $(CCOPTS)-c $<
X
X.asm.obj:
X		masm $<,,nul,nul
X
Xminix.lib:	dummy1 dummy2
X
Xdummy1:	$(OBJ1)
X
Xdummy2:	$(OBJ2)
X
+ END-OF-FILE lib/makefile
chmod 'u=rw,g=r,o=r' lib/makefile
set `sum lib/makefile`
sum=$1
case $sum in
27941)	:;;
*)	echo 'Bad sum in 'lib/makefile >&2
esac
echo Extracting lib/prologue.h
sed 's/^X//' > lib/prologue.h << '+ END-OF-FILE 'lib/prologue.h
X
X;	Segment and Group declarations
X
X_TEXT	SEGMENT BYTE PUBLIC 'CODE'
X_TEXT	ENDS
X_DATABEG	SEGMENT PARA PUBLIC 'DATA'
X_DATABEG	ENDS
X_DATA	SEGMENT PARA PUBLIC 'DATA'
X_DATA	ENDS
X_DATAEND SEGMENT PARA PUBLIC 'DATA'
X_DATAEND ENDS
X_BSS	SEGMENT WORD PUBLIC 'BSS'
X_BSS	ENDS
X_BSSEND SEGMENT BYTE PUBLIC 'BSS'
X_BSSEND ENDS
X_STACK	SEGMENT STACK 'STACK'
X_STACK	ENDS
X
XDGROUP	GROUP	_DATABEG,_DATA, _DATAEND, _BSS, _BSSEND, _STACK
X
+ END-OF-FILE lib/prologue.h
chmod 'u=rw,g=r,o=r' lib/prologue.h
set `sum lib/prologue.h`
sum=$1
case $sum in
27968)	:;;
*)	echo 'Bad sum in 'lib/prologue.h >&2
esac
echo Extracting lib/regexp.dif
sed 's/^X//' > lib/regexp.dif << '+ END-OF-FILE 'lib/regexp.dif
X813c813
X<   extern char *strchr();
X---
X>   extern char *strchr(char *,char);
X1001a1002
X>   extern char *strchr(char *,char);
+ END-OF-FILE lib/regexp.dif
chmod 'u=rw,g=r,o=r' lib/regexp.dif
set `sum lib/regexp.dif`
sum=$1
case $sum in
9408)	:;;
*)	echo 'Bad sum in 'lib/regexp.dif >&2
esac
echo Extracting lib/sendrec.asm
sed 's/^X//' > lib/sendrec.asm << '+ END-OF-FILE 'lib/sendrec.asm
Xtitle Send/Receive  -  C86 version; now for Turbo C [EVAS]
Xpage,132
X
Xinclude prologue.h
X
X	PUBLIC _send, _receive, _send_rec, _sendrec
X
X
X; The following definitions are from  ../h/com.h
X
X	__SEND	= 1
X	__RECEIVE= 2
X	__BOTH	= 3
X	__SYSVEC	= 32
X
X
X_TEXT	SEGMENT byte public 'CODE'
X
X	ASSUME	CS:_TEXT,DS:DGROUP
X
X;========================================================================
X;                           send and receive                              
X;========================================================================
X; send(), receive(), send_rec() all save bp, but destroy ax, bx, and cx.
X
X_send:	mov cx,__SEND		; send(dest, ptr)
X	jmp L0
X
X_receive:
X	mov cx,__RECEIVE		; receive(src, ptr)
X	jmp L0
X
X_sendrec:
X_send_rec:
X	mov cx,__BOTH		; send_rec(srcdest, ptr)
X	jmp L0
X
X  L0:	push bp			; save bp
X	mov bp,sp		; can't index off sp
X	mov ax,4[bp]		; ax = dest-src
X	mov bx,6[bp]		; bx = message pointer
X	int __SYSVEC		; trap to the kernel
X	pop bp			; restore bp
X	ret			; return
X
X_TEXT	ENDS
X
X	END	; end of assembly-file
+ END-OF-FILE lib/sendrec.asm
chmod 'u=rw,g=r,o=r' lib/sendrec.asm
set `sum lib/sendrec.asm`
sum=$1
case $sum in
8152)	:;;
*)	echo 'Bad sum in 'lib/sendrec.asm >&2
esac
echo Extracting lib/setjmp.asm
sed 's/^X//' > lib/setjmp.asm << '+ END-OF-FILE 'lib/setjmp.asm
Xtitle setjmp/longjmp  -  C86 version
Xpage,132
X
Xinclude ..\lib\prologue.h
X
X
X	PUBLIC _setjmp, _longjmp
X	EXTRN _exit:near
X
X
X; 	struct jmpbuf {
X;		int bp;
X;	 	int sp;
X;	 	int ret-addr;
X; 	}
X
XJMPERR	EQU	-99		; call _exit(JMPERR) when jmp-error
X
X_TEXT	SEGMENT byte public 'CODE'
X
X	ASSUME	CS:_TEXT,DS:DGROUP
X
X_setjmp:
X	mov	bx,sp
X	mov	ax,[bx]		; ret-addr.
X	mov	bx,2[bx]	; addr of jmp-struct
X	mov	[bx],bp
X	mov	2[bx],sp
X	mov	4[bx],ax
X	xor	ax,ax
X	ret
X
X_longjmp:
X	push	bp
X	mov	bp,sp		; set new frame pointer to sp
X	mov	bx,4[bp]	; get address of jmp-structure
X	mov	ax,6[bp]	; get ret-code
X	or	ax,ax
X	jne	L1
X	inc	ax		; return code may not be zero
X    L1:	mov	sp,[bx+2]
X	mov	bp,[bx]
X	or	bp,bp		; test if last frame-pointer (error)
X	jne	L2		; else execute the longjmp
X	pop	bp
X	mov	ax,JMPERR
X	push	ax
X	call	_exit		; should never return
X	hlt
X    L2:	mov	bx,[bx+4]
X	pop	cx		; dump the bp we pushed upon entry
X	jmp	bx
X
X_TEXT	ENDS
X
X	END
+ END-OF-FILE lib/setjmp.asm
chmod 'u=rw,g=r,o=r' lib/setjmp.asm
set `sum lib/setjmp.asm`
sum=$1
case $sum in
6019)	:;;
*)	echo 'Bad sum in 'lib/setjmp.asm >&2
esac
echo Extracting mlib/libfile
sed 's/^X//' > mlib/libfile << '+ END-OF-FILE 'mlib/libfile
X..\mlib\minix
Xy
X+cleanup +fgets +fprintf &
X+fputs +fread +freopen +fclose +fopen +fseek &
X+fflush +ftell +fwrite +gets +getc +printdat &
X+setbuf +sprintf +doprintf +putc +scanf +ungetc &
X+strcmp +access +chdir +chmod +chown +chroot &
X+creat +dup +dup2 +exec +exit +fork +isatty &
X+fstat +getegid +getenv +geteuid +getgid +getpass &
X+close +getuid +ioctl +kill +link +lseek +malloc &
X+brk +brk2 +mknod +mktemp +getpid +mount +open &
X+perror +pipe +prints +read +setgid +setuid &
X+sleep +alarm +pause +signal +catchsig +stat &
X+stime +strcat +strcpy +strlen +strncat +strncmp &
X+strncpy +sync +time +times +umask +umount +unlink &
X+utime +wait +stderr +write +syslib +call +atoi &
X+message +sendrec +printk +abort +itoa +stb &
X+abs +atol +ctype +index +bcopy +getutil &
X+rand +rindex +crypt +getgrent +getpwent +regexp &
X+regsub +setjmp +ldiv +lrsh +lxmul +scopy +spush
X..\mlib\minix.lst
+ END-OF-FILE mlib/libfile
chmod 'u=rw,g=r,o=r' mlib/libfile
set `sum mlib/libfile`
sum=$1
case $sum in
11026)	:;;
*)	echo 'Bad sum in 'mlib/libfile >&2
esac
echo Extracting mlib/minix.lst
sed 's/^X//' > mlib/minix.lst << '+ END-OF-FILE 'mlib/minix.lst
XLDIV@.............ldiv              LLSH@.............lrsh
XLMOD@.............ldiv              LRSH@.............lrsh
XLUDIV@............ldiv              LUMOD@............ldiv
XLURSH@............lrsh              LXMUL@............lxmul
XSCOPY@............scopy             SPUSH@............spush
X_abort............abort             _abs..............abs
X_access...........access            _alarm............alarm
X_atoi.............atoi              _atol.............atol
X_bcopy............bcopy             _begsig...........catchsig
X_brk..............brk               _brk2.............brk2
X_Buf..............prints            _Bufp.............prints
X_callm1...........call              _callm3...........call
X_callx............call              _chdir............chdir
X_chmod............chmod             _chown............chown
X_chroot...........chroot            _close............close
X_creat............creat             _crypt............crypt
X_dup..............dup               _dup2.............dup2
X_endgrent.........getgrent          _endpwent.........getpwent
X_errno............call              _error_message....perror
X_execl............exec              _execle...........exec
X_execn............exec              _execv............exec
X_execve...........exec              _exit.............exit
X_fclose...........fclose            _fflush...........fflush
X_fgets............fgets             _fopen............fopen
X_fork.............fork              _fprintf..........fprintf
X_fputs............fputs             _fread............fread
X_free.............malloc            _freopen..........freopen
X_fscanf...........scanf             _fseek............fseek
X_fstat............fstat             _ftell............ftell
X_fwrite...........fwrite            _getc.............getc
X_getegid..........getegid           _getenv...........getenv
X_geteuid..........geteuid           _getgid...........getgid
X_getgrent.........getgrent          _getgrgid.........getgrent
X_getgrnam.........getgrent          _getpass..........getpass
X_getpid...........getpid            _getpwent.........getpwent
X_getpwnam.........getpwent          _getpwuid.........getpwent
X_gets.............gets              _getuid...........getuid
X_get_base.........getutil           _get_size.........getutil
X_get_tot_mem......getutil           _index............index
X_ioctl............ioctl             _isatty...........isatty
X_itoa.............itoa              _kill.............kill
X_len..............call              _link.............link
X_longjmp..........setjmp            _lseek............lseek
X_M................message           _malloc...........malloc
X_mknod............mknod             _mktemp...........mktemp
X_mount............mount             _nullptr..........exec
X_open.............open              _pause............pause
X_perror...........perror            _pipe.............pipe
X_printf...........fprintf           _printk...........printk
X_prints...........prints            _putc.............putc
X_rand.............rand              _read.............read
X_realloc..........malloc            _receive..........sendrec
X_regcomp..........regexp            _regexec..........regexp
X_regsub...........regsub            _rindex...........rindex
X_sbrk.............brk               _scanf............scanf
X_send.............sendrec           _sendrec..........sendrec
X_send_rec.........sendrec           _setbuf...........setbuf
X_setgid...........setgid            _setgrent.........getgrent
X_setjmp...........setjmp            _setpwent.........getpwent
X_setuid...........setuid            _signal...........signal
X_sleep............sleep             _sprintf..........sprintf
X_sscanf...........scanf             _stat.............stat
X_std_err..........stderr            _stime............stime
X_strcat...........strcat            _strcmp...........strcmp
X_strcpy...........strcpy            _strlen...........strlen
X_strncat..........strncat           _strncmp..........strncmp
X_strncpy..........strncpy           _sync.............sync
X_sys_abort........syslib            _sys_copy.........syslib
X_sys_exec.........syslib            _sys_fork.........syslib
X_sys_getsp........syslib            _sys_newmap.......syslib
X_sys_sig..........syslib            _sys_times........syslib
X_sys_xit..........syslib            _tell_fs..........syslib
X_time.............time              _times............times
X_umask............umask             _umount...........umount
X_ungetc...........ungetc            _unlink...........unlink
X_utime............utime             _vectab...........signal
X_wait.............wait              _write............write
X__cleanup.........cleanup           __ctype_..........ctype
X__doprintf........doprintf          __doscanf.........scanf
X__io_table........printdat          __stderr..........printdat
X__stdin...........printdat          __stdout..........printdat
X___stb............stb               ___stdin..........printdat
X___stdout.........printdat          
X
Xcleanup           Offset: 00000010H  Code and data size: 24H
X  __cleanup       
X
Xfgets             Offset: 00000110H  Code and data size: 43H
X  _fgets          
X
Xfprintf           Offset: 00000210H  Code and data size: 4eH
X  _fprintf          _printf         
X
Xfputs             Offset: 00000360H  Code and data size: 20H
X  _fputs          
X
Xfread             Offset: 00000440H  Code and data size: 4cH
X  _fread          
X
Xfreopen           Offset: 00000540H  Code and data size: 1fH
X  _freopen        
X
Xfclose            Offset: 00000630H  Code and data size: 5eH
X  _fclose         
X
Xfopen             Offset: 00000780H  Code and data size: 105H
X  _fopen          
X
Xfseek             Offset: 00000980H  Code and data size: 121H
X  _fseek          
X
Xfflush            Offset: 00000b70H  Code and data size: 55H
X  _fflush         
X
Xftell             Offset: 00000c80H  Code and data size: 86H
X  _ftell          
X
Xfwrite            Offset: 00000dc0H  Code and data size: 41H
X  _fwrite         
X
Xgets              Offset: 00000ec0H  Code and data size: 3eH
X  _gets           
X
Xgetc              Offset: 00000fc0H  Code and data size: a1H
X  _getc           
X
Xprintdat          Offset: 00001120H  Code and data size: 846H
X  __io_table        __stderr          __stdin           __stdout
X  ___stdin          ___stdout       
X
Xsetbuf            Offset: 00001290H  Code and data size: 3fH
X  _setbuf         
X
Xsprintf           Offset: 00001390H  Code and data size: 3eH
X  _sprintf        
X
Xdoprintf          Offset: 000014a0H  Code and data size: 458H
X  __doprintf      
X
Xputc              Offset: 00001a70H  Code and data size: b7H
X  _putc           
X
Xscanf             Offset: 00001be0H  Code and data size: 526H
X  _fscanf           _scanf            _sscanf           __doscanf
X
Xungetc            Offset: 00002380H  Code and data size: 4cH
X  _ungetc         
X
Xstrcmp            Offset: 00002470H  Code and data size: 30H
X  _strcmp         
X
Xaccess            Offset: 00002540H  Code and data size: 18H
X  _access         
X
Xchdir             Offset: 00002610H  Code and data size: 18H
X  _chdir          
X
Xchmod             Offset: 000026e0H  Code and data size: 18H
X  _chmod          
X
Xchown             Offset: 000027b0H  Code and data size: 29H
X  _chown          
X
Xchroot            Offset: 000028a0H  Code and data size: 18H
X  _chroot         
X
Xcreat             Offset: 00002970H  Code and data size: 18H
X  _creat          
X
Xdup               Offset: 00002a40H  Code and data size: 24H
X  _dup            
X
Xdup2              Offset: 00002b20H  Code and data size: 28H
X  _dup2           
X
Xexec              Offset: 00002c00H  Code and data size: 211H
X  _execl            _execle           _execn            _execv
X  _execve           _nullptr        
X
Xexit              Offset: 00002f40H  Code and data size: 23H
X  _exit           
X
Xfork              Offset: 00003020H  Code and data size: 20H
X  _fork           
X
Xisatty            Offset: 00003100H  Code and data size: 2cH
X  _isatty         
X
Xfstat             Offset: 000031e0H  Code and data size: 2aH
X  _fstat          
X
Xgetegid           Offset: 000032c0H  Code and data size: 2fH
X  _getegid        
X
Xgetenv            Offset: 000033b0H  Code and data size: 46H
X  _getenv         
X
Xgeteuid           Offset: 000034b0H  Code and data size: 2fH
X  _geteuid        
X
Xgetgid            Offset: 000035a0H  Code and data size: 26H
X  _getgid         
X
Xgetpass           Offset: 00003680H  Code and data size: 9cH
X  _getpass        
X
Xclose             Offset: 00003830H  Code and data size: 24H
X  _close          
X
Xgetuid            Offset: 00003910H  Code and data size: 26H
X  _getuid         
X
Xioctl             Offset: 000039f0H  Code and data size: 278H
X  _ioctl          
X
Xkill              Offset: 00003e50H  Code and data size: 23H
X  _kill           
X
Xlink              Offset: 00003f30H  Code and data size: 2eH
X  _link           
X
Xlseek             Offset: 00004020H  Code and data size: 3fH
X  _lseek          
X
Xmalloc            Offset: 00004140H  Code and data size: 1b2H
X  _free             _malloc           _realloc        
X
Xbrk               Offset: 00004440H  Code and data size: 64H
X  _brk              _sbrk           
X
Xbrk2              Offset: 00004590H  Code and data size: 2dH
X  _brk2           
X
Xmknod             Offset: 00004680H  Code and data size: 29H
X  _mknod          
X
Xmktemp            Offset: 00004770H  Code and data size: 40H
X  _mktemp         
X
Xgetpid            Offset: 00004870H  Code and data size: 20H
X  _getpid         
X
Xmount             Offset: 00004950H  Code and data size: 2eH
X  _mount          
X
Xopen              Offset: 00004a50H  Code and data size: 18H
X  _open           
X
Xperror            Offset: 00004b20H  Code and data size: 33aH
X  _error_message    _perror         
X
Xpipe              Offset: 00005040H  Code and data size: 47H
X  _pipe           
X
Xprints            Offset: 00005150H  Code and data size: 19eH
X  _Buf              _Bufp             _prints         
X
Xread              Offset: 00005380H  Code and data size: 2aH
X  _read           
X
Xsetgid            Offset: 00005460H  Code and data size: 23H
X  _setgid         
X
Xsetuid            Offset: 00005540H  Code and data size: 23H
X  _setuid         
X
Xsleep             Offset: 00005620H  Code and data size: 1dH
X  _sleep          
X
Xalarm             Offset: 00005720H  Code and data size: 23H
X  _alarm          
X
Xpause             Offset: 00005800H  Code and data size: 20H
X  _pause          
X
Xsignal            Offset: 000058e0H  Code and data size: 79H
X  _signal           _vectab         
X
Xstat              Offset: 00005a30H  Code and data size: 2fH
X  _stat           
X
Xstime             Offset: 00005b20H  Code and data size: 21H
X  _stime          
X
Xstrcat            Offset: 00005c10H  Code and data size: 31H
X  _strcat         
X
Xstrcpy            Offset: 00005ce0H  Code and data size: 29H
X  _strcpy         
X
Xstrlen            Offset: 00005db0H  Code and data size: 1aH
X  _strlen         
X
Xstrncat           Offset: 00005e70H  Code and data size: 38H
X  _strncat        
X
Xstrncmp           Offset: 00005f50H  Code and data size: 35H
X  _strncmp        
X
Xstrncpy           Offset: 00006030H  Code and data size: 30H
X  _strncpy        
X
Xsync              Offset: 00006110H  Code and data size: 21H
X  _sync           
X
Xtime              Offset: 000061f0H  Code and data size: 70H
X  _time           
X
Xtimes             Offset: 00006340H  Code and data size: 62H
X  _times          
X
Xumask             Offset: 00006490H  Code and data size: 24H
X  _umask          
X
Xumount            Offset: 00006570H  Code and data size: 18H
X  _umount         
X
Xunlink            Offset: 00006640H  Code and data size: 18H
X  _unlink         
X
Xutime             Offset: 00006710H  Code and data size: 41H
X  _utime          
X
Xwait              Offset: 00006830H  Code and data size: 31H
X  _wait           
X
Xstderr            Offset: 00006920H  Code and data size: 25H
X  _std_err        
X
Xwrite             Offset: 00006a00H  Code and data size: 24H
X  _write          
X
Xsyslib            Offset: 00006ae0H  Code and data size: 1bcH
X  _sys_abort        _sys_copy         _sys_exec         _sys_fork
X  _sys_getsp        _sys_newmap       _sys_sig          _sys_times
X  _sys_xit          _tell_fs        
X
Xcall              Offset: 00006ea0H  Code and data size: d5H
X  _callm1           _callm3           _callx            _errno
X  _len            
X
Xatoi              Offset: 000070c0H  Code and data size: 7cH
X  _atoi           
X
Xmessage           Offset: 00007200H  Code and data size: 18H
X  _M              
X
Xprintk            Offset: 000072a0H  Code and data size: 374H
X  _printk         
X
Xabort             Offset: 00007760H  Code and data size: 9H
X  _abort          
X
Xitoa              Offset: 00007820H  Code and data size: a0H
X  _itoa           
X
Xstb               Offset: 000079b0H  Code and data size: 21H
X  ___stb          
X
Xabs               Offset: 00007a70H  Code and data size: 16H
X  _abs            
X
Xatol              Offset: 00007b20H  Code and data size: 87H
X  _atol           
X
Xctype             Offset: 00007c70H  Code and data size: 81H
X  __ctype_        
X
Xindex             Offset: 00007d90H  Code and data size: 1fH
X  _index          
X
Xbcopy             Offset: 00007e50H  Code and data size: 21H
X  _bcopy          
X
Xrand              Offset: 00007f10H  Code and data size: 31H
X  _rand           
X
Xrindex            Offset: 00008020H  Code and data size: 21H
X  _rindex         
X
Xcrypt             Offset: 000080e0H  Code and data size: 1beH
X  _crypt          
X
Xgetgrent          Offset: 00008370H  Code and data size: 695H
X  _endgrent         _getgrent         _getgrgid         _getgrnam
X  _setgrent       
X
Xgetpwent          Offset: 00008790H  Code and data size: 6c4H
X  _endpwent         _getpwent         _getpwnam         _getpwuid
X  _setpwent       
X
Xregexp            Offset: 00008c00H  Code and data size: f44H
X  _regcomp          _regexec        
X
Xregsub            Offset: 0000a1f0H  Code and data size: 161H
X  _regsub         
X
Xldiv              Offset: 0000a440H  Code and data size: 86H
X  LDIV@             LMOD@             LUDIV@            LUMOD@
X
Xlrsh              Offset: 0000a540H  Code and data size: 3aH
X  LLSH@             LRSH@             LURSH@          
X
Xlxmul             Offset: 0000a5e0H  Code and data size: 19H
X  LXMUL@          
X
Xscopy             Offset: 0000a640H  Code and data size: 2cH
X  SCOPY@          
X
Xcatchsig          Offset: 0000a6b0H  Code and data size: 31H
X  _begsig         
X
Xsendrec           Offset: 0000a7f0H  Code and data size: 1fH
X  _receive          _send             _sendrec          _send_rec
X
Xspush             Offset: 0000a910H  Code and data size: 21H
X  SPUSH@          
X
Xsetjmp            Offset: 0000a980H  Code and data size: 38H
X  _longjmp          _setjmp         
X
Xgetutil           Offset: 0000aab0H  Code and data size: 2dH
X  _get_base         _get_size         _get_tot_mem    
X        
+ END-OF-FILE mlib/minix.lst
chmod 'u=rw,g=r,o=r' mlib/minix.lst
set `sum mlib/minix.lst`
sum=$1
case $sum in
59547)	:;;
*)	echo 'Bad sum in 'mlib/minix.lst >&2
esac
echo Extracting mlib/mklib.bat
sed 's/^X//' > mlib/mklib.bat << '+ END-OF-FILE 'mlib/mklib.bat
Xif exist minix.bak del minix.bak
Xif exist minix.lib ren minix.lib minix.bak
Xcd ..\lib
Xlib @..\mlib\libfile
Xcd ..\mlib
+ END-OF-FILE mlib/mklib.bat
chmod 'u=rw,g=r,o=r' mlib/mklib.bat
set `sum mlib/mklib.bat`
sum=$1
case $sum in
10394)	:;;
*)	echo 'Bad sum in 'mlib/mklib.bat >&2
esac
exit 0