[comp.os.minix] V1.3c posting #14 - odds and ends

ast@cs.vu.nl (Andy Tanenbaum) (10/03/88)

Here are some recent fixes to apply to 1.3c.  I have included the entire
amoeba/kernel/makefile because, he said sheepishly, I just deleted
the amoeba directory from my disk on the SUN, and I don't know what the
original makefile was.  My AT only has the new makefile. Sorry.

Andy Tanenbaum (ast@cs.vu.nl)

: 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 'amoeba:ker:makef'
sed 's/^X//' > 'amoeba:ker:makef' << '+ END-OF-FILE ''amoeba:ker:makef'
X# The kernel dir contains xt_wini.c and at_wini.c.  Before running make
X# you must copy one of these to wini.c, depending on which controller you
X# have.  If you do not have a hard disk, you MUST choose one of them at random.
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.  You can change this by editing commands/cc.c.
X#
X# Normally, MINIX scrolls the screen using the 6845's registers.  However,
X# on some EGA cards (those that are not IBM compatible), the 6845 is not
X# properly emulated.  On these machines, it is necessary to scroll in
X# software by copying. This is much slower, but it works. The CFLAGS flags are:
X#
X#  -Di8088	- required on an 8088/80286/80386 CPU; forbidden on a 68000
X#  -F		- run cpp and cem sequentially (used when memory is tight)
X#  -T.		- put temporaries in working directory (when RAM disk is small)
X#  -DAM_KERNEL	- includes code for Amoeba transactions
X#  -DNONET	- single machine, no Ethernet available (requires -DAM_KERNEL)
X#  -DSTATISTICS	- include code to collect Ethernet statistics
X#
X# Machines wishing to use Amoeba transactions should add -DAM_KERNEL to CFLAGS.
X# If there is no ethernet connection then also add -DNONET.  The ethernet
X# driver included in this distribution is for the Western Digital Ethercard
X# Plus.  If you want ethernet statistics then add -DSTATISTICS to CFLAGS.
X#
X# When making a kernel on a machine with limited RAM disk, it may be 
X# necessary to use -T. or even remove /lib/cem and /lib/cpp during asld.
X#
XCFLAGS	= -DAM_KERNEL -Di8088   -F -I../../kernel -I. 
XA	= ../h
XH	= ../../h
XK	= ../../kernel
XLIB	= /usr/lib
X
XOBJ =	../../kernel/mpx88.s main.s tty.s floppy.s wini.s system.s proc.s \
X	console.s rs232.s clock.s memory.s printer.s amoeba.s conf.s dp8390.s \
X	util.s etherplus.s portcache.s trans.s table.s ../../kernel/klib88.s \
X	dmp.s
X
X
XCOBJS =	main.s tty.s floppy.s wini.s system.s proc.s clock.s memory.s \
X	amoeba.s conf.s dp8390.s util.s etherplus.s portcache.s trans.s \
X	console.s rs232.s printer.s table.s dmp.s
X
X
Xkernel:	makefile $(OBJ) $(LIB)/libc.a
X	@echo "Start linking Kernel."
X	@asld -o kernel $(OBJ) $(LIB)/libc.a $(LIB)/end.s
X	@echo "Kernel done.  "
X
Xclean:
X	rm -f $(COBJS) kernel
X
Xclock.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xclock.s:	$H/callnr.h
Xclock.s:	$H/com.h
Xclock.s:	$H/error.h
Xclock.s:	$H/signal.h
Xclock.s:	$K/glo.h
Xclock.s:	$K/proc.h
Xclock.s:	$K/clock.c
X	$(CC) $(CFLAGS) -c $K/clock.c
X
Xconsole.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xconsole.s:	$H/callnr.h
Xconsole.s:	$H/com.h
Xconsole.s:	$H/error.h
Xconsole.s:	$H/sgtty.h
Xconsole.s:	$H/signal.h
Xconsole.s:	$K/glo.h
Xconsole.s:	$K/proc.h
Xconsole.s:	$K/tty.h
Xconsole.s:	$K/tty.c
X	$(CC) $(CFLAGS) -c $K/console.c
X
Xdmp.s:		$K/const.h $K/type.h $H/const.h $H/type.h
Xdmp.s:		$H/callnr.h
Xdmp.s:		$H/com.h
Xdmp.s:		$H/error.h
Xdmp.s:		$K/glo.h
Xdmp.s:		$K/proc.h
Xdmp.s:		$K/dmp.c
X	$(CC) $(CFLAGS) -c $K/dmp.c
X
Xfloppy.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xfloppy.s:	$H/callnr.h
Xfloppy.s:	$H/com.h
Xfloppy.s:	$H/error.h
Xfloppy.s:	$K/glo.h
Xfloppy.s:	$K/proc.h
Xfloppy.s:	$K/floppy.c
X	$(CC) $(CFLAGS) -c $K/floppy.c
X
Xmain.s:		$K/const.h $K/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:		$K/glo.h
Xmain.s:		$K/proc.h
Xmain.s:		$K/main.c
X	$(CC) $(CFLAGS) -c $K/main.c
X
Xmemory.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xmemory.s:	$H/callnr.h
Xmemory.s:	$H/com.h
Xmemory.s:	$H/error.h
Xmemory.s:	$K/proc.h
Xmemory.s:	$K/memory.c
X	$(CC) $(CFLAGS) -c $K/memory.c
X
Xprinter.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xprinter.s:	$H/callnr.h
Xprinter.s:	$H/com.h
Xprinter.s:	$H/error.h
Xprinter.s:	$K/proc.h
Xprinter.s:	$K/glo.h
Xprinter.s:	$K/printer.c
X	$(CC) $(CFLAGS) -c $K/printer.c
X
Xproc.s:		$K/const.h $K/type.h $H/const.h $H/type.h
Xproc.s:		$H/callnr.h
Xproc.s:		$H/com.h
Xproc.s:		$H/error.h
Xproc.s:		$K/glo.h
Xproc.s:		$K/proc.h
Xproc.s:		$K/proc.c
X	$(CC) $(CFLAGS) -c $K/proc.c
X
Xrs232.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xrs232.s:	$H/callnr.h
Xrs232.s:	$H/com.h
Xrs232.s:	$H/error.h
Xrs232.s:	$H/sgtty.h
Xrs232.s:	$H/signal.h
Xrs232.s:	$K/glo.h
Xrs232.s:	$K/proc.h
Xrs232.s:	$K/rs232.c
X	$(CC) $(CFLAGS) -c $K/rs232.c
X
Xsystem.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xsystem.s:	$H/callnr.h
Xsystem.s:	$H/com.h
Xsystem.s:	$H/error.h
Xsystem.s:	$H/signal.h
Xsystem.s:	$K/glo.h
Xsystem.s:	$K/proc.h
Xsystem.s:	$K/system.c
X	$(CC) $(CFLAGS) -c $K/system.c
X
Xtable.s:	$K/const.h $K/type.h $H/const.h $H/type.h $H/com.h
Xtable.s:	$K/glo.h
Xtable.s:	$K/proc.h
Xtable.s:	$K/table.c
X	$(CC) $(CFLAGS) -c $K/table.c
X
Xtty.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xtty.s:	$H/callnr.h
Xtty.s:	$H/com.h
Xtty.s:	$H/error.h
Xtty.s:	$H/sgtty.h
Xtty.s:	$H/signal.h
Xtty.s:	$K/glo.h
Xtty.s:	$K/proc.h
Xtty.s:	$K/tty.c
Xtty.s:	$K/ttymaps.h
X	$(CC) $(CFLAGS) -c $K/tty.c
X
Xwini.s:	$K/const.h $K/type.h $H/const.h $H/type.h
Xwini.s:	$H/callnr.h
Xwini.s:	$H/com.h
Xwini.s:	$H/error.h
Xwini.s:	$K/proc.h
Xwini.s:	$K/wini.c
X	$(CC) $(CFLAGS) -c $K/wini.c
X
Xamoeba.s: $A/amoeba.h
Xamoeba.s: $A/host_os.h
Xamoeba.s: $A/amparam.h
Xamoeba.s: $H/signal.h
Xamoeba.s: $H/type.h
Xamoeba.s: ./assert.h
Xamoeba.s: ./byteorder.h
Xamoeba.s: $K/const.h
Xamoeba.s: ./dp8390info.h
Xamoeba.s: ./etherformat.h
Xamoeba.s: $K/glo.h
Xamoeba.s: ./global.h
Xamoeba.s: ./internet.h
Xamoeba.s: ./mpx.H
Xamoeba.s: ./portcache.H
Xamoeba.s: $K/proc.h
Xamoeba.s: ./task.h
Xamoeba.s: ./trans.H
Xamoeba.s: $K/type.h
Xamoeba.s: amoeba.c
Xconf.s: $A/amoeba.h
Xconf.s: $A/host_os.h
Xconf.s: $H/type.h
Xconf.s: ./conf.h
Xconf.s: ./global.h
Xconf.s: ./mpx.H
Xconf.s: ./portcache.H
Xconf.s: ./task.h
Xconf.s: ./trans.H
Xconf.s: conf.c
Xdp8390.s: $H/com.h
Xdp8390.s: $H/const.h
Xdp8390.s: $H/error.h
Xdp8390.s: $H/type.h
Xdp8390.s: ./assert.h
Xdp8390.s: $K/const.h
Xdp8390.s: ./dp8390.h
Xdp8390.s: ./dp8390info.h
Xdp8390.s: ./dp8390stat.h
Xdp8390.s: ./etherformat.h
Xdp8390.s: ./internet.h
Xdp8390.s: dp8390.c
Xetherplus.s: $H/com.h
Xetherplus.s: $H/const.h
Xetherplus.s: $H/type.h
Xetherplus.s: ./assert.h
Xetherplus.s: $K/const.h
Xetherplus.s: ./dp8390.h
Xetherplus.s: ./dp8390info.h
Xetherplus.s: ./eplinfo.h
Xetherplus.s: ./etherformat.h
Xetherplus.s: ./etherplus.h
Xetherplus.s: ./internet.h
Xetherplus.s: etherplus.c
Xportcache.s: $A/amoeba.h
Xportcache.s: $H/const.h
Xportcache.s: $A/host_os.h
Xportcache.s: $H/type.h
Xportcache.s: ./assert.h
Xportcache.s: ./conf.h
Xportcache.s: $K/const.h
Xportcache.s: ./global.h
Xportcache.s: ./internet.h
Xportcache.s: ./mpx.H
Xportcache.s: ./portcache.H
Xportcache.s: ./task.h
Xportcache.s: ./trans.H
Xportcache.s: portcache.c
Xtrans.s: $A/amoeba.h
Xtrans.s: $H/const.h
Xtrans.s: $A/host_os.h
Xtrans.s: $H/type.h
Xtrans.s: ./amstat.h
Xtrans.s: ./assert.h
Xtrans.s: ./byteorder.h
Xtrans.s: $K/const.h
Xtrans.s: ./exception.h
Xtrans.s: ./global.h
Xtrans.s: ./internet.h
Xtrans.s: ./mpx.H
Xtrans.s: ./portcache.H
Xtrans.s: ./task.h
Xtrans.s: ./trans.H
Xtrans.s: trans.c
Xutil.s: $H/com.h
Xutil.s: $H/const.h
Xutil.s: $H/type.h
Xutil.s: ./assert.h
Xutil.s: $K/const.h
Xutil.s: ./dp8390.h
Xutil.s: ./dp8390info.h
Xutil.s: ./eplinfo.h
Xutil.s: $K/proc.h
Xutil.s: $K/type.h
Xutil.s: util.c
X
+ END-OF-FILE amoeba:ker:makef
chmod 'u=rw,g=r,o=r' 'amoeba:ker:makef'
set `wc -c 'amoeba:ker:makef'`
count=$1
case $count in
7147)	:;;
*)	echo 'Bad character count in ''amoeba:ker:makef' >&2
		echo 'Count should be 7147' >&2
esac
echo Extracting 'at_makefile.cdif'
sed 's/^X//' > 'at_makefile.cdif' << '+ END-OF-FILE ''at_makefile.cdif'
X*** /local/ast/minix/tape3c/kernel/at_makefile	Mon Sep 26 23:34:01 1988
X--- at_makefile	Mon Oct  3 15:39:20 1988
X***************
X*** 90,95 ****
X--- 90,105 ----
X  proc.s:		glo.h
X  proc.s:		proc.h
X  
X+ rs232.s:	const.h type.h $h/const.h $h/type.h
X+ rs232.s:	$h/callnr.h
X+ rs232.s:	$h/com.h
X+ rs232.s:	$h/error.h
X+ rs232.s:	$h/sgtty.h
X+ rs232.s:	$h/signal.h
X+ rs232.s:	glo.h
X+ rs232.s:	proc.h
X+ rs232.s:	tty.h
X+ 
X  system.s:	const.h type.h $h/const.h $h/type.h
X  system.s:	$h/callnr.h
X  system.s:	$h/com.h
+ END-OF-FILE at_makefile.cdif
chmod 'u=rw,g=r,o=r' 'at_makefile.cdif'
set `wc -c 'at_makefile.cdif'`
count=$1
case $count in
503)	:;;
*)	echo 'Bad character count in ''at_makefile.cdif' >&2
		echo 'Count should be 503' >&2
esac
echo Extracting 'changemem'
sed 's/^X//' > 'changemem' << '+ END-OF-FILE ''changemem'
X: Increase default stack size from 2K.
Xb=/usr/bin
Xl=/usr/lib
Xt=../test
Xchmem =50000 $b/ar
Xchmem =16000 $b/ast
Xchmem =60000 $b/asld
Xchmem =3000  $b/cc
Xchmem =35000 $l/cem
Xchmem =30000 $l/cg
Xchmem =16000 $b/cp
Xchmem =60000 $b/cdiff
Xchmem =64000 $b/compress
Xchmem =64000 $b/cpdir
Xchmem =30000 $l/cpp
Xchmem =40000 $b/dd
Xchmem =32000 $b/du
Xchmem =60000 $b/diff
Xchmem =8000  $b/df
Xchmem =32000 $b/dosread
Xchmem =60000 $b/ed
Xchmem =8000  $b/fgrep
Xchmem =50000 $b/file
Xchmem =50000 $b/find
Xchmem =60000 $b/fix
Xchmem =8000  $b/grep
Xchmem =8000  $b/gres
Xchmem =8000  $b/head
Xchmem =64000 $b/libpack
Xchmem =64000 $b/libupack
Xchmem =20000 $b/make
Xchmem =64000 $b/mined
Xchmem =8000  $b/mkdir
Xchmem =40000 $b/mkfs
Xchmem =8000  $b/mv
Xchmem =16000 $b/nm
Xchmem =40000 $l/opt
Xchmem =8000  $b/paste
Xchmem =32000 $b/pr
Xchmem =8000  $b/prep
Xchmem =50000 $b/readfs
Xchmem =8000  $b/rm
Xchmem =8000  $b/rmdir
Xchmem =16000  $b/roff
Xchmem =16000  $b/strings
Xchmem =12000 $b/sh
Xchmem =8000  $b/shar
Xchmem =60000 $b/sort
Xchmem =16000 $b/strip
Xchmem =8000  $b/tail
Xchmem =8000  $b/time
Xchmem =60000 $b/treecmp
Xchmem =8000  $t/t10a
Xchmem =8000  $t/t11a
Xchmem =8000  $t/t11b
Xchmem =8000  $b/uniq
Xchmem =8000  $b/uuencode
Xchmem =8000  $b/uudecode
Xchmem =8000  $b/wc
Xfor i in 1 2 3 4 5 6 7 8 9 10
Xdo chmem =8000 ../test/test$i
Xdone
+ END-OF-FILE changemem
chmod 'u=rwx,g=rx,o=rx' 'changemem'
set `wc -c 'changemem'`
count=$1
case $count in
1298)	:;;
*)	echo 'Bad character count in ''changemem' >&2
		echo 'Count should be 1298' >&2
esac
echo Extracting 'pc_makefile.cdif'
sed 's/^X//' > 'pc_makefile.cdif' << '+ END-OF-FILE ''pc_makefile.cdif'
X*** /local/ast/minix/tape3c/kernel/pc_makefile	Tue Sep 27 08:51:15 1988
X--- pc_makefile	Mon Oct  3 15:39:21 1988
X***************
X*** 92,97 ****
X--- 92,107 ----
X  proc.s:		glo.h
X  proc.s:		proc.h
X  
X+ rs232.s:	const.h type.h $h/const.h $h/type.h
X+ rs232.s:	$h/callnr.h
X+ rs232.s:	$h/com.h
X+ rs232.s:	$h/error.h
X+ rs232.s:	$h/sgtty.h
X+ rs232.s:	$h/signal.h
X+ rs232.s:	glo.h
X+ rs232.s:	proc.h
X+ rs232.s:	tty.h
X+ 
X  system.s:	const.h type.h $h/const.h $h/type.h
X  system.s:	$h/callnr.h
X  system.s:	$h/com.h
+ END-OF-FILE pc_makefile.cdif
chmod 'u=rw,g=r,o=r' 'pc_makefile.cdif'
set `wc -c 'pc_makefile.cdif'`
count=$1
case $count in
503)	:;;
*)	echo 'Bad character count in ''pc_makefile.cdif' >&2
		echo 'Count should be 503' >&2
esac
echo Extracting 'portio.s'
sed 's/^X//' > 'portio.s' << '+ END-OF-FILE ''portio.s'
X.define _port_out, _port_in, _peek
X
X| These routines are used by the kernel to write and read I/O ports.
X| They can also be called by user programs
X
X| port_out(port, value) writes 'value' on the I/O port 'port'.
X
X_port_out:
X	push bx			| save bx
X	mov bx,sp		| index off bx
X	push ax			| save ax
X	push dx			| save dx
X	mov dx,4(bx)		| dx = port
X	mov ax,6(bx)		| ax = value
X	out			| output 1 byte
X	pop dx			| restore dx
X	pop ax			| restore ax
X	pop bx			| restore bx
X	ret			| return to caller
X
X
X
X| port_in(port, &value) reads from port 'port' and puts the result in 'value'.
X_port_in:
X	push bx			| save bx
X	mov bx,sp		| index off bx
X	push ax			| save ax
X	push dx			| save dx
X	mov dx,4(bx)		| dx = port
X	in			| input 1 byte
X	xorb ah,ah		| clear ah
X	mov bx,6(bx)		| fetch address where byte is to go
X	mov (bx),ax		| return byte to caller in param
X	pop dx			| restore dx
X	pop ax			| restore ax
X	pop bx			| restore bx
X	ret			| return to caller
X
X| value = peek(segment, offset)
X_peek:
X	push bp			| save bp
X	mov bp,sp		| we need to access parameters
X	push es			| save es
X	mov es,4(bp)		| load es with segment value
X	mov bx,6(bp)		| load bx with offset from segment
X	seg es			| go get the byte
X	movb al,(bx)		| al = byte
X	xorb ah,ah		| ax = byte
X	pop es			| restore es
X	pop bp			| restore bp
X	ret			| return to caller
+ END-OF-FILE portio.s
chmod 'u=rw,g=r,o=r' 'portio.s'
set `wc -c 'portio.s'`
count=$1
case $count in
1305)	:;;
*)	echo 'Bad character count in ''portio.s' >&2
		echo 'Count should be 1305' >&2
esac
echo Extracting 'proc.c.cdif'
sed 's/^X//' > 'proc.c.cdif' << '+ END-OF-FILE ''proc.c.cdif'
X*** /local/ast/minix/tape3c/kernel/proc.c	Tue Sep 27 08:51:16 1988
X--- proc.c	Mon Oct  3 15:39:22 1988
X***************
X*** 243,249 ****
X    /* If MM has just blocked and there are kernel signals pending, now is the
X     * time to tell MM about them, since it will be able to accept the message.
X     */
X!   if (sig_procs > 0 && caller == MM_PROC_NR && src == ANY) inform();
X    return(OK);
X  }
X  
X--- 243,252 ----
X    /* If MM has just blocked and there are kernel signals pending, now is the
X     * time to tell MM about them, since it will be able to accept the message.
X     */
X!   if (sig_procs > 0 && caller == MM_PROC_NR && src == ANY) {
X! 	inform();
X! 	pick_proc();
X!   }
X    return(OK);
X  }
X  
+ END-OF-FILE proc.c.cdif
chmod 'u=rw,g=r,o=r' 'proc.c.cdif'
set `wc -c 'proc.c.cdif'`
count=$1
case $count in
702)	:;;
*)	echo 'Bad character count in ''proc.c.cdif' >&2
		echo 'Count should be 702' >&2
esac
echo Extracting 'system.c.cdif'
sed 's/^X//' > 'system.c.cdif' << '+ END-OF-FILE ''system.c.cdif'
X*** /local/ast/minix/tape3c/kernel/system.c	Tue Sep 27 08:51:19 1988
X--- system.c	Mon Oct  3 15:39:23 1988
X***************
X*** 136,141 ****
X--- 136,143 ----
X    while (bytes--) *dptr++ = *sptr++;	/* copy parent struct to child */
X  
X    rpc->p_flags |= NO_MAP;	/* inhibit the process from running */
X+   rpc->p_flags &= ~PENDING;	/* only one in group should have PENDING */
X+   rpc->p_pending = 0;
X    rpc->p_pid = pid;		/* install child's pid */
X    rpc->p_reg[RET_REG] = 0;	/* child sees pid = 0 to know it is child */
X  
X***************
X*** 271,276 ****
X--- 273,279 ----
X  		}
X  	}
X    }
X+   if (rc->p_flags & PENDING) --sig_procs;
X    rc->p_flags = P_SLOT_FREE;
X    return(OK);
X  }
+ END-OF-FILE system.c.cdif
chmod 'u=rw,g=r,o=r' 'system.c.cdif'
set `wc -c 'system.c.cdif'`
count=$1
case $count in
686)	:;;
*)	echo 'Bad character count in ''system.c.cdif' >&2
		echo 'Count should be 686' >&2
esac
exit 0