Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!botter!ast From: ast@cs.vu.nl (Andy Tanenbaum) Newsgroups: comp.os.minix Subject: Definitive MINIX 1.2 updates (Part 4 of 4) Message-ID: <1565@botter.cs.vu.nl> Date: Sun, 9-Aug-87 17:57:37 EDT Article-I.D.: botter.1565 Posted: Sun Aug 9 17:57:37 1987 Date-Received: Tue, 11-Aug-87 00:46:26 EDT Reply-To: ast@cs.vu.nl (Andy Tanenbaum) Distribution: world Organization: VU Informatica, Amsterdam Lines: 1131 : 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 echo Extracting \l\i\b\:\c\r\y\p\t\.\c sed 's/^X//' > \l\i\b\:\c\r\y\p\t\.\c << '+ END-OF-FILE '\l\i\b\:\c\r\y\p\t\.\c X1,40c1,294 X< char *crypt(pw, salt) X< char *pw, *salt; X< { X< static char buf[14]; X< register char bits[67]; X< register int i; X< register int j, rot; X< X< for (i=0; i < 67; i++) X< bits[i] = 0; X< if (salt[1] == 0) X< salt[1] = salt[0]; X< rot = (salt[1] * 4 - salt[0]) % 128; X< for (i=0; *pw && i < 8; i++) { X< for (j=0; j < 7; j++) X< bits[i+j*8] = (*pw & (1 << j) ? 1 : 0); X< bits[i+56] = (salt[i / 4] & (1 << (i % 4)) ? 1 : 0); X< pw++; X< } X< bits[64] = (salt[0] & 1 ? 1 : 0); X< bits[65] = (salt[1] & 1 ? 1 : 0); X< bits[66] = (rot & 1 ? 1 : 0); X< while (rot--) { X< for (i=65; i >= 0; i--) X< bits[i+1] = bits[i]; X< bits[0] = bits[66]; X< } X< for (i=0; i < 12; i++) { X< buf[i+2] = 0; X< for (j=0; j < 6; j++) X< buf[i+2] |= (bits[i*6+j] ? (1 << j) : 0); X< buf[i+2] += 48; X< if (buf[i+2] > '9') buf[i+2] += 7; X< if (buf[i+2] > 'Z') buf[i+2] += 6; X< } X< buf[0] = salt[0]; X< buf[1] = salt[1]; X< buf[13] = '\0'; X< return(buf); X< } X--- X> /* From Andy Tanenbaum's book "Computer Networks", X> rewritten in C X> */ X> X> struct block { X> unsigned char b_data[64]; X> }; X> X> struct ordering { X> unsigned char o_data[64]; X> }; X> X> static struct block key; X> X> static struct ordering InitialTr = { X> 58,50,42,34,26,18,10, 2,60,52,44,36,28,20,12, 4, X> 62,54,46,38,30,22,14, 6,64,56,48,40,32,24,16, 8, X> 57,49,41,33,25,17, 9, 1,59,51,43,35,27,19,11, 3, X> 61,53,45,37,29,21,13, 5,63,55,47,39,31,23,15, 7, X> }; X> X> static struct ordering FinalTr = { X> 40, 8,48,16,56,24,64,32,39, 7,47,15,55,23,63,31, X> 38, 6,46,14,54,22,62,30,37, 5,45,13,53,21,61,29, X> 36, 4,44,12,52,20,60,28,35, 3,43,11,51,19,59,27, X> 34, 2,42,10,50,18,58,26,33, 1,41, 9,49,17,57,25, X> }; X> X> static struct ordering swap = { X> 33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48, X> 49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64, X> 1, 2, 3, 4, 5, 6, 7, 8, 9,10,11,12,13,14,15,16, X> 17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32, X> }; X> X> static struct ordering KeyTr1 = { X> 57,49,41,33,25,17, 9, 1,58,50,42,34,26,18, X> 10, 2,59,51,43,35,27,19,11, 3,60,52,44,36, X> 63,55,47,39,31,23,15, 7,62,54,46,38,30,22, X> 14, 6,61,53,45,37,29,21,13, 5,28,20,12, 4, X> }; X> X> static struct ordering KeyTr2 = { X> 14,17,11,24, 1, 5, 3,28,15, 6,21,10, X> 23,19,12, 4,26, 8,16, 7,27,20,13, 2, X> 41,52,31,37,47,55,30,40,51,45,33,48, X> 44,49,39,56,34,53,46,42,50,36,29,32, X> }; X> X> static struct ordering etr = { X> 32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9, X> 8, 9,10,11,12,13,12,13,14,15,16,17, X> 16,17,18,19,20,21,20,21,22,23,24,25, X> 24,25,26,27,28,29,28,29,30,31,32, 1, X> }; X> X> static struct ordering ptr = { X> 16, 7,20,21,29,12,28,17, 1,15,23,26, 5,18,31,10, X> 2, 8,24,14,32,27, 3, 9,19,13,30, 6,22,11, 4,25, X> }; X> X> static unsigned char s_boxes[8][64] = { X> { 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7, X> 0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8, X> 4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0, X> 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, X> }, X> X> { 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10, X> 3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5, X> 0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15, X> 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, X> }, X> X> { 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8, X> 13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1, X> 13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7, X> 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, X> }, X> X> { 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15, X> 13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9, X> 10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4, X> 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, X> }, X> X> { 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9, X> 14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6, X> 4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14, X> 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, X> }, X> X> { 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11, X> 10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8, X> 9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6, X> 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, X> }, X> X> { 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1, X> 13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6, X> 1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2, X> 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, X> }, X> X> { 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7, X> 1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2, X> 7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8, X> 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11, X> }, X> }; X> X> static int rots[] = { X> 1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1, X> }; X> X> static X> transpose(data, t, n) X> register struct block *data; X> register struct ordering *t; X> register int n; X> { X> struct block x; X> X> x = *data; X> X> while (n-- > 0) { X> data->b_data[n] = x.b_data[t->o_data[n] - 1]; X> } X> } X> X> static X> rotate(key) X> register struct block *key; X> { X> register unsigned char *p = key->b_data; X> register unsigned char *ep = &(key->b_data[55]); X> int data0 = key->b_data[0], data28 = key->b_data[28]; X> X> while (p++ < ep) *(p-1) = *p; X> key->b_data[27] = data0; X> key->b_data[55] = data28; X> } X> X> static struct ordering *EP = &etr; X> X> static X> f(i, key, a, x) X> struct block *key, *a; X> register struct block *x; X> { X> struct block e, ikey, y; X> int k; X> register unsigned char *p, *q, *r; X> X> e = *a; X> transpose(&e, EP, 48); X> for (k = rots[i]; k; k--) rotate(key); X> ikey = *key; X> transpose(&ikey, &KeyTr2, 48); X> p = &(y.b_data[48]); X> q = &(e.b_data[48]); X> r = &(ikey.b_data[48]); X> while (p > y.b_data) { X> *--p = *--q ^ *--r; X> } X> q = x->b_data; X> for (k = 0; k < 8; k++) { X> register int xb, r; X> X> r = *p++ << 5; X> r += *p++ << 3; X> r += *p++ << 2; X> r += *p++ << 1; X> r += *p++; X> r += *p++ << 4; X> X> xb = s_boxes[k][r]; X> X> *q++ = (xb >> 3) & 1; X> *q++ = (xb>>2) & 1; X> *q++ = (xb>>1) & 1; X> *q++ = (xb & 1); X> } X> transpose(x, &ptr, 32); X> } X> X> setkey(k) X> register char *k; X> { X> X> key = *((struct block *) k); X> transpose(&key, &KeyTr1, 56); X> } X> X> encrypt(blck, edflag) X> char *blck; X> { X> register struct block *p = (struct block *) blck; X> register int i; X> X> transpose(p, &InitialTr, 64); X> for (i = 15; i>= 0; i--) { X> int j = edflag ? i : 15 - i; X> register int k; X> struct block b, x; X> X> b = *p; X> for (k = 31; k >= 0; k--) { X> p->b_data[k] = b.b_data[k + 32]; X> } X> f(j, &key, p, &x); X> for (k = 31; k >= 0; k--) { X> p->b_data[k+32] = b.b_data[k] ^ x.b_data[k]; X> } X> } X> transpose(p, &swap, 64); X> transpose(p, &FinalTr, 64); X> } X> X> char * X> crypt(pw,salt) X> register char *pw; X> char *salt; X> { X> /* Unfortunately, I had to look at the sources of V7 crypt. X> There was no other way to find out what this routine X> actually does. X> */ X> X> char pwb[66]; X> static char result[16]; X> register char *p = pwb; X> struct ordering new_etr; X> register int i; X> X> while (*pw && p < &pwb[64]) { X> register int j = 7; X> X> while (j--) { X> *p++ = (*pw >> j) & 01; X> } X> pw++; X> *p++ = 0; X> } X> while (p < &pwb[64]) *p++ = 0; X> X> setkey(p = pwb); X> X> while (p < &pwb[66]) *p++ = 0; X> X> new_etr = etr; X> EP = &new_etr; X> for (i = 0; i < 2; i++) { X> register char c = *salt++; X> register int j; X> X> result[i] = c; X> if ( c > 'Z') c -= 6 + 7 + '.'; /* c was a lower case letter */ X> else if ( c > '9') c -= 7 + '.';/* c was upper case letter */ X> else c -= '.'; /* c was digit, '.' or '/'. */ X> /* now, 0 <= c <= 63 */ X> for (j = 0; j < 6; j++) { X> if ((c >> j) & 01) { X> int t = 6*i + j; X> int temp = new_etr.o_data[t]; X> new_etr.o_data[t] = new_etr.o_data[t+24]; X> new_etr.o_data[t+24] = temp; X> } X> } X> } X> X> if (result[1] == 0) result[1] = result[0]; X> X> for (i = 0; i < 25; i++) encrypt(pwb,0); X> EP = &etr; X> X> p = pwb; X> pw = result+2; X> while (p < &pwb[66]) { X> register int c = 0; X> register int j = 6; X> X> while (j--) { X> c <<= 1; X> c |= *p++; X> } X> c += '.'; /* becomes >= '.' */ X> if (c > '9') c += 7; /* not in [./0-9], becomes upper */ X> if (c > 'Z') c += 6; /* not in [A-Z], becomes lower */ X> *pw++ = c; X> } X> *pw = 0; X> return result; X> } + END-OF-FILE lib:crypt.c chmod 'u=rw,g=r,o=r' \l\i\b\:\c\r\y\p\t\.\c set `sum \l\i\b\:\c\r\y\p\t\.\c` sum=$1 case $sum in 12716) :;; *) echo 'Bad sum in '\l\i\b\:\c\r\y\p\t\.\c >&2 esac echo Extracting \l\i\b\:\e\n\d\.\s sed 's/^X//' > \l\i\b\:\e\n\d\.\s << '+ END-OF-FILE '\l\i\b\:\e\n\d\.\s X1c1 X< .globl endtext, enddata, endbss X--- X> .globl endtext, enddata, endbss, _end, _edata X6,7c6,9 X< .bss X< endbss: X--- X> _edata: X> .bss X> endbss: X> _end: + END-OF-FILE lib:end.s chmod 'u=rw,g=r,o=r' \l\i\b\:\e\n\d\.\s set `sum \l\i\b\:\e\n\d\.\s` sum=$1 case $sum in 21833) :;; *) echo 'Bad sum in '\l\i\b\:\e\n\d\.\s >&2 esac echo Extracting \l\i\b\:\g\e\t\e\n\v\.\c sed 's/^X//' > \l\i\b\:\g\e\t\e\n\v\.\c << '+ END-OF-FILE '\l\i\b\:\g\e\t\e\n\v\.\c X1d0 X< #define NULL (char *) 0 X8,18c7,14 X< while ((p = *v) != NULL) { X< q = name; X< while (*p++ == *q) X< if (*q++ == 0) X< continue; X< if (*(p - 1) != '=') X< continue; X< return(p); X< } X< return(0); X< } X--- X> while ((p = *v++) != 0) { X> q = name; X> while (*q && *q++ == *p++) /* nothing */ ; X> if (*q || *p != '=') continue; X> return(p+1); X> } X> return(0); X> } + END-OF-FILE lib:getenv.c chmod 'u=rw,g=r,o=r' \l\i\b\:\g\e\t\e\n\v\.\c set `sum \l\i\b\:\g\e\t\e\n\v\.\c` sum=$1 case $sum in 06320) :;; *) echo 'Bad sum in '\l\i\b\:\g\e\t\e\n\v\.\c >&2 esac echo Extracting \l\i\b\:\g\e\t\p\w\e\n\t\.\c sed 's/^X//' > \l\i\b\:\g\e\t\p\w\e\n\t\.\c << '+ END-OF-FILE '\l\i\b\:\g\e\t\p\w\e\n\t\.\c 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) + END-OF-FILE lib:getpwent.c chmod 'u=rw,g=r,o=r' \l\i\b\:\g\e\t\p\w\e\n\t\.\c set `sum \l\i\b\:\g\e\t\p\w\e\n\t\.\c` sum=$1 case $sum in 09719) :;; *) echo 'Bad sum in '\l\i\b\:\g\e\t\p\w\e\n\t\.\c >&2 esac echo Extracting \l\i\b\:\m\a\l\l\o\c\.\c sed 's/^X//' > \l\i\b\:\m\a\l\l\o\c\.\c << '+ END-OF-FILE '\l\i\b\:\m\a\l\l\o\c\.\c X84,88c84,105 X< free(p) X< char *p; X< { X< * (vir_bytes *) (p - sizeof(char *)) &= ~BUSY; X< } X--- X> char *calloc(m,size) X> unsigned m,size; X> { X> char *malloc(); X> char *cp; X> register int i; X> register char *temp; X> X> i = m*size; X> if ((cp=malloc(i))==(char *)0) return (char *)0; X> X> /* malloc succeeded--clear allocated memory */ X> for (temp = cp ; i-- ; ) *temp++ = '\0'; X> return cp; X> } X> X> X> free(p) X> char *p; X> { X> * (vir_bytes *) (p - sizeof(char *)) &= ~BUSY; X> } + END-OF-FILE lib:malloc.c chmod 'u=rw,g=r,o=r' \l\i\b\:\m\a\l\l\o\c\.\c set `sum \l\i\b\:\m\a\l\l\o\c\.\c` sum=$1 case $sum in 23606) :;; *) echo 'Bad sum in '\l\i\b\:\m\a\l\l\o\c\.\c >&2 esac echo Extracting \l\i\b\:\p\r\i\n\t\k\.\c sed 's/^X//' > \l\i\b\:\p\r\i\n\t\k\.\c << '+ END-OF-FILE '\l\i\b\:\p\r\i\n\t\k\.\c X2c2 X< * system itself, and should never be included in user programs. The name X--- X> * system itself, and should never be included in user programs. The name X15a16 X> char **pp; X33a35 X> pp = (char **) valp; X43c45 X< case 's': p = (char *) *valp++; X--- X> case 's': p = *pp++; valp = (int *) pp; + END-OF-FILE lib:printk.c chmod 'u=rw,g=r,o=r' \l\i\b\:\p\r\i\n\t\k\.\c set `sum \l\i\b\:\p\r\i\n\t\k\.\c` sum=$1 case $sum in 60538) :;; *) echo 'Bad sum in '\l\i\b\:\p\r\i\n\t\k\.\c >&2 esac echo Extracting \l\i\b\:\p\u\t\c\.\c sed 's/^X//' > \l\i\b\:\p\u\t\c\.\c << '+ END-OF-FILE '\l\i\b\:\p\u\t\c\.\c X41,43c41,43 X< return(0); X< } X< X--- X> return(ch & CMASK); X> } X> + END-OF-FILE lib:putc.c chmod 'u=rw,g=r,o=r' \l\i\b\:\p\u\t\c\.\c set `sum \l\i\b\:\p\u\t\c\.\c` sum=$1 case $sum in 30324) :;; *) echo 'Bad sum in '\l\i\b\:\p\u\t\c\.\c >&2 esac echo Extracting \l\i\b\:\r\u\n sed 's/^X//' > \l\i\b\:\r\u\n << '+ END-OF-FILE '\l\i\b\:\r\u\n X1,8c1,68 X< for i in *.s X< do as -o `basename $i .s`.o $i X< done X< for i in *.c X< do cc -c -O $i X< done X< ar r lib.a `lorder *.o | tsort 2>/dev/null` X< echo "lib.a done." X--- X> # ========== compile everything =========== X> for i in *.c X> do X> echo $i X> cc -c -LIB $i X> done X> X> X> # ========== build library ============== X> # X> # Build libc.a using all of the .s files in the current directory. X> # New files are placed at the beginning of the library followed by X> # modules which are already in the old library (/usr/lib/libc.a). X> # Old modules are placed in the new library in the same order in which X> # they appear in the old library. X> # X> # Art Zemon, July 17, 1987 X> # X> echo Reading old library X> ar t /usr/lib/libc.a > list X> split -8 list X> cat /dev/null > orig.order X> echo Creating orig.order X> for f in x?? X> do X> echo ar a libc.a `cat $f` >> orig.order X> rm $f X> done X> X> # X> # Figure out which files are not in the existing library. X> # Base this decision on the .c files because there are a couple of .s X> # files here which don't belong in the library. X> # X> echo Checking .c files X> cat /dev/null > new.files X> for c in *.c X> do X> f=`basename $c .c`.s X> echo $f X> if grep -s $f list > /dev/null 2>&1 ; then cat /dev/null ; else echo ar av libc.a $f >> new.files ; fi X> done X> X> # X> # Figure out which modules are in the library but not here and extract them X> # from the library. X> # X> echo determining which modules must be extracted from old library X> rm -f libc.a X> sh orig.order > /dev/null 2> missing X> ar xv /usr/lib/libc.a `grep 'Cannot find ' missing | gres 'Cannot find ' ''` X> rm missing libc.a list X> X> # X> # Construct the library X> # X> echo constructing new library with new modules X> sh new.files X> echo appending original modules to new library X> sh orig.order X> echo done X> -- X> -- Art Zemon X> FileNet Corporation X> Costa Mesa, California X> ...!hplabs!felix!zemon X> X> + END-OF-FILE lib:run chmod 'u=rw,g=r,o=r' \l\i\b\:\r\u\n set `sum \l\i\b\:\r\u\n` sum=$1 case $sum in 35638) :;; *) echo 'Bad sum in '\l\i\b\:\r\u\n >&2 esac echo Extracting \l\i\b\:\s\c\a\n\f\.\c sed 's/^X//' > \l\i\b\:\s\c\a\n\f\.\c << '+ END-OF-FILE '\l\i\b\:\s\c\a\n\f\.\c X3c3 X< #include X--- X> #include "stdio.h" X74c74 X< static index(ch, string) X--- X> static scnindex(ch, string) X292c292 X< (index (ic, format) ^ reverse)) { X--- X> (scnindex (ic, format) ^ reverse)) { + END-OF-FILE lib:scanf.c chmod 'u=rw,g=r,o=r' \l\i\b\:\s\c\a\n\f\.\c set `sum \l\i\b\:\s\c\a\n\f\.\c` sum=$1 case $sum in 35529) :;; *) echo 'Bad sum in '\l\i\b\:\s\c\a\n\f\.\c >&2 esac echo Extracting \m\m\:\f\o\r\k\e\x\i\t\.\c sed 's/^X//' > \m\m\:\f\o\r\k\e\x\i\t\.\c << '+ END-OF-FILE '\m\m\:\f\o\r\k\e\x\i\t\.\c X27a28 X> PRIVATE process_group = 1; /* next process grp to be assigned */ X81a83,85 X> /* Set process group. */ X> if (who == INIT_PROC_NR) rmc->mp_procgrp = process_group++; X> + END-OF-FILE mm:forkexit.c chmod 'u=rw,g=r,o=r' \m\m\:\f\o\r\k\e\x\i\t\.\c set `sum \m\m\:\f\o\r\k\e\x\i\t\.\c` sum=$1 case $sum in 38716) :;; *) echo 'Bad sum in '\m\m\:\f\o\r\k\e\x\i\t\.\c >&2 esac echo Extracting \m\m\:\m\a\k\e\.\b\a\t sed 's/^X//' > \m\m\:\m\a\k\e\.\b\a\t << '+ END-OF-FILE '\m\m\:\m\a\k\e\.\b\a\t X9d8 X< echo (e.g. after a manual compilation of a module). + END-OF-FILE mm:make.bat chmod 'u=rw,g=r,o=r' \m\m\:\m\a\k\e\.\b\a\t set `sum \m\m\:\m\a\k\e\.\b\a\t` sum=$1 case $sum in 49173) :;; *) echo 'Bad sum in '\m\m\:\m\a\k\e\.\b\a\t >&2 esac echo Extracting \m\m\:\m\a\k\e\f\i\l\e sed 's/^X//' > \m\m\:\m\a\k\e\f\i\l\e << '+ END-OF-FILE '\m\m\:\m\a\k\e\f\i\l\e X9,12c9,14 X< @echo "Start linking MM. /lib/cem will be removed to make space on RAM disk" X< @rm -f /lib/cem /tmp/* X< @asld -o mm $l/head.s $(obj) $l/libc.a $l/end.s X< @echo "MM done. Please restore /lib/cem manually" X--- X> @echo "Start linking MM." X> @echo "If RAM disk fills up, edit makefile to use asld -T. " X> @echo "On a PC, /lib/* will be removed to make space on RAM disk" X> @rm -f /lib/cem /tmp/* X> @asld -o mm $l/head.s $(obj) $l/libc.a $l/end.s X> @echo "MM done. On a PC, please restore /lib/cem manually" + END-OF-FILE mm:makefile chmod 'u=rw,g=r,o=r' \m\m\:\m\a\k\e\f\i\l\e set `sum \m\m\:\m\a\k\e\f\i\l\e` sum=$1 case $sum in 20778) :;; *) echo 'Bad sum in '\m\m\:\m\a\k\e\f\i\l\e >&2 esac echo Extracting \m\m\:\s\i\g\n\a\l\.\c sed 's/^X//' > \m\m\:\s\i\g\n\a\l\.\c << '+ END-OF-FILE '\m\m\:\s\i\g\n\a\l\.\c X102a103 X> mp->mp_procgrp = rmp->mp_procgrp; /* get process group right */ X116c117,118 X< id = (i+1 == SIGINT || i+1 == SIGQUIT ? 0 : proc_id); X--- X> id= (i+1 == SIGINT || i+1 == SIGQUIT ? 0 : proc_id); X> if (i + 1 == SIGKILL) id = -1; /* simulate kill -1 9 */ X257c259 X< m_sig.PROC_NR = proc_nr; X--- X> m_sig.CLOCK_PROC_NR = proc_nr; X344c346,349 X< if (rmp->mp_realuid != rmp->mp_effuid) return; X--- X> if (rmp->mp_realuid != rmp->mp_effuid) { X> tell_fs(CHDIR, 0, 1, 0); /* go back to MM's directory */ X> return; X> } + END-OF-FILE mm:signal.c chmod 'u=rw,g=r,o=r' \m\m\:\s\i\g\n\a\l\.\c set `sum \m\m\:\s\i\g\n\a\l\.\c` sum=$1 case $sum in 58516) :;; *) echo 'Bad sum in '\m\m\:\s\i\g\n\a\l\.\c >&2 esac echo Extracting \t\o\o\l\s\:\b\o\o\t\b\l\o\k sed 's/^X//' > \t\o\o\l\s\:\b\o\o\t\b\l\o\k << '+ END-OF-FILE '\t\o\o\l\s\:\b\o\o\t\b\l\o\k X62,63c62,63 X< mov ss,ax | set ss to 0 X< mov sp,#1024 | initialize sp (top of vector table) X--- X> mov ss,dx | set ss to cs i.e., stack in high core X> mov sp,#1536 | initialize sp to high core X222c222 X< greet: .asciz "\rBooting MINIX 1.1\r\n" X--- X> greet: .asciz "\rBooting MINIX 1.2. Copyright 1987 Prentice-Hall, Inc.\r\n" + END-OF-FILE tools:bootblok chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\b\o\o\t\b\l\o\k set `sum \t\o\o\l\s\:\b\o\o\t\b\l\o\k` sum=$1 case $sum in 55015) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\b\o\o\t\b\l\o\k >&2 esac echo Extracting \t\o\o\l\s\:\c\h\a\n\g\e\m\e sed 's/^X//' > \t\o\o\l\s\:\c\h\a\n\g\e\m\e << '+ END-OF-FILE '\t\o\o\l\s\:\c\h\a\n\g\e\m\e X1,44c1,39 X< : The default stack size is 1K. The following commands need more. X< b=../commands/bin X< t=../test X< chmem =2000 $b/cc X< chmem =2000 $b/time X< chmem =2000 $b/tail X< chmem =40000 $b/cpp X< chmem =52000 $b/cem X< chmem =20000 $b/opt X< chmem =30000 $b/cg X< chmem =30000 $b/sort X< chmem =30000 $b/asld X< chmem =16000 $b/mkfs X< chmem =8000 $b/dd X< chmem =8000 $b/rmdir X< chmem =8000 $b/mkdir X< chmem =32000 $b/dosread X< chmem =20000 $b/make X< chmem =8000 $b/gres X< chmem =8000 $b/grep X< chmem =8000 $b/sh X< chmem =8000 $b/gres X< chmem =8000 $b/mv X< chmem =8000 $b/rm X< chmem =8000 $b/pr X< chmem =64000 $b/libpack X< chmem =64000 $b/libupack X< chmem =64000 $b/mined X< chmem =8000 $t/test0 X< chmem =8000 $t/test1 X< chmem =8000 $t/test2 X< chmem =8000 $t/test3 X< chmem =8000 $t/test4 X< chmem =8000 $t/test5 X< chmem =8000 $t/test6 X< chmem =8000 $t/test7 X< chmem =8000 $t/test8 X< chmem =8000 $t/test9 X< chmem =8000 $t/test10 X< chmem =8000 $t/test11 X< chmem =8000 $t/t10a X< chmem =8000 $t/t11a X< chmem =8000 $t/t11b X< chmem =8000 $b/df X--- X> : Increase default stack size from 2K. X> b=../commands/bin X> t=../test X> chmem =30000 $b/asld X> chmem =2000 $b/cc X> chmem =52000 $b/cem X> chmem =30000 $b/cg X> chmem =32000 $b/cpdir X> chmem =40000 $b/cpp X> chmem =40000 $b/dd X> chmem =50000 $b/diff X> chmem =8000 $b/df X> chmem =32000 $b/dosread X> chmem =50000 $b/find X> chmem =50000 $b/fix X> chmem =8000 $b/grep X> chmem =8000 $b/gres X> chmem =64000 $b/libpack X> chmem =64000 $b/libupack X> chmem =20000 $b/make X> chmem =64000 $b/mined X> chmem =8000 $b/mkdir X> chmem =16000 $b/mkfs X> chmem =8000 $b/mv X> chmem =20000 $b/opt X> chmem =8000 $b/pr X> chmem =50000 $b/readfs X> chmem =8000 $b/rm X> chmem =8000 $b/rmdir X> chmem =8000 $b/sh X> chmem =30000 $b/sort X> chmem =2000 $b/tail X> chmem =2000 $b/time X> chmem =8000 $t/t10a X> chmem =8000 $t/t11a X> chmem =8000 $t/t11b X> for i in 1 2 3 4 5 6 7 8 9 10 X> do chmem =8000 ../test/test$i X> done + END-OF-FILE tools:changeme chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\c\h\a\n\g\e\m\e set `sum \t\o\o\l\s\:\c\h\a\n\g\e\m\e` sum=$1 case $sum in 53481) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\c\h\a\n\g\e\m\e >&2 esac echo Extracting \t\o\o\l\s\:\m\a\k\e\f\i\l\e sed 's/^X//' > \t\o\o\l\s\:\m\a\k\e\f\i\l\e << '+ END-OF-FILE '\t\o\o\l\s\:\m\a\k\e\f\i\l\e X40,41d39 X< mkfs.s: mkfs.c X< cc -c -DUNIX mkfs.c X45c43 X< asld -o fsck fsck1.s fsck.s $l/libc.a $l/end.s X--- X> asld -o fsck -T. fsck1.s fsck.s $l/libc.a $l/end.s X58,59c56 X< @echo "Insert blank disk in drive 0 and hit return" X< @getlf X--- X> @getlf "Insert blank diskette in drive 0 and hit return" X69,71c66,67 X< @echo insert blank disk in drive 0 and hit return X< @getlf X< mkfs -l /dev/fd0 proto.usr >log.usr X--- X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.usr >log.usr X75,77c71,72 X< @echo insert blank disk in drive 0 and hit return X< @getlf X< mkfs -l /dev/fd0 proto.user >log.user X--- X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.user >log.user X85,87c80,136 X< @echo "insert blank disk in drive 0 and hit return" X< mkfs -l /dev/fd0 proto.ram >log.ram X< getlf X--- X> @getlf "Insert blank disk in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.ram >log.ram X> X> # Make the distribution disks. X> disk5: mkfs proto.disk5 X> /etc/umount /dev/fd0 X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.disk5 >log.disk5 X> X> disk6: mkfs proto.disk6 X> /etc/umount /dev/fd0 X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.disk6 >log.disk6 X> X> disk7: mkfs proto.disk7 X> @rm -rf proto.a misc.a >/dev/null X> ar r proto.a proto.* X> ar r misc.a passwd rc ttys profile X> /etc/umount /dev/fd0 X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.disk7 >log.disk7 X> X> disk8: mkfs proto.disk8 X> /etc/umount /dev/fd0 X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.disk8 >log.disk8 X> X> disk9: mkfs proto.disk9 X> /etc/umount /dev/fd0 X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/fd0 proto.disk9 >log.disk9 X> X> at.ram: mkfs proto.at.ram X> if /etc/umount /dev/at0; then : ; else : ; fi X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/at0 proto.at.ram >log.at.ram X> X> at.usr: mkfs proto.at.usr X> if /etc/umount /dev/at0; then : ; else : ; fi X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/at0 proto.at.usr >log.at.usr X> X> at.disk4: mkfs proto.at.disk4 X> if /etc/umount /dev/at0; then : ; else : ; fi X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/at0 proto.at.disk4 >log.at.disk4 X> X> at.disk5: mkfs proto.at.disk5 X> if /etc/umount /dev/at0; then : ; else : ; fi X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/at0 proto.at.disk5 >log.at.disk5 X> X> at.disk6: mkfs proto.at.disk6 X> if /etc/umount /dev/at0; then : ; else : ; fi X> @getlf "Insert blank diskette in drive 0 and hit return" X> mkfs -dL /dev/at0 proto.at.disk6 >log.at.disk6 X> + END-OF-FILE tools:makefile chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\m\a\k\e\f\i\l\e set `sum \t\o\o\l\s\:\m\a\k\e\f\i\l\e` sum=$1 case $sum in 21270) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\m\a\k\e\f\i\l\e >&2 esac echo Extracting \t\o\o\l\s\:\p\r\o\t\o\.\a\t sed 's/^X//' > \t\o\o\l\s\:\p\r\o\t\o\.\a\t << '+ END-OF-FILE '\t\o\o\l\s\:\p\r\o\t\o\.\a\t X45,51c45 X< test d--755 2 1 X< $ X< commands d--755 2 1 X< $ X< doc d--755 2 1 X< $ X< $ X--- X> $ + END-OF-FILE tools:proto.at chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\p\r\o\t\o\.\a\t set `sum \t\o\o\l\s\:\p\r\o\t\o\.\a\t` sum=$1 case $sum in 65198) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\p\r\o\t\o\.\a\t >&2 esac echo Extracting \t\o\o\l\s\:\p\r\o\t\o\.\d\i sed 's/^X//' > \t\o\o\l\s\:\p\r\o\t\o\.\d\i << '+ END-OF-FILE '\t\o\o\l\s\:\p\r\o\t\o\.\d\i X29,31c29,31 X< lpr.c ---644 2 1 ../commands/lpr.c X< ls.c ---644 2 1 ../commands/ls.c X< make.c ---644 2 1 ../commands/make.c X--- X> login.c ---644 2 1 ../commands/login.c X> lpr.c ---644 2 1 ../commands/lpr.c X> ls.c ---644 2 1 ../commands/ls.c X65d64 X< changemem ---644 2 1 changemem X72c71 X< makefile ---644 2 1 ../commands/makefile X--- X> makefile ---644 2 1 ../commands/PCIX/makefile X78c77,91 X< $ X--- X> include d--777 2 1 X> blocksize.h ---644 2 1 ../include/blocksize.h X> ctype.h ---644 2 1 ../include/ctype.h X> errno.h ---644 2 1 ../include/errno.h X> grp.h ---644 2 1 ../include/grp.h X> lib.h ---644 2 1 ../include/lib.h X> pwd.h ---644 2 1 ../include/pwd.h X> regexp.h ---644 2 1 ../include/regexp.h X> setjmp.h ---644 2 1 ../include/setjmp.h X> sgtty.h ---644 2 1 ../include/sgtty.h X> signal.h ---644 2 1 ../include/signal.h X> stat.h ---644 2 1 ../include/stat.h X> stdio.h ---644 2 1 ../include/stdio.h X> $ X> $ + END-OF-FILE tools:proto.di chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\p\r\o\t\o\.\d\i set `sum \t\o\o\l\s\:\p\r\o\t\o\.\d\i` sum=$1 case $sum in 14581) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\p\r\o\t\o\.\d\i >&2 esac echo Extracting \t\o\o\l\s\:\p\r\o\t\o\.\u\s sed 's/^X//' > \t\o\o\l\s\:\p\r\o\t\o\.\u\s << '+ END-OF-FILE '\t\o\o\l\s\:\p\r\o\t\o\.\u\s X8,71c8,68 X< ar ---755 2 1 ../commands/bin/ar X< asld ---755 2 1 ../commands/bin/asld X< basename ---755 2 1 ../commands/bin/basename X< chmem ---755 2 1 ../commands/bin/chmem X< chmod ---755 2 1 ../commands/bin/chmod X< chown ---755 2 1 ../commands/bin/chown X< clr ---755 2 1 ../commands/bin/clr X< cmp ---755 2 1 ../commands/bin/cmp X< comm ---755 2 1 ../commands/bin/comm X< date ---755 2 1 ../commands/bin/date X< dd ---755 2 1 ../commands/bin/dd X< df -u-755 0 1 ../commands/bin/df X< dosread ---755 2 1 ../commands/bin/dosread X< echo ---755 2 1 ../commands/bin/echo X< grep ---755 2 1 ../commands/bin/grep X< head ---755 2 1 ../commands/bin/head X< libpack ---755 2 1 ../commands/bin/libpack X< libupack ---755 2 1 ../commands/bin/libupack X< ln ---755 2 1 ../commands/bin/ln X< login ---755 2 1 ../commands/bin/login X< lpr ---755 2 1 ../commands/bin/lpr X< make ---755 2 1 ../commands/bin/make X< mkfs ---755 2 1 ../commands/bin/mkfs X< mknod ---755 2 1 ../commands/bin/mknod X< mv ---755 2 1 ../commands/bin/mv X< od ---755 2 1 ../commands/bin/od X< passwd -u-755 0 1 ../commands/bin/passwd X< pr ---755 2 1 ../commands/bin/pr X< pwd ---755 2 1 ../commands/bin/pwd X< rmdir -u-755 0 1 ../commands/bin/rmdir X< size ---755 2 1 ../commands/bin/size X< sleep ---755 2 1 ../commands/bin/sleep X< sort ---755 2 1 ../commands/bin/sort X< split ---755 2 1 ../commands/bin/split X< stty ---755 2 1 ../commands/bin/stty X< su -u-755 0 1 ../commands/bin/su X< sum ---755 2 1 ../commands/bin/sum X< tail ---755 2 1 ../commands/bin/tail X< tee ---755 2 1 ../commands/bin/tee X< time ---755 2 1 ../commands/bin/time X< touch ---755 2 1 ../commands/bin/touch X< tr ---755 2 1 ../commands/bin/tr X< true ---755 2 1 ../commands/bin/true X< uniq ---755 2 1 ../commands/bin/uniq X< wc ---755 2 1 ../commands/bin/wc X< $ X< include d--755 2 1 X< blocksize.h ---644 2 1 ../include/blocksize.h X< errno.h ---644 2 1 ../include/errno.h X< sgtty.h ---644 2 1 ../include/sgtty.h X< signal.h ---644 2 1 ../include/signal.h X< stat.h ---644 2 1 ../include/stat.h X< setjmp.h ---644 2 1 ../include/setjmp.h X< stdio.h ---644 2 1 ../include/stdio.h X< $ X< lib d--755 2 1 X< cg ---755 2 1 ../commands/bin/cg X< opt ---755 2 1 ../commands/bin/opt X< crtso.s ---755 2 1 ../lib/MINIX/crtso.s X< end.s ---755 2 1 ../lib/MINIX/end.s X< head.s ---755 2 1 ../lib/MINIX/head.s X< libc.a ---755 2 1 ../commands/bin/libc.a X< $ X< $ X--- X> ar ---755 2 1 ../commands/bin/ar X> asld ---755 2 1 ../commands/bin/asld X> basename ---755 2 1 ../commands/bin/basename X> chmem ---755 2 1 ../commands/bin/chmem X> chmod ---755 2 1 ../commands/bin/chmod X> chown ---755 2 1 ../commands/bin/chown X> clr ---755 2 1 ../commands/bin/clr X> cmp ---755 2 1 ../commands/bin/cmp X> comm ---755 2 1 ../commands/bin/comm X> date ---755 2 1 ../commands/bin/date X> dd ---755 2 1 ../commands/bin/dd X> df -u-755 0 1 ../commands/bin/df X> dosread ---755 2 1 ../commands/bin/dosread X> echo ---755 2 1 ../commands/bin/echo X> grep ---755 2 1 ../commands/bin/grep X> head ---755 2 1 ../commands/bin/head X> ln ---755 2 1 ../commands/bin/ln X> login ---755 2 1 ../commands/bin/login X> lpr ---755 2 1 ../commands/bin/lpr X> make ---755 2 1 ../commands/bin/make X> mkfs ---755 2 1 ../commands/bin/mkfs X> mknod ---755 2 1 ../commands/bin/mknod X> mv -u-755 0 1 ../commands/bin/mv X> od ---755 2 1 ../commands/bin/od X> pr ---755 2 1 ../commands/bin/pr X> pwd ---755 2 1 ../commands/bin/pwd X> rmdir -u-755 0 1 ../commands/bin/rmdir X> size ---755 2 1 ../commands/bin/size X> sleep ---755 2 1 ../commands/bin/sleep X> sort ---755 2 1 ../commands/bin/sort X> split ---755 2 1 ../commands/bin/split X> stty ---755 2 1 ../commands/bin/stty X> su -u-755 0 1 ../commands/bin/su X> sum ---755 2 1 ../commands/bin/sum X> tail ---755 2 1 ../commands/bin/tail X> tee ---755 2 1 ../commands/bin/tee X> time ---755 2 1 ../commands/bin/time X> touch ---755 2 1 ../commands/bin/touch X> tr ---755 2 1 ../commands/bin/tr X> true ---755 2 1 ../commands/bin/true X> uniq ---755 2 1 ../commands/bin/uniq X> wc ---755 2 1 ../commands/bin/wc X> $ X> include d--755 2 1 X> blocksize.h ---644 2 1 ../include/blocksize.h X> errno.h ---644 2 1 ../include/errno.h X> sgtty.h ---644 2 1 ../include/sgtty.h X> signal.h ---644 2 1 ../include/signal.h X> stat.h ---644 2 1 ../include/stat.h X> setjmp.h ---644 2 1 ../include/setjmp.h X> stdio.h ---644 2 1 ../include/stdio.h X> $ X> lib d--755 2 1 X> cg ---755 2 1 ../commands/bin/cg X> opt ---755 2 1 ../commands/bin/opt X> crtso.s ---755 2 1 ../lib/MINIX/crtso.s X> end.s ---755 2 1 ../lib/MINIX/end.s X> head.s ---755 2 1 ../lib/MINIX/head.s X> libc.a ---755 2 1 ../commands/bin/libc.a X> $ X> $ + END-OF-FILE tools:proto.us chmod 'u=rw,g=r,o=r' \t\o\o\l\s\:\p\r\o\t\o\.\u\s set `sum \t\o\o\l\s\:\p\r\o\t\o\.\u\s` sum=$1 case $sum in 09029) :;; *) echo 'Bad sum in '\t\o\o\l\s\:\p\r\o\t\o\.\u\s >&2 esac exit 0