ast@cs.vu.nl (Andy Tanenbaum) (09/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 17 X-rw-r--r-- 1 ast 4197 Sep 27 15:12 at_makefile X-rw-r--r-- 1 ast 2585 Sep 27 15:12 inode.c.cdif X-rw-r--r-- 1 ast 1449 Sep 27 15:12 link.c.cdif X-rw-r--r-- 1 ast 4266 Sep 27 15:12 pc_makefile X-rw-r--r-- 1 ast 1736 Sep 27 15:12 read.c.cdif + END-OF-FILE LISTING chmod 'u=rw,g=r,o=r' 'LISTING' set `wc -c 'LISTING'` count=$1 case $count in 295) :;; *) echo 'Bad character count in ''LISTING' >&2 echo 'Count should be 295' >&2 esac echo Extracting 'at_makefile' sed 's/^X//' > 'at_makefile' << '+ END-OF-FILE ''at_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 -T. 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 -T. $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 at_makefile chmod 'u=rw,g=r,o=r' 'at_makefile' set `wc -c 'at_makefile'` count=$1 case $count in 4197) :;; *) echo 'Bad character count in ''at_makefile' >&2 echo 'Count should be 4197' >&2 esac echo Extracting 'inode.c.cdif' sed 's/^X//' > 'inode.c.cdif' << '+ END-OF-FILE ''inode.c.cdif' X*** /local/ast/minix/tape3b/fs/inode.c Tue Jul 12 23:42:51 1988 X--- inode.c Mon Sep 26 13:04:05 1988 X*************** X*** 111,117 **** X X /* Acquire an inode from the bit map. */ X sp = get_super(dev); /* get pointer to super_block */ X! b=alloc_bit(sp->s_imap, (bit_nr)sp->s_ninodes+1, sp->s_imap_blocks,(bit_nr)0); X if (b == NO_BIT) { X err_code = ENFILE; X major = (int) (sp->s_dev >> MAJOR) & BYTE; X--- 111,117 ---- X X /* Acquire an inode from the bit map. */ X sp = get_super(dev); /* get pointer to super_block */ X! b=alloc_bit(sp->s_imap,(bit_nr)sp->s_ninodes+1, sp->s_imap_blocks,(bit_nr)0); X if (b == NO_BIT) { X err_code = ENFILE; X major = (int) (sp->s_dev >> MAJOR) & BYTE; X*************** X*** 129,142 **** X /* No inode table slots available. Free the inode just allocated. */ X free_bit(sp->s_imap, b); X } else { X! /* An inode slot is available. Put the inode just allocated into it. */ X rip->i_mode = bits; X rip->i_nlinks = (links) 0; X rip->i_uid = fp->fp_effuid; X rip->i_gid = fp->fp_effgid; X rip->i_dev = dev; /* was provisionally set to NO_DEV */ X X! /* The fields not cleared already are cleared in wipe_inode(). They have X * been put there because truncate() needs to clear the same fields if X * the file happens to be open while being truncated. It saves space X * not to repeat the code twice. X--- 129,142 ---- X /* No inode table slots available. Free the inode just allocated. */ X free_bit(sp->s_imap, b); X } else { X! /* An inode slot is available. Put the inode just allocated into it. */ X rip->i_mode = bits; X rip->i_nlinks = (links) 0; X rip->i_uid = fp->fp_effuid; X rip->i_gid = fp->fp_effgid; X rip->i_dev = dev; /* was provisionally set to NO_DEV */ X X! /* Fields not cleared already are cleared in wipe_inode(). They have X * been put there because truncate() needs to clear the same fields if X * the file happens to be open while being truncated. It saves space X * not to repeat the code twice. X*************** X*** 212,220 **** X X /* Do the read or write. */ X if (rw_flag == READING) { X! copy((char *)rip, (char *) dip, INODE_SIZE); /* copy from blk to inode */ X } else { X! copy((char *)dip, (char *) rip, INODE_SIZE); /* copy from inode to blk */ X bp->b_dirt = DIRTY; X } X X--- 212,220 ---- X X /* Do the read or write. */ X if (rw_flag == READING) { X! copy((char *)rip, (char *)dip, INODE_SIZE); /* copy from blk to inode*/ X } else { X! copy((char *)dip, (char *)rip, INODE_SIZE); /* copy from inode to blk*/ X bp->b_dirt = DIRTY; X } X + END-OF-FILE inode.c.cdif chmod 'u=rw,g=r,o=r' 'inode.c.cdif' set `wc -c 'inode.c.cdif'` count=$1 case $count in 2585) :;; *) echo 'Bad character count in ''inode.c.cdif' >&2 echo 'Count should be 2585' >&2 esac echo Extracting 'link.c.cdif' sed 's/^X//' > 'link.c.cdif' << '+ END-OF-FILE ''link.c.cdif' X*** /local/ast/minix/tape3b/fs/link.c Tue Jul 12 23:42:51 1988 X--- link.c Mon Sep 26 13:04:06 1988 X*************** X*** 11,16 **** X--- 11,17 ---- X #include "../h/const.h" X #include "../h/type.h" X #include "../h/error.h" X+ #include "../h/stat.h" X #include "const.h" X #include "type.h" X #include "buf.h" X*************** X*** 144,159 **** X { X /* Remove all the zones from the inode 'rip' and mark it dirty. */ X X- register file_pos position; X- register zone_type zone_size; X register block_nr b; X register zone_nr z, *iz; X! register int scale; X! register struct buf *bp; X! register dev_nr dev; X extern struct buf *get_block(); X extern block_nr read_map(); X X dev = rip->i_dev; /* device on which inode resides */ X scale = scale_factor(rip); X zone_size = (zone_type) BLOCK_SIZE << scale; X--- 145,163 ---- X { X /* Remove all the zones from the inode 'rip' and mark it dirty. */ X X register block_nr b; X register zone_nr z, *iz; X! file_pos position; X! zone_type zone_size; X! int scale, file_type; X! struct buf *bp; X! dev_nr dev; X! unshort modewd; X extern struct buf *get_block(); X extern block_nr read_map(); X X+ file_type = rip->i_mode & S_IFMT; /* check to see if file is special */ X+ if (file_type == S_IFCHR || file_type == S_IFBLK) return; X dev = rip->i_dev; /* device on which inode resides */ X scale = scale_factor(rip); X zone_size = (zone_type) BLOCK_SIZE << scale; + END-OF-FILE link.c.cdif chmod 'u=rw,g=r,o=r' 'link.c.cdif' set `wc -c 'link.c.cdif'` count=$1 case $count in 1449) :;; *) echo 'Bad character count in ''link.c.cdif' >&2 echo 'Count should be 1449' >&2 esac echo Extracting 'pc_makefile' sed 's/^X//' > 'pc_makefile' << '+ END-OF-FILE ''pc_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 -T. 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 @echo "If disk fills up, remove some files or use asld -Tsomething" X @asld -o fs -T. $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 pc_makefile chmod 'u=rw,g=r,o=r' 'pc_makefile' set `wc -c 'pc_makefile'` count=$1 case $count in 4266) :;; *) echo 'Bad character count in ''pc_makefile' >&2 echo 'Count should be 4266' >&2 esac echo Extracting 'read.c.cdif' sed 's/^X//' > 'read.c.cdif' << '+ END-OF-FILE ''read.c.cdif' X*** /local/ast/minix/tape3b/fs/read.c Tue Jul 12 23:42:55 1988 X--- read.c Mon Sep 26 13:04:10 1988 X*************** X*** 143,164 **** X X /* On write, update file size and access time. */ X if (rw_flag == WRITING) { X! if (char_spec == 0 && block_spec == 0 && position > f_size) X! rip->i_size = position; X! rip->i_modtime = clock_time(); X! rip->i_dirt = DIRTY; X } else { X if (rip->i_pipe && position >= rip->i_size) { X /* Reset pipe pointers. */ X rip->i_size = 0; /* no data left */ X position = 0; /* reset reader(s) */ X! if ( (wf = find_filp(rip, W_BIT)) != NIL_FILP) wf->filp_pos = 0; X } X } X f->filp_pos = position; X X /* Check to see if read-ahead is called for, and if so, set it up. */ X! if (rw_flag == READING && rip->i_seek == NO_SEEK && position % BLOCK_SIZE == 0 X && (mode_word == I_REGULAR || mode_word == I_DIRECTORY)) { X rdahed_inode = rip; X rdahedpos = position; X--- 143,165 ---- X X /* On write, update file size and access time. */ X if (rw_flag == WRITING) { X! if (char_spec == 0 && block_spec == 0) { X! if (position > f_size) rip->i_size = position; X! rip->i_modtime = clock_time(); X! rip->i_dirt = DIRTY; X! } X } else { X if (rip->i_pipe && position >= rip->i_size) { X /* Reset pipe pointers. */ X rip->i_size = 0; /* no data left */ X position = 0; /* reset reader(s) */ X! if ( (wf = find_filp(rip, W_BIT)) != NIL_FILP) wf->filp_pos =0; X } X } X f->filp_pos = position; X X /* Check to see if read-ahead is called for, and if so, set it up. */ X! if (rw_flag == READING && rip->i_seek == NO_SEEK && position % BLOCK_SIZE== 0 X && (mode_word == I_REGULAR || mode_word == I_DIRECTORY)) { X rdahed_inode = rip; X rdahedpos = position; + END-OF-FILE read.c.cdif chmod 'u=rw,g=r,o=r' 'read.c.cdif' set `wc -c 'read.c.cdif'` count=$1 case $count in 1736) :;; *) echo 'Bad character count in ''read.c.cdif' >&2 echo 'Count should be 1736' >&2 esac exit 0