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 45
X-rw-r--r-- 1 ast 167 Jun 27 22:51 cache.c.diff
X-rw-r--r-- 1 ast 278 Jun 27 22:51 const.h.diff
X-rw-r--r-- 1 ast 3244 Jun 27 22:51 device.c.diff
X-rw-r--r-- 1 ast 90 Jun 27 22:51 fproc.h.diff
X-rw-r--r-- 1 ast 456 Jun 27 22:52 fs.log
X-rw-r--r-- 1 ast 113 Jun 27 22:51 link.c.diff
X-rw-r--r-- 1 ast 7511 Jun 27 22:51 main.c.diff
X-rw-r--r-- 1 ast 4190 Jun 27 22:51 makefile
X-rw-r--r-- 1 ast 694 Jun 27 22:51 misc.c.diff
X-rw-r--r-- 1 ast 140 Jun 27 22:51 mount.c.diff
X-rw-r--r-- 1 ast 452 Jun 27 22:51 open.c.diff
X-rw-r--r-- 1 ast 34 Jun 27 22:51 param.h.diff
X-rw-r--r-- 1 ast 743 Jun 27 22:51 path.c.diff
X-rw-r--r-- 1 ast 1736 Jun 27 22:51 pipe.c.diff
X-rw-r--r-- 1 ast 231 Jun 27 22:51 protect.c.diff
X-rw-r--r-- 1 ast 67 Jun 27 22:51 putc.c.diff
X-rw-r--r-- 1 ast 2579 Jun 27 22:51 read.c.diff
X-rw-r--r-- 1 ast 369 Jun 27 22:51 super.c.diff
X-rw-r--r-- 1 ast 139 Jun 27 22:51 super.h.diff
X-rw-r--r-- 1 ast 824 Jun 27 22:51 table.c.diff
X-rw-r--r-- 1 ast 82 Jun 27 22:51 time.c.diff
X-rw-r--r-- 1 ast 145 Jun 27 22:52 type.h.diff
X-rw-r--r-- 1 ast 274 Jun 27 22:52 utility.c.diff
X-rw-r--r-- 1 ast 168 Jun 27 22:52 write.c.diff
+ END-OF-FILE LISTING
chmod 'u=rw,g=r,o=r' 'LISTING'
set `wc -c 'LISTING'`
count=$1
case $count in
1386) :;;
*) echo 'Bad character count in ''LISTING' >&2
echo 'Count should be 1386' >&2
esac
echo Extracting 'cache.c.diff'
sed 's/^X//' > 'cache.c.diff' << '+ END-OF-FILE ''cache.c.diff'
X66c66
X< * However, a block that is aready in use (b_count > 0) may not be taken.
X---
X> * However, a block that is already in use (b_count > 0) may not be taken.
+ END-OF-FILE cache.c.diff
chmod 'u=rw,g=r,o=r' 'cache.c.diff'
set `wc -c 'cache.c.diff'`
count=$1
case $count in
167) :;;
*) echo 'Bad character count in ''cache.c.diff' >&2
echo 'Count should be 167' >&2
esac
echo Extracting 'const.h.diff'
sed 's/^X//' > 'const.h.diff' << '+ END-OF-FILE ''const.h.diff'
X3c3
X< #define NR_BUFS 20 /* # blocks in the buffer cache */
X---
X> #define NR_BUFS 30 /* # blocks in the buffer cache */
X11a12,13
X>
X> #ifdef i8088
X12a15,19
X> #endif
X>
X> #ifdef ATARI_ST
X> #define FS_STACK_BYTES 2048 /* size of file system stack */
X> #endif
+ 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
278) :;;
*) echo 'Bad character count in ''const.h.diff' >&2
echo 'Count should be 278' >&2
esac
echo Extracting 'device.c.diff'
sed 's/^X//' > 'device.c.diff' << '+ END-OF-FILE ''device.c.diff'
X11a12,13
X> * tty_open: a tty has been opened
X> * tty_exit: a process with pid=pgrp has exited.
X40a43
X> dev_mess.DEVICE = dev;
X111a115
X> dev_mess.TTY_SPEED = m.TTY_SPEED;
X138d141
X< dev_mess.DEVICE = minor;
X151a155,156
X> int r;
X> message m;
X153,160c158,161
X< int proc_nr;
X<
X< proc_nr = mess_ptr->PROC_NR;
X<
X< if (sendrec(task_nr, mess_ptr) != OK) panic("rw_dev: can't send", NO_NUM);
X< while (mess_ptr->REP_PROC_NR != proc_nr) {
X< /* Instead of the reply to this request, we got a message for an
X< * earlier request. Handle it and go receive again.
X---
X> while ((r = sendrec(task_nr, mess_ptr)) == E_LOCKED) {
X> /* sendrec() failed to avoid deadlock. The task 'task_nr' is
X> * trying to send a REVIVE message for an earlier request.
X> * Handle it and go try again.
X162,163c163,164
X< revive(mess_ptr->REP_PROC_NR, mess_ptr->REP_STATUS);
X< receive(task_nr, mess_ptr);
X---
X> if (receive(task_nr, &m) != OK) panic("rw_dev: can't receive", NO_NUM);
X> revive(m.REP_PROC_NR, m.REP_STATUS);
X164a166
X> if (r != OK) panic("rw_dev: can't send", NO_NUM);
X175c177
X< /* This routine is only called for one device, namely /dev/tty. It's job
X---
X> /* This routine is only called for one device, namely /dev/tty. Its job
X181a184,188
X> if (fp->fs_tty == 0) {
X> mess_ptr->DEVICE = NULL_DEV;
X> rw_dev(MEM, mess_ptr);
X> return;
X> }
X199a207,264
X>
X> /*===========================================================================*
X> * tty_open *
X> *===========================================================================*/
X> PUBLIC tty_open(task_nr, mess_ptr)
X> int task_nr;
X> message *mess_ptr;
X> {
X> register struct fproc *rfp;
X> int major;
X>
X> mess_ptr->REP_STATUS = OK;
X>
X> /* Is this a process group leader? */
X> if (fp->fp_pid != fp->fp_pgrp) return;
X>
X> /* Is there a current control terminal? */
X> if (fp->fs_tty != 0) return;
X> /* Is this one already allocated to another process? */
X> for (rfp = &fproc[INIT_PROC_NR + 1]; rfp < &fproc[NR_PROCS]; rfp++)
X> if (rfp->fs_tty == mess_ptr->DEVICE) return;
X>
X> /* All conditions satisfied. Make this a control terminal. */
X> fp->fs_tty = mess_ptr->DEVICE;
X> major = (mess_ptr->DEVICE >> MAJOR) & BYTE;
X> mess_ptr->DEVICE = (mess_ptr->DEVICE >> MINOR) & BYTE;
X> mess_ptr->m_type = TTY_SETPGRP;
X> mess_ptr->PROC_NR = who;
X> mess_ptr->TTY_PGRP = who;
X> (*dmap[major].dmap_rw)(task_nr, mess_ptr);
X> }
X>
X> /*===========================================================================*
X> * tty_exit *
X> *===========================================================================*/
X> PUBLIC tty_exit()
X> {
X> /* Process group leader exits. Remove its control terminal
X> * from any processes currently running.
X> */
X>
X> register struct fproc *rfp;
X> register dev_nr ttydev;
X>
X> ttydev = fp->fs_tty;
X> for (rfp = &fproc[INIT_PROC_NR + 1]; rfp < &fproc[NR_PROCS]; rfp++)
X> if (rfp->fs_tty == ttydev)
X> rfp->fs_tty = 0;
X> /* Inform the terminal driver. */
X> find_dev(ttydev);
X> dev_mess.m_type = TTY_SETPGRP;
X> dev_mess.DEVICE = (ttydev >> MINOR) & BYTE;
X> dev_mess.PROC_NR = who;
X> dev_mess.TTY_PGRP = 0;
X> (*dmap[major].dmap_rw)(task, &dev_mess);
X> return(OK);
X> }
X>
+ END-OF-FILE device.c.diff
chmod 'u=rw,g=r,o=r' 'device.c.diff'
set `wc -c 'device.c.diff'`
count=$1
case $count in
3244) :;;
*) echo 'Bad character count in ''device.c.diff' >&2
echo 'Count should be 3244' >&2
esac
echo Extracting 'fproc.h.diff'
sed 's/^X//' > 'fproc.h.diff' << '+ END-OF-FILE ''fproc.h.diff'
X5a6
X>
X21a23,24
X> int fp_pid; /* process id */
X> int fp_pgrp; /* process group */
+ END-OF-FILE fproc.h.diff
chmod 'u=rw,g=r,o=r' 'fproc.h.diff'
set `wc -c 'fproc.h.diff'`
count=$1
case $count in
90) :;;
*) echo 'Bad character count in ''fproc.h.diff' >&2
echo 'Count should be 90' >&2
esac
echo Extracting 'link.c.diff'
sed 's/^X//' > 'link.c.diff' << '+ END-OF-FILE ''link.c.diff'
X28c28
X< /* Perform the link(name, name2) system call. */
X---
X> /* Perform the link(name1, name2) system call. */
+ END-OF-FILE link.c.diff
chmod 'u=rw,g=r,o=r' 'link.c.diff'
set `wc -c 'link.c.diff'`
count=$1
case $count in
113) :;;
*) echo 'Bad character count in ''link.c.diff' >&2
echo 'Count should be 113' >&2
esac
echo Extracting 'main.c.diff'
sed 's/^X//' > 'main.c.diff' << '+ END-OF-FILE ''main.c.diff'
X9a10,14
X> #ifdef ATARI_ST
X> #define ASKDEV /* ask for boot device */
X> #define FASTLOAD /* use multiple block transfers to init ram */
X> #endif
X>
X24a30,33
X> #ifdef FASTLOAD
X> #include "dev.h"
X> #endif FASTLOAD
X>
X27c36,37
X< #define MAX_RAM 512 /* maxium RAM disk size in blocks */
X---
X> #define MAX_RAM 16384 /* maximum RAM disk size in blocks */
X> #define RAM_IMAGE (dev_nr)0x303 /* major-minor dev where root image is kept */
X28a39,43
X> #ifdef i8088
X> #define EM_ORIGIN 0x100000 /* origin of extended memory RAM disk on AT */
X> #define MAX_CRD 255 /* if root fs > MAX_CRD, use extended mem */
X> #endif
X>
X80c95
X< who = rp - fproc;
X---
X> who = (int)(rp - fproc);
X85c100
X< rp->fp_suspended = NOT_SUSPENDED; /* no longer hanging*/
X---
X> rp->fp_suspended = NOT_SUSPENDED; /*no longer hanging*/
X109c124
X< * been killed by a signal, so don't check the return code. If the send
X---
X> * been killed by a signal), so don't check the return code. If the send
X166a182
X> #ifdef i8088
X169a186
X> #endif
X224a242
X> dev_nr root_device;
X225a244
X> long base;
X232a252,253
X> base = (long) init_org + (long) init_text_clicks + (long) init_data_clicks;
X> base = base << CLICK_SHIFT;
X234,235c255,267
X< /* Get size of RAM disk by reading root file system's super block */
X< bp = get_block(BOOT_DEV, SUPER_BLOCK, NORMAL); /* get RAM super block */
X---
X> /* Get size of RAM disk by reading root file system's super block.
X> * First read block 0 from the floppy. If this is a valid file system, use
X> * it as the root image, otherwise try the hard disk (RAM_IMAGE).
X> */
X> #ifdef ATARI_ST
X> printf("Booting MINIX-ST 1.1. Copyright 1988 Prentice-Hall, Inc.\n");
X> #endif ATARI_ST
X> #ifdef ASKDEV
X> root_device = (dev_nr)askdev();
X> if (root_device == 0)
X> #endif ASKDEV
X> root_device = BOOT_DEV; /* try floppy disk first */
X> bp = get_block(root_device, SUPER_BLOCK, NORMAL); /* get RAM super block */
X238,239c270,278
X< if (sp->s_magic != SUPER_MAGIC)
X< panic("Diskette in drive 0 is not root file system", NO_NUM);
X---
X> if (sp->s_magic != SUPER_MAGIC) {
X> put_block(bp, FULL_DATA_BLOCK);
X> root_device = RAM_IMAGE;
X> bp = get_block(root_device, SUPER_BLOCK, NORMAL); /* get RAM super block */
X> copy(super_block, bp->b_data, sizeof(struct super_block));
X> sp = &super_block[0];
X> if (sp->s_magic != SUPER_MAGIC)
X> panic("Invalid root file system", NO_NUM);
X> }
X244a284,296
X> #ifdef i8088
X> /* There are two possibilities now (by convention):
X> * count < MAX_CRD ==> RAM disk is in core
X> * count >=MAX_CRD ==> RAM disk is in extended memory (AT only)
X> * In the latter case, tell MM that RAM disk size is 0 and tell the ram disk
X> * driver than the device begins at 1MB.
X> */
X> if (count > MAX_CRD) {
X> ram_clicks = 0; /* MM does not have to allocate any core */
X> base = EM_ORIGIN; /* tell RAM disk driver RAM disk origin */
X> }
X> #endif
X>
X251a304,306
X> #ifdef ATARI_ST
X> m1.m1_p1 = (char *) (int) init_org; /* Bug in Alcyon 4.14 C */
X> #else
X252a308
X> #endif
X258,259c314
X< m1.POSITION = (long) init_org + (long) init_text_clicks + init_data_clicks;
X< m1.POSITION = m1.POSITION << CLICK_SHIFT;
X---
X> m1.POSITION = base;
X264c319,326
X< printf("Loading RAM disk from root diskette. Loaded: 0K ");
X---
X> #ifdef i8088
X> if (ram_clicks == 0)
X> printf("RAM disk of %d blocks is in extended memory\n\n", count);
X> #endif
X> #ifdef FASTLOAD
X> fastload(root_device, (char *)base);
X> #else
X> printf("Loading RAM disk. Loaded: 0K ");
X266c328
X< bp = get_block(BOOT_DEV, (block_nr) i, NORMAL);
X---
X> bp = get_block(root_device, (block_nr) i, NORMAL);
X273c335
X< if (k_loaded % 5 == 0) printf("\b\b\b\b\b%3DK %c", k_loaded, 0);
X---
X> if (k_loaded % 5 == 0) printf("\b\b\b\b\b\b%4DK %c", k_loaded, 0);
X274a337
X> #endif FASTLOAD
X276c339,342
X< printf("\rRAM disk loaded. Please remove root diskette. \n\n");
X---
X> if (root_device == BOOT_DEV)
X> printf("\rRAM disk loaded. Please remove root diskette. \n\n");
X> else
X> printf("\rRAM disk loaded. \n\n");
X311a378,506
X>
X> #ifdef ASKDEV
X> /*===========================================================================*
X> * askdev *
X> *===========================================================================*/
X> PRIVATE askdev()
X> {
X> char line[80];
X> register char *p;
X> register min, maj, c, n;
X>
X> printf("Insert ROOT diskette and hit RETURN (or specify bootdev) %c", 0);
X> m.m_type = TTY_READ;
X> m.TTY_LINE = 0;
X> m.PROC_NR = FS_PROC_NR;
X> m.ADDRESS = line;
X> m.COUNT = sizeof(line);
X> if (sendrec(TTY, &m) != OK)
X> return(0);
X> for (;;) {
X> if (m.REP_PROC_NR != FS_PROC_NR)
X> return(-1);
X> if (m.REP_STATUS != SUSPEND)
X> break;
X> receive(TTY, &m);
X> }
X> if ((n = m.REP_STATUS) <= 0)
X> return(0);
X> p = line;
X> for (maj = 0;;) {
X> if (--n < 0)
X> return(0);
X> c = *p++;
X> if (c == ',')
X> break;
X> if (c < '0' || c > '9')
X> return(0);
X> maj = maj * 10 + c - '0';
X> }
X> for (min = 0;;) {
X> if (--n < 0)
X> return(0);
X> c = *p++;
X> if (c == '\n')
X> break;
X> if (c < '0' || c > '9')
X> return(0);
X> min = min * 10 + c - '0';
X> }
X> if (n != 0)
X> return(0);
X> return((maj << 8) | min);
X> }
X> #endif ASKDEV
X>
X> #ifdef FASTLOAD
X> /*===========================================================================*
X> * fastload *
X> *===========================================================================*/
X> PRIVATE fastload(boot_dev, address)
X> dev_nr boot_dev;
X> char *address;
X> {
X> register i, blocks;
X> register long position;
X>
X> blocks = lastused(boot_dev);
X> printf("Loading RAM disk. To load: %4DK Loaded: 0K %c",
X> ((long)blocks * BLOCK_SIZE) / 1024, 0);
X> position = 0;
X> while (blocks) {
X> i = blocks;
X> if (i > (18*1024)/BLOCK_SIZE)
X> i = (18*1024)/BLOCK_SIZE;
X> blocks -= i;
X> i *= BLOCK_SIZE;
X> m1.m_type = DISK_READ;
X> m1.DEVICE = (boot_dev >> MINOR) & BYTE;
X> m1.POSITION = position;
X> m1.PROC_NR = HARDWARE;
X> m1.ADDRESS = address;
X> m1.COUNT = i;
X> (*dmap[(boot_dev >> MAJOR) & BYTE].dmap_rw)(
X> dmap[(boot_dev >> MAJOR) & BYTE].dmap_task,
X> &m1
X> );
X> if (m1.REP_STATUS < 0)
X> panic("Disk error loading BOOT disk", m1.REP_STATUS);
X> position += i;
X> address += i;
X> printf("\b\b\b\b\b\b%4DK %c", position / 1024L, 0);
X> }
X> }
X>
X> /*===========================================================================*
X> * lastused *
X> *===========================================================================*/
X> PRIVATE lastused(boot_dev)
X> dev_nr boot_dev;
X> {
X> register i, w, b, last, this, zbase;
X> register struct super_block *sp = &super_block[0];
X> register struct buf *bp;
X> register short *wptr, *wlim;
X>
X> zbase = SUPER_BLOCK + 1 + sp->s_imap_blocks;
X> this = sp->s_firstdatazone;
X> last = this - 1;
X> for (i = 0; i < sp->s_zmap_blocks; i++) {
X> bp = get_block(boot_dev, (block_nr) zbase + i, NORMAL);
X> wptr = (short *)&bp->b_data[0];
X> wlim = (short *)&bp->b_data[BLOCK_SIZE];
X> while (wptr != wlim) {
X> w = *wptr++;
X> for (b = 0; b < 8*sizeof(*wptr); b++) {
X> if (this == sp->s_nzones) {
X> put_block(bp, ZMAP_BLOCK);
X> return(last << sp->s_log_zone_size);
X> }
X> if ((w>>b) & 1)
X> last = this;
X> this++;
X> }
X> }
X> put_block(bp, ZMAP_BLOCK);
X> }
X> panic("lastused", NO_NUM);
X> }
X> #endif FASTLOAD
+ 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
7511) :;;
*) echo 'Bad character count in ''main.c.diff' >&2
echo 'Count should be 7511' >&2
esac
echo Extracting 'makefile'
sed 's/^X//' > 'makefile' << '+ END-OF-FILE ''makefile'
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
XCFLAGS= -Di8088 -F
Xh=../h
Xl=/usr/lib
X
Xobj = main.s open.s read.s write.s pipe.s device.s \
X path.s mount.s link.s super.s inode.s cache.s filedes.s \
X stadir.s protect.s time.s misc.s utility.s table.s putc.s
X
Xfs: makefile $l/head.s $(obj) $l/libc.a $l/end.s
X @echo "Start linking FS. "
X @asld -o fs $l/head.s $(obj) $l/libc.a $l/end.s
X @echo "FS done. "
X
Xclean:
X rm -f $(obj)
X
Xcache.s: const.h type.h $h/const.h $h/type.h
Xcache.s: $h/error.h
Xcache.s: buf.h
Xcache.s: file.h
Xcache.s: fproc.h
Xcache.s: glo.h
Xcache.s: inode.h
Xcache.s: super.h
X
Xdevice.s: const.h type.h $h/const.h $h/type.h
Xdevice.s: $h/com.h
Xdevice.s: $h/error.h
Xdevice.s: dev.h
Xdevice.s: file.h
Xdevice.s: fproc.h
Xdevice.s: glo.h
Xdevice.s: inode.h
Xdevice.s: param.h
X
Xfiledes.s: const.h type.h $h/const.h $h/type.h
Xfiledes.s: $h/error.h
Xfiledes.s: file.h
Xfiledes.s: fproc.h
Xfiledes.s: glo.h
Xfiledes.s: inode.h
X
Xinode.s: const.h type.h $h/const.h $h/type.h
Xinode.s: $h/error.h
Xinode.s: buf.h
Xinode.s: file.h
Xinode.s: fproc.h
Xinode.s: glo.h
Xinode.s: inode.h
Xinode.s: super.h
X
Xlink.s: const.h type.h $h/const.h $h/type.h
Xlink.s: $h/error.h
Xlink.s: buf.h
Xlink.s: file.h
Xlink.s: fproc.h
Xlink.s: glo.h
Xlink.s: inode.h
Xlink.s: param.h
X
Xmain.s: const.h type.h $h/const.h $h/type.h
Xmain.s: $h/callnr.h
Xmain.s: $h/com.h
Xmain.s: $h/error.h
Xmain.s: buf.h
Xmain.s: file.h
Xmain.s: fproc.h
Xmain.s: glo.h
Xmain.s: inode.h
Xmain.s: param.h
Xmain.s: super.h
X
Xmisc.s: const.h type.h $h/const.h $h/type.h
Xmisc.s: $h/callnr.h
Xmisc.s: $h/com.h
Xmisc.s: $h/error.h
Xmisc.s: buf.h
Xmisc.s: file.h
Xmisc.s: fproc.h
Xmisc.s: glo.h
Xmisc.s: inode.h
Xmisc.s: param.h
Xmisc.s: super.h
X
Xmount.s: const.h type.h $h/const.h $h/type.h
Xmount.s: $h/error.h
Xmount.s: buf.h
Xmount.s: file.h
Xmount.s: fproc.h
Xmount.s: glo.h
Xmount.s: inode.h
Xmount.s: param.h
Xmount.s: super.h
X
Xopen.s: const.h type.h $h/const.h $h/type.h
Xopen.s: $h/callnr.h
Xopen.s: $h/error.h
Xopen.s: buf.h
Xopen.s: file.h
Xopen.s: fproc.h
Xopen.s: glo.h
Xopen.s: inode.h
Xopen.s: param.h
X
Xpath.s: const.h type.h $h/const.h $h/type.h
Xpath.s: $h/error.h
Xpath.s: buf.h
Xpath.s: file.h
Xpath.s: fproc.h
Xpath.s: glo.h
Xpath.s: inode.h
Xpath.s: super.h
X
Xpipe.s: const.h type.h $h/const.h $h/type.h
Xpipe.s: $h/callnr.h
Xpipe.s: $h/com.h
Xpipe.s: $h/error.h
Xpipe.s: $h/signal.h
Xpipe.s: file.h
Xpipe.s: fproc.h
Xpipe.s: glo.h
Xpipe.s: inode.h
Xpipe.s: param.h
X
Xprotect.s: const.h type.h $h/const.h $h/type.h
Xprotect.s: $h/error.h
Xprotect.s: buf.h
Xprotect.s: file.h
Xprotect.s: fproc.h
Xprotect.s: glo.h
Xprotect.s: inode.h
Xprotect.s: param.h
Xprotect.s: super.h
X
Xputc.s: const.h type.h $h/const.h $h/type.h
Xputc.s: $h/com.h
X
Xread.s: const.h type.h $h/const.h $h/type.h
Xread.s: $h/com.h
Xread.s: $h/error.h
Xread.s: buf.h
Xread.s: file.h
Xread.s: fproc.h
Xread.s: glo.h
Xread.s: inode.h
Xread.s: param.h
Xread.s: super.h
X
Xstadir.s: const.h type.h $h/const.h $h/type.h
Xstadir.s: $h/error.h
Xstadir.s: $h/stat.h
Xstadir.s: file.h
Xstadir.s: fproc.h
Xstadir.s: glo.h
Xstadir.s: inode.h
Xstadir.s: param.h
X
Xsuper.s: const.h type.h $h/const.h $h/type.h
Xsuper.s: $h/error.h
Xsuper.s: buf.h
Xsuper.s: inode.h
Xsuper.s: super.h
X
Xtable.s: const.h type.h $h/const.h $h/type.h
Xtable.s: $h/com.h
Xtable.s: $h/callnr.h
Xtable.s: $h/error.h
Xtable.s: $h/stat.h
Xtable.s: buf.h
Xtable.s: dev.h
Xtable.s: file.h
Xtable.s: fproc.h
Xtable.s: glo.h
Xtable.s: inode.h
Xtable.s: super.h
X
Xtime.s: const.h type.h $h/const.h $h/type.h
Xtime.s: $h/callnr.h
Xtime.s: $h/com.h
Xtime.s: $h/error.h
Xtime.s: file.h
Xtime.s: fproc.h
Xtime.s: glo.h
Xtime.s: inode.h
Xtime.s: param.h
X
Xutility.s: const.h type.h $h/const.h $h/type.h
Xutility.s: $h/com.h
Xutility.s: $h/error.h
Xutility.s: buf.h
Xutility.s: file.h
Xutility.s: fproc.h
Xutility.s: glo.h
Xutility.s: inode.h
Xutility.s: param.h
Xutility.s: super.h
X
Xwrite.s: const.h type.h $h/const.h $h/type.h
Xwrite.s: $h/error.h
Xwrite.s: buf.h
Xwrite.s: file.h
Xwrite.s: fproc.h
Xwrite.s: glo.h
Xwrite.s: inode.h
Xwrite.s: super.h
+ END-OF-FILE makefile
chmod 'u=rw,g=r,o=r' 'makefile'
set `wc -c 'makefile'`
count=$1
case $count in
4190) :;;
*) echo 'Bad character count in ''makefile' >&2
echo 'Count should be 4190' >&2
esac
echo Extracting 'misc.c.diff'
sed 's/^X//' > 'misc.c.diff' << '+ END-OF-FILE ''misc.c.diff'
X88,89c88,91
X< sp->s_time = clock_time();
X< if (sp->s_rd_only == FALSE) sp->s_dirt = DIRTY;
X---
X> if (sp != NIL_SUPER) {
X> sp->s_time = clock_time();
X> if (sp->s_rd_only == FALSE) sp->s_dirt = DIRTY;
X> }
X124c126
X< * In particular, let the child inherit its parents file descriptors.
X---
X> * In particular, let the child inherit its parent's file descriptors.
X146a149,154
X> /* Fill in new process id and, if necessary, process group. */
X> cp->fp_pid = pid;
X> if (parent == INIT_PROC_NR) {
X> cp->fp_pgrp = pid;
X> }
X>
X168a177,179
X>
X> /* Can this be a process group leader associated with a terminal? */
X> if (fp->fp_pid == fp->fp_pgrp && fp->fs_tty != 0) tty_exit();
+ END-OF-FILE misc.c.diff
chmod 'u=rw,g=r,o=r' 'misc.c.diff'
set `wc -c 'misc.c.diff'`
count=$1
case $count in
694) :;;
*) echo 'Bad character count in ''misc.c.diff' >&2
echo 'Count should be 694' >&2
esac
echo Extracting 'mount.c.diff'
sed 's/^X//' > 'mount.c.diff' << '+ END-OF-FILE ''mount.c.diff'
X34c34
X< extern dev_nr name_to_dev();
X---
X> dev_nr name_to_dev();
X132c132
X< extern dev_nr name_to_dev();
X---
X> dev_nr name_to_dev();
+ END-OF-FILE mount.c.diff
chmod 'u=rw,g=r,o=r' 'mount.c.diff'
set `wc -c 'mount.c.diff'`
count=$1
case $count in
140) :;;
*) echo 'Bad character count in ''mount.c.diff' >&2
echo 'Count should be 140' >&2
esac
echo Extracting 'open.c.diff'
sed 's/^X//' > 'open.c.diff' << '+ END-OF-FILE ''open.c.diff'
X39c39
X< extern struct inode *new_node();
X---
X> struct inode *new_node();
X52c52
X< * and has been created, or it pre-existed. In the later case, truncate
X---
X> * and has been created, or it pre-existed. In the latter case, truncate
X213,217d212
X< /* Assume that first open of char special file is controlling tty. */
X< if (fp->fs_tty == 0) fp->fs_tty = (dev_nr) rip->i_zone[0];
X< dev_open((dev_nr) rip->i_zone[0], (int) bits);
X< break;
X<
+ END-OF-FILE open.c.diff
chmod 'u=rw,g=r,o=r' 'open.c.diff'
set `wc -c 'open.c.diff'`
count=$1
case $count in
452) :;;
*) echo 'Bad character count in ''open.c.diff' >&2
echo 'Count should be 452' >&2
esac
echo Extracting 'param.h.diff'
sed 's/^X//' > 'param.h.diff' << '+ END-OF-FILE ''param.h.diff'
X29a30
X> #define pid m.m1_i3
+ END-OF-FILE param.h.diff
chmod 'u=rw,g=r,o=r' 'param.h.diff'
set `wc -c 'param.h.diff'`
count=$1
case $count in
34) :;;
*) echo 'Bad character count in ''param.h.diff' >&2
echo 'Count should be 34' >&2
esac
echo Extracting 'path.c.diff'
sed 's/^X//' > 'path.c.diff' << '+ END-OF-FILE ''path.c.diff'
X70c70
X< extern char *get_name();
X---
X> char *get_name();
X121c121
X< while ( rnp < &user_path[MAX_PATH] && c != '/' && c != '\0') {
X---
X> while ( rnp < &old_name[MAX_PATH] && c != '/' && c != '\0') {
X127c127
X< while (c == '/' && rnp < &user_path[MAX_PATH]) c = *++rnp;
X---
X> while (c == '/' && rnp < &old_name[MAX_PATH]) c = *++rnp;
X132c132
X< if (rnp >= &user_path[MAX_PATH]) {
X---
X> if (rnp >= &old_name[MAX_PATH]) {
X162a163,165
X> /* Check for NIL_INODE. */
X> if (dirp == NIL_INODE) return(NIL_INODE);
X>
X175c178
X< for (sp = &super_block[1]; sp < &super_block[NR_SUPERS]; sp++) {
X---
X> for (sp = &super_block[1]; sp < &super_block[NR_SUPERS]; sp++){
X189a193,194
X> if (rip == NIL_INODE) return(NIL_INODE);
X>
+ END-OF-FILE path.c.diff
chmod 'u=rw,g=r,o=r' 'path.c.diff'
set `wc -c 'path.c.diff'`
count=$1
case $count in
743) :;;
*) echo 'Bad character count in ''path.c.diff' >&2
echo 'Count should be 743' >&2
esac
echo Extracting 'pipe.c.diff'
sed 's/^X//' > 'pipe.c.diff' << '+ END-OF-FILE ''pipe.c.diff'
X84c84
X< PUBLIC int pipe_check(rip, rw_flag, virgin, bytes, position)
X---
X> PUBLIC int pipe_check(rip, rw_flag, bytes, position)
X87d86
X< int virgin; /* 1 if no data transferred yet, else 0 */
X89c88
X< register file_pos *position; /* pointer to current file position */
X---
X> register file_pos position; /* pointer to current file position */
X101c100
X< if (*position >= rip->i_size) {
X---
X> if (position >= rip->i_size) {
X104,105c103,104
X< /* Writer exists; suspend rdr if no data already read.*/
X< if (virgin) suspend(XPIPE); /* block reader */
X---
X> /* Writer exists */
X> suspend(XPIPE); /* block reader */
X116,120c115,116
X< /* Tell MM to generate a SIGPIPE signal. */
X< mess.m_type = KSIG;
X< mess.PROC1 = fp - fproc;
X< mess.SIG_MAP = 1 << (SIGPIPE - 1);
X< send(MM_PROC_NR, &mess);
X---
X> /* Tell kernel to generate a SIGPIPE signal. */
X> sys_kill((int)(fp - fproc), SIGPIPE);
X124c120
X< if (*position + bytes > PIPE_SIZE) {
X---
X> if (position + bytes > PIPE_SIZE) {
X130c126
X< if (*position == 0) release(rip, READ, 1);
X---
X> if (position == 0) release(rip, READ, 1);
X176,178c172,176
X< if (rp->fp_suspended == SUSPENDED && (rp->fp_fd & BYTE) == call_nr &&
X< rp->fp_filp[rp->fp_fd>>8]->filp_ino == ip) {
X< revive(rp - fproc, 0);
X---
X> if (rp->fp_suspended == SUSPENDED &&
X> rp->fp_revived == NOT_REVIVING &&
X> (rp->fp_fd & BYTE) == call_nr &&
X> rp->fp_filp[rp->fp_fd>>8]->filp_ino == ip) {
X> revive((int)(rp - fproc), 0);
X251,255c249
X< if (sendrec(task, &mess) != OK) panic("unpause err 3", NO_NUM);
X< while (mess.REP_PROC_NR != proc_nr) {
X< revive(mess.REP_PROC_NR, mess.REP_STATUS);
X< if (receive(task, &m) != OK) panic("unpause err 4", NO_NUM);
X< }
X---
X> rw_dev(task, &mess);
+ END-OF-FILE pipe.c.diff
chmod 'u=rw,g=r,o=r' 'pipe.c.diff'
set `wc -c 'pipe.c.diff'`
count=$1
case $count in
1736) :;;
*) echo 'Bad character count in ''pipe.c.diff' >&2
echo 'Count should be 1736' >&2
esac
echo Extracting 'protect.c.diff'
sed 's/^X//' > 'protect.c.diff' << '+ END-OF-FILE ''protect.c.diff'
X138c138
X< /* Given a pointer to an inode, 'rip', and the accessed desired, determine
X---
X> /* Given a pointer to an inode, 'rip', and the access desired, determine
X181c181
X< PRIVATE int read_only(ip)
X---
X> PUBLIC int read_only(ip)
+ END-OF-FILE protect.c.diff
chmod 'u=rw,g=r,o=r' 'protect.c.diff'
set `wc -c 'protect.c.diff'`
count=$1
case $count in
231) :;;
*) echo 'Bad character count in ''protect.c.diff' >&2
echo 'Count should be 231' >&2
esac
echo Extracting 'putc.c.diff'
sed 's/^X//' > 'putc.c.diff' << '+ END-OF-FILE ''putc.c.diff'
X49c49
X< sendrec(TTY, &putchmsg);
X---
X> rw_dev(TTY, &putchmsg);
+ END-OF-FILE putc.c.diff
chmod 'u=rw,g=r,o=r' 'putc.c.diff'
set `wc -c 'putc.c.diff'`
count=$1
case $count in
67) :;;
*) echo 'Bad character count in ''putc.c.diff' >&2
echo 'Count should be 67' >&2
esac
echo Extracting 'read.c.diff'
sed 's/^X//' > 'read.c.diff' << '+ END-OF-FILE ''read.c.diff'
X9c9
X< * read_map: given an inode and file position, lookup its zone number
X---
X> * read_map: given an inode and file position, look up its zone number
X56c56
X< int r, chunk, virg, mode_word, usr, seg;
X---
X> int r, chunk, mode_word, usr, seg, block_spec, char_spec;
X73,74c73,76
X< if (nbytes == 0) return(0); /* so char special files need not check for 0*/
X< if (who != MM_PROC_NR && nbytes < 0) return(EINVAL); /* only MM > 32K */
X---
X> #ifdef i8088
X> if (who != MM_PROC_NR) /* only MM > 32K */
X> #endif
X> if (nbytes < 0) return(EINVAL);
X77a80
X> if (nbytes == 0) return(0); /* so char special files need not check for 0*/
X84d86
X< virg = TRUE;
X86c88,90
X< if (mode_word == I_BLOCK_SPECIAL && f_size == 0) f_size = MAX_P_LONG;
X---
X> char_spec = (mode_word == I_CHAR_SPECIAL ? 1 : 0);
X> block_spec = (mode_word == I_BLOCK_SPECIAL ? 1 : 0);
X> if (block_spec && f_size == 0) f_size = MAX_P_LONG;
X90c94
X< if (mode_word == I_CHAR_SPECIAL) {
X---
X> if (char_spec) {
X98c102
X< if (rw_flag == WRITING && mode_word != I_BLOCK_SPECIAL) {
X---
X> if (rw_flag == WRITING && block_spec == 0) {
X111,113c115,117
X< if (rip->i_pipe && (r = pipe_check(rip, rw_flag, virg,
X< nbytes, &position)) <= 0) return(r);
X<
X---
X> if (rip->i_pipe &&
X> (r = pipe_check(rip, rw_flag, nbytes, position)) <= 0)
X> return r;
X120c124
X< if (rw_flag == READING) {
X---
X> if (rw_flag == READING || (block_spec && rw_flag == WRITING)) {
X137d140
X< virg = FALSE; /* tells pipe_check() that data has been copied */
X143,144c146
X< if (mode_word != I_CHAR_SPECIAL && mode_word != I_BLOCK_SPECIAL &&
X< position > f_size)
X---
X> if (char_spec == 0 && block_spec == 0 && position > f_size)
X220c222,223
X< if(rw_flag == WRITING && off == 0 && position >= rip->i_size) n=NO_READ;
X---
X> if(rw_flag == WRITING && !block_spec &&
X> off == 0 && position >= rip->i_size) n=NO_READ;
X263c266
X< if ( (z = rip->i_zone[zone]) == NO_ZONE) return(NO_BLOCK);
X---
X> if ( (z = rip->i_zone[(int) zone]) == NO_ZONE) return(NO_BLOCK);
X280c283
X< z = bp->b_ind[excess/NR_INDIRECTS]; /* z is zone # for single ind */
X---
X> z = bp->b_ind[(int)(excess/NR_INDIRECTS)];/*z is zone # for single ind*/
X285c288
X< /* 'z' is zone number for single indirect block; 'excess' is index into it. */
X---
X> /* 'z' is zone num for single indirect block; 'excess' is index into it. */
X289,290c292,293
X< z = bp->b_ind[excess];
X< put_block(bp, INDIRECT_BLOCK); /* release single indirect blk */
X---
X> z = bp->b_ind[(int) excess];
X> put_block(bp, INDIRECT_BLOCK); /* release single indir blk */
+ END-OF-FILE read.c.diff
chmod 'u=rw,g=r,o=r' 'read.c.diff'
set `wc -c 'read.c.diff'`
count=$1
case $count in
2579) :;;
*) echo 'Bad character count in ''read.c.diff' >&2
echo 'Count should be 2579' >&2
esac
echo Extracting 'super.c.diff'
sed 's/^X//' > 'super.c.diff' << '+ END-OF-FILE ''super.c.diff'
X125c125
X< a = i + (wptr - &bp->b_int[0])*INT_BITS
X---
X> a = i + (int)(wptr - &bp->b_int[0])*INT_BITS
X153c153
X< /* Return a zone or inode by turning on its bitmap bit. */
X---
X> /* Return a zone or inode by turning off its bitmap bit. */
X166c166
X< bp->b_int[w] &= ~(1 << bit); /* turn the bit on */
X---
X> bp->b_int[w] &= ~(1 << bit); /* turn the bit off */
+ END-OF-FILE super.c.diff
chmod 'u=rw,g=r,o=r' 'super.c.diff'
set `wc -c 'super.c.diff'`
count=$1
case $count in
369) :;;
*) echo 'Bad character count in ''super.c.diff' >&2
echo 'Count should be 369' >&2
esac
echo Extracting 'super.h.diff'
sed 's/^X//' > 'super.h.diff' << '+ END-OF-FILE ''super.h.diff'
X30c30
X< int s_magic; /* magic number to recognize super-blocks */
X---
X> short s_magic; /* magic number to recognize super-blocks */
+ END-OF-FILE super.h.diff
chmod 'u=rw,g=r,o=r' 'super.h.diff'
set `wc -c 'super.h.diff'`
count=$1
case $count in
139) :;;
*) echo 'Bad character count in ''super.h.diff' >&2
echo 'Count should be 139' >&2
esac
echo Extracting 'table.c.diff'
sed 's/^X//' > 'table.c.diff' << '+ END-OF-FILE ''table.c.diff'
X105c105,108
X< no_sys /* 68 = TASK_REPLY */
X---
X> no_sys, /* 68 = TASK_REPLY */
X> #ifdef i8088
X> no_sys, /* 69 = unused */
X> #endif
X109c112
X< extern rw_dev(), rw_dev2();
X---
X> extern rw_dev(), rw_dev2(), tty_open();
X110a114
X>
X115c119,121
X< * must be changed to correspond to the new values.
X---
X> * must be changed to correspond to the new values. Note that the major
X> * device numbers used in /dev are NOT the same as the task numbers used
X> * inside the kernel (as defined in h/com.h).
X124c130
X< no_call, rw_dev, no_call, TTY, /* 4 = /dev/tty0 */
X---
X> tty_open, rw_dev, no_call, TTY, /* 4 = /dev/tty0 */
X126c132
X< no_call, rw_dev, no_call, PRINTER /* 6 = /dev/lp */
X---
X> no_call, rw_dev, no_call, PRINTER, /* 6 = /dev/lp */
+ 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
824) :;;
*) echo 'Bad character count in ''table.c.diff' >&2
echo 'Count should be 824' >&2
esac
echo Extracting 'time.c.diff'
sed 's/^X//' > 'time.c.diff' << '+ END-OF-FILE ''time.c.diff'
X42a43
X> if (read_only(rip) != OK) r = EROFS; /* not even su can touch if R/O */
+ END-OF-FILE time.c.diff
chmod 'u=rw,g=r,o=r' 'time.c.diff'
set `wc -c 'time.c.diff'`
count=$1
case $count in
82) :;;
*) echo 'Bad character count in ''time.c.diff' >&2
echo 'Count should be 82' >&2
esac
echo Extracting 'type.h.diff'
sed 's/^X//' > 'type.h.diff' << '+ END-OF-FILE ''type.h.diff'
X9c9
X< typedef struct { /* disk inode. Memory inode is in "inotab.h" */
X---
X> typedef struct { /* disk inode. Memory inode is in "inode.h" */
+ END-OF-FILE type.h.diff
chmod 'u=rw,g=r,o=r' 'type.h.diff'
set `wc -c 'type.h.diff'`
count=$1
case $count in
145) :;;
*) echo 'Bad character count in ''type.h.diff' >&2
echo 'Count should be 145' >&2
esac
echo Extracting 'utility.c.diff'
sed 's/^X//' > 'utility.c.diff' << '+ END-OF-FILE ''utility.c.diff'
X45,46c45,48
X< sp->s_time = clock_mess.NEW_TIME; /* update super block time */
X< if (sp->s_rd_only == FALSE) sp->s_dirt = DIRTY;
X---
X> if (sp) {
X> sp->s_time = clock_mess.NEW_TIME; /* update super block time */
X> if (sp->s_rd_only == FALSE) sp->s_dirt = DIRTY;
X> }
+ 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
274) :;;
*) echo 'Bad character count in ''utility.c.diff' >&2
echo 'Count should be 274' >&2
esac
echo Extracting 'write.c.diff'
sed 's/^X//' > 'write.c.diff' << '+ END-OF-FILE ''write.c.diff'
X61c61
X< rip->i_zone[zone] = new_zone;
X---
X> rip->i_zone[(int) zone] = new_zone;
X112c112
X< bp->b_ind[excess] = new_zone;
X---
X> bp->b_ind[(int) excess] = new_zone;
+ END-OF-FILE write.c.diff
chmod 'u=rw,g=r,o=r' 'write.c.diff'
set `wc -c 'write.c.diff'`
count=$1
case $count in
168) :;;
*) echo 'Bad character count in ''write.c.diff' >&2
echo 'Count should be 168' >&2
esac
exit 0