Path: alps!icus!att!watmath!uunet!cs.utexas.edu!news-server.csri.toronto.edu!torsqnt!hybrid!hybrid!mdapoz
From: mdapoz@hybrid.uucp (Mark Dapoz)
Newsgroups: unix-pc.sources,comp.sys.att
Subject: conf.c for unix-pc 3.51m kernel
Keywords: kernel conf.c
Message-ID: <1990Apr15.225852.14739@hybrid.UUCP>
Date: 15 Apr 90 22:58:52 GMT
Sender: mdapoz@hybrid
Organization: The Home for Unemployed Basselopes, Toronto, Ontario, Canada
Lines: 325
Xref: alps unix-pc.sources:117 comp.sys.att:1544

Ok, as promised, here's conf.c.  If you don't know what this is then don't
bother trying to use it, you'll probably get yourself into more problems than
it's worth :-)

BTW, bumping NMOUNT works, I have it set to 16 and I can now actually mount
all my partitions!

Managing a software development team 	|   Mark Dapoz  
is a lot like being on the psychiatric	|   ...uunet!mnetor!hybrid!mdapoz
ward.  -Mitch Kapor, San Jose Mercury	|   mnetor!hybrid!mdapoz@cs.toronto.edu

--- snip --- snip --- snip --- snip --- snip --- snip --- snip --- snip --- 

# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by mdapoz@hybrid on Sun Apr 15 18:55:55 EDT 1990
# Contents:  README.conf conf.c id.c name.c Makefile space.h.patch
 
echo x - README.conf
sed 's/^@//' > "README.conf" <<'@//E*O*F README.conf//'

This shar file contains the following files:

-rw-r--r--  1 mdapoz  staff       317 Apr 15 18:23 Makefile
-rw-r--r--  1 mdapoz  staff      6820 Apr 15 04:09 conf.c
-rw-r--r--  1 mdapoz  staff        64 Apr 15 04:20 id.c
-rw-r--r--  1 mdapoz  staff       158 Apr 15 04:12 name.c
-rw-r--r--  1 mdapoz  staff       927 Apr 13 20:41 space.h.patch

In order to rebuild conf.o, you must create the following directory heirarchy 
in some suitable locaton for source code (eg. /usr/src/uts/kern):

@./sys: contains a copy of the /usr/include/sys directory from the 3.51
       development set

@./cf:  contains the ifile.0407 file from the kernel .o distribution

You must then apply a patch to space.h using the following command:

		patch -p0 < space.h.patch

You can then rebuild the kernel using the makefile provided.

Enjoy....  Mark Dapoz	( mdapoz%hybrid@cs.toronto.edu  or
  			  ...uunet!mnetor!hybrid!mdapoz)
@//E*O*F README.conf//
chmod u=rw,g=r,o=r README.conf
 
echo x - conf.c
sed 's/^@//' > "conf.c" <<'@//E*O*F conf.c//'
#sccs	"@(#)uts/kern:conf.c	1.0"

/* 
   This is a hand built version of conf.c for use with the unix-pc 3.51m 
   kernel .o files provided by AT&T.  With this file and the kernel .o files,
   you will be able to fully reconfigure your 3B1 kernel without being 
   restricted to the options provided by ktune(7).

   WARNING: do *NOT* attempt to rebuild your kernel if you are unsure of
   the effects of changes in this file.  You can easily cause damage to
   data on your system.

   Disclaimer: The information presented in this file has been derived 
   only from work performed by the author and is in no way based on any
   AT&T and/or Convergent Technologies documents or code.  All information
   was obtained using files available on the stock AT&T unix-pc version
   3.51 base and development set.

   Mark Dapoz	( mdapoz%hybrid@cs.toronto.edu  or
  		  ...uunet!mnetor!hybrid!mdapoz)
   90/04/15
*/
    

#define	KERNEL				/* indicate it's kernel code */

		/* the following params define general purpose configuation */
#define	DEBUGGER	0		/* kernel debugger loaded */
#undef	BASSLOCKING			/* no Bass locking in this kernel */
#define	NERR		4		/* number of error slots in kernel */
#define	MESG		0		/* no message ipc mechanism in kernel */
#define	SEMA		0		/* no semaphore ipc mech in kernel */
#define	SHMEM		0		/* no shared memory ipc mech in kernel*/
#define	PLP_0		0		/* parallel line printer is supported */
#undef	PRF_0
#define	DISK_0		1		/* this is assigned to gd_cnt */
#define	HDPRECOMP	0x20200000	/* precomp cylinder for hard drive */
#undef	NOSTREAMS			/* streams are supported */
#undef	SLAN_0				/* ...but no network card */
#define	NSWBUF		12
#define	ROOTDEV		2		/* device minor number of root filesys*/
#define	PIPEDEV		2		/* device minor number of pipe device */
#define	SWAPDEV		1		/* device minor number of swapping dev*/
#define	NSWAP		8000		/* size of swap space (in 1K blocks) */

		/* the following params define the tulo structure */
#define	NBUF		25		/* number of system buffers */
#define	NINODE		80		/* number of resident inodes */
#define	NFILE		80		/* number of concurrent open files */
#define	NPROC		30		/* number of concurrent process */
#define	NTEXT		24		/* number of text structures in kernel*/
#define	NCLIST		32		/* number of clist buffers available */
#define	NPBUF		4		/* number of buffer headers available */
#define	NCALL		16		/* number of callouts in kernel */

		/* the following params define the tuhi structure */
#define	NBUFHI		100		/* max system buffers available */
#define	NINODEHI	400		/* max number of resident inodes */
#define	NFILEHI		300		/* max concurrent open files */
#define	NPROCHI		100		/* max concurrent process */
#define	NTEXTHI		75		/* max text structures in kernel */
#define	NCLISTHI	150		/* max clist buffers available */
#define	NPBUFHI		16		/* max buffer headers available */
#define	NCALLHI		32		/* max callouts in kernel */

		/* the following params define the v structure */
#define	NMOUNT		8		/* number of mount points */
#define	NSABUF		0
#define	MAXUP		24
#define	SMAPSIZ		75
#define	NHBUF		16		/* hashbuf, must be a power of 2 */

#define	NSERBUF		400		/* max chars in a tty buffer, mul of 4*/
#define	NTTYHOG		1024		/* max outstanding chars in tty buf */
#define	NLBDRV		5		/* number of block loadable dev drv */
#define	NLCDRV		14		/* number of char loadable dev drv */

#define	NDL		400		/* number of display list items */
#define	PXMEMSIZE	(256*1024)	/* pixel memory size (in virt space) */
#define	NWINDOWS	12		/* number of windows */
#define	FMEMSIZE	(64*1024)	/* font memory size (in virt space) */
#define	NOL		(NWINDOWS*40)	/* num of obscured pieces per system */

#include "sys/space.h"

/*
 * Declaration of block device switch. Each entry (row) is
 * the only link between the main unix code and the driver.
 */

		/* block device driver entry point declarations */
extern gdopen(), gdclose(), gdstrategy(); /* block driver for disk */

#define	NBDEVSW	5	/* number of entries in following table */

struct bdevsw bdevsw[] = {
	{	gdopen, gdclose, gdstrategy, nulldev},
	{	nodev, nodev, nodev, nulldev},
	{	nodev, nodev, nodev, nulldev},
	{	nodev, nodev, nodev, nulldev},
	{	nodev, nodev, nodev, nulldev}
};


/*
 * Character device switch.
 */

	/* character device driver entry point declarations */
		/* intel 8274 serial chip handler */
extern seropen(), serclose(), serread(), serwrite(), serioctl();
		/* console handler */
extern conopen(), conclose(), conread(), conwrite(), conioctl();
		/* tty handler (ie. /dev/tty) */
extern syopen(), syread(), sywrite(), syioctl();
		/* memory device handler */
extern mmread(), mmwrite();
		/* raw (char) disk handler */
extern gdread(), gdwrite(), gdioctl();
		/* error device handler */
extern errread(), errwrite();
		/* printer handler */
extern lpopen(), lpclose(), lpwrite(), lpioctl();
		/* on board modem handler */
extern phopen(), phclose(), phread(), phwrite(), phioctl();

#define	NCDEVSW	24	/* number of entries in following table */

struct cdevsw cdevsw[] = {
	{	seropen, serclose, serread, serwrite, serioctl, NULL, NULL},
	{	conopen, conclose, conread, conwrite, conioctl, NULL, NULL},
	{	syopen, nulldev, syread, sywrite, syioctl, NULL, NULL},
	{	nulldev, nulldev, mmread, mmwrite, nodev, NULL, NULL},
	{	gdopen, gdclose, gdread, gdwrite, gdioctl, NULL, NULL},
	{	nulldev, nulldev, errread, errwrite, nodev, NULL, NULL},
	{	lpopen, lpclose, nodev, lpwrite, lpioctl, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	phopen, phclose, phread, phwrite, phioctl, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL},
	{	nodev, nodev, nodev, nodev, nodev, NULL, NULL}
};

int bdevcnt=NBDEVSW;		/* must equal bdevsw table size */
int cdevcnt=NCDEVSW;		/* must equal cdevsw table size */

dev_t rootdev=ROOTDEV;		/* device minor number of root filesystem */
dev_t pipedev=PIPEDEV;		/* device minor number of pipe device */
dev_t swapdev=SWAPDEV;		/* device minor number of swapping device */

struct swdevt swdevt[]={	/* Swap device information (from BSD 4.1) */
	{	1, 0},		/* (device, freed) pair */
	{	0, 0},
};

int swplo=1;
int nswap=NSWAP;		/* size of swap space */
@//E*O*F conf.c//
chmod u=rw,g=r,o=r conf.c
 
echo x - id.c
sed 's/^@//' > "id.c" <<'@//E*O*F id.c//'
#sccs	"@(#)uts/kern:id.c	1.0"

static char SCCS_ID[] = "@(#) ";
@//E*O*F id.c//
chmod u=rw,g=r,o=r id.c
 
echo x - name.c
sed 's/^@//' > "name.c" <<'@//E*O*F name.c//'
#sccs	"@(#)uts/kern:name.c	1.0"

#define	NODE	"UNIXPC"
#define	VER	"3.51m"

#include "sys/utsname.h"

struct utsname utsname = { SYS, NODE, REL, VER, MACH };
@//E*O*F name.c//
chmod u=rw,g=r,o=r name.c
 
echo x - Makefile
sed 's/^@//' > "Makefile" <<'@//E*O*F Makefile//'
#sccs	"@(#)uts/kern:Makefile	1.0"

# workaround for System V make bug
SHELL	= /bin/sh
COPTS	= -O
CFLAGS 	= $(COPTS)
LIBS	= lib1 lib2 lib3 lib4

all:	UNIX3.51m

UNIX3.51m: $(LIBS) conf.o id.o linesw.o locore.o low.o name.o
	$(LD) -x -N cf/ifile.0407 -o UNIX3.51m low.o locore.o conf.o linesw.o \
		$(LIBS) name.o id.o
@//E*O*F Makefile//
chmod u=rw,g=r,o=r Makefile
 
echo x - space.h.patch
sed 's/^@//' > "space.h.patch" <<'@//E*O*F space.h.patch//'
*** sys/space.h~	Fri Aug  5 00:26:19 1988
--- sys/space.h	Fri Apr 13 20:38:59 1990
***************
*** 274,279
  		-1,0,8, 80*8,60, gfpintr, gfpstart,
  		FPMAXCYL, FPMAXBADBLK, NULL, NULL,0}
  };
  struct iobuf	gdutab[DISKS];
  struct iobuf	gdtab;
  #ifdef IOSTAT

--- 274,280 -----
  		-1,0,8, 80*8,60, gfpintr, gfpstart,
  		FPMAXCYL, FPMAXBADBLK, NULL, NULL,0}
  };
+ int gdhdprecomp = HDPRECOMP;		/* precomp cylinder for hard drive */
  struct iobuf	gdutab[DISKS];
  struct iobuf	gdtab;
  #ifdef IOSTAT
***************
*** 404,409
  #include "sys/wd.h"
  
  extern int khigh(),mscoord(), kbinit();	/* defaults for resident keyboard */
  
  int	(*ldmisc[])() = {
  	nulldev, nulldev, nulldev, nulldev, kbinit,

--- 405,411 -----
  #include "sys/wd.h"
  
  extern int khigh(),mscoord(), kbinit();	/* defaults for resident keyboard */
+ extern int nulldev();
  
  int	(*ldmisc[])() = {
  	nulldev, nulldev, nulldev, nulldev, kbinit,
@//E*O*F space.h.patch//
chmod u=rw,g=r,o=r space.h.patch
 
echo Inspecting for damage in transit...
temp=/tmp/shar$$; dtemp=/tmp/.shar$$
trap "rm -f $temp $dtemp; exit" 0 1 2 3 15
cat > $temp <<\!!!
     25    129    910 README.conf
    169   1086   6820 conf.c
      3      9     64 id.c
      8     22    158 name.c
     13     49    317 Makefile
     36    118    935 space.h.patch
    254   1413   9204 total
!!!
wc  README.conf conf.c id.c name.c Makefile space.h.patch | sed 's=[^ ]*/==' | diff -b $temp - >$dtemp
if [ -s $dtemp ]
then echo "Ouch [diff of wc output]:" ; cat $dtemp
else echo "No problems found."
fi
exit 0
-- 
Managing a software development team 	|   Mark Dapoz  
is a lot like being on the psychiatric	|   ...uunet!mnetor!hybrid!mdapoz
ward.  -Mitch Kapor, San Jose Mercury	|   mnetor!hybrid!mdapoz@cs.toronto.edu

