From: julian@tfs.com (Julian Elischer)
Subject: New scsi system beta3 (part 1 of       10)
Organization: TRW Financial Systems
Date: Sat, 3 Oct 1992 04:00:06 GMT

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	ddb/db_command.c.patch
#	kern/kern_subr.c.patch
#	i386/isa/clock.c.patch
#	i386/conf/Makefile.i386.patch
#	i386/i386/conf.c.patch
#	i386/isa/isa.h.patch
#	i386/conf/devices.i386.patch
#	i386/conf/files.i386.patch
#	MAKEDEV
#
echo x - ddb/db_command.c.patch
sed 's/^X//' >ddb/db_command.c.patch << 'END-of-ddb/db_command.c.patch'
X*** /usr/src/syschanges/sys.originals/ddb/db_command.c	Thu Apr 16 00:00:20 1992
X--- /usr/src/sys.386bsd/ddb/db_command.c	Sun Aug 23 16:10:49 1992
X***************
X*** 515,531 ****
X  			 args[5], args[6], args[7], args[8], args[9] );
X  	db_printf("%#n\n", retval);
X  }
X- 
X- int
X- strcmp(s1, s2)
X- 	register const char *s1, *s2;
X- {
X- 	while (*s1 == *s2++)
X- 		if (*s1++ == 0)
X- 			return (0);
X- 	return (*(unsigned char *)s1 - *(unsigned char *)--s2);
X- }
X- 
X- 		
X- 
X- 	
X--- 515,517 ----
END-of-ddb/db_command.c.patch
echo x - kern/kern_subr.c.patch
sed 's/^X//' >kern/kern_subr.c.patch << 'END-of-kern/kern_subr.c.patch'
X*** /usr/src/syschanges/sys.originals/kern/kern_subr.c	Mon Jul 13 07:24:35 1992
X--- /usr/src/sys.386bsd/kern/kern_subr.c	Sun Aug 23 16:11:29 1992
X***************
X*** 199,204 ****
X--- 199,220 ----
X  	*to = '\0';
X  }
X  
X+ 
X+ int
X+ strcmp(s1, s2)
X+ 	register const char *s1, *s2;
X+ {
X+ 	while (*s1 == *s2++)
X+ 		if (*s1++ == 0)
X+ 			return (0);
X+ 	return (*(unsigned char *)s1 - *(unsigned char *)--s2);
X+ }
X+ 
X+ 		
X+ 
X+ 	
X+ 
X+ 
X  #ifndef lint	/* unused except by ct.c, other oddities XXX */
X  /*
X   * Get next character written in by user from uio.
END-of-kern/kern_subr.c.patch
echo x - i386/isa/clock.c.patch
sed 's/^X//' >i386/isa/clock.c.patch << 'END-of-i386/isa/clock.c.patch'
X*** /usr/src/syschanges/sys.originals/i386/isa/clock.c	Tue Dec 24 14:23:38 1991
X--- /usr/src/sys.386bsd/i386/isa/clock.c	Sun Aug 23 20:27:24 1992
X***************
X*** 49,62 ****
X  
X  #define DAYST 119
X  #define DAYEN 303
X  
X  startrtclock() {
X  	int s;
X  
X  	/* initialize 8253 clock */
X  	outb (IO_TIMER1+3, 0x36);
X! 	outb (IO_TIMER1, 1193182/hz);
X! 	outb (IO_TIMER1, (1193182/hz)/256);
X  
X  	/* initialize brain-dead battery powered clock */
X  	outb (IO_RTC, RTC_STATUSA);
X--- 49,65 ----
X  
X  #define DAYST 119
X  #define DAYEN 303
X+ #define XTALSPEED 1193182
X  
X  startrtclock() {
X  	int s;
X  
X+ 	findcpuspeed();		/* use the clock (while it's free)
X+ 					to find the cpu speed */
X  	/* initialize 8253 clock */
X  	outb (IO_TIMER1+3, 0x36);
X! 	outb (IO_TIMER1, XTALSPEED/hz);
X! 	outb (IO_TIMER1, (XTALSPEED/hz)/256);
X  
X  	/* initialize brain-dead battery powered clock */
X  	outb (IO_RTC, RTC_STATUSA);
X***************
X*** 71,76 ****
X--- 74,105 ----
X  	outb (IO_RTC+1, 0);
X  }
X  
X+ unsigned int delaycount;	/* calibrated loop variable (1 millisecond) */
X+ 
X+ #define FIRST_GUESS	0x2000
X+ findcpuspeed()
X+ {
X+ 	unsigned char low;
X+ 	unsigned int remainder;
X+ 
X+ 	/* Put counter in count down mode */
X+ 	outb(IO_TIMER1+3, 0x34);
X+ 	outb(IO_TIMER1, 0xff);
X+ 	outb(IO_TIMER1, 0xff);
X+ 	delaycount = FIRST_GUESS;
X+ 	spinwait(1);
X+ 	/* Read the value left in the counter */
X+ 	low 	= inb(IO_TIMER1);	/* least siginifcant */
X+ 	remainder = inb(IO_TIMER1);	/* most significant */
X+ 	remainder = (remainder<<8) + low ;
X+ 	/* Formula for delaycount is :
X+ 	 *  (loopcount * timer clock speed)/ (counter ticks * 1000)
X+ 	 */
X+ 	delaycount = (FIRST_GUESS * (XTALSPEED/1000)) / (0xffff-remainder);
X+ }
X+ 
X+ 
X+ 
X  /* convert 2 digit BCD number */
X  bcd(i)
X  int i;
X***************
X*** 204,206 ****
X--- 233,249 ----
X  	setidt(ICU_OFFSET+0, &V(clk), SDT_SYS386IGT, SEL_KPL);
X  	splnone();
X  }
X+ 
X+ 
X+ 
X+ 
X+ spinwait(millisecs)
X+ int millisecs;		/* number of milliseconds to delay */
X+ {
X+ 	int i, j;
X+ 
X+ 	for (i=0;i<millisecs;i++)
X+ 		for (j=0;j<delaycount;j++)
X+ 			;
X+ }
X+ 
END-of-i386/isa/clock.c.patch
echo x - i386/conf/Makefile.i386.patch
sed 's/^X//' >i386/conf/Makefile.i386.patch << 'END-of-i386/conf/Makefile.i386.patch'
X*** /usr/src/syschanges/sys.originals/i386/conf/Makefile.i386	Mon Feb 24 14:52:46 1992
X--- /usr/src/sys.386bsd/i386/conf/Makefile.i386	Mon Aug 24 13:02:30 1992
X***************
X*** 38,44 ****
X  SYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o
X  SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
X  SYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
X! SYSTEM_LD= @${LD} -z -T FE000000 -o $@ -X ${SYSTEM_OBJS}
X  SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; size $@; chmod 755 $@
X  
X  %OBJS
X--- 38,44 ----
X  SYSTEM_OBJS=locore.o ${OBJS} param.o ioconf.o conf.o
X  SYSTEM_DEP=Makefile symbols.sort ${SYSTEM_OBJS}
X  SYSTEM_LD_HEAD= 	@echo loading $@; rm -f $@
X! SYSTEM_LD= @${LD} -z -T FE000000 -o $@ -X vers.o ${SYSTEM_OBJS}
X  SYSTEM_LD_TAIL= @echo rearranging symbols; symorder symbols.sort $@; size $@; chmod 755 $@
X  
X  %OBJS
X***************
X*** 63,71 ****
X  
X  locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
X  	machine/pte.h vector.s ${I386}/isa/icu.s ${I386}/isa/isa.h \
X! 	${I386}/isa/icu.h
X  	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
X  		${AS} ${ASFLAGS} -o locore.o
X  
X  # the following is necessary because autoconf.o depends on #if GENERIC
X  autoconf.o: Makefile
X--- 63,74 ----
X  
X  locore.o: assym.s ${I386}/i386/locore.s machine/trap.h machine/psl.h \
X  	machine/pte.h vector.s ${I386}/isa/icu.s ${I386}/isa/isa.h \
X! 	${I386}/isa/icu.h vers.o
X  	${CPP} -I. -DLOCORE ${COPTS} ${I386}/i386/locore.s | \
X  		${AS} ${ASFLAGS} -o locore.o
X+ 
X+ vers.c:	Makefile
X+ 	sh ../../conf/newvers.sh
X  
X  # the following is necessary because autoconf.o depends on #if GENERIC
X  autoconf.o: Makefile
END-of-i386/conf/Makefile.i386.patch
echo x - i386/i386/conf.c.patch
sed 's/^X//' >i386/i386/conf.c.patch << 'END-of-i386/i386/conf.c.patch'
X*** /usr/src/syschanges/sys.originals/i386/i386/conf.c	Sat May 30 16:48:08 1992
X--- /usr/src/sys.386bsd/i386/i386/conf.c	Wed Sep 23 01:41:37 1992
X***************
X*** 74,79 ****
X--- 74,122 ----
X  #define	assize		NULL
X  #endif
X  
X+ #include "sd.h"
X+ #if NSD > 0
X+ int	sdopen(),sdclose(),sdstrategy(),sdioctl();
X+ int	/*sddump(),*/sdsize();
X+ #define	sddump		enxio
X+ #else
X+ #define	sdopen		enxio
X+ #define	sdclose		enxio
X+ #define	sdstrategy	enxio
X+ #define	sdioctl		enxio
X+ #define	sddump		enxio
X+ #define	sdsize		NULL
X+ #endif
X+ 
X+ #include "st.h"
X+ #if NST > 0
X+ int	stopen(),stclose(),ststrategy(),stioctl();
X+ /*int	stdump(),stsize();*/
X+ #define	stdump		enxio
X+ #define	stsize		NULL
X+ #else
X+ #define	stopen		enxio
X+ #define	stclose		enxio
X+ #define	ststrategy	enxio
X+ #define	stioctl		enxio
X+ #define	stdump		enxio
X+ #define	stsize		NULL
X+ #endif
X+ 
X+ #include "cd.h"
X+ #if NCD > 0
X+ int	cdopen(),cdclose(),cdstrategy(),cdioctl();
X+ int	/*cddump(),*/cdsize();
X+ #define	cddump		enxio
X+ #else
X+ #define	cdopen		enxio
X+ #define	cdclose		enxio
X+ #define	cdstrategy	enxio
X+ #define	cdioctl		enxio
X+ #define	cddump		enxio
X+ #define	cdsize		NULL
X+ #endif
X+ 
X  #include "wt.h"
X  #if NWT > 0
X  int	wtopen(),wtclose(),wtstrategy(),wtioctl();
X***************
X*** 114,121 ****
X--- 157,173 ----
X  	  fddump,	fdsize,		NULL },
X  	{ wtopen,	wtclose,	wtstrategy,	wtioctl,	/*3*/
X  	  wtdump,	wtsize,		B_TAPE },
X+ #if NSD > 0
X+ 	{ sdopen,	sdclose,	sdstrategy,	sdioctl,	/*4*/
X+ 	  sddump,	sdsize,		NULL },
X+ #else NSD > 0
X  	{ asopen,	asclose,	asstrategy,	asioctl,	/*4*/
X  	  asdump,	assize,		NULL },
X+ #endif NSD > 0
X+ 	{ stopen,	stclose,	ststrategy,	stioctl,	/*5*/
X+ 	  stdump,	stsize,		NULL },
X+ 	{ cdopen,	cdclose,	cdstrategy,	cdioctl,	/*6*/
X+ 	  cddump,	cdsize,		NULL },
X  };
X  int	nblkdev = sizeof (bdevsw) / sizeof (bdevsw[0]);
X  
X***************
X*** 211,219 ****
X--- 263,283 ----
X  	{ pcopen,	pcclose,	pcread,		pcwrite,	/*C*/
X  	  pcioctl,	nullop,		nullop,		&pccons,
X  	  ttselect,	pcmmap,		NULL },
X+ #if	NSD > 0
X+ 	{ sdopen,	sdclose,	rawread,	rawwrite,	/*D*/
X+ 	  sdioctl,	enodev,		nullop,		NULL,
X+ 	  seltrue,	enodev,		sdstrategy },
X+ #else	NSD > 0
X  	{ asopen,	asclose,	rawread,	rawwrite,	/*D*/
X  	  asioctl,	enodev,		nullop,		NULL,
X  	  seltrue,	enodev,		asstrategy },
X+ #endif	NSD > 0
X+ 	{ stopen,	stclose,	rawread,	rawwrite,	/*E*/
X+ 	  stioctl,	enodev,		nullop,		NULL,
X+ 	  seltrue,	enodev,		ststrategy },
X+ 	{ cdopen,	cdclose,	rawread,	enodev,		/*F*/
X+ 	  cdioctl,	enodev,		nullop,		NULL,
X+ 	  seltrue,	enodev,		cdstrategy },
X  };
X  int	nchrdev = sizeof (cdevsw) / sizeof (cdevsw[0]);
X  
END-of-i386/i386/conf.c.patch
echo x - i386/isa/isa.h.patch
sed 's/^X//' >i386/isa/isa.h.patch << 'END-of-i386/isa/isa.h.patch'
X*** /usr/src/syschanges/sys.originals/i386/isa/isa.h	Tue May 12 21:51:02 1992
X--- /usr/src/sys.386bsd/i386/isa/isa.h	Sat Sep 26 18:35:12 1992
X***************
X*** 86,93 ****
X  					/* 0x280 - 0x2F7 Open */
X  
X  #define IO_COM2		0x2f8		/* COM2 i/o address */
X  
X! 					/* 0x300 - 0x36F Open */
X  
X  #define IO_FD2		0x370		/* secondary base i/o address */
X  #define IO_LPT1		0x378		/* Parallel Port #1 */
X--- 86,98 ----
X  					/* 0x280 - 0x2F7 Open */
X  
X  #define IO_COM2		0x2f8		/* COM2 i/o address */
X+ 					/* 0x300 - 0x32F Open */
X  
X! #define	IO_BT0		0x330		/* bustek 742a default addr. */
X! #define	IO_AHA0		0x330		/* adaptec 1542 default addr. */
X! #define	IO_BT1		0x334		/* bustek 742a default addr. */
X! #define	IO_AHA1		0x334		/* adaptec 1542 default addr. */
X! 					/* 0x338 - 0x36F Open */
X  
X  #define IO_FD2		0x370		/* secondary base i/o address */
X  #define IO_LPT1		0x378		/* Parallel Port #1 */
END-of-i386/isa/isa.h.patch
echo x - i386/conf/devices.i386.patch
sed 's/^X//' >i386/conf/devices.i386.patch << 'END-of-i386/conf/devices.i386.patch'
X*** /usr/src/syschanges/sys.originals/i386/conf/devices.i386	Thu Jun 11 14:09:16 1992
X--- /usr/src/sys.386bsd/i386/conf/devices.i386	Wed Sep 16 21:59:36 1992
X***************
X*** 2,5 ****
X--- 2,6 ----
X  dk	1
X  fd	2
X  wt	3
X+ sd	4
X  as	4
END-of-i386/conf/devices.i386.patch
echo x - i386/conf/files.i386.patch
sed 's/^X//' >i386/conf/files.i386.patch << 'END-of-i386/conf/files.i386.patch'
X*** /usr/src/syschanges/sys.originals/i386/conf/files.i386	Mon May 25 12:25:04 1992
X--- /usr/src/sys.386bsd/i386/conf/files.i386	Fri Oct  2 00:22:42 1992
X***************
X*** 25,27 ****
X--- 25,35 ----
X  i386/i386/db_disasm.c	optional ddb
X  i386/i386/db_interface.c	optional ddb
X  i386/i386/db_trace.c	optional ddb
X+ i386/isa/aha1742.c	optional ahb
X+ i386/isa/aha1542.c	optional aha
X+ i386/isa/bt742a.c	optional bt
X+ scsi/st.c		optional st
X+ scsi/sd.c		optional sd
X+ scsi/cd.c		optional cd
X+ scsi/ch.c		optional ch
X+ scsi/scsiconf.c		optional scbus
END-of-i386/conf/files.i386.patch
echo x - MAKEDEV
sed 's/^X//' >MAKEDEV << 'END-of-MAKEDEV'
X#!/bin/sh -
X#
X# Copyright (c) 1990 The Regents of the University of California.
X# All rights reserved.
X#
X# Written and contributed by W. Jolitz 12/90
X#
X# Redistribution and use in source and binary forms are permitted provided
X# that: (1) source distributions retain this entire copyright notice and
X# comment, and (2) distributions including binaries display the following
X# acknowledgement:  ``This product includes software developed by the
X# University of California, Berkeley and its contributors'' in the
X# documentation or other materials provided with the distribution and in
X# all advertising materials mentioning features or use of this software.
X# Neither the name of the University nor the names of its contributors may
X# be used to endorse or promote products derived from this software without
X# specific prior written permission.
X# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
X# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
X# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
X#
X#	@(#)MAKEDEV	5.2 (Berkeley) 6/22/90
X#
X# Device "make" file.  Valid arguments:
X#	std	standard devices
X#	local	configuration specific devices
X#
X# Tapes:
X#	wt*	QIC-interfaced (e.g. not SCSI) 3M cartridge tape
X#	st*	"NEW type scsi tapes"
X#
X# Disks:
X#	wd*	"winchester" disk drives (ST506,IDE,ESDI,RLL,...)
X#	fd*	"floppy" disk drives (3 1/2", 5 1/4")
X#	as*	"SCSI" disk/tape/CDROM drives
X#	sd*	"NEW type scsi disks"
X#
X# Terminal ports:
X#	com*	standard PC COM ports
X#
X# Pseudo terminals:
X#	pty*	set of 16 master and slave pseudo terminals
X#
X# Printers:
X#
X# Call units:
X#
X# Special purpose devices:
X#	flog*	kernel logging device
X#
X
XPATH=/sbin:/bin/:/usr/bin:/usr/sbin:
Xumask 77
Xfor i
Xdo
Xcase $i in
X
Xstd)
X	rm -f console drum mem kmdem null tty klog stdin stdout stderr
X	mknod console		c 0 0
X	mknod drum		c 4 0	; chmod 640 drum ; chgrp kmem drum
X	mknod kmem		c 2 1	; chmod 640 kmem ; chgrp kmem kmem
X	mknod mem		c 2 0	; chmod 640 mem ; chgrp kmem mem
X	mknod null		c 2 2	; chmod 666 null
X	mknod tty		c 1 0	; chmod 666 tty
X	mknod klog		c 7 0	; chmod 600 klog
X	mknod stdin		c 53 0	; chmod 666 stdin
X	mknod stdout		c 53 1	; chmod 666 stdout
X	mknod stderr		c 53 2	; chmod 666 stderr
X	rm -f fd/*
X	mkdir fd > /dev/null 2>&1
X	(cd fd && eval `echo "" | awk ' BEGIN { \
X		for (i = 0; i < 64; i++) \
X	 		printf("mknod %d c 53 %d;", i, i)}'`)
X	chown -R bin.bin fd
X	chmod 555 fd
X	chmod 666 fd/*
X	;;
X
Xwt*)
X	umask 2
X	mknod wt0 b 3 0
X	mknod rwt0 c 10 0
X	umask 77
X	;;
X
Xst*)
X	umask 2 ; unit=`expr $i : '..\(.*\)'`
X	case $i in
X	st*) name=st;  chr=14;;
X	esac
X	rm -f r$name$unit nr$name$unit er$name$unit enr$name$unit 
X	case $unit in
X	0|1|2|3|4|5|6)
X		mknod r${name}${unit}	c $chr `expr $unit '*' 16 + 0`
X		mknod nr${name}${unit}	c $chr `expr $unit '*' 16 + 1`
X		mknod er${name}${unit}	c $chr `expr $unit '*' 16 + 2`
X		mknod enr${name}${unit}	c $chr `expr $unit '*' 16 + 3`
X		chgrp operator r${name}${unit} nr${name}${unit} \
X			er${name}${unit} enr${name}${unit} 
X		chmod 640 r${name}${unit} nr${name}${unit} \
X			er${name}${unit} enr${name}${unit} 
X		;;
X	*)
X		echo bad unit for tape in: $i
X		;;
X	esac
X	umask 77
X	;;
X
Xcd*)
X	umask 2 ; unit=`expr $i : '..\(.*\)'`
X	case $i in
X	cd*) name=cd; blk=6; chr=15;;
X	esac
X	rm -f $name$unit? r$name$unit?
X	case $unit in
X	0|1|2|3|4|5|6)
X		mknod ${name}${unit}a	b $blk `expr $unit '*' 8 + 0`
X		mknod ${name}${unit}d	b $blk `expr $unit '*' 8 + 3`
X		mknod r${name}${unit}a	c $chr `expr $unit '*' 8 + 0`
X		mknod r${name}${unit}d	c $chr `expr $unit '*' 8 + 3`
X		chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
X		chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
X		;;
X	*)
X		echo bad unit for disk in: $i
X		;;
X	esac
X	umask 77
X	;;
Xfd*|wd*|as*|sd*)
X	umask 2 ; unit=`expr $i : '..\(.*\)'`
X	case $i in
X	fd*) name=fd; blk=2; chr=9;;
X	wd*) name=wd; blk=0; chr=3;;
X	as*) name=as; blk=4; chr=13;;
X	sd*) name=sd; blk=4; chr=13;;
X	esac
X	rm -f $name$unit? r$name$unit?
X	case $unit in
X	0|1|2|3|4|5|6)
X		mknod ${name}${unit}a	b $blk `expr $unit '*' 8 + 0`
X		mknod ${name}${unit}b	b $blk `expr $unit '*' 8 + 1`
X		mknod ${name}${unit}c	b $blk `expr $unit '*' 8 + 2`
X		mknod ${name}${unit}d	b $blk `expr $unit '*' 8 + 3`
X		mknod ${name}${unit}e	b $blk `expr $unit '*' 8 + 4`
X		mknod ${name}${unit}f	b $blk `expr $unit '*' 8 + 5`
X		mknod ${name}${unit}g	b $blk `expr $unit '*' 8 + 6`
X		mknod ${name}${unit}h	b $blk `expr $unit '*' 8 + 7`
X		mknod r${name}${unit}a	c $chr `expr $unit '*' 8 + 0`
X		mknod r${name}${unit}b	c $chr `expr $unit '*' 8 + 1`
X		mknod r${name}${unit}c	c $chr `expr $unit '*' 8 + 2`
X		mknod r${name}${unit}d	c $chr `expr $unit '*' 8 + 3`
X		mknod r${name}${unit}e	c $chr `expr $unit '*' 8 + 4`
X		mknod r${name}${unit}f	c $chr `expr $unit '*' 8 + 5`
X		mknod r${name}${unit}g	c $chr `expr $unit '*' 8 + 6`
X		mknod r${name}${unit}h	c $chr `expr $unit '*' 8 + 7`
X		chgrp operator ${name}${unit}[a-h] r${name}${unit}[a-h]
X		chmod 640 ${name}${unit}[a-h] r${name}${unit}[a-h]
X		;;
X	*)
X		echo bad unit for disk in: $i
X		;;
X	esac
X	umask 77
X	;;
X
Xcom*)
X	unit=`expr $i : 'com\(.*\)'`
X	rm -f com0$unit
X	mknod com0$unit c 8 $unit
X	;;
X
Xpty*)
X	class=`expr $i : 'pty\(.*\)'`
X	case $class in
X	0) offset=0 name=p;;
X	1) offset=16 name=q;;
X	2) offset=32 name=r;;
X	3) offset=48 name=s;;
X# Note that telnetd, rlogind, and xterm (at least) only look at p-s.
X	4) offset=64 name=t;;
X	*) echo bad unit for pty in: $i;;
X	esac
X	case $class in
X	0|1|2|3|4)
X		umask 0
X		eval `echo $offset $name | awk ' { b=$1; n=$2 } END {
X			for (i = 0; i < 16; i++)
X				printf("mknod tty%s%x c 5 %d; \
X					mknod pty%s%x c 6 %d; ", \
X					n, i, b+i, n, i, b+i); }'`
X		umask 77
X		if [ $class = 1 ]; then
X			mv ttyqf ttyv0; mv ptyqf ptyv0
X		fi
X		;;
X	esac
X	;;
X
Xlocal)
X	umask 0
X	sh MAKEDEV.local
X	;;
X
Xesac
Xdone
END-of-MAKEDEV
exit