diff -u --recursive --new-file v1.3.38/linux/Makefile linux/Makefile
--- v1.3.38/linux/Makefile	Wed Nov  8 07:11:29 1995
+++ linux/Makefile	Thu Nov  9 08:24:03 1995
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 38
+SUBLEVEL = 39
 
 ARCH = i386
 
@@ -224,12 +224,12 @@
 	$(MAKE) linuxsubdirs SUBDIRS=net
 
 ifdef CONFIG_MODVERSIONS
-MODV = -DCONFIG_MODVERSIONS
+MODV = -DMODVERSIONS
 endif
 
 modules: include/linux/version.h
 	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) -DMODULE $(MODV)" modules; done
-	
+
 modules_install:
 	@( \
 	MODLIB=/lib/modules/$(VERSION).$(PATCHLEVEL).$(SUBLEVEL); \
diff -u --recursive --new-file v1.3.38/linux/Rules.make linux/Rules.make
--- v1.3.38/linux/Rules.make	Wed Nov  8 07:11:29 1995
+++ linux/Rules.make	Thu Nov  9 08:24:03 1995
@@ -22,6 +22,13 @@
 unexport O_OBJS
 unexport L_OBJS
 unexport M_OBJS
+unexport ALL_MOBJS
+# objects that export symbol tables
+unexport OX_OBJS
+unexport LX_OBJS
+unexport MX_OBJS
+unexport SYMTAB_OBJS
+
 unexport MOD_LIST_NAME
 
 #
@@ -46,10 +53,11 @@
 # Rule to compile a set of .o files into one .o file
 #
 ifdef O_TARGET
-$(O_TARGET): $(O_OBJS) $(TOPDIR)/include/linux/config.h
+ALL_O = $(OX_OBJS) $(O_OBJS)
+$(O_TARGET): $(ALL_O) $(TOPDIR)/include/linux/config.h
 	rm -f $@
-ifdef O_OBJS
-	$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(O_OBJS)
+ifneq "$(strip $(ALL_O))" ""
+	$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(ALL_O)
 else
 	$(AR) rcs $@
 endif
@@ -59,9 +67,9 @@
 # Rule to compile a set of .o files into one .a file
 #
 ifdef L_TARGET
-$(L_TARGET): $(L_OBJS) $(TOPDIR)/include/linux/config.h
+$(L_TARGET): $(LX_OBJS) $(L_OBJS) $(TOPDIR)/include/linux/config.h
 	rm -f $@
-	$(AR) $(EXTRA_ARFLAGS) rcs $@ $(L_OBJS)
+	$(AR) $(EXTRA_ARFLAGS) rcs $@ $(LX_OBJS) $(L_OBJS)
 endif
 
 #
@@ -85,10 +93,11 @@
 #
 # A rule to make modules
 #
-ifdef M_OBJS
+ALL_MOBJS = $(MX_OBJS) $(M_OBJS)
+ifneq "$(strip $(ALL_MOBJS))" ""
 PDWN=$(shell /bin/sh $(TOPDIR)/scripts/pathdown.sh)
 endif
-modules: $(M_OBJS) dummy
+modules: $(ALL_MOBJS) dummy
 ifdef MOD_SUB_DIRS
 	set -e; for i in $(MOD_SUB_DIRS); do $(MAKE) -C $$i modules; done
 endif
@@ -98,13 +107,13 @@
 	for i in $(MOD_SUB_DIRS); do \
 	    echo `basename $$i`.o >> $$TOPDIR/modules/$(MOD_LIST_NAME); done
 endif
-ifdef M_OBJS
-	echo $(M_OBJS) >> $$TOPDIR/modules/$(MOD_LIST_NAME)
+ifneq "$(strip $(ALL_MOBJS))" ""
+	echo $(ALL_MOBJS) >> $$TOPDIR/modules/$(MOD_LIST_NAME)
 endif
 endif
-ifdef M_OBJS
+ifneq "$(strip $(ALL_MOBJS))" ""
 	echo $(PDWN)
-	cd $$TOPDIR/modules; for i in $(M_OBJS); do \
+	cd $$TOPDIR/modules; for i in $(ALL_MOBJS); do \
 	    ln -sf ../$(PDWN)/$$i .; done
 endif
 
@@ -118,6 +127,41 @@
 #
 script:
 	$(SCRIPT)
+
+#
+# This sets version suffixes on exported symbols
+# Uses SYMTAB_OBJS
+# Separate the object into "normal" objects and "exporting" objects
+# Exporting objects are: all objects that define symbol tables
+#
+ifdef CONFIG_MODVERSIONS
+SYMTAB_OBJS = $(LX_OBJS) $(OX_OBJS) $(MX_OBJS)
+ifneq "$(strip $(SYMTAB_OBJS))" ""
+
+%.ver: %.c
+	@if [ ! -x /sbin/genksyms ]; then echo "Please read: README.modules"; fi
+	$(CC) $(CFLAGS) -E -D__GENKSYMS__ $< | /sbin/genksyms -w $(TOPDIR)/include/linux/modules
+	@ln -sf $(TOPDIR)/include/linux/modules/$@ .
+
+$(SYMTAB_OBJS:.o=.ver): $(TOPDIR)/include/linux/autoconf.h
+
+$(TOPDIR)/include/linux/modversions.h: $(SYMTAB_OBJS:.o=.ver)
+	@echo updating $(TOPDIR)/include/linux/modversions.h
+	@(cd $(TOPDIR)/include/linux/modules; for f in *.ver;\
+	do echo "#include <linux/modules/$${f}>"; done) \
+	> $(TOPDIR)/include/linux/modversions.h
+
+$(MX_OBJS): $(TOPDIR)/include/linux/modversions.h
+	$(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
+
+$(LX_OBJS) $(OX_OBJS): $(TOPDIR)/include/linux/modversions.h
+	$(CC) $(CFLAGS) -DMODVERSIONS -DEXPORT_SYMTAB -c $(@:.o=.c)
+
+dep fastdep: $(TOPDIR)/include/linux/modversions.h
+
+endif
+endif
+
 #
 # include dependency files they exist
 #
diff -u --recursive --new-file v1.3.38/linux/arch/alpha/Makefile linux/arch/alpha/Makefile
--- v1.3.38/linux/arch/alpha/Makefile	Fri Oct 13 14:44:31 1995
+++ linux/arch/alpha/Makefile	Thu Nov  9 10:04:33 1995
@@ -30,6 +30,9 @@
 
 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
 
+rawboot:
+	@$(MAKEBOOT) rawboot
+
 #
 # my boot writes directly to a specific disk partition, I doubt most
 # people will want to do that without changes..
diff -u --recursive --new-file v1.3.38/linux/arch/alpha/boot/Makefile linux/arch/alpha/boot/Makefile
--- v1.3.38/linux/arch/alpha/boot/Makefile	Fri Oct 13 14:44:32 1995
+++ linux/arch/alpha/boot/Makefile	Thu Nov  9 10:04:33 1995
@@ -22,20 +22,28 @@
 	$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
 
 OBJECTS = head.o main.o
-TARGETS = tools/lxboot tools/bootlx vmlinux vmlinux.gz
+TARGETS = vmlinux.gz
 
 all:	$(TARGETS)
 	@echo Ready to install kernel in $(shell pwd)/vmlinux.gz
 
-msb:	tools/lxboot tools/bootlx vmlinux
-	( cat tools/lxboot tools/bootlx vmlinux ) > /dev/rz0a
+# normally no need to build these:
+rawboot: vmlinux.nh tools/lxboot tools/bootlx vmlinux
+
+msb:	tools/lxboot tools/bootlx vmlinux.nh
+	( cat tools/lxboot tools/bootlx vmlinux.nh ) > /dev/rz0a
 	disklabel -rw rz0 'linux' tools/lxboot tools/bootlx
 
 vmlinux.gz: vmlinux
 	gzip -fv vmlinux
 
-vmlinux: tools/build $(TOPDIR)/vmlinux
-#	tools/build -v $(TOPDIR)/vmlinux > vmlinux
+#
+# A raw binary without header.  Used by raw boot.
+#
+vmlinux.nh: tools/build
+	tools/build -v $(TOPDIR)/vmlinux > vmlinux.nh
+
+vmlinux: $(TOPDIR)/vmlinux
 	cp $(TOPDIR)/vmlinux vmlinux
 	quickstrip vmlinux
 
diff -u --recursive --new-file v1.3.38/linux/arch/alpha/config.in linux/arch/alpha/config.in
--- v1.3.38/linux/arch/alpha/config.in	Wed Nov  8 07:11:29 1995
+++ linux/arch/alpha/config.in	Thu Nov  9 09:58:20 1995
@@ -40,7 +40,6 @@
 	define_bool CONFIG_ALPHA_APECS y
 fi
 
-bool 'Kernel GDB support' CONFIG_KGDB
 bool 'Echo console messages on /dev/ttyS1' CONFIG_SERIAL_ECHO
 if [ "$CONFIG_PCI" = "y" ]; then
   bool 'TGA Console Support' CONFIG_TGA_CONSOLE
diff -u --recursive --new-file v1.3.38/linux/arch/alpha/lib/io.c linux/arch/alpha/lib/io.c
--- v1.3.38/linux/arch/alpha/lib/io.c	Wed Nov  8 07:11:29 1995
+++ linux/arch/alpha/lib/io.c	Thu Nov  9 10:04:33 1995
@@ -180,7 +180,7 @@
  * doing byte reads the "slow" way isn't nearly as slow as
  * doing byte writes the slow way (no r-m-w cycle).
  */
-void outsb(unsigned long port, void * src, unsigned long count)
+void outsb(unsigned long port, const void * src, unsigned long count)
 {
 	while (count) {
 		count--;
@@ -195,7 +195,7 @@
  * interfaces seems to be slow: just using the inlined version of the
  * outw() breaks things.
  */
-void outsw (unsigned long port, void *src, unsigned long count)
+void outsw (unsigned long port, const void *src, unsigned long count)
 {
 	if (((unsigned long)src) & 0x3) {
 		if (((unsigned long)src) & 0x1) {
@@ -227,7 +227,7 @@
  * interfaces seems to be slow: just using the inlined version of the
  * outw() breaks things.
  */
-void outsl (unsigned long port, void *src, unsigned long count)
+void outsl (unsigned long port, const void *src, unsigned long count)
 {
 	if (((unsigned long)src) & 0x3) {
 		panic("outsw: memory not aligned");
@@ -245,7 +245,7 @@
  * Copy data from IO memory space to "real" memory space.
  * This needs to be optimized.
  */
-void memcpy_fromio(void * to, unsigned long from, unsigned long count)
+void _memcpy_fromio(void * to, unsigned long from, unsigned long count)
 {
 	while (count) {
 		count--;
@@ -259,7 +259,7 @@
  * Copy data from "real" memory space to IO memory space.
  * This needs to be optimized.
  */
-void memcpy_toio(unsigned long to, void * from, unsigned long count)
+void _memcpy_toio(unsigned long to, void * from, unsigned long count)
 {
 	while (count) {
 		count--;
@@ -273,7 +273,7 @@
  * "memset" on IO memory space.
  * This needs to be optimized.
  */
-void memset_io(unsigned long dst, int c, unsigned long count)
+void _memset_io(unsigned long dst, int c, unsigned long count)
 {
 	while (count) {
 		count--;
diff -u --recursive --new-file v1.3.38/linux/arch/i386/defconfig linux/arch/i386/defconfig
--- v1.3.38/linux/arch/i386/defconfig	Mon Oct 23 18:02:01 1995
+++ linux/arch/i386/defconfig	Wed Nov  8 14:42:15 1995
@@ -14,7 +14,6 @@
 CONFIG_BINFMT_ELF=y
 CONFIG_KERNEL_ELF=y
 CONFIG_M486=y
-# CONFIG_SMP is not set
 
 #
 # Loadable module support
@@ -33,6 +32,7 @@
 # CONFIG_BLK_DEV_HD is not set
 CONFIG_BLK_DEV_IDE=y
 CONFIG_BLK_DEV_IDECD=y
+# CONFIG_BLK_DEV_TRITON is not set
 # CONFIG_BLK_DEV_XD is not set
 
 #
@@ -43,7 +43,6 @@
 # CONFIG_IP_FORWARD is not set
 # CONFIG_IP_MULTICAST is not set
 # CONFIG_IP_ACCT is not set
-# CONFIG_NET_IPIP is not set
 
 #
 # (it is safe to leave these untouched)
diff -u --recursive --new-file v1.3.38/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v1.3.38/linux/drivers/block/floppy.c	Wed Nov  8 07:11:30 1995
+++ linux/drivers/block/floppy.c	Thu Nov  9 08:24:03 1995
@@ -109,29 +109,14 @@
 
 #include <linux/module.h>
 
-#ifdef MODULE
-
-#define FD_MODULE
-
-int FLOPPY_IRQ=6;
-int FLOPPY_DMA=2;
-int ALLOWED_DRIVE_MASK = 0x33;
-
-#endif
-
-#ifndef FD_MODULE
 /* the following is the mask of allowed drives. By default units 2 and
  * 3 of both floppy controllers are disabled, because switching on the
  * motor of these drives causes system hangs on some PCI computers. drive
  * 0 is the low bit (0x1), and drive 7 is the high bit (0x80). Bits are on if
  * a drive is allowed. */
-static int ALLOWED_DRIVE_MASK=0x33;
-
-#define FLOPPY_IRQ 6
-#define FLOPPY_DMA 2
-#endif
-
-#define MODULE_AWARE_DRIVER
+static int FLOPPY_IRQ=6;
+static int FLOPPY_DMA=2;
+static int ALLOWED_DRIVE_MASK = 0x33;
 
 #include <linux/sched.h>
 #include <linux/fs.h>
@@ -3910,9 +3895,7 @@
 		return 0;
 	}
 	sti();
-#ifdef FD_MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	for(i=0; i< N_FDC; i++){
 		if(FDCS->address != -1){
 			fdc = i;
@@ -3955,9 +3938,7 @@
 		return;
 	}
 	sti();
-#ifdef FD_MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	fd_disable_dma();
 	fd_free_dma();
 	fd_disable_irq();
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/aztcd.c linux/drivers/cdrom/aztcd.c
--- v1.3.38/linux/drivers/cdrom/aztcd.c	Sun Oct 29 11:38:48 1995
+++ linux/drivers/cdrom/aztcd.c	Thu Nov  9 08:24:03 1995
@@ -139,18 +139,7 @@
 	NOTE: 
 	Points marked with ??? are questionable !
 */
-#include <linux/major.h>
-#include <linux/config.h>
-
-#ifdef MODULE
-# include <linux/module.h>
-# include <linux/version.h>
-# ifndef CONFIG_MODVERSIONS
-    char kernel_version[]= UTS_RELEASE;
-# endif
-#define aztcd_init init_module
-#endif
-
+#include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
@@ -160,6 +149,7 @@
 #include <linux/cdrom.h>
 #include <linux/ioport.h>
 #include <linux/string.h>
+#include <linux/major.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -167,14 +157,7 @@
 
 #define MAJOR_NR AZTECH_CDROM_MAJOR 
 
-#include "blk.h"
-
-#ifdef MODULE
-#else
-# define MOD_INC_USE_COUNT
-# define MOD_DEC_USE_COUNT
-#endif
-
+#include <linux/blk.h>
 #include <linux/aztcd.h>
 
 #define SET_TIMER(func, jifs)   delay_timer.expires = jiffies + (jifs); \
@@ -246,7 +229,7 @@
 #define READ_TIMEOUT 3000
 
 #define azt_port aztcd  /*needed for the modutils*/
-static short azt_port = AZT_BASE_ADDR;
+static int azt_port = AZT_BASE_ADDR;
 
 static char  azt_cont = 0;
 static char  azt_init_end = 0;
@@ -2079,11 +2062,14 @@
 }
 
 #ifdef MODULE
+
+int init_module(void)
+{
+	return aztcd_init();
+}
+
 void cleanup_module(void)
-{ if (MOD_IN_USE)
-    { printk("aztcd module in use - can't remove it.\n");
-      return;
-    }
+{
   if ((unregister_blkdev(MAJOR_NR, "aztcd") == -EINVAL))    
     { printk("What's that: can't unregister aztcd\n");
       return;
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
--- v1.3.38/linux/drivers/cdrom/cdu31a.c	Wed Nov  8 07:11:30 1995
+++ linux/drivers/cdrom/cdu31a.c	Thu Nov  9 08:24:03 1995
@@ -2990,10 +2990,6 @@
 /*
  * Initialize the driver.
  */
-#ifdef MODULE
-#define cdu31a_init init_module
-#endif
-
 int
 cdu31a_init(void)
 {
@@ -3156,6 +3152,13 @@
 }
 
 #ifdef MODULE
+
+int
+init_module(void)
+{
+	return cdu31a_init();
+}
+
 void
 cleanup_module(void)
 {
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/cm206.c linux/drivers/cdrom/cm206.c
--- v1.3.38/linux/drivers/cdrom/cm206.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/cm206.c	Thu Nov  9 08:24:04 1995
@@ -81,16 +81,7 @@
  *                       David van Leeuwen, david@tm.tno.nl.  */
 #define VERSION "0.34"
 
-#ifdef MODULE			/* OK, so some of this is stolen */
 #include <linux/module.h>	
-#include <linux/version.h>
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[]=UTS_RELEASE;
-#endif
-#else 
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif MODULE
 
 #include <linux/errno.h>	/* These include what we really need */
 #include <linux/delay.h>
@@ -1123,41 +1114,12 @@
 }
 #endif
 
-#ifdef MODULE
-
-static int cm206[2] = {0,0};	/* for compatible `insmod' parameter passing */
-void parse_options(void) 
-{
-  int i;
-  for (i=0; i<2; i++) {
-    if (0x300 <= cm206[i] && i<= 0x370 && cm206[i] % 0x10 == 0) {
-      cm206_base = cm206[i];
-      auto_probe=0;
-    }
-    else if (3 <= cm206[i] && cm206[i] <= 15) {
-      cm206_irq = cm206[i];
-      auto_probe=0;
-    }
-  }
-}
-
-#define cm206_init init_module
-
-#endif MODULE
-
-
 int cm206_init(void)
 {
   uch e=0;
   long int size=sizeof(struct cm206_struct);
 
   printk("cm206: v" VERSION);
-#if defined(MODULE) 
-  parse_options();
-#if !defined(AUTO_PROBE_MODULE)
-   auto_probe=0;
-#endif
-#endif
   cm206_base = probe_base_port(auto_probe ? 0 : cm206_base);
   if (!cm206_base) {
     printk(" can't find adapter!\n");
@@ -1221,13 +1183,40 @@
 }
 
 #ifdef MODULE
+
+static int cm206[2] = {0,0};	/* for compatible `insmod' parameter passing */
+
+void parse_options(void) 
+{
+  int i;
+  for (i=0; i<2; i++) {
+    if (0x300 <= cm206[i] && i<= 0x370 && cm206[i] % 0x10 == 0) {
+      cm206_base = cm206[i];
+      auto_probe=0;
+    }
+    else if (3 <= cm206[i] && cm206[i] <= 15) {
+      cm206_irq = cm206[i];
+      auto_probe=0;
+    }
+  }
+}
+
+int init_module(void)
+{
+	parse_options();
+#if !defined(AUTO_PROBE_MODULE)
+	auto_probe=0;
+#endif
+	return cm206_init();
+}
+
 void cleanup_module(void)
 {
   cleanup(4);
   printk("cm206 removed\n");
 }
       
-#else MODULE
+#else /* !MODULE */
 
 /* This setup function accepts either `auto' or numbers in the range
  * 3--11 (for irq) or 0x300--0x370 (for base port) or both. */
@@ -1246,4 +1235,4 @@
     }
   }
 }
-#endif MODULE
+#endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/gscd.c linux/drivers/cdrom/gscd.c
--- v1.3.38/linux/drivers/cdrom/gscd.c	Wed Nov  8 07:11:31 1995
+++ linux/drivers/cdrom/gscd.c	Wed Nov  8 12:07:27 1995
@@ -41,17 +41,9 @@
 #define  NO_FUTURE_WORK
 /*------------------------*/
 
-#include <linux/config.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#include <linux/malloc.h>
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[] = UTS_RELEASE;
-#endif
-#endif MODULE
 
+#include <linux/malloc.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -390,9 +382,7 @@
 		return -EIO;
 */
 
-        #ifdef MODULE
-           MOD_INC_USE_COUNT;
-        #endif
+	MOD_INC_USE_COUNT;
  
 	return 0;
 }
@@ -413,9 +403,7 @@
 	sync_dev(inode->i_rdev);
 	invalidate_buffers(inode -> i_rdev);
 
-        #ifdef MODULE
-           MOD_DEC_USE_COUNT;
-        #endif
+	MOD_DEC_USE_COUNT;
 }
 
 
@@ -963,6 +951,7 @@
 }
 #endif
 
+#ifdef MODULE
 /* Init for the Module-Version */
 int init_module (void)
 {
@@ -983,16 +972,9 @@
      }    
 }
 
-#ifdef MODULE
 void cleanup_module (void)
 {
 
-   if (MOD_IN_USE)
-   {
-      printk("GoldStar-module in use - can't remove it.\n" );
-      return;
-   }
- 
    if ((unregister_blkdev(MAJOR_NR, "gscd" ) == -EINVAL))
    {
       printk("What's that: can't unregister GoldStar-module\n" );
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
--- v1.3.38/linux/drivers/cdrom/mcd.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/mcd.c	Thu Nov  9 09:47:18 1995
@@ -59,22 +59,21 @@
 	DOS DRIVERS .... Accuracy counts... speed is secondary ;)
 	17 June 95 Modifications By Andrew J. Kroll <ag784@freenet.buffalo.edu>
 	07 July 1995 Modifications by Andrew J. Kroll
+	
+	0.6
+        8 November 95 More Modifications By Andrew J. Kroll
+        Media change detect now works :) That means that SuperMount and
+        other programs that depend on this will now work!
+        You are welcome in advance!  You will notice, however that you don't 
+        always get the kernel message saying "VFS: Disk change detected on 
+        device", so I'm not sure that it's *PERFECT* but it does seem to
+        actually work! What else should I add?
+	                                                         
 
 */
 
-#include <linux/config.h>
 
-#ifdef MODULE
-# include <linux/module.h>
-# include <linux/version.h>
-# ifndef CONFIG_MODVERSIONS
-    char kernel_version[]= UTS_RELEASE;
-# endif
-#define mcd_init init_module
-#else
-# define MOD_INC_USE_COUNT
-# define MOD_DEC_USE_COUNT
-#endif
+#include <linux/module.h>
 
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -145,18 +144,22 @@
 #define MFL_STATUSorDATA (MFL_STATUS | MFL_DATA)
 #define MCD_BUF_SIZ 16
 static volatile int mcd_transfer_is_active;
+
+/* Are you sleeping, Are you sleeping, Brother John, Brother John? ;) */
+static volatile int sleeping_for_status;
+
 static char mcd_buf[2048*MCD_BUF_SIZ];	/* buffer for block size conversion */
 static volatile int mcd_buf_bn[MCD_BUF_SIZ], mcd_next_bn;
 static volatile int mcd_buf_in, mcd_buf_out = -1;
 static volatile int mcd_error;
 static int mcd_open_count;
 enum mcd_state_e {
-  MCD_S_IDLE,   /* 0 */
-  MCD_S_START,  /* 1 */
-  MCD_S_MODE, /* 2 */
-  MCD_S_READ,   /* 3 */
-  MCD_S_DATA,   /* 4 */
-  MCD_S_STOP,   /* 5 */
+  MCD_S_IDLE,    /* 0 */
+  MCD_S_START,   /* 1 */
+  MCD_S_MODE,    /* 2 */
+  MCD_S_READ,    /* 3 */
+  MCD_S_DATA,    /* 4 */
+  MCD_S_STOP,    /* 5 */
   MCD_S_STOPPING /* 6 */
 };
 static volatile enum mcd_state_e mcd_state = MCD_S_IDLE;
@@ -211,31 +214,7 @@
       mitsumi_bug_93_wait = ints[3];
 #endif /* WORK_AROUND_MITSUMI_BUG_93 */
 }
-
  
-static int
-check_mcd_change(kdev_t full_dev)
-{
-   int retval, target;
-
-
-#if 1	 /* the below is not reliable */
-   return 0;
-#endif  
-   target = MINOR(full_dev);
-
-   if (target > 0) {
-      printk("mcd: Mitsumi CD-ROM request error: invalid device.\n");
-      return 0;
-   }
-
-   retval = mcdDiskChanged;
-   mcdDiskChanged = 0;
-
-   return retval;
-}
-
-
 /*
  * Do a 'get status' command and get the result.  Only use from the top half
  * because it calls 'getMcdStatus' which sleeps.
@@ -258,6 +237,69 @@
 	return st;
 }
 
+/*
+ *             This detects a media change on the CD ROM.
+ *        We need to grab the status right off the drive in here.
+ *     Before, it ALWAYS returned a value of 0, which was not right!
+ */
+ 
+static int
+check_mcd_change(dev_t full_dev)
+{
+   int retval, target, st, count;
+   st = -1;
+   target = MINOR(full_dev);
+
+   if (target > 0) 
+   	{
+   	printk("mcd: Mitsumi CD-ROM request error: invalid device.\n");
+   	return 0;
+   	}
+
+/* 
+ * SOMETIMES it changes, sometimes not! Well, here we FIX that little nasty!
+ * All we need to do is read the status from the drive without spamming the 
+ * kernel! In other words, this routine CANNOT sleep! 
+ * The kernel will automagically picks up on this now.
+ * Devilishly sneaky it is! 8) -- AJK
+ */
+if ((!mcd_transfer_is_active) && 
+    (!sleeping_for_status) &&
+    (mcd_state == MCD_S_IDLE)) /* YES I'm paraniod! :) */
+	{
+	outb(MCMD_GET_STATUS, MCDPORT(0)); 	/* send get-status cmd */
+	for (count = 0; count < 3000; count++) /* wait for the status */
+		{
+		if (!(inb(MCDPORT(1)) & MFL_STATUS))
+			break;
+		}
+	if (count >= 3000)	/* Did we time out? */
+		{
+		retval = mcdDiskChanged; /* We can just jump out of here */
+		mcdDiskChanged = 0; /* as it's not needed all the time. */
+		return retval;	/* So we pretend nothing happened here! ;) */
+		}
+	st=inb(MCDPORT(0)) & 0xFF ;	/* Read the status in... */
+       
+	/* okay... here's that magic part! Muhuhuhuh...*/
+
+	if (st & MST_DSK_CHG)      /* Devil made me do it! O];) */ 
+		{
+		mcdDiskChanged = 1;  /* Show a change. */
+		audioStatus = CDROM_AUDIO_NO_STATUS; /* just incase... */
+		tocUpToDate = 0; 	/* Frantic laughing continues... */
+		mcd_invalidate_buffers(); /* 666 wins! */
+      		}		/* Stupid comments are fun! */
+	
+	
+	}
+ 
+   retval = mcdDiskChanged; /* Indicate status. */
+   mcdDiskChanged = 0;   /* Go, now. Enjoy a good beer! */
+
+   return retval; /* The End. */
+}
+
 
 /*
  * Send a 'Play' command and get the status.  Use only from the top half.
@@ -1175,7 +1217,7 @@
 {
 	int count;
 	unsigned char result[3];
-
+        sleeping_for_status = 0;
 	if (mcd_port <= 0 || mcd_irq <= 0) {
 	  printk("skip mcd_init\n");
           return -EIO;
@@ -1377,10 +1419,14 @@
 
 	McdTimeout = timeout;
 	SET_TIMER(mcdStatTimer, 1);
-	sleep_on(&mcd_waitq);
+        sleeping_for_status = 1;
+        sleep_on(&mcd_waitq);
 	if (McdTimeout <= 0)
-		return -1;
-
+		{
+		sleeping_for_status = 0;
+	      	return -1;
+		}
+	sleeping_for_status = 0;
 	st = inb(MCDPORT(0)) & 0xFF;
 	if (st == 0xFF)
 		return -1;
@@ -1616,11 +1662,13 @@
 }
 
 #ifdef MODULE
+int init_module(void)
+{
+	return mcd_init();
+}
+
 void cleanup_module(void)
-{ if (MOD_IN_USE)
-     { printk("mcd module in use - can't remove it.\n");
-       return;    
-     }
+{
   if ((unregister_blkdev(MAJOR_NR, "mcd") == -EINVAL))
      { printk("What's that: can't unregister mcd\n");
        return;    
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/mcdx.c linux/drivers/cdrom/mcdx.c
--- v1.3.38/linux/drivers/cdrom/mcdx.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/mcdx.c	Wed Nov  8 12:07:27 1995
@@ -37,18 +37,7 @@
 		= "mcdx.c,v 1.7 1995/08/27 01:46:41 heiko Exp";
 #endif
 
-#include <linux/config.h>
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[] = UTS_RELEASE;
-#endif
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#define MOD_IN_USE 1
-#endif MODULE
 
 #include <linux/errno.h>
 #include <linux/signal.h>
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/optcd.c linux/drivers/cdrom/optcd.c
--- v1.3.38/linux/drivers/cdrom/optcd.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/optcd.c	Thu Nov  9 08:24:04 1995
@@ -49,20 +49,7 @@
 	29-9-95		v0.4a	Fixed bug that prevented compilation as module
 */
 
-#include <linux/major.h>
-#include <linux/config.h>
-
-#ifdef MODULE
-# include <linux/module.h>
-# include <linux/version.h>
-# ifndef CONFIG_MODVERSIONS
-	char kernel_version[]= UTS_RELEASE;
-# endif
-#define optcd_init init_module
-#else
-# define MOD_INC_USE_COUNT
-# define MOD_DEC_USE_COUNT
-#endif
+#include <linux/module.h>
 
 #include <linux/errno.h>
 #include <linux/mm.h>
@@ -71,6 +58,8 @@
 #include <linux/kernel.h>
 #include <linux/cdrom.h>
 #include <linux/ioport.h>
+#include <linux/major.h>
+
 #include <asm/io.h>
 
 #define MAJOR_NR OPTICS_CDROM_MAJOR
@@ -1466,11 +1455,12 @@
 }
 
 #ifdef MODULE
+int init_module(void)
+{
+	return optcd_init();
+}
+
 void cleanup_module(void) {
-	if (MOD_IN_USE) {
-		printk("optcd: module in use - can't remove it.\n");
-	return;
-	}
 	if ((unregister_blkdev(MAJOR_NR, "optcd") == -EINVAL)) {
 		printk("optcd: what's that: can't unregister\n");
 		return;
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
--- v1.3.38/linux/drivers/cdrom/sbpcd.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/sbpcd.c	Wed Nov  8 12:07:27 1995
@@ -261,18 +261,7 @@
 #define SBPCD_ISSUE 1
 #endif SBPCD_ISSUE
 
-#include <linux/config.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[]=UTS_RELEASE;
-#endif
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif MODULE
 
 #include <linux/errno.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/sjcd.c linux/drivers/cdrom/sjcd.c
--- v1.3.38/linux/drivers/cdrom/sjcd.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/sjcd.c	Thu Nov  9 08:24:04 1995
@@ -51,17 +51,7 @@
  *
  */
 
-#include <linux/major.h>
-#include <linux/config.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#define sjcd_init init_module
-#ifndef CONFIG_MODVERSIONS
-char kernel_version[]= UTS_RELEASE;
-#endif
-#endif
 
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -72,6 +62,7 @@
 #include <linux/cdrom.h>
 #include <linux/ioport.h>
 #include <linux/string.h>
+#include <linux/major.h>
 
 #include <asm/system.h>
 #include <asm/io.h>
@@ -1440,9 +1431,7 @@
     printk( "sjcd: open: done\n" );
 #endif
   }
-#ifdef MODULE
   MOD_INC_USE_COUNT;
-#endif
   ++sjcd_open_count;
   return( 0 );
 }
@@ -1456,9 +1445,7 @@
 #if defined( SJCD_TRACE )
   printk( "sjcd: release\n" );
 #endif
-#ifdef MODULE
   MOD_DEC_USE_COUNT;
-#endif
   if( --sjcd_open_count == 0 ){
     sjcd_invalidate_buffers();
     sync_dev( inode->i_rdev );
@@ -1632,10 +1619,14 @@
 }
 
 #ifdef MODULE
+
+int init_module(void)
+{
+	return sjcd_init();
+}
+
 void cleanup_module( void ){
-  if( MOD_IN_USE ){
-    printk( "sjcd: module: in use - can not remove.\n" );
-  } else if( ( unregister_blkdev( MAJOR_NR, "sjcd" ) == -EINVAL ) ){
+  if( ( unregister_blkdev( MAJOR_NR, "sjcd" ) == -EINVAL ) ){
     printk( "sjcd: module: can not unregister device.\n" );
   } else {
     release_region( sjcd_port, 4 );
diff -u --recursive --new-file v1.3.38/linux/drivers/cdrom/sonycd535.c linux/drivers/cdrom/sonycd535.c
--- v1.3.38/linux/drivers/cdrom/sonycd535.c	Mon Oct 23 18:02:05 1995
+++ linux/drivers/cdrom/sonycd535.c	Thu Nov  9 08:24:04 1995
@@ -107,19 +107,7 @@
  */
 
 
-#include <linux/config.h>
-
-#ifdef MODULE
 # include <linux/module.h>
-# include <linux/version.h>
-# ifndef CONFIG_MODVERSIONS
-	char kernel_version[]= UTS_RELEASE;
-# endif
-#define sony535_init init_module
-#else
-# define MOD_INC_USE_COUNT
-# define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -209,10 +197,7 @@
 
 /* The base I/O address of the Sony Interface.  This is a variable (not a
    #define) so it can be easily changed via some future ioctl() */
-#ifndef MODULE
-static
-#endif
-unsigned short sony535_cd_base_io = CDU535_ADDRESS;
+static unsigned int sony535_cd_base_io = CDU535_ADDRESS;
 
 /*
  * The following are I/O addresses of the various registers for the drive.  The
@@ -271,10 +256,7 @@
 static Byte final_pos_msf[3] = {0, 0, 0};
 
 /* What IRQ is the drive using?  0 if none. */
-#ifndef MODULE
-static
-#endif
-int sony535_irq_used = CDU535_INTERRUPT;
+static int sony535_irq_used = CDU535_INTERRUPT;
 
 /* The interrupt handler will wake this queue up when it gets an interrupt. */
 static struct wait_queue *cdu535_irq_wait = NULL;
@@ -1681,14 +1663,16 @@
 
 #else /* MODULE */
 
+int init_module(void)
+{
+	return sony535_init();
+}
+
 void
 cleanup_module(void)
 {
 	int i;
-	if (MOD_IN_USE) {
-		printk(CDU535_HANDLE " module in use, cannot remove\n");
-		return;
-	}
+
 	release_region(sony535_cd_base_io, 4);
 	for (i = 0; i < sony_buffer_sectors; i++)
 		kfree_s(sony_buffer[i], 2048);
diff -u --recursive --new-file v1.3.38/linux/drivers/char/ChangeLog linux/drivers/char/ChangeLog
--- v1.3.38/linux/drivers/char/ChangeLog	Tue May  2 08:38:31 1995
+++ linux/drivers/char/ChangeLog	Wed Nov  8 07:06:25 1995
@@ -1,3 +1,30 @@
+Sat Nov  4 17:14:45 1995    <tytso@rsts-11.mit.edu>
+
+	* tty_io.c (tty_init): Move registration of TTY_MAJOR and
+		TTY_AUX_MAJOR to the end, so that /proc/devices looks
+		prettier. 
+
+	* pty.c (pty_init): Use new major numbers for PTY master and slave
+		devices.  This allow us to have more than 64 pty's.  We
+		register the old pty devices for backwards compatibility.
+		Note that a system should either be using the old pty
+		devices or the new pty devices --- in general, it should
+		try to use both, since they map into the same pty table.
+		The old pty devices are strictly for backwards compatibility.
+
+Wed Oct 11 12:45:24 1995    <tytso@rsts-11.mit.edu>
+
+	* tty_io.c (disassociate_ctty): If dissassociate_ctty is called by
+		exit, perform an implicit vhangup on the tty.
+
+	* pty.c (pty_close): When the master pty is closed, send a hangup
+		to the slave pty.
+		(pty_open): Use the flag TTY_SLAVE_CLOSED to test to see
+		if there are any open slave ptys, instead of using
+		tty->link->count.  The old method got confused if there
+		were processes that had hung-up file descriptors on the
+		slave tty.
+
 Tue May  2 00:53:25 1995    <tytso@rsx-11.mit.edu>
 
 	* tty_io.c (tty_set_ldisc): Wait until the output buffer is
diff -u --recursive --new-file v1.3.38/linux/drivers/char/atixlmouse.c linux/drivers/char/atixlmouse.c
--- v1.3.38/linux/drivers/char/atixlmouse.c	Mon Oct 16 18:38:22 1995
+++ linux/drivers/char/atixlmouse.c	Thu Nov  9 08:24:04 1995
@@ -10,16 +10,7 @@
  * version 0.3a
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
-#define atixl_busmouse_init init_module
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -236,12 +227,14 @@
 }
 
 #ifdef MODULE
+
+int init_module(void)
+{
+	return atixl_busmouse_init();
+}
+
 void cleanup_module(void)
 {
-	if (MOD_IN_USE) {
-		printk("atixlmouse: in use, remove delayed\n");
-		return;
-	}
 	mouse_deregister(&atixl_mouse);
 }
 #endif
diff -u --recursive --new-file v1.3.38/linux/drivers/char/busmouse.c linux/drivers/char/busmouse.c
--- v1.3.38/linux/drivers/char/busmouse.c	Mon Oct 16 18:38:22 1995
+++ linux/drivers/char/busmouse.c	Thu Nov  9 08:24:04 1995
@@ -28,16 +28,7 @@
  * Modularised 6-Sep-95 Philip Blundell <pjb27@cam.ac.uk> 
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
-#define bus_mouse_init init_module
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -272,10 +263,14 @@
 }
 
 #ifdef MODULE
+
+int init_module(void)
+{
+	return bus_mouse_init();
+}
+
 void cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("busmouse: in use - remove delayed\n");
 	mouse_deregister(&bus_mouse);
 }
 #endif
diff -u --recursive --new-file v1.3.38/linux/drivers/char/console.h linux/drivers/char/console.h
--- v1.3.38/linux/drivers/char/console.h	Wed Nov  8 07:11:31 1995
+++ linux/drivers/char/console.h	Thu Jan  1 02:00:00 1970
@@ -1,138 +0,0 @@
-/*
- * console.h
- *
- * Data structure and defines shared between console.c, vga.c and tga.c
- */
-
-#define NPAR 16
-
-struct vc_data {
-	unsigned long	vc_screenbuf_size;
-	unsigned short	vc_video_erase_char;	/* Background erase character */
-	unsigned char	vc_attr;		/* Current attributes */
-	unsigned char	vc_def_color;		/* Default colors */
-	unsigned char	vc_color;		/* Foreground & background */
-	unsigned char	vc_s_color;		/* Saved foreground & background */
-	unsigned char	vc_ulcolor;		/* Colour for underline mode */
-	unsigned char	vc_halfcolor;		/* Colour for half intensity mode */
-	unsigned long	vc_origin;		/* Used for EGA/VGA fast scroll	*/
-	unsigned long	vc_scr_end;		/* Used for EGA/VGA fast scroll	*/
-	unsigned long	vc_pos;
-	unsigned long	vc_x,vc_y;
-	unsigned long	vc_top,vc_bottom;
-	unsigned long	vc_state;
-	unsigned long	vc_npar,vc_par[NPAR];
-	unsigned long	vc_video_mem_start;	/* Start of video RAM		*/
-	unsigned long	vc_video_mem_end;	/* End of video RAM (sort of)	*/
-	unsigned long	vc_saved_x;
-	unsigned long	vc_saved_y;
-	/* mode flags */
-	unsigned long	vc_charset	: 1;	/* Character set G0 / G1 */
-	unsigned long	vc_s_charset	: 1;	/* Saved character set */
-	unsigned long	vc_disp_ctrl	: 1;	/* Display chars < 32? */
-	unsigned long	vc_toggle_meta	: 1;	/* Toggle high bit? */
-	unsigned long	vc_decscnm	: 1;	/* Screen Mode */
-	unsigned long	vc_decom	: 1;	/* Origin Mode */
-	unsigned long	vc_decawm	: 1;	/* Autowrap Mode */
-	unsigned long	vc_deccm	: 1;	/* Cursor Visible */
-	unsigned long	vc_decim	: 1;	/* Insert Mode */
-	unsigned long	vc_deccolm	: 1;	/* 80/132 Column Mode */
-	/* attribute flags */
-	unsigned long	vc_intensity	: 2;	/* 0=half-bright, 1=normal, 2=bold */
-	unsigned long	vc_underline	: 1;
-	unsigned long	vc_blink	: 1;
-	unsigned long	vc_reverse	: 1;
-	unsigned long	vc_s_intensity	: 2;	/* saved rendition */
-	unsigned long	vc_s_underline	: 1;
-	unsigned long	vc_s_blink	: 1;
-	unsigned long	vc_s_reverse	: 1;
-	/* misc */
-	unsigned long	vc_ques		: 1;
-	unsigned long	vc_need_wrap	: 1;
-	unsigned long	vc_has_scrolled : 1;	/* Info for unblank_screen */
-	unsigned long	vc_kmalloced	: 1;	/* kfree_s() needed */
-	unsigned long	vc_report_mouse : 2;
-	unsigned char	vc_utf		: 1;	/* Unicode UTF-8 encoding */
-	unsigned char	vc_utf_count;
-		 long	vc_utf_char;
-	unsigned long	vc_tab_stop[5];		/* Tab stops. 160 columns. */
-	unsigned char   vc_palette[16*3];       /* Colour palette for VGA+ */
-	unsigned short * vc_translate;
-	unsigned char 	vc_G0_charset;
-	unsigned char 	vc_G1_charset;
-	unsigned char 	vc_saved_G0;
-	unsigned char 	vc_saved_G1;
-	/* additional information is in vt_kern.h */
-};
-
-struct vc {
-	struct vc_data *d;
-
-	/* might add  scrmem, vt_struct, kbd  at some time,
-	   to have everything in one place - the disadvantage
-	   would be that vc_cons etc can no longer be static */
-};
-
-extern struct vc vc_cons [MAX_NR_CONSOLES];
-
-#define screenbuf_size	(vc_cons[currcons].d->vc_screenbuf_size)
-#define origin		(vc_cons[currcons].d->vc_origin)
-#define scr_end	(vc_cons[currcons].d->vc_scr_end)
-#define pos		(vc_cons[currcons].d->vc_pos)
-#define top		(vc_cons[currcons].d->vc_top)
-#define bottom		(vc_cons[currcons].d->vc_bottom)
-#define x		(vc_cons[currcons].d->vc_x)
-#define y		(vc_cons[currcons].d->vc_y)
-#define vc_state	(vc_cons[currcons].d->vc_state)
-#define npar		(vc_cons[currcons].d->vc_npar)
-#define par		(vc_cons[currcons].d->vc_par)
-#define ques		(vc_cons[currcons].d->vc_ques)
-#define attr		(vc_cons[currcons].d->vc_attr)
-#define saved_x	(vc_cons[currcons].d->vc_saved_x)
-#define saved_y	(vc_cons[currcons].d->vc_saved_y)
-#define translate	(vc_cons[currcons].d->vc_translate)
-#define G0_charset	(vc_cons[currcons].d->vc_G0_charset)
-#define G1_charset	(vc_cons[currcons].d->vc_G1_charset)
-#define saved_G0	(vc_cons[currcons].d->vc_saved_G0)
-#define saved_G1	(vc_cons[currcons].d->vc_saved_G1)
-#define utf		(vc_cons[currcons].d->vc_utf)
-#define utf_count	(vc_cons[currcons].d->vc_utf_count)
-#define utf_char	(vc_cons[currcons].d->vc_utf_char)
-#define video_mem_start (vc_cons[currcons].d->vc_video_mem_start)
-#define video_mem_end	(vc_cons[currcons].d->vc_video_mem_end)
-#define video_erase_char (vc_cons[currcons].d->vc_video_erase_char)
-#define disp_ctrl	(vc_cons[currcons].d->vc_disp_ctrl)
-#define toggle_meta	(vc_cons[currcons].d->vc_toggle_meta)
-#define decscnm	(vc_cons[currcons].d->vc_decscnm)
-#define decom		(vc_cons[currcons].d->vc_decom)
-#define decawm		(vc_cons[currcons].d->vc_decawm)
-#define deccm		(vc_cons[currcons].d->vc_deccm)
-#define decim		(vc_cons[currcons].d->vc_decim)
-#define deccolm	(vc_cons[currcons].d->vc_deccolm)
-#define need_wrap	(vc_cons[currcons].d->vc_need_wrap)
-#define has_scrolled	(vc_cons[currcons].d->vc_has_scrolled)
-#define kmalloced	(vc_cons[currcons].d->vc_kmalloced)
-#define report_mouse	(vc_cons[currcons].d->vc_report_mouse)
-#define color		(vc_cons[currcons].d->vc_color)
-#define s_color	(vc_cons[currcons].d->vc_s_color)
-#define def_color	(vc_cons[currcons].d->vc_def_color)
-#define 	foreground	(color & 0x0f)
-#define 	background	(color & 0xf0)
-#define charset	(vc_cons[currcons].d->vc_charset)
-#define s_charset	(vc_cons[currcons].d->vc_s_charset)
-#define	intensity	(vc_cons[currcons].d->vc_intensity)
-#define	underline	(vc_cons[currcons].d->vc_underline)
-#define	blink		(vc_cons[currcons].d->vc_blink)
-#define	reverse		(vc_cons[currcons].d->vc_reverse)
-#define	s_intensity	(vc_cons[currcons].d->vc_s_intensity)
-#define	s_underline	(vc_cons[currcons].d->vc_s_underline)
-#define	s_blink		(vc_cons[currcons].d->vc_s_blink)
-#define	s_reverse	(vc_cons[currcons].d->vc_s_reverse)
-#define	ulcolor		(vc_cons[currcons].d->vc_ulcolor)
-#define	halfcolor	(vc_cons[currcons].d->vc_halfcolor)
-#define tab_stop	(vc_cons[currcons].d->vc_tab_stop)
-#define palette		(vc_cons[currcons].d->vc_palette)
-
-#define vcmode		(vt_cons[currcons]->vc_mode)
-#define structsize	(sizeof(struct vc_data) + sizeof(struct vt_struct))
-
diff -u --recursive --new-file v1.3.38/linux/drivers/char/console_struct.h linux/drivers/char/console_struct.h
--- v1.3.38/linux/drivers/char/console_struct.h	Wed Nov  8 07:11:31 1995
+++ linux/drivers/char/console_struct.h	Thu Nov  9 10:04:33 1995
@@ -135,4 +135,3 @@
 
 #define vcmode		(vt_cons[currcons]->vc_mode)
 #define structsize	(sizeof(struct vc_data) + sizeof(struct vt_struct))
-
diff -u --recursive --new-file v1.3.38/linux/drivers/char/lp.c linux/drivers/char/lp.c
--- v1.3.38/linux/drivers/char/lp.c	Tue Oct 10 18:46:33 1995
+++ linux/drivers/char/lp.c	Thu Nov  9 08:24:04 1995
@@ -9,13 +9,7 @@
  * Statistics and support for slow printers by Rob Janssen, rob@knoware.nl
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -556,9 +550,9 @@
 }
 
 #ifdef MODULE
-char kernel_version[]=UTS_RELEASE;
-int io[] = {0, 0, 0};
-int irq[] = {0, 0, 0};
+static int io[] = {0, 0, 0};
+static int irq[] = {0, 0, 0};
+
 #define lp_init init_module
 #endif
 
diff -u --recursive --new-file v1.3.38/linux/drivers/char/mem.c linux/drivers/char/mem.c
--- v1.3.38/linux/drivers/char/mem.c	Mon Oct 16 18:38:22 1995
+++ linux/drivers/char/mem.c	Wed Nov  8 07:06:25 1995
@@ -323,30 +323,6 @@
 	NULL		/* no special release code */
 };
 
-static struct file_operations random_fops = {
-	memory_lseek,
-	read_random,
-	write_random,
-	NULL,		/* random_readdir */
-	NULL,		/* random_select */
-	random_ioctl,
-	NULL,		/* random_mmap */
-	NULL,		/* no special open code */
-	NULL		/* no special release code */
-};
-
-static struct file_operations urandom_fops = {
-	memory_lseek,
-	read_random_unlimited,
-	write_random,
-	NULL,		/* urandom_readdir */
-	NULL,		/* urandom_select */
-	random_ioctl,
-	NULL,		/* urandom_mmap */
-	NULL,		/* no special open code */
-	NULL		/* no special release code */
-};
-
 static int memory_open(struct inode * inode, struct file * filp)
 {
 	switch (MINOR(inode->i_rdev)) {
diff -u --recursive --new-file v1.3.38/linux/drivers/char/msbusmouse.c linux/drivers/char/msbusmouse.c
--- v1.3.38/linux/drivers/char/msbusmouse.c	Mon Oct 16 18:38:22 1995
+++ linux/drivers/char/msbusmouse.c	Thu Nov  9 08:24:04 1995
@@ -30,16 +30,7 @@
  * version 0.3b
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
-#define ms_bus_mouse_init init_module
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/ioport.h>
@@ -219,12 +210,13 @@
 }
 
 #ifdef MODULE
+int init_module(void)
+{
+	return ms_bus_mouse_init();
+}
+
 void cleanup_module(void)
 {
-	if (MOD_IN_USE) {
-		printk("msbusmouse: in use, remove delayed\n");
-		return;
-	}
 	mouse_deregister(&ms_bus_mouse);
 	release_region(MS_MSE_CONTROL_PORT, 0x04);
 }
diff -u --recursive --new-file v1.3.38/linux/drivers/char/psaux.c linux/drivers/char/psaux.c
--- v1.3.38/linux/drivers/char/psaux.c	Mon Oct 16 18:38:22 1995
+++ linux/drivers/char/psaux.c	Thu Nov  9 08:24:04 1995
@@ -31,13 +31,7 @@
 
 /* #define INITIALIZE_DEVICE */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
  
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -537,10 +531,13 @@
 }
 
 #ifdef MODULE
+int init_module(void)
+{
+	return psaux_init(); /*?? Bjorn */
+}
+
 void cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("psaux: in use, remove delayed\n");
 	mouse_deregister(&psaux_mouse);
 }
 #endif
diff -u --recursive --new-file v1.3.38/linux/drivers/char/pty.c linux/drivers/char/pty.c
--- v1.3.38/linux/drivers/char/pty.c	Tue Oct 10 18:46:33 1995
+++ linux/drivers/char/pty.c	Wed Nov  8 07:06:25 1995
@@ -48,6 +48,7 @@
 static struct semaphore tmp_buf_sem = MUTEX;
 
 struct tty_driver pty_driver, pty_slave_driver;
+struct tty_driver old_pty_driver, old_pty_slave_driver;
 static int pty_refcount;
 
 static struct tty_struct *pty_table[NR_PTYS];
@@ -77,9 +78,10 @@
 		return;
 	wake_up_interruptible(&tty->link->read_wait);
 	wake_up_interruptible(&tty->link->write_wait);
-	if (tty->driver.subtype == PTY_TYPE_MASTER)
+	if (tty->driver.subtype == PTY_TYPE_MASTER) {
 		tty_hangup(tty->link);
-	else {
+		set_bit(TTY_SLAVE_CLOSED, &tty->flags);
+	} else {
 		start_tty(tty);
 		set_bit(TTY_SLAVE_CLOSED, &tty->link->flags);
 	}
@@ -204,7 +206,8 @@
 	set_bit(TTY_THROTTLED, &tty->flags);
 	if (filp->f_flags & O_NDELAY)
 		return 0;
-	while (!tty->link->count && !(current->signal & ~current->blocked))
+	while (test_bit(TTY_SLAVE_CLOSED, &tty->link->flags) &&
+	       !(current->signal & ~current->blocked))
 		interruptible_sleep_on(&pty->open_wait);
 	if (!tty->link->count)
 		return -ERESTARTSYS;
@@ -217,8 +220,8 @@
 	memset(&pty_driver, 0, sizeof(struct tty_driver));
 	pty_driver.magic = TTY_DRIVER_MAGIC;
 	pty_driver.name = "pty";
-	pty_driver.major = TTY_MAJOR;
-	pty_driver.minor_start = 128;
+	pty_driver.major = PTY_MASTER_MAJOR;
+	pty_driver.minor_start = 0;
 	pty_driver.num = NR_PTYS;
 	pty_driver.type = TTY_DRIVER_TYPE_PTY;
 	pty_driver.subtype = PTY_TYPE_MASTER;
@@ -245,7 +248,8 @@
 	pty_slave_driver = pty_driver;
 	pty_slave_driver.name = "ttyp";
 	pty_slave_driver.subtype = PTY_TYPE_SLAVE;
-	pty_slave_driver.minor_start = 192;
+	pty_slave_driver.major = PTY_SLAVE_MAJOR;
+	pty_slave_driver.minor_start = 0;
 	pty_slave_driver.init_termios = tty_std_termios;
 	pty_slave_driver.init_termios.c_cflag = B38400 | CS8 | CREAD;
 	pty_slave_driver.table = ttyp_table;
@@ -253,12 +257,28 @@
 	pty_slave_driver.termios_locked = ttyp_termios_locked;
 	pty_slave_driver.other = &pty_driver;
 
+	old_pty_driver = pty_driver;
+	old_pty_driver.major = TTY_MAJOR;
+	old_pty_driver.minor_start = 128;
+	old_pty_driver.num = (NR_PTYS > 64) ? 64 : NR_PTYS;
+	old_pty_driver.other = &old_pty_slave_driver;
+	
+	old_pty_slave_driver = pty_slave_driver;
+	old_pty_slave_driver.major = TTY_MAJOR;
+	old_pty_slave_driver.minor_start = 192;
+	old_pty_slave_driver.num = (NR_PTYS > 64) ? 64 : NR_PTYS;
+	old_pty_slave_driver.other = &old_pty_driver;
+
 	tmp_buf = 0;
 
 	if (tty_register_driver(&pty_driver))
 		panic("Couldn't register pty driver");
 	if (tty_register_driver(&pty_slave_driver))
 		panic("Couldn't register pty slave driver");
+	if (tty_register_driver(&old_pty_driver))
+		panic("Couldn't register compat pty driver");
+	if (tty_register_driver(&old_pty_slave_driver))
+		panic("Couldn't register compat pty slave driver");
 	
 	return 0;
 }
diff -u --recursive --new-file v1.3.38/linux/drivers/char/random.c linux/drivers/char/random.c
--- v1.3.38/linux/drivers/char/random.c	Mon Oct 16 18:38:23 1995
+++ linux/drivers/char/random.c	Wed Nov  8 07:06:25 1995
@@ -1,7 +1,7 @@
 /*
  * random.c -- A strong random number generator
  *
- * Version 0.94, last modified 11-Oct-95
+ * Version 0.95, last modified 4-Nov-95
  * 
  * Copyright Theodore Ts'o, 1994, 1995.  All rights reserved.
  *
@@ -186,17 +186,17 @@
 
 /*
  * The pool is stirred with a primitive polynomial of degree 128
- * over GF(2), namely x^128 + x^119 + x^72 + x^64 + x^14 + x^8 + 1.
+ * over GF(2), namely x^128 + x^99 + x^59 + x^31 + x^9 + x^7 + 1.
  * For a pool of size 64, try x^64+x^62+x^38+x^10+x^6+x+1.
  */
 #define POOLWORDS 128    /* Power of 2 - note that this is 32-bit words */
 #define POOLBITS (POOLWORDS*32)
 #if POOLWORDS == 128
-#define TAP1    119     /* The polynomial taps */
-#define TAP2    72
-#define TAP3    64
-#define TAP4    14
-#define TAP5    8
+#define TAP1    99     /* The polynomial taps */
+#define TAP2    59
+#define TAP3    31
+#define TAP4    9
+#define TAP5    7
 #elif POOLWORDS == 64
 #define TAP1    62      /* The polynomial taps */
 #define TAP2    38
@@ -219,7 +219,7 @@
 struct timer_rand_state {
 	unsigned long	last_time;
 	int 		last_delta;
-	int 		nbits;
+	int		dont_count_entropy:1;
 };
 
 static struct random_bucket random_state;
@@ -231,6 +231,18 @@
 static struct timer_rand_state *blkdev_timer_state[MAX_BLKDEV];
 static struct wait_queue *random_wait;
 
+static int random_read(struct inode * inode, struct file * file,
+		       char * buf, int nbytes);
+static int random_read_unlimited(struct inode * inode, struct file * file,
+				 char * buf, int nbytes);
+static int random_select(struct inode *inode, struct file *file,
+			 int sel_type, select_table * wait);
+static int random_write(struct inode * inode, struct file * file,
+			const char * buffer, int count);
+static int random_ioctl(struct inode * inode, struct file * file,
+			unsigned int cmd, unsigned long arg);
+
+
 #ifndef MIN
 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #endif
@@ -242,10 +254,14 @@
 	random_state.pool = random_pool;
 	memset(irq_timer_state, 0, sizeof(irq_timer_state));
 	memset(blkdev_timer_state, 0, sizeof(blkdev_timer_state));
-	random_wait = NULL;}
+	extract_timer_state.dont_count_entropy = 1;
+	random_wait = NULL;
+}
 
 void rand_initialize_irq(int irq)
 {
+	struct timer_rand_state *state;
+	
 	if (irq >= NR_IRQS || irq_timer_state[irq])
 		return;
 
@@ -253,12 +269,17 @@
 	 * If kamlloc returns null, we just won't use that entropy
 	 * source.
 	 */
-	irq_timer_state[irq] = kmalloc(sizeof(struct timer_rand_state), 
-				       GFP_KERNEL);
+	state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
+	if (state) {
+		irq_timer_state[irq] = state;
+		memset(state, 0, sizeof(struct timer_rand_state));
+	}
 }
 
 void rand_initialize_blkdev(int major)
 {
+	struct timer_rand_state *state;
+	
 	if (major >= MAX_BLKDEV || blkdev_timer_state[major])
 		return;
 
@@ -266,8 +287,11 @@
 	 * If kamlloc returns null, we just won't use that entropy
 	 * source.
 	 */
-	blkdev_timer_state[major] = kmalloc(sizeof(struct timer_rand_state), 
-					    GFP_KERNEL);
+	state = kmalloc(sizeof(struct timer_rand_state), GFP_KERNEL);
+	if (state) {
+		blkdev_timer_state[major] = state;
+		memset(state, 0, sizeof(struct timer_rand_state));
+	}
 }
 
 /*
@@ -275,7 +299,7 @@
  * update the entropy estimate.  The caller must do this if appropriate.
  *
  * The pool is stirred with a primitive polynomial of degree 128
- * over GF(2), namely x^128 + x^119 + x^72 + x^64 + x^14 + x^8 + 1.
+ * over GF(2), namely x^128 + x^99 + x^59 + x^31 + x^9 + x^7 + 1.
  * For a pool of size 64, try x^64+x^62+x^38+x^10+x^6+x+1.
  * 
  * We rotate the input word by a changing number of bits, to help
@@ -352,7 +376,8 @@
 		outb_p(0x00, 0x43);	/* latch the count ASAP */
 		num |= inb_p(0x40) << 16;
 		num |= inb(0x40) << 24;
-		r->entropy_count += 2;
+		if (!state->dont_count_entropy)
+			r->entropy_count += 2;
 #endif
 		
 		time = jiffies;
@@ -369,24 +394,26 @@
 	 * added.  We take into account the first and second order
 	 * deltas in order to make our estimate.
 	 */
-	delta = time - state->last_time;
-	state->last_time = time;
-
-	delta2 = delta - state->last_delta;
-	state->last_delta = delta;
-
-	if (delta < 0) delta = -delta;
-	if (delta2 < 0) delta2 = -delta2;
-	delta = MIN(delta, delta2) >> 1;
-	for (nbits = 0; delta; nbits++)
-		delta >>= 1;
+	if (!state->dont_count_entropy) {
+		delta = time - state->last_time;
+		state->last_time = time;
+
+		delta2 = delta - state->last_delta;
+		state->last_delta = delta;
+
+		if (delta < 0) delta = -delta;
+		if (delta2 < 0) delta2 = -delta2;
+		delta = MIN(delta, delta2) >> 1;
+		for (nbits = 0; delta; nbits++)
+			delta >>= 1;
 
-	r->entropy_count += nbits;
-	
-	/* Prevent overflow */
-	if (r->entropy_count > POOLBITS)
-		r->entropy_count = POOLBITS;
+		r->entropy_count += nbits;
 	
+		/* Prevent overflow */
+		if (r->entropy_count > POOLBITS)
+			r->entropy_count = POOLBITS;
+	}
+		
 	wake_up_interruptible(&random_wait);	
 }
 
@@ -609,23 +636,71 @@
 	extract_entropy(&random_state, (char *) buf, nbytes, 0);
 }
 
-int read_random(struct inode * inode, struct file * file,
-                char * buf, int nbytes)
+static int
+random_read(struct inode * inode, struct file * file, char * buf, int nbytes)
 {
-	if (nbytes > random_state.entropy_count / 8)
-		nbytes = random_state.entropy_count / 8;
+	struct wait_queue 	wait = { current, NULL };
+	int			n;
+	int			retval = 0;
+	int			count = 0;
 	
-	return extract_entropy(&random_state, buf, nbytes, 1);
+	if (nbytes == 0)
+		return 0;
+
+	add_wait_queue(&random_wait, &wait);
+	while (nbytes > 0) {
+		current->state = TASK_INTERRUPTIBLE;
+		
+		n = nbytes;
+		if (n > random_state.entropy_count / 8)
+			n = random_state.entropy_count / 8;
+		if (n == 0) {
+			if (file->f_flags & O_NONBLOCK) {
+				retval = -EAGAIN;
+				break;
+			}
+			if (current->signal & ~current->blocked) {
+				retval = -ERESTARTSYS;
+				break;
+			}
+			schedule();
+			continue;
+		}
+		n = extract_entropy(&random_state, buf, n, 1);
+		count += n;
+		buf += n;
+		nbytes -= n;
+		break;		/* This break makes the device work */
+				/* like a named pipe */
+	}
+	current->state = TASK_RUNNING;
+	remove_wait_queue(&random_wait, &wait);
+
+	return (count ? count : retval);
 }
 
-int read_random_unlimited(struct inode * inode, struct file * file,
-			  char * buf, int nbytes)
+static int
+random_read_unlimited(struct inode * inode, struct file * file,
+		      char * buf, int nbytes)
 {
 	return extract_entropy(&random_state, buf, nbytes, 1);
 }
 
-int write_random(struct inode * inode, struct file * file,
-		 const char * buffer, int count)
+static int
+random_select(struct inode *inode, struct file *file,
+		      int sel_type, select_table * wait)
+{
+	if (sel_type == SEL_IN) {
+		if (random_state.entropy_count >= 8)
+			return 1;
+		select_wait(&random_wait, wait);
+	}
+	return 0;
+}
+
+static int
+random_write(struct inode * inode, struct file * file,
+	     const char * buffer, int count)
 {
 	int i;
 	__u32 word, *p;
@@ -641,22 +716,31 @@
 		memcpy_fromfs(&word, p, i);
 		add_entropy_word(&random_state, word);
 	}
-	inode->i_mtime = CURRENT_TIME;
+	if (inode)
+		inode->i_mtime = CURRENT_TIME;
 	return count;
 }
 
-int random_ioctl(struct inode * inode, struct file * file,
-			unsigned int cmd, unsigned long arg)
+static int
+random_ioctl(struct inode * inode, struct file * file,
+	     unsigned int cmd, unsigned long arg)
 {
-	int *p, max_size;
+	int *p, size, ent_count;
+	int retval;
 	
 	switch (cmd) {
 	case RNDGETENTCNT:
+		retval = verify_area(VERIFY_WRITE, (void *) arg, sizeof(int));
+		if (retval)
+			return(retval);
 		put_user(random_state.entropy_count, (int *) arg);
 		return 0;
 	case RNDADDTOENTCNT:
 		if (!suser())
 			return -EPERM;
+		retval = verify_area(VERIFY_READ, (void *) arg, sizeof(int));
+		if (retval)
+			return(retval);
 		random_state.entropy_count += get_user((int *) arg);
 		if (random_state.entropy_count > POOLBITS)
 			random_state.entropy_count = POOLBITS;
@@ -665,17 +749,67 @@
 		if (!suser())
 			return -EPERM;
 		p = (int *) arg;
-		put_user(random_state.entropy_count, p);
-		max_size = get_user(++p);
+		retval = verify_area(VERIFY_WRITE, (void *) p, sizeof(int));
+		if (retval)
+			return(retval);
+		put_user(random_state.entropy_count, p++);
+		retval = verify_area(VERIFY_READ, (void *) p, sizeof(int));
+		if (retval)
+			return(retval);
+		size = get_user(p);
 		put_user(POOLWORDS, p);
-		if (max_size < 0)
+		if (size < 0)
 			return -EINVAL;
-		if (max_size > POOLWORDS)
-			max_size = POOLWORDS;
+		if (size > POOLWORDS)
+			size = POOLWORDS;
 		memcpy_tofs(++p, random_state.pool,
-			    max_size*sizeof(__u32));
+			    size*sizeof(__u32));
+		return 0;
+	case RNDADDENTROPY:
+		if (!suser())
+			return -EPERM;
+		p = (int *) arg;
+		retval = verify_area(VERIFY_READ, (void *) p, 2*sizeof(int));
+		if (retval)
+			return(retval);
+		ent_count = get_user(p++);
+		size = get_user(p++);
+		(void) random_write(0, file, (const char *) p, size);
+		random_state.entropy_count += ent_count;
+		if (random_state.entropy_count > POOLBITS)
+			random_state.entropy_count = POOLBITS;
+		return 0;
+	case RNDZAPENTCNT:
+		if (!suser())
+			return -EPERM;
+		random_state.entropy_count = 0;
 		return 0;
 	default:
 		return -EINVAL;
 	}
 }
+
+struct file_operations random_fops = {
+	NULL,		/* random_lseek */
+	random_read,
+	random_write,
+	NULL,		/* random_readdir */
+	random_select,	/* random_select */
+	random_ioctl,
+	NULL,		/* random_mmap */
+	NULL,		/* no special open code */
+	NULL		/* no special release code */
+};
+
+struct file_operations urandom_fops = {
+	NULL,		/* unrandom_lseek */
+	random_read_unlimited,
+	random_write,
+	NULL,		/* urandom_readdir */
+	NULL,		/* urandom_select */
+	random_ioctl,
+	NULL,		/* urandom_mmap */
+	NULL,		/* no special open code */
+	NULL		/* no special release code */
+};
+
diff -u --recursive --new-file v1.3.38/linux/drivers/char/stallion.c linux/drivers/char/stallion.c
--- v1.3.38/linux/drivers/char/stallion.c	Tue Oct 10 18:46:34 1995
+++ linux/drivers/char/stallion.c	Wed Nov  8 12:07:27 1995
@@ -25,11 +25,7 @@
 
 /*****************************************************************************/
 
-#ifdef MODULE
-#include <linux/config.h>
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/errno.h>
 #include <linux/sched.h>
@@ -45,6 +41,8 @@
 #include <linux/string.h>
 #include <linux/malloc.h>
 #include <linux/ioport.h>
+#include <linux/config.h>	/* for CONFIG_PCI */
+
 #include <asm/system.h>
 #include <asm/io.h>
 #include <asm/segment.h>
@@ -508,8 +506,6 @@
 /*
  *	Use the kernel version number for modules.
  */
-char	kernel_version[] = UTS_RELEASE;
-
 int init_module()
 {
 	unsigned long	flags;
diff -u --recursive --new-file v1.3.38/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v1.3.38/linux/drivers/char/tty_io.c	Tue Oct 10 18:46:34 1995
+++ linux/drivers/char/tty_io.c	Wed Nov  8 07:06:25 1995
@@ -443,22 +443,28 @@
  * 	(2)  Clears the tty from being controlling the session
  * 	(3)  Clears the controlling tty for all processes in the
  * 		session group.
+ *
+ * The argument on_exit is set to 1 if called when a process is
+ * exiting; it is 0 if called by the ioctl TIOCNOTTY.
  */
-void disassociate_ctty(int priv)
+void disassociate_ctty(int on_exit)
 {
 	struct tty_struct *tty = current->tty;
 	struct task_struct *p;
 
-	if (!tty) {
+	if (tty) {
+		if (on_exit)
+			tty_vhangup(tty);
+	} else {
 		if (current->tty_old_pgrp) {
-			kill_pg(current->tty_old_pgrp, SIGHUP, priv);
-			kill_pg(current->tty_old_pgrp, SIGCONT, priv);
+			kill_pg(current->tty_old_pgrp, SIGHUP, on_exit);
+			kill_pg(current->tty_old_pgrp, SIGCONT, on_exit);
 		}
 		return;
 	}
 	if (tty->pgrp > 0) {
-		kill_pg(tty->pgrp, SIGHUP, priv);
-		kill_pg(tty->pgrp, SIGCONT, priv);
+		kill_pg(tty->pgrp, SIGHUP, on_exit);
+		kill_pg(tty->pgrp, SIGCONT, on_exit);
 	}
 
 	current->tty_old_pgrp = 0;
@@ -1781,11 +1787,6 @@
 {
 	if (sizeof(struct tty_struct) > PAGE_SIZE)
 		panic("size of tty structure > PAGE_SIZE!");
-	if (register_chrdev(TTY_MAJOR,"tty",&tty_fops))
-		panic("unable to get major %d for tty device", TTY_MAJOR);
-	if (register_chrdev(TTYAUX_MAJOR,"cua",&tty_fops))
-		panic("unable to get major %d for tty device", TTYAUX_MAJOR);
-
 	kbd_init();
 	rs_init();
 #ifdef CONFIG_SCC
@@ -1802,5 +1803,10 @@
 #endif
 	pty_init();
 	vcs_init();
+	if (register_chrdev(TTY_MAJOR,"tty",&tty_fops))
+		panic("unable to get major %d for tty device", TTY_MAJOR);
+	if (register_chrdev(TTYAUX_MAJOR,"cua",&tty_fops))
+		panic("unable to get major %d for tty device", TTYAUX_MAJOR);
+
 	return 0;
 }
diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c501.c linux/drivers/net/3c501.c
--- v1.3.38/linux/drivers/net/3c501.c	Wed Oct  4 14:14:30 1995
+++ linux/drivers/net/3c501.c	Thu Nov  9 08:24:04 1995
@@ -83,14 +83,7 @@
   The 3c501 board.
   */
 
-#include <linux/config.h>
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -102,6 +95,7 @@
 #include <linux/string.h>
 #include <linux/ioport.h>
 #include <linux/errno.h>
+#include <linux/config.h>	/* for CONFIG_IP_MULTICAST */
 
 #include <asm/bitops.h>
 #include <asm/io.h>
@@ -677,7 +671,6 @@
     }
 }
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_3c501 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -685,8 +678,8 @@
 	0x280, 5,
 	0, 0, 0, NULL, el1_probe };
 
-int io=0x280;
-int irq=5;
+static int io=0x280;
+static int irq=5;
 	
 int
 init_module(void)
diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c503.c linux/drivers/net/3c503.c
--- v1.3.38/linux/drivers/net/3c503.c	Sun Oct 29 11:38:48 1995
+++ linux/drivers/net/3c503.c	Thu Nov  9 08:24:04 1995
@@ -31,23 +31,19 @@
 static const char *version =
     "3c503.c:v1.10 9/23/93  Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/delay.h>
-#include <asm/io.h>
-#include <asm/system.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 
+#include <asm/io.h>
+#include <asm/system.h>
+
 #include "8390.h"
 #include "3c503.h"
 
@@ -531,15 +527,14 @@
     outb_p(ei_status.interface_num == 0 ? ECNTRL_THIN : ECNTRL_AUI, E33G_CNTRL);
 }
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static struct device el2_drv =
 {"3c503", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el2_probe };
        
 static struct device el2pio_drv =
 {"3c503pio", 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, el2_pio_probe };
 
-int io = 0x300;
-int irq = 0;
+static int io = 0x300;
+static int irq = 0;
 
 static int no_pio = 1;
 int init_module(void)
@@ -569,23 +564,18 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("3c503: device busy, remove delayed\n");
-	else {
-	    int ioaddr;
+	int ioaddr;
 
-	    if (no_pio) {
+	if (no_pio) {
 		ioaddr = el2_drv.base_addr;
 		unregister_netdev(&el2_drv);
-	    } else {
+	} else {
 		ioaddr = el2pio_drv.base_addr;
 		unregister_netdev(&el2pio_drv);
-	    }
-
-	    /* If we don't do this, we can't re-insmod it later. */
-	    release_region(ioaddr, EL2_IO_EXTENT);
-
 	}
+
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(ioaddr, EL2_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c505.c linux/drivers/net/3c505.c
--- v1.3.38/linux/drivers/net/3c505.c	Tue Oct 10 18:46:34 1995
+++ linux/drivers/net/3c505.c	Thu Nov  9 08:24:04 1995
@@ -33,10 +33,7 @@
  *                     
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -924,9 +921,7 @@
 	if (elp_debug >= 3)
 		printk("%s: start receive command sent\n", dev->name);
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 
 	return 0;			/* Always succeed */
 }
@@ -1157,9 +1152,7 @@
 	 */
 	irq2dev_map[dev->irq] = 0;
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -1462,7 +1455,6 @@
 	return 0;
 }
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_3c505 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -1470,8 +1462,8 @@
 	0, 0,
 	0, 0, 0, NULL, elplus_probe };
 
-int io = 0x300;
-int irq = 0;
+static int io = 0x300;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -1489,16 +1481,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("3c505: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_3c505);
-		kfree(dev_3c505.priv);
-		dev_3c505.priv = NULL;
+	unregister_netdev(&dev_3c505);
+	kfree(dev_3c505.priv);
+	dev_3c505.priv = NULL;
 
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_3c505.base_addr, ELP_IO_EXTENT);
-	}
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_3c505.base_addr, ELP_IO_EXTENT);
 }
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c507.c linux/drivers/net/3c507.c
--- v1.3.38/linux/drivers/net/3c507.c	Wed Nov  8 07:11:31 1995
+++ linux/drivers/net/3c507.c	Thu Nov  9 08:24:05 1995
@@ -442,9 +442,7 @@
 	dev->interrupt = 0;
 	dev->start = 1;
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -637,9 +635,7 @@
 
 	/* Update the statistics here. */
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -887,8 +883,8 @@
 	0, 0, 0, NULL, el16_probe
 };
 
-int io = 0x300;
-int irq = 0;
+static int io = 0x300;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -906,18 +902,13 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("3c507: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_3c507);
-		kfree(dev_3c507.priv);
-		dev_3c507.priv = NULL;
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_3c507.irq);
-		release_region(dev_3c507.base_addr, EL16_IO_EXTENT);
-	}
+	unregister_netdev(&dev_3c507);
+	kfree(dev_3c507.priv);
+	dev_3c507.priv = NULL;
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_3c507.irq);
+	release_region(dev_3c507.base_addr, EL16_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/3c509.c linux/drivers/net/3c509.c
--- v1.3.38/linux/drivers/net/3c509.c	Wed Oct  4 14:14:30 1995
+++ linux/drivers/net/3c509.c	Thu Nov  9 08:24:05 1995
@@ -26,12 +26,9 @@
 
 static const  char *version = "3c509.c:1.03 10/8/94 becker@cesdis.gsfc.nasa.gov\n";
 
-#include <linux/config.h>
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -41,12 +38,13 @@
 #include <linux/in.h>
 #include <linux/malloc.h>
 #include <linux/ioport.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
+#include <linux/config.h>	/* for CONFIG_MCA */
+
+#include <asm/bitops.h>
+#include <asm/io.h>
 
 
 #ifdef EL3_DEBUG
@@ -380,9 +378,7 @@
 		printk("%s: Opened 3c509  IRQ %d  status %4.4x.\n",
 			   dev->name, dev->irq, inw(ioaddr + EL3_STATUS));
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;					/* Always succeed */
 }
 
@@ -699,14 +695,11 @@
 	irq2dev_map[dev->irq] = 0;
 
 	update_stats(ioaddr, dev);
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_3c509 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -714,8 +707,8 @@
 	0, 0,
 	0, 0, 0, NULL, el3_probe };
 
-int io = 0;
-int irq = 0;
+static int io = 0;
+static int irq = 0;
 
 int
 init_module(void)
@@ -733,16 +726,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("3c509: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_3c509);
-		kfree_s(dev_3c509.priv,sizeof(struct el3_private));
-		dev_3c509.priv=NULL;
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_3c509.base_addr, EL3_IO_EXTENT);
-	}
+	unregister_netdev(&dev_3c509);
+	kfree_s(dev_3c509.priv,sizeof(struct el3_private));
+	dev_3c509.priv=NULL;
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_3c509.base_addr, EL3_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/8390.c linux/drivers/net/8390.c
--- v1.3.38/linux/drivers/net/8390.c	Wed Oct  4 14:14:30 1995
+++ linux/drivers/net/8390.c	Wed Nov  8 12:07:26 1995
@@ -36,10 +36,7 @@
   The National Semiconductor LAN Databook, and the 3Com 3c503 databook.
   */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -704,7 +701,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void)
 {
diff -u --recursive --new-file v1.3.38/linux/drivers/net/Makefile linux/drivers/net/Makefile
--- v1.3.38/linux/drivers/net/Makefile	Tue Oct 10 18:46:35 1995
+++ linux/drivers/net/Makefile	Thu Nov  9 08:24:05 1995
@@ -130,12 +130,12 @@
 endif
 
 ifeq ($(CONFIG_PPP),y)
-L_OBJS += ppp.o
+LX_OBJS += ppp.o
 CONFIG_SLHC_BUILTIN = y
 else
   ifeq ($(CONFIG_PPP),m)
   CONFIG_SLHC_MODULE = y
-  M_OBJS += ppp.o
+  MX_OBJS += ppp.o
   endif
 endif
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/ac3200.c linux/drivers/net/ac3200.c
--- v1.3.38/linux/drivers/net/ac3200.c	Wed Oct  4 14:14:30 1995
+++ linux/drivers/net/ac3200.c	Thu Nov  9 08:24:05 1995
@@ -17,19 +17,18 @@
 static const char *version =
 	"ac3200.c:v1.01 7/1/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
+
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+
 #include <asm/system.h>
 #include <asm/io.h>
 
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
 #include "8390.h"
 
 /* Offsets from the base address. */
@@ -221,9 +220,7 @@
 	rc = ei_open(dev);
 	if (rc != 0) return rc;
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -298,15 +295,12 @@
 
 	NS8390_init(dev, 0);
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_ac3200 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -314,8 +308,8 @@
 	0, 0,
 	0, 0, 0, NULL, ac3200_probe };
 
-int io = 0;
-int irq = 0;
+static int io = 0;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -331,16 +325,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("ac3200: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_ac3200);
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_ac3200.irq);
-		release_region(dev_ac3200.base_addr, AC_IO_EXTENT);
-	}
+	unregister_netdev(&dev_ac3200);
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_ac3200.irq);
+	release_region(dev_ac3200.base_addr, AC_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/apricot.c linux/drivers/net/apricot.c
--- v1.3.38/linux/drivers/net/apricot.c	Tue Aug 15 20:39:02 1995
+++ linux/drivers/net/apricot.c	Thu Nov  9 08:24:05 1995
@@ -21,10 +21,7 @@
 
 static const char *version = "apricot.c:v0.2 05/12/94\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -34,14 +31,14 @@
 #include <linux/ioport.h>
 #include <linux/malloc.h>
 #include <linux/interrupt.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/dma.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
 
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+
 #ifndef HAVE_PORTRESERVE
 #define check_region(addr, size)	0
 #define request_region(addr, size,name)	do ; while(0)
@@ -562,9 +559,7 @@
     dev->tbusy = 0;
     dev->interrupt = 0;
     dev->start = 1;
-#ifdef MODULE
     MOD_INC_USE_COUNT;
-#endif
 
     /* Initialize the 82596 memory */
     init_i596_mem(dev);
@@ -946,10 +941,7 @@
     free_irq(dev->irq);
     irq2dev_map[dev->irq] = 0;
     remove_rx_bufs(dev);
-#ifdef MODULE
     MOD_DEC_USE_COUNT;
-#endif
-
 
     return 0;
 }
@@ -1013,7 +1005,6 @@
 #endif
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_apricot = {
   devicename, /* device name inserted by /linux/drivers/net/net_init.c */
@@ -1021,8 +1012,8 @@
   0x300, 10,
   0, 0, 0, NULL, apricot_probe };
 
-int io = 0x300;
-int irq = 10;
+static int io = 0x300;
+static int irq = 10;
 
 int
 init_module(void)
@@ -1037,17 +1028,12 @@
 void
 cleanup_module(void)
 {
-  if (MOD_IN_USE)
-    printk("%s: device busy, remove delayed\n", dev_apricot.name);
-  else
-  {
     unregister_netdev(&dev_apricot);
     kfree_s((void *)dev_apricot.mem_start, sizeof(struct i596_private) + 0xf);
     dev_apricot.priv = NULL;
 
     /* If we don't do this, we can't re-insmod it later. */
     release_region(dev_apricot.base_addr, APRICOT_TOTAL_SIZE);
-  }
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/arcnet.c linux/drivers/net/arcnet.c
--- v1.3.38/linux/drivers/net/arcnet.c	Sun Oct 29 11:38:49 1995
+++ linux/drivers/net/arcnet.c	Thu Nov  9 08:24:05 1995
@@ -125,16 +125,9 @@
 static const char *version =
  "arcnet.c:v2.12 ALPHA 95/10/27 Avery Pennarun <apenwarr@foxnet.net>\n";
 
- 
-
-#include <linux/config.h>
-#include <linux/version.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#endif /* MODULE */
-
 
+#include <linux/config.h>
 /* are we Linux 1.2.x? */
 #if LINUX_VERSION_CODE < 0x10300
 #define LINUX12
@@ -155,16 +148,17 @@
 #include <linux/errno.h>
 #include <linux/delay.h>
 #include <linux/if_arp.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+
+#include <linux/config.h>	/* for CONFIG_INET */
 
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/io.h>
 #include <asm/dma.h>
 
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-
 #ifdef LINUX12
 #include "arp.h"
 #else
@@ -1140,11 +1134,8 @@
 	JIFFER(ACKtime);
 	outb(NORXflag|RECON_flag,INTMASK);
 	
-
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
-                                 	
+
 	return 0;
 }
 
@@ -1189,9 +1180,7 @@
 
 	/* Update the statistics here. */
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -2997,7 +2986,6 @@
 
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device thiscard = {
   devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -3007,10 +2995,10 @@
 };
 	
 	
-int io=0x0;	/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
-int irqnum=0;	/* or use the insmod io= irqnum= shmem= options */
-int shmem=0;
-int num=0;	/* number of device (ie for 0 for arc0, 1 for arc1...) */
+static int io=0x0;	/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
+static int irqnum=0;	/* or use the insmod io= irqnum= shmem= options */
+static int shmem=0;
+static int num=0;	/* number of device (ie for 0 for arc0, 1 for arc1...) */
 
 int
 init_module(void)
@@ -3038,20 +3026,13 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-	{
-		printk("%s: device busy, remove delayed\n",thiscard.name);
-	}
-	else
-	{
-		if (thiscard.start) arcnet_close(&thiscard);
-		if (thiscard.irq) free_irq(thiscard.irq);
-		if (thiscard.base_addr) release_region(thiscard.base_addr,
+	if (thiscard.start) arcnet_close(&thiscard);
+	if (thiscard.irq) free_irq(thiscard.irq);
+	if (thiscard.base_addr) release_region(thiscard.base_addr,
 						ARCNET_TOTAL_SIZE);
-		unregister_netdev(&thiscard);
-		kfree(thiscard.priv);
-		thiscard.priv = NULL;
-	}
+	unregister_netdev(&thiscard);
+	kfree(thiscard.priv);
+	thiscard.priv = NULL;
 }
 
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/at1700.c linux/drivers/net/at1700.c
--- v1.3.38/linux/drivers/net/at1700.c	Wed Nov  8 07:11:31 1995
+++ linux/drivers/net/at1700.c	Thu Nov  9 08:24:05 1995
@@ -355,9 +355,7 @@
 	dev->interrupt = 0;
 	dev->start = 1;
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -587,9 +585,7 @@
 	/* Power-down the chip.  Green, green, green! */
 	outb(0x00, ioaddr + CONFIG_1);
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -640,8 +636,8 @@
 	0, 0,
 	0, 0, 0, NULL, at1700_probe };
 
-int io = 0x260;
-int irq = 0;
+static int io = 0x260;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -659,19 +655,14 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("at1700: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_at1700);
-		kfree(dev_at1700.priv);
-		dev_at1700.priv = NULL;
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_at1700.irq);
-		irq2dev_map[dev_at1700.irq] = NULL;
-		release_region(dev_at1700.base_addr, AT1700_IO_EXTENT);
-	}
+	unregister_netdev(&dev_at1700);
+	kfree(dev_at1700.priv);
+	dev_at1700.priv = NULL;
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_at1700.irq);
+	irq2dev_map[dev_at1700.irq] = NULL;
+	release_region(dev_at1700.base_addr, AT1700_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/bsd_comp.c linux/drivers/net/bsd_comp.c
--- v1.3.38/linux/drivers/net/bsd_comp.c	Wed Nov  8 07:11:31 1995
+++ linux/drivers/net/bsd_comp.c	Thu Nov  9 08:24:05 1995
@@ -1197,8 +1197,5 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("ppp_bsd_comp: device busy, remove delayed\n");
-	else
-		ppp_unregister_compressor (&ppp_bsd_compress);
+	ppp_unregister_compressor (&ppp_bsd_compress);
 }
diff -u --recursive --new-file v1.3.38/linux/drivers/net/de4x5.c linux/drivers/net/de4x5.c
--- v1.3.38/linux/drivers/net/de4x5.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/de4x5.c	Thu Nov  9 08:24:05 1995
@@ -2764,20 +2764,16 @@
 {
   struct de4x5_private *lp = (struct de4x5_private *) thisDE4X5.priv;
 
-  if (MOD_IN_USE) {
-    printk("%s: device busy, remove delayed\n",thisDE4X5.name);
-  } else {
-    if (lp) {
-      kfree_s(bus_to_virt(lp->rx_ring[0].buf), RX_BUFF_SZ * NUM_RX_DESC + ALIGN);
-    }
-    kfree_s(thisDE4X5.priv, sizeof(struct de4x5_private) + ALIGN);
-    thisDE4X5.priv = NULL;
+  if (lp) {
+    kfree_s(bus_to_virt(lp->rx_ring[0].buf), RX_BUFF_SZ * NUM_RX_DESC + ALIGN);
+  }
+  kfree_s(thisDE4X5.priv, sizeof(struct de4x5_private) + ALIGN);
+  thisDE4X5.priv = NULL;
 
-    release_region(thisDE4X5.base_addr, (lp->bus == PCI ? 
+  release_region(thisDE4X5.base_addr, (lp->bus == PCI ? 
 					             DE4X5_PCI_TOTAL_SIZE :
 			                             DE4X5_EISA_TOTAL_SIZE));
-    unregister_netdev(&thisDE4X5);
-  }
+  unregister_netdev(&thisDE4X5);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/de600.c linux/drivers/net/de600.c
--- v1.3.38/linux/drivers/net/de600.c	Tue Oct 10 18:46:35 1995
+++ linux/drivers/net/de600.c	Thu Nov  9 08:24:05 1995
@@ -90,10 +90,7 @@
 #endif
 unsigned int de600_debug = DE600_DEBUG;
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -345,9 +342,7 @@
 	}
 	irq2dev_map[DE600_IRQ] = dev;
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	dev->start = 1;
 	if (adapter_init(dev)) {
 		return 1;
@@ -373,9 +368,7 @@
 		free_irq(DE600_IRQ);
 		irq2dev_map[DE600_IRQ] = NULL;
 		dev->start = 0;
-#ifdef MODULE
 		MOD_DEC_USE_COUNT;
-#endif
 	}
 	return 0;
 }
@@ -832,7 +825,6 @@
 #endif
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char nullname[8];
 static struct device de600_dev = {
 	nullname, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, de600_probe };
diff -u --recursive --new-file v1.3.38/linux/drivers/net/de620.c linux/drivers/net/de620.c
--- v1.3.38/linux/drivers/net/de620.c	Tue Oct 10 18:46:35 1995
+++ linux/drivers/net/de620.c	Thu Nov  9 08:24:05 1995
@@ -1,5 +1,5 @@
 /*
- *	de620.c $Revision: 1.31 $ BETA
+ *	de620.c $Revision: 1.40 $ BETA
  *
  *
  *	Linux driver for the D-Link DE-620 Ethernet pocket adapter.
@@ -39,7 +39,7 @@
  *
  *****************************************************************************/
 static const char *version =
-	"de620.c: $Revision: 1.31 $,  Bjorn Ekwall <bj0rn@blox.se>\n";
+	"de620.c: $Revision: 1.40 $,  Bjorn Ekwall <bj0rn@blox.se>\n";
 
 /***********************************************************************
  *
@@ -57,6 +57,22 @@
  */
 
 /*
+ * This driver assumes that the printer port is a "normal",
+ * dumb, uni-directional port!
+ * If your port is "fancy" in any way, please try to set it to "normal"
+ * with your BIOS setup.  I have no access to machines with bi-directional
+ * ports, so I can't test such a driver :-(
+ * (Yes, I _know_ it is possible to use DE620 with bidirectional ports...)
+ *
+ * There are some clones of DE620 out there, with different names.
+ * If the current driver does not recognize a clone, try to change
+ * the following #define to:
+ *
+ * #define DE620_CLONE 1
+ */
+#define DE620_CLONE 0
+
+/*
  * If the adapter has problems with high speeds, enable this #define
  * otherwise full printerport speed will be attempted.
  *
@@ -100,18 +116,8 @@
 #define COUNT_LOOPS
  */
 #endif
-static int bnc = 0, utp = 0;
-/*
- * Force media with insmod:
- *	insmod de620.o bnc=1
- * or
- *	insmod de620.o utp=1
- */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -165,6 +171,27 @@
 #define PRINTK(x) /**/
 #endif
 
+
+/*
+ * Force media with insmod:
+ *	insmod de620.o bnc=1
+ * or
+ *	insmod de620.o utp=1
+ *
+ * Force io and/or irq with insmod:
+ *	insmod de620.o io=0x378 irq=7
+ *
+ * Make a clone skip the Ethernet-address range check:
+ *	insmod de620.o clone=1
+ */
+static int bnc = 0;
+static int utp = 0;
+static int io  = DE620_IO;
+static int irq = DE620_IRQ;
+static int clone = DE620_CLONE;
+
+static unsigned int de620_debug = DE620_DEBUG;
+
 /***********************************************
  *                                             *
  * Index to functions, as function prototypes. *
@@ -200,8 +227,6 @@
 #define DE620_RX_START_PAGE 12		/* 12 pages (=3k) reserved for tx */
 #define DEF_NIC_CMD IRQEN | ICEN | DS1
 
-unsigned int de620_debug = DE620_DEBUG;
-
 static volatile byte	NIC_Cmd;
 static volatile byte	next_rx_page;
 static byte		first_rx_page;
@@ -407,15 +432,13 @@
 static int
 de620_open(struct device *dev)
 {
-	if (request_irq(DE620_IRQ, de620_interrupt, 0, "de620")) {
-		printk ("%s: unable to get IRQ %d\n", dev->name, DE620_IRQ);
+	if (request_irq(dev->irq, de620_interrupt, 0, "de620")) {
+		printk ("%s: unable to get IRQ %d\n", dev->name, dev->irq);
 		return 1;
 	}
-	irq2dev_map[DE620_IRQ] = dev;
+	irq2dev_map[dev->irq] = dev;
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	if (adapter_init(dev)) {
 		return 1;
 	}
@@ -434,13 +457,11 @@
 	/* disable recv */
 	de620_set_register(dev, W_TCR, RXOFF);
 
-	free_irq(DE620_IRQ);
-	irq2dev_map[DE620_IRQ] = NULL;
+	free_irq(dev->irq);
+	irq2dev_map[dev->irq] = NULL;
 
 	dev->start = 0;
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -580,16 +601,16 @@
  *
  */
 static void
-de620_interrupt(int irq, struct pt_regs *regs)
+de620_interrupt(int irq_in, struct pt_regs *regs)
 {
-	struct device *dev = irq2dev_map[irq];
+	struct device *dev = irq2dev_map[irq_in];
 	byte irq_status;
 	int bogus_count = 0;
 	int again = 0;
 
 	/* This might be deleted now, no crummy drivers present :-) Or..? */
-	if ((dev == NULL) || (DE620_IRQ != irq)) {
-		printk("%s: bogus interrupt %d\n", dev?dev->name:"DE620", irq);
+	if ((dev == NULL) || (irq != irq_in)) {
+		printk("%s: bogus interrupt %d\n", dev?dev->name:"de620", irq_in);
 		return;
 	}
 
@@ -817,6 +838,13 @@
 	int i;
 	byte checkbyte = 0xa5;
 
+	/*
+	 * This is where the base_addr and irq gets set.
+	 * Tunable at compile-time and insmod-time
+	 */
+	dev->base_addr = io;
+	dev->irq       = irq;
+
 	if (de620_debug)
 		printk(version);
 
@@ -836,12 +864,12 @@
 	}
 
 #if 0 /* Not yet */
-	if (check_region(DE620_IO, 3)) {
-		printk(", port 0x%x busy\n", DE620_IO);
+	if (check_region(dev->base_addr, 3)) {
+		printk(", port 0x%x busy\n", dev->base_addr);
 		return EBUSY;
 	}
 #endif
-	request_region(DE620_IO, 3, "de620");
+	request_region(dev->base_addr, 3, "de620");
 
 	/* else, got it! */
 	printk(", Ethernet Address: %2.2X",
@@ -869,8 +897,7 @@
 	dev->stop = de620_close;
 	dev->hard_start_xmit = &de620_start_xmit;
 	dev->set_multicast_list = &de620_set_multicast_list;
-	dev->base_addr = DE620_IO;
-	dev->irq = DE620_IRQ;
+	/* base_addr and irq are already set, see above! */
 
 	ether_setup(dev);
 	
@@ -948,13 +975,13 @@
 
 	/* D-Link Ethernet addresses are in the series  00:80:c8:7X:XX:XX:XX */
 	wrd = ReadAWord(dev, 0x1aa);	/* bytes 0 + 1 of NodeID */
-	if (wrd != htons(0x0080)) /* Valid D-Link ether sequence? */
+	if (!clone && (wrd != htons(0x0080))) /* Valid D-Link ether sequence? */
 		return -1; /* Nope, not a DE-620 */
 	nic_data.NodeID[0] = wrd & 0xff;
 	nic_data.NodeID[1] = wrd >> 8;
 
 	wrd = ReadAWord(dev, 0x1ab);	/* bytes 2 + 3 of NodeID */
-	if ((wrd & 0xff) != 0xc8) /* Valid D-Link ether sequence? */
+	if (!clone && ((wrd & 0xff) != 0xc8)) /* Valid D-Link ether sequence? */
 		return -1; /* Nope, not a DE-620 */
 	nic_data.NodeID[2] = wrd & 0xff;
 	nic_data.NodeID[3] = wrd >> 8;
@@ -984,19 +1011,13 @@
  *
  */
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char nullname[8] = "";
 static struct device de620_dev = {
 	nullname, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, de620_probe };
 
-int de620_io  = DE620_IO;
-int de620_irq = DE620_IRQ;
-
 int
 init_module(void)
 {
-	de620_dev.base_addr = de620_io;
-	de620_dev.irq       = de620_irq;
 	if (register_netdev(&de620_dev) != 0)
 		return -EIO;
 	return 0;
diff -u --recursive --new-file v1.3.38/linux/drivers/net/depca.c linux/drivers/net/depca.c
--- v1.3.38/linux/drivers/net/depca.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/depca.c	Thu Nov  9 08:24:06 1995
@@ -1837,9 +1837,6 @@
 void
 cleanup_module(void)
 {
-  if (MOD_IN_USE) {
-    printk("%s: device busy, remove delayed\n",thisDepca.name);
-  } else {
     release_region(thisDepca.base_addr, DEPCA_TOTAL_SIZE);
     if (thisDepca.priv) {
       kfree_s(thisDepca.priv, sizeof(struct depca_private));
@@ -1847,7 +1844,6 @@
     }
 
     unregister_netdev(&thisDepca);
-  }
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/dummy.c linux/drivers/net/dummy.c
--- v1.3.38/linux/drivers/net/dummy.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/dummy.c	Thu Nov  9 08:24:06 1995
@@ -164,13 +164,8 @@
 
 void cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("dummy: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_dummy);
-		kfree(dev_dummy.priv);
-		dev_dummy.priv = NULL;
-	}
+	unregister_netdev(&dev_dummy);
+	kfree(dev_dummy.priv);
+	dev_dummy.priv = NULL;
 }
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/e2100.c linux/drivers/net/e2100.c
--- v1.3.38/linux/drivers/net/e2100.c	Wed Oct  4 14:14:30 1995
+++ linux/drivers/net/e2100.c	Thu Nov  9 08:24:06 1995
@@ -34,21 +34,19 @@
 static const char *version =
 	"e2100.c:v1.01 7/21/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
-#include <asm/io.h>
-#include <asm/system.h>
 #include <linux/ioport.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
+
+#include <asm/io.h>
+#include <asm/system.h>
+
 #include "8390.h"
 
 static int e21_probe_list[] = {0x300, 0x280, 0x380, 0x220, 0};
@@ -261,9 +259,7 @@
 
 	rc = ei_open(dev);
 	if (rc != 0) return rc;
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -359,9 +355,7 @@
 	   really bad things happen if it isn't. */
 	mem_off(ioaddr);
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -372,7 +366,6 @@
 #endif
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_e2100 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -380,8 +373,8 @@
 	0, 0,
 	0, 0, 0, NULL, e2100_probe };
 
-int io = 0x300;
-int irq = 0;
+static int io = 0x300;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -399,15 +392,10 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("e2100: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_e2100);
+	unregister_netdev(&dev_e2100);
 
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_e2100.base_addr, E21_IO_EXTENT);
-	}
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_e2100.base_addr, E21_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/eepro.c linux/drivers/net/eepro.c
--- v1.3.38/linux/drivers/net/eepro.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/eepro.c	Thu Nov  9 08:24:06 1995
@@ -587,9 +587,7 @@
 
 	outb(RCV_ENABLE_CMD, ioaddr);
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -756,9 +754,7 @@
 	SLOW_DOWN_IO;
 	SLOW_DOWN_IO; /* May not be enough? */
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -1138,8 +1134,8 @@
 	0, 0,
 	0, 0, 0, NULL, eepro_probe };
 
-int io = 0x200;
-int irq = 0;
+static int io = 0x200;
+static int irq = 0;
 
 int
 init_module(void)
@@ -1157,16 +1153,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("eepro: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_eepro);
-		kfree_s(dev_eepro.priv,sizeof(struct eepro_local));
-		dev_eepro.priv=NULL;
+	unregister_netdev(&dev_eepro);
+	kfree_s(dev_eepro.priv,sizeof(struct eepro_local));
+	dev_eepro.priv=NULL;
 
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_eepro.base_addr, EEPRO_IO_EXTENT);
-	}
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_eepro.base_addr, EEPRO_IO_EXTENT);
 }
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/eexpress.c linux/drivers/net/eexpress.c
--- v1.3.38/linux/drivers/net/eexpress.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/eexpress.c	Thu Nov  9 08:24:06 1995
@@ -442,9 +442,7 @@
 	dev->tbusy = 0;
 	dev->interrupt = 0;
 	dev->start = 1;
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -656,9 +654,7 @@
 
 	/* Update the statistics here. */
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -1006,8 +1002,8 @@
 	0, 0, 0, NULL, express_probe };
 	
 
-int irq=0x300;
-int io=0;	
+static int irq=0x300;
+static int io=0;	
 
 int
 init_module(void)
@@ -1024,17 +1020,12 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("eexpress: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_eexpress);
-		kfree_s(dev_eexpress.priv,sizeof(struct net_local));
-		dev_eexpress.priv=NULL;
+	unregister_netdev(&dev_eexpress);
+	kfree_s(dev_eexpress.priv,sizeof(struct net_local));
+	dev_eexpress.priv=NULL;
 
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(dev_eexpress.base_addr, EEXPRESS_IO_EXTENT);
-	}
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(dev_eexpress.base_addr, EEXPRESS_IO_EXTENT);
 }
 #endif /* MODULE */
 /*
diff -u --recursive --new-file v1.3.38/linux/drivers/net/eql.c linux/drivers/net/eql.c
--- v1.3.38/linux/drivers/net/eql.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/eql.c	Thu Nov  9 08:24:06 1995
@@ -291,9 +291,7 @@
 	eql->timer_on = 1;
 	add_timer (&eql->timer);
 
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
       }
   return 1;
@@ -318,9 +316,7 @@
 
   eql_delete_slave_queue (eql->queue);
 
-#ifdef MODULE
   MOD_DEC_USE_COUNT;
-#endif
 
   return 0;
 }
@@ -1203,12 +1199,7 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("eql: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_eql);
-	}
+	unregister_netdev(&dev_eql);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/ewrk3.c linux/drivers/net/ewrk3.c
--- v1.3.38/linux/drivers/net/ewrk3.c	Tue Oct 10 18:46:36 1995
+++ linux/drivers/net/ewrk3.c	Thu Nov  9 08:24:06 1995
@@ -128,12 +128,10 @@
 
 static const char *version = "ewrk3.c:v0.32 1/16/95 davies@wanton.lkg.dec.com\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
 
 #include <stdarg.h>
+
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/string.h>
@@ -142,19 +140,18 @@
 #include <linux/ioport.h>
 #include <linux/malloc.h>
 #include <linux/interrupt.h>
-#include <asm/bitops.h>
-#include <asm/io.h>
-#include <asm/dma.h>
-#include <asm/segment.h>
-
 #include <linux/netdevice.h>
 #include <linux/etherdevice.h>
 #include <linux/skbuff.h>
-
 #include <linux/time.h>
 #include <linux/types.h>
 #include <linux/unistd.h>
 
+#include <asm/bitops.h>
+#include <asm/io.h>
+#include <asm/dma.h>
+#include <asm/segment.h>
+
 #include "ewrk3.h"
 
 #ifdef EWRK3_DEBUG
@@ -712,10 +709,7 @@
     printk("      Run the 'ewrk3setup' utility or remove the hard straps.\n");
   }
 
-#ifdef MODULE
-    MOD_INC_USE_COUNT;
-#endif       
-
+  MOD_INC_USE_COUNT;
 
   return status;
 }
@@ -1190,9 +1184,7 @@
     irq2dev_map[dev->irq] = 0;
   }
 
-#ifdef MODULE
   MOD_DEC_USE_COUNT;
-#endif    
 
   return 0;
 }
@@ -1856,7 +1848,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device thisEthwrk = {
   devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -1864,8 +1855,8 @@
   0x300, 5,  /* I/O address, IRQ */
   0, 0, 0, NULL, ewrk3_probe };
 	
-int io=0x300;	/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
-int irq=5;	/* or use the insmod io= irq= options 		*/
+static int io=0x300;	/* <--- EDIT THESE LINES FOR YOUR CONFIGURATION */
+static int irq=5;	/* or use the insmod io= irq= options 		*/
 
 int
 init_module(void)
@@ -1880,14 +1871,10 @@
 void
 cleanup_module(void)
 {
-  if (MOD_IN_USE) {
-    printk("%s: device busy, remove delayed\n",thisEthwrk.name);
-  } else {
     release_region(thisEthwrk.base_addr, EWRK3_TOTAL_SIZE);
     unregister_netdev(&thisEthwrk);
     kfree(thisEthwrk.priv);
     thisEthwrk.priv = NULL;
-  }
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/hp-plus.c linux/drivers/net/hp-plus.c
--- v1.3.38/linux/drivers/net/hp-plus.c	Tue Oct 10 18:46:36 1995
+++ linux/drivers/net/hp-plus.c	Thu Nov  9 08:24:06 1995
@@ -21,10 +21,7 @@
 static const char *version =
 "hp-plus.c:v1.10 9/24/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/string.h>		/* Important -- this inlines word moves. */
 #include <linux/kernel.h>
@@ -400,7 +397,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_hp = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -408,8 +404,8 @@
 	0, 0,
 	0, 0, 0, NULL, hp_plus_probe };
 
-int io = 0x200;
-int irq = 0;
+static int io = 0x200;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -427,17 +423,12 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("HP-plus: device busy, remove delayed\n");
-	else
-	{
-		int ioaddr = dev_hp.base_addr - NIC_OFFSET;
+	int ioaddr = dev_hp.base_addr - NIC_OFFSET;
 
-		unregister_netdev(&dev_hp);
+	unregister_netdev(&dev_hp);
 
-		/* If we don't do this, we can't re-insmod it later. */
-		release_region(ioaddr, HP_IO_EXTENT);
-	}
+	/* If we don't do this, we can't re-insmod it later. */
+	release_region(ioaddr, HP_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/hp.c linux/drivers/net/hp.c
--- v1.3.38/linux/drivers/net/hp.c	Tue Oct 10 18:46:36 1995
+++ linux/drivers/net/hp.c	Thu Nov  9 08:24:06 1995
@@ -22,20 +22,18 @@
 	"hp.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/ioport.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+
 #include <asm/system.h>
 #include <asm/io.h>
 
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
 #include "8390.h"
 
 /* A zero-terminated list of I/O addresses to be probed. */
@@ -350,7 +348,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_hp = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -358,8 +355,8 @@
 	0, 0,
 	0, 0, 0, NULL, hp_probe };
 
-int io = 300;
-int irq = 0;
+static int io = 300;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -377,18 +374,13 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("hp: device busy, remove delayed\n");
-	else
-	{
-		int ioaddr = dev_hp.base_addr - NIC_OFFSET;
-
-		unregister_netdev(&dev_hp);
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_hp.irq);
-		release_region(ioaddr, HP_IO_EXTENT);
-	}
+	int ioaddr = dev_hp.base_addr - NIC_OFFSET;
+
+	unregister_netdev(&dev_hp);
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_hp.irq);
+	release_region(ioaddr, HP_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/hp100.c linux/drivers/net/hp100.c
--- v1.3.38/linux/drivers/net/hp100.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/hp100.c	Thu Nov  9 08:24:06 1995
@@ -499,9 +499,7 @@
     }
   irq2dev_map[ dev -> irq ] = dev;
 
-#ifdef MODULE
   MOD_INC_USE_COUNT;
-#endif
   
   dev -> tbusy = 0;
   dev -> trans_start = jiffies;
@@ -569,9 +567,7 @@
 
   free_irq( dev -> irq );
   irq2dev_map[ dev -> irq ] = NULL;
-#ifdef MODULE
   MOD_DEC_USE_COUNT;
-#endif
   return 0;
 }
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/ibmtr.c linux/drivers/net/ibmtr.c
--- v1.3.38/linux/drivers/net/ibmtr.c	Wed Nov  8 07:11:32 1995
+++ linux/drivers/net/ibmtr.c	Thu Nov  9 08:24:06 1995
@@ -40,10 +40,7 @@
       active adapter is identified.
 */
 	
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #define NO_AUTODETECT 1
 #undef NO_AUTODETECT
@@ -563,9 +560,7 @@
       /*  NEED to see smem size *AND* reset high 512 bytes if
           needed */
 
-#ifdef MODULE
-	MOD_INC_USE_COUNT;
-#endif
+      MOD_INC_USE_COUNT;
 
       return 0;
    }
@@ -589,11 +584,9 @@
 
 	if(close_adapter->ret_code)
 		DPRINTK("close adapter failed: %02X\n",close_adapter->ret_code);
-
-#ifdef MODULE
-	MOD_DEC_USE_COUNT;
-#endif
 	
+	MOD_DEC_USE_COUNT;
+
 	return 0;
 }
 
@@ -1294,7 +1287,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_ibmtr = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -1302,7 +1294,7 @@
 	0, 0,
 	0, 0, 0, NULL, tok_probe };
 
-int io = 0xa20;
+static int io = 0xa20;
 
 int init_module(void)
 {
@@ -1320,16 +1312,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("ibmtr: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_ibmtr);
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_ibmtr.irq);
-		irq2dev_map[dev_ibmtr.irq] = NULL;
-		release_region(dev_ibmtr.base_addr, TR_IO_EXTENT);
-	}
+	unregister_netdev(&dev_ibmtr);
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_ibmtr.irq);
+	irq2dev_map[dev_ibmtr.irq] = NULL;
+	release_region(dev_ibmtr.base_addr, TR_IO_EXTENT);
 }
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/ne.c linux/drivers/net/ne.c
--- v1.3.38/linux/drivers/net/ne.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/ne.c	Thu Nov  9 08:24:06 1995
@@ -30,10 +30,7 @@
     "ne.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -572,7 +569,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_ne2000 = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -580,8 +576,8 @@
 	0, 0,
 	0, 0, 0, NULL, ne_probe };
 
-int io = 0x300;
-int irq = 0;
+static int io = 0x300;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -597,16 +593,11 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("ne2000: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_ne2000);
-
-		/* If we don't do this, we can't re-insmod it later. */
-		free_irq(dev_ne2000.irq);
-		release_region(dev_ne2000.base_addr, NE_IO_EXTENT);
-	}
+	unregister_netdev(&dev_ne2000);
+
+	/* If we don't do this, we can't re-insmod it later. */
+	free_irq(dev_ne2000.irq);
+	release_region(dev_ne2000.base_addr, NE_IO_EXTENT);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/pi2.c linux/drivers/net/pi2.c
--- v1.3.38/linux/drivers/net/pi2.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/pi2.c	Thu Nov  9 08:24:06 1995
@@ -91,7 +91,7 @@
 #define PI2_MODULE 0
 
 #if PI2_MODULE > 0
-#include <linux/modules.h>
+#include <linux/module.h>
 #endif
 
 #include <linux/kernel.h>
diff -u --recursive --new-file v1.3.38/linux/drivers/net/plip.c linux/drivers/net/plip.c
--- v1.3.38/linux/drivers/net/plip.c	Wed Oct  4 14:14:31 1995
+++ linux/drivers/net/plip.c	Thu Nov  9 08:24:07 1995
@@ -85,13 +85,7 @@
     extra grounds are 18,19,20,21,22,23,24
 */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -1060,9 +1054,8 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
-int io[] = {0, 0, 0};
-int irq[] = {0, 0, 0};
+static int io[] = {0, 0, 0};
+static int irq[] = {0, 0, 0};
 
 static struct device dev_plip[] = {
 	{
diff -u --recursive --new-file v1.3.38/linux/drivers/net/ppp.c linux/drivers/net/ppp.c
--- v1.3.38/linux/drivers/net/ppp.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/ppp.c	Thu Nov  9 08:24:07 1995
@@ -6,7 +6,7 @@
  *  Dynamic PPP devices by Jim Freeman <jfree@caldera.com>.
  *  ppp_tty_receive ``noisy-raise-bug'' fixed by Ove Ewerlid <ewerlid@syscon.uu.se>
  *
- *  ==FILEVERSION 6==
+ *  ==FILEVERSION 7==
  *
  *  NOTE TO MAINTAINERS:
  *     If you modify this file at all, increment the number above.
@@ -68,11 +68,6 @@
  */
 
 #include <linux/module.h>
-#ifdef MODULE
-#define  STATIC
-#else
-#define  STATIC static
-#endif /* def MODULE */
 
 #include <endian.h>
 #include <linux/kernel.h>
@@ -131,8 +126,8 @@
 #define PPP_LQR 0xc025  /* Link Quality Reporting Protocol */
 #endif
 
-STATIC int ppp_register_compressor (struct compressor *cp);
-STATIC void ppp_unregister_compressor (struct compressor *cp);
+static int ppp_register_compressor (struct compressor *cp);
+static void ppp_unregister_compressor (struct compressor *cp);
 
 /*
  * Local functions
@@ -176,8 +171,8 @@
  * Parameters which may be changed via insmod.
  */
 
-STATIC int  flag_time = OPTIMIZE_FLAG_TIME;
-STATIC int  max_dev   = PPP_MAX_DEV;
+static int  flag_time = OPTIMIZE_FLAG_TIME;
+static int  max_dev   = PPP_MAX_DEV;
 
 /*
  * The "main" procedure to the ppp device
@@ -541,6 +536,14 @@
 	ppp->sc_rc_state = NULL;
 }
 
+static struct symbol_table ppp_syms = {
+#include <linux/symtab_begin.h>
+	X(ppp_register_compressor),
+	X(ppp_unregister_compressor),
+	X(ppp_crc16_table),
+#include <linux/symtab_end.h>
+};
+
 /* called at boot/load time for each ppp device defined in the kernel */
 
 #ifndef MODULE
@@ -551,28 +554,19 @@
 	int    answer = 0;
 
 	if (first_time) {
-		static struct symbol_table ppp_syms = {
-#include <linux/symtab_begin.h>
-#define Y(sym) { (void *) &sym, SYMBOL_NAME_STR (sym) }
-			Y(ppp_register_compressor),
-			Y(ppp_unregister_compressor),
-			Y(ppp_crc16_table),
-#undef Y
-#include <linux/symtab_end.h>
-		};
-
 		first_time = 0;
 		answer     = ppp_first_time();
 		if (answer == 0)
 			(void) register_symtab (&ppp_syms);
 	}
-/*
- * Un-register the devices defined at the start of the system. They will
- * be added when they are needed again. The first device just gets us into
- * this code to register the handlers.
- */
-	unregister_netdev (dev);
-	return answer;
+	if (answer)
+		return answer;
+	/*
+	 * Return "not found", so that dev_init() will unlink
+	 * the placeholder device entry for us.
+	 */
+	return ENODEV;
+
 }
 #endif
 
@@ -3471,7 +3465,7 @@
 	return (struct compressor *) 0;
 }
 
-STATIC int ppp_register_compressor (struct compressor *cp)
+static int ppp_register_compressor (struct compressor *cp)
 {
 	struct compressor_link *new;
 	unsigned long flags;
@@ -3498,7 +3492,7 @@
 	return 0;
 }
 
-STATIC void ppp_unregister_compressor (struct compressor *cp)
+static void ppp_unregister_compressor (struct compressor *cp)
 {
 	struct compressor_link *prev = (struct compressor_link *) 0;
 	struct compressor_link *lnk;
@@ -3528,7 +3522,6 @@
  *************************************************************/
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int
 init_module(void)
@@ -3540,6 +3533,8 @@
 	if (status != 0)
 		printk (KERN_INFO
 		       "PPP: ppp_init() failure %d\n", status);
+	else
+		(void) register_symtab (&ppp_syms);
 	return (status);
 }
 
@@ -3550,26 +3545,24 @@
 	ppp_ctrl_t *ctl, *next_ctl;
 	struct device *dev;
 	struct ppp *ppp;
-	int busy_flag = MOD_IN_USE;
+	int busy_flag = 0;
 /*
  * Ensure that the devices are not in operation.
  */
-	if (!busy_flag) {
-		ctl = ppp_list;
-		while (ctl) {
-			ppp = ctl2ppp (ctl);
-			if (ppp->inuse && ppp->tty != NULL) {
-				busy_flag = 1;
-				break;
-			}
+	ctl = ppp_list;
+	while (ctl) {
+		ppp = ctl2ppp (ctl);
+		if (ppp->inuse && ppp->tty != NULL) {
+			busy_flag = 1;
+			break;
+		}
 
-			dev = ctl2dev (ctl);
-			if (dev->start || dev->flags & IFF_UP) {
-				busy_flag = 1;
-				break;
-			}
-			ctl = ctl->next;
+		dev = ctl2dev (ctl);
+		if (dev->start || dev->flags & IFF_UP) {
+			busy_flag = 1;
+			break;
 		}
+		ctl = ctl->next;
 	}
 /*
  * Ensure that there are no compressor modules registered
@@ -3594,10 +3587,6 @@
 	else
 		printk (KERN_INFO
 		       "PPP: ppp line discipline successfully unregistered\n");
-/*
- * Remove the symbol definitions
- */
-	(void) register_symtab ((struct symbol_table *) 0);
 /*
  * De-register the devices so that there is no problem with them
  */	
diff -u --recursive --new-file v1.3.38/linux/drivers/net/skeleton.c linux/drivers/net/skeleton.c
--- v1.3.38/linux/drivers/net/skeleton.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/skeleton.c	Thu Nov  9 08:24:07 1995
@@ -39,13 +39,7 @@
 	under the GPL.
 */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define  MOD_INC_USE_COUNT do {} while (0)
-#define  MOD_DEC_USE_COUNT do {} while (0)
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -531,7 +525,6 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device this_device = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -539,10 +532,10 @@
 	0, 0,  /* I/O address, IRQ */
 	0, 0, 0, NULL, netcard_probe };
 
-int io = 0x300;
-int irq = 0;
-int dma = 0;
-int mem = 0;
+static int io = 0x300;
+static int irq = 0;
+static int dma = 0;
+static int mem = 0;
 
 int init_module(void)
 {
diff -u --recursive --new-file v1.3.38/linux/drivers/net/slhc.c linux/drivers/net/slhc.c
--- v1.3.38/linux/drivers/net/slhc.c	Fri Oct  6 14:35:15 1995
+++ linux/drivers/net/slhc.c	Thu Nov  9 08:24:07 1995
@@ -53,10 +53,7 @@
 #include <linux/config.h>
 #ifdef CONFIG_INET
 /* Entire module is for IP only */
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/types.h>
 #include <linux/sched.h>
@@ -158,9 +155,7 @@
 		ts[0].next = &(ts[comp->tslot_limit]);
 		ts[0].cs_this = 0;
 	}
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return comp;
 }
 
@@ -178,9 +173,7 @@
 	if ( comp->tstate != NULLSLSTATE )
 		kfree( comp->tstate );
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	kfree( comp );
 }
 
@@ -735,7 +728,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void)
 {
@@ -745,9 +737,6 @@
 
 void cleanup_module(void)
 {
-	if (MOD_IN_USE)  {
-		printk("CSLIP: module in use, remove delayed");
-	}
 	return;
 }
 #endif /* MODULE */
diff -u --recursive --new-file v1.3.38/linux/drivers/net/slip.c linux/drivers/net/slip.c
--- v1.3.38/linux/drivers/net/slip.c	Mon Sep 25 12:26:21 1995
+++ linux/drivers/net/slip.c	Thu Nov  9 08:24:07 1995
@@ -51,10 +51,7 @@
 
 #define SL_CHECK_TRANSMIT
 #include <linux/config.h>
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 /* Undef this, if you don't need 6bit encapsulation code in the driver */
 #define CONFIG_SLIP_MODE_SLIP6
@@ -761,9 +758,7 @@
 		return err;
 	}
 	
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 
 	/* Done.  We have linked the TTY line to a channel. */
 	return sl->dev->base_addr;
@@ -792,9 +787,7 @@
 	sl->tty = NULL;
 	sl_free(sl);
 	unregister_netdev(sl->dev);
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 }
 
 
@@ -1235,7 +1228,6 @@
 	return 0;
 }
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int
 init_module(void)
@@ -1248,10 +1240,6 @@
 {
 	int i;
 
-	if (MOD_IN_USE)  {
-		printk("SLIP: device busy, remove delayed\n");
-		return;
-	}
 	if (slip_ctrls != NULL) {
 	  for (i = 0; i < slip_maxdev; i++)  {
 	    if (slip_ctrls[i] != NULL) {
diff -u --recursive --new-file v1.3.38/linux/drivers/net/smc-ultra.c linux/drivers/net/smc-ultra.c
--- v1.3.38/linux/drivers/net/smc-ultra.c	Tue Oct 10 18:46:37 1995
+++ linux/drivers/net/smc-ultra.c	Thu Nov  9 08:24:07 1995
@@ -41,10 +41,7 @@
 	"smc-ultra.c:v1.12 1/18/95 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -235,9 +232,7 @@
 	outb(0x01, ioaddr + 6);		/* Enable interrupts and memory. */
 	rc = ei_open(dev);
 	if (rc != 0) return rc;
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -330,15 +325,12 @@
 	/* We should someday disable shared memory and change to 8-bit mode
 	   "just in case"... */
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 static char devicename[9] = { 0, };
 static struct device dev_ultra = {
 	devicename, /* device name is inserted by linux/drivers/net/net_init.c */
@@ -346,8 +338,8 @@
 	0, 0,
 	0, 0, 0, NULL, ultra_probe };
 
-int io = 0x200;
-int irq = 0;
+static int io = 0x200;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -365,17 +357,12 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("smc-ultra: device busy, remove delayed\n");
-	else
-	{
-		int ioaddr = dev_ultra.base_addr - ULTRA_NIC_OFFSET;
+	int ioaddr = dev_ultra.base_addr - ULTRA_NIC_OFFSET;
 
-		unregister_netdev(&dev_ultra);
+	unregister_netdev(&dev_ultra);
 
-		/* If we don't do this, we can't re-insmod it later. */
+	/* If we don't do this, we can't re-insmod it later. */
     	release_region(ioaddr, ULTRA_IO_EXTENT);
-	}
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/tulip.c linux/drivers/net/tulip.c
--- v1.3.38/linux/drivers/net/tulip.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/tulip.c	Thu Nov  9 08:24:07 1995
@@ -344,9 +344,7 @@
 		printk("%s: Done tulip_open(), CSR0 %8.8x, CSR13 %8.8x.\n",
 			   dev->name, inl(ioaddr + CSR0), inl(ioaddr + CSR13));
 	}
-#ifdef MODULE
 	MOD_INC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -660,9 +658,7 @@
 	free_irq(dev->irq);
 	irq2dev_map[dev->irq] = 0;
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 	return 0;
 }
 
@@ -745,8 +741,8 @@
 	0, 0, 0, NULL, tulip_probe
 };
 
-int io = 0;
-int irq = 0;
+static int io = 0;
+static int irq = 0;
 
 int init_module(void)
 {
@@ -768,12 +764,7 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("tulip: device busy, remove delayed\n");
-	else
-	{
-		unregister_netdev(&dev_tulip);
-	}
+	unregister_netdev(&dev_tulip);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/tunnel.c linux/drivers/net/tunnel.c
--- v1.3.38/linux/drivers/net/tunnel.c	Wed Sep 27 15:59:58 1995
+++ linux/drivers/net/tunnel.c	Wed Nov  8 12:07:27 1995
@@ -18,12 +18,7 @@
 		-Alan Cox	(Alan.Cox@linux.org) 21 March 95
 */
 
-#include <linux/config.h>
-#ifdef CONFIG_IP_FORWARD
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -316,4 +311,3 @@
 	dev_tunnel.priv=NULL;
 }
 #endif /* MODULE */
-#endif
diff -u --recursive --new-file v1.3.38/linux/drivers/net/wavelan.c linux/drivers/net/wavelan.c
--- v1.3.38/linux/drivers/net/wavelan.c	Wed Nov  8 07:11:33 1995
+++ linux/drivers/net/wavelan.c	Thu Nov  9 08:24:07 1995
@@ -1264,9 +1264,7 @@
 		return -EAGAIN;
 	}
 
-#if	defined(MODULE)
 	MOD_INC_USE_COUNT;
-#endif	/* defined(MODULE) */
 
 	if (wavelan_debug > 0)
 		printk("%s: <-wavelan_open(): 0\n", dev->name);
@@ -1992,9 +1990,7 @@
 	 */
 	release_region(ioaddr, sizeof(ha_t));
 
-#if	defined(MODULE)
 	MOD_DEC_USE_COUNT;
-#endif	/* defined(MODULE) */
 
 	if (wavelan_debug > 0)
 		printk("%s: <-wavelan_close(): 0\n", dev->name);
@@ -2179,8 +2175,8 @@
 	0, 0, 0, NULL, wavelan_probe
 };
 
-int io = 0x390; /* Default from above.. */
-int irq = 0;
+static int io = 0x390; /* Default from above.. */
+static int irq = 0;
 
 int
 init_module(void)
@@ -2196,15 +2192,10 @@
 void
 cleanup_module(void)
 {
-	if (MOD_IN_USE)
-		printk("wavelan: device busy, remove delayed\n");
-	else
-	{
-		proc_net_unregister(PROC_NET_WAVELAN);
-		unregister_netdev(&dev_wavelan);
-		kfree_s(dev_wavelan.priv, sizeof(struct net_local));
-		dev_wavelan.priv = NULL;
-	}
+	proc_net_unregister(PROC_NET_WAVELAN);
+	unregister_netdev(&dev_wavelan);
+	kfree_s(dev_wavelan.priv, sizeof(struct net_local));
+	dev_wavelan.priv = NULL;
 }
 #endif	/* defined(MODULE) */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/net/wd.c linux/drivers/net/wd.c
--- v1.3.38/linux/drivers/net/wd.c	Sun Oct 29 11:38:49 1995
+++ linux/drivers/net/wd.c	Thu Nov  9 08:24:08 1995
@@ -25,10 +25,7 @@
 static const char *version =
 	"wd.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -302,9 +299,7 @@
 
   rc = ei_open(dev);
   if (rc != 0) return rc;
-#ifdef MODULE
   MOD_INC_USE_COUNT;
-#endif
   return 0;
 }
 
@@ -406,9 +401,7 @@
 	/* And disable the shared memory. */
 	outb(ei_status.reg0 & ~WD_MEMENB, wd_cmdreg);
 
-#ifdef MODULE
 	MOD_DEC_USE_COUNT;
-#endif
 
 	return 0;
 }
@@ -417,7 +410,6 @@
 #ifdef MODULE
 #define MAX_WD_MODS	4	/* Max number of wd modules allowed */
 #define NAMELEN		9	/* # of chars for storing dev->name */
-char kernel_version[] = UTS_RELEASE;
 static char namelist[NAMELEN * MAX_WD_MODS] = { 0, };
 static struct device dev_wd80x3[MAX_WD_MODS] = {
 	{
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
--- v1.3.38/linux/drivers/scsi/53c7,8xx.c	Mon Oct 23 18:02:06 1995
+++ linux/drivers/scsi/53c7,8xx.c	Thu Nov  9 08:24:08 1995
@@ -156,9 +156,7 @@
  *
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#endif
 
 #include <asm/dma.h>
 #include <asm/io.h>
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/Makefile linux/drivers/scsi/Makefile
--- v1.3.38/linux/drivers/scsi/Makefile	Wed Nov  8 07:11:33 1995
+++ linux/drivers/scsi/Makefile	Thu Nov  9 08:24:08 1995
@@ -14,6 +14,7 @@
 L_TARGET := scsi.a
 L_OBJS   := 
 M_OBJS   := 
+MX_OBJS  := 
 MOD_LIST_NAME := SCSI_MODULES
 SCSI_SRCS = $(wildcard $(L_OBJS:%.o=%.c))
 
@@ -34,11 +35,7 @@
 L_OBJS += hosts.o scsi.o scsi_ioctl.o constants.o scsicam.o scsi_proc.o
 else
   ifeq ($(CONFIG_SCSI),m)
-    ifdef CONFIG_MODVERSIONS
-      # Create this before we build anything else.
-      SCSI_MODULE_VER := scsi_syms.ver
-    endif
-    SYMTAB_OBJS := scsi_syms.o
+    MX_OBJS += scsi_syms.o
     M_OBJS += scsi_mod.o
   endif
 endif
@@ -242,12 +239,6 @@
 
 include $(TOPDIR)/Rules.make
 
-ifeq ($(CONFIG_SCSI),m)
-  ifdef CONFIG_MODVERSIONS
-      include ../../versions.mk
-  endif
-endif
-
 aha152x.o: aha152x.c
 	$(CC) $(CFLAGS) $(AHA152X) -c aha152x.c 
 
@@ -272,16 +263,12 @@
 	mv scriptu.h 53c8xx_u.h
 	rm fake.c
 
-scsi_mod.o: $(SCSI_MODULE_VER) hosts.o scsi.o scsi_ioctl.o constants.o \
-		scsicam.o scsi_proc.o $(SYMTAB_OBJS)
-	$(LD) $(LD_RFLAG) -r -o $@ hosts.o scsi.o scsi_ioctl.o constants.o scsicam.o scsi_proc.o $(SYMTAB_OBJS)
+scsi_mod.o: $(MX_OBJS) hosts.o scsi.o scsi_ioctl.o constants.o \
+		scsicam.o scsi_proc.o
+	$(LD) $(LD_RFLAG) -r -o $@ $(MX_OBJS) hosts.o scsi.o scsi_ioctl.o constants.o scsicam.o scsi_proc.o
 
-sr_mod.o: $(SCSI_MODULE_VER) sr.o sr_ioctl.o
+sr_mod.o: sr.o sr_ioctl.o
 	$(LD) $(LD_RFLAG) -r -o $@ sr.o sr_ioctl.o
 
-sd_mod.o: $(SCSI_MODULE_VER) sd.o sd_ioctl.o
+sd_mod.o: sd.o sd_ioctl.o
 	$(LD) $(LD_RFLAG) -r -o $@ sd.o sd_ioctl.o
-
-$(SYMTAB_OBJS): $(SYMTAB_OBJS:.o=.c)
-
-modules: $(SCSI_MODULE_VER)
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- v1.3.38/linux/drivers/scsi/scsi.c	Wed Nov  8 07:11:34 1995
+++ linux/drivers/scsi/scsi.c	Thu Nov  9 08:24:08 1995
@@ -3107,12 +3107,6 @@
 
     timer_table[SCSI_TIMER].fn = NULL;
     timer_table[SCSI_TIMER].expires = 0;
-    /*
-     * Supposedly you just do this, and the last symtab registered will
-     * be removed.  If someone else registered a symtab, this could
-     * blow up in our faces.  FIXME.
-     */
-    register_symtab(0);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/scsi_module.c linux/drivers/scsi/scsi_module.c
--- v1.3.38/linux/drivers/scsi/scsi_module.c	Thu Jun 29 19:02:52 1995
+++ linux/drivers/scsi/scsi_module.c	Thu Nov  9 08:24:08 1995
@@ -30,9 +30,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
     driver_template.usage_count = &mod_use_count_;
@@ -41,10 +38,6 @@
 }
 
 void cleanup_module( void) {
-    if (MOD_IN_USE) {
-	printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-	return;
-    }
     scsi_unregister_module(MODULE_SCSI_HA, &driver_template);
 }
 
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/scsi_syms.c linux/drivers/scsi/scsi_syms.c
--- v1.3.38/linux/drivers/scsi/scsi_syms.c	Wed Nov  8 07:11:34 1995
+++ linux/drivers/scsi/scsi_syms.c	Thu Nov  9 08:24:08 1995
@@ -6,16 +6,9 @@
 #error Go away.
 #endif
 
-/*
- * Even though we are building a module, we need to undef this, since
- * we are building a symbol table to be used by other modules.  For
- * the symbol table to build properly, we need to undefine this.
- */
-#undef MODULE
-
 #include <linux/module.h>
-
 #include <linux/config.h>
+
 #include <linux/sched.h>
 #include <linux/timer.h>
 #include <linux/string.h>
@@ -47,10 +40,6 @@
 
 struct symbol_table scsi_symbol_table = {
 #include <linux/symtab_begin.h>
-#ifdef CONFIG_MODVERSIONS
-    { (void *)1 /* Version version :-) */, 
-	SYMBOL_NAME_STR(Using_Versions) },
-#endif
     X(scsi_register_module),
     X(scsi_unregister_module),
     X(scsi_free),
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/sd.c linux/drivers/scsi/sd.c
--- v1.3.38/linux/drivers/scsi/sd.c	Mon Oct 23 18:02:12 1995
+++ linux/drivers/scsi/sd.c	Thu Nov  9 08:24:08 1995
@@ -16,10 +16,8 @@
  *       low-level scsi drivers.
  */
 
-#ifdef MODULE
-#include <linux/autoconf.h>
 #include <linux/module.h>
-#include <linux/version.h>
+#ifdef MODULE
 /*
  * This is a variable in scsi.c that is set when we are processing something
  * after boot time.  By definition, this is true when we are a loadable module
@@ -1462,10 +1460,6 @@
 }
 
 #ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
     sd_template.usage_count = &mod_use_count_;
@@ -1477,10 +1471,6 @@
     struct gendisk * prev_sdgd;
     struct gendisk * sdgd;
     
-    if (MOD_IN_USE) {
-	printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-	return;
-    }
     scsi_unregister_module(MODULE_SCSI_DEV, &sd_template);
     unregister_blkdev(SCSI_DISK_MAJOR, "sd");
     sd_registered--;
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/sg.c linux/drivers/scsi/sg.c
--- v1.3.38/linux/drivers/scsi/sg.c	Mon Oct 23 18:02:12 1995
+++ linux/drivers/scsi/sg.c	Thu Nov  9 08:24:08 1995
@@ -6,11 +6,7 @@
  *   
  *  Borrows code from st driver.
  */
-#ifdef MODULE
-#include <linux/autoconf.h>
 #include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
 
 #include <linux/fs.h>
 #include <linux/kernel.h>
@@ -602,7 +598,6 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
     sg_template.usage_count = &mod_use_count_;
@@ -611,10 +606,6 @@
 
 void cleanup_module( void) 
 {
-    if (MOD_IN_USE) {
-	printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-	return;
-    }
     scsi_unregister_module(MODULE_SCSI_DEV, &sg_template);
     unregister_chrdev(SCSI_GENERIC_MAJOR, "sg");
     
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- v1.3.38/linux/drivers/scsi/sr.c	Mon Oct 23 18:02:12 1995
+++ linux/drivers/scsi/sr.c	Wed Nov  8 12:07:27 1995
@@ -19,11 +19,7 @@
  *
  */
 
-#ifdef MODULE
-#include <linux/autoconf.h>
 #include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
 
 #include <linux/fs.h>
 #include <linux/kernel.h>
@@ -1139,10 +1135,6 @@
 
 
 #ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
     sr_template.usage_count = &mod_use_count_;
diff -u --recursive --new-file v1.3.38/linux/drivers/scsi/st.c linux/drivers/scsi/st.c
--- v1.3.38/linux/drivers/scsi/st.c	Wed Nov  8 07:11:34 1995
+++ linux/drivers/scsi/st.c	Thu Nov  9 08:24:08 1995
@@ -14,11 +14,8 @@
   Last modified: Sat Nov  4 22:23:54 1995 by root@kai.makisara.fi
   Some small formal changes - aeb, 950809
 */
-#ifdef MODULE
-#include <linux/autoconf.h>
+
 #include <linux/module.h>
-#include <linux/version.h>
-#endif /* MODULE */
 
 #include <linux/fs.h>
 #include <linux/kernel.h>
@@ -2241,7 +2238,6 @@
 
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
   st_template.usage_count = &mod_use_count_;
@@ -2252,10 +2248,6 @@
 {
   int i;
 
-  if (MOD_IN_USE) {
-    printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-    return;
-  }
   scsi_unregister_module(MODULE_SCSI_DEV, &st_template);
   unregister_chrdev(SCSI_TAPE_MAJOR, "st");
   st_registered--;
diff -u --recursive --new-file v1.3.38/linux/drivers/sound/audio.c linux/drivers/sound/audio.c
--- v1.3.38/linux/drivers/sound/audio.c	Wed Nov  8 07:11:35 1995
+++ linux/drivers/sound/audio.c	Thu Nov  9 10:04:33 1995
@@ -58,7 +58,7 @@
 static int      local_conversion[MAX_AUDIO_DEV];
 
 static int
-set_format (int dev, int fmt)
+set_format (int dev, long fmt)
 {
   if (fmt != AFMT_QUERY)
     {
@@ -87,7 +87,7 @@
 audio_open (int dev, struct fileinfo *file)
 {
   int             ret;
-  int             bits;
+  long            bits;
   int             dev_type = dev & 0x0f;
   int             mode = file->mode & O_ACCMODE;
 
diff -u --recursive --new-file v1.3.38/linux/drivers/sound/sb16_dsp.c linux/drivers/sound/sb16_dsp.c
--- v1.3.38/linux/drivers/sound/sb16_dsp.c	Wed Nov  8 07:11:36 1995
+++ linux/drivers/sound/sb16_dsp.c	Thu Nov  9 10:04:33 1995
@@ -157,7 +157,7 @@
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-	return dsp_set_speed ((int) arg);
+	return dsp_set_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_speed (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_RATE:
@@ -167,12 +167,12 @@
 
     case SNDCTL_DSP_STEREO:
       if (local)
-	return dsp_set_stereo ((int) arg);
+	return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-	return dsp_set_stereo ((int) arg - 1) + 1;
+	return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
 
     case SOUND_PCM_READ_CHANNELS:
@@ -182,7 +182,7 @@
 
     case SNDCTL_DSP_SETFMT:
       if (local)
-	return dsp_set_bits ((int) arg);
+	return dsp_set_bits ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_bits (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_BITS:
diff -u --recursive --new-file v1.3.38/linux/drivers/sound/sb_dsp.c linux/drivers/sound/sb_dsp.c
--- v1.3.38/linux/drivers/sound/sb_dsp.c	Wed Nov  8 07:11:36 1995
+++ linux/drivers/sound/sb_dsp.c	Thu Nov  9 10:04:33 1995
@@ -737,7 +737,7 @@
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-	return dsp_speed ((int) arg);
+	return dsp_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_speed (get_fs_long ((long *) arg)));
       break;
 
@@ -749,7 +749,7 @@
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-	return dsp_set_stereo ((int) arg - 1) + 1;
+	return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
       break;
 
@@ -761,7 +761,7 @@
 
     case SNDCTL_DSP_STEREO:
       if (local)
-	return dsp_set_stereo ((int) arg);
+	return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
       break;
 
@@ -785,9 +785,7 @@
     case SOUND_PCM_READ_BITS:
       if (local)
 	return 8;
-      return snd_ioctl_return ((int *) (int) arg, 8);	/*
-							   * Only 8 bits/sample supported
-							 */
+      return snd_ioctl_return ((int *) arg, 8);	/* Only 8 bits/sample supported */
       break;
 #endif /* ifdef JAZZ16  */
 
diff -u --recursive --new-file v1.3.38/linux/drivers/sound/soundcard.c linux/drivers/sound/soundcard.c
--- v1.3.38/linux/drivers/sound/soundcard.c	Wed Nov  8 07:11:37 1995
+++ linux/drivers/sound/soundcard.c	Wed Nov  8 12:07:27 1995
@@ -308,8 +308,6 @@
   irqs = 0;
 }
 
-char            kernel_version[] = UTS_RELEASE;
-
 #endif
 
 static int      debugmem = 0;	/* switched off by default */
diff -u --recursive --new-file v1.3.38/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- v1.3.38/linux/fs/binfmt_elf.c	Mon Oct 23 18:02:17 1995
+++ linux/fs/binfmt_elf.c	Thu Nov  9 08:24:08 1995
@@ -9,13 +9,7 @@
  * Copyright 1993, 1994: Eric Youngdale (ericy@cais.com).
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/fs.h>
 #include <linux/stat.h>
@@ -1229,23 +1223,17 @@
 }
 
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void) {
 	/* Install the COFF, ELF and XOUT loaders.
 	 * N.B. We *rely* on the table being the right size with the
 	 * right number of free slots...
 	 */
-	register_binfmt(&elf_format);
-	return 0;
+	return register_binfmt(&elf_format);
 }
 
 
 void cleanup_module( void) {
-	
-	if (MOD_IN_USE)
-		printk(KERN_INFO "iBCS: module is in use, remove delayed\n");
-
 	/* Remove the COFF and ELF loaders. */
 	unregister_binfmt(&elf_format);
 }
diff -u --recursive --new-file v1.3.38/linux/fs/exec.c linux/fs/exec.c
--- v1.3.38/linux/fs/exec.c	Tue Oct 10 18:46:37 1995
+++ linux/fs/exec.c	Thu Nov  9 10:04:33 1995
@@ -853,10 +853,19 @@
 	current->suid = current->euid = current->fsuid = bprm->e_uid;
 	current->sgid = current->egid = current->fsgid = bprm->e_gid;
 	if (N_MAGIC(ex) == OMAGIC) {
+#ifdef __alpha__
+		do_mmap(NULL, N_TXTADDR(ex) & PAGE_MASK,
+			ex.a_text+ex.a_data + PAGE_SIZE - 1,
+			PROT_READ|PROT_WRITE|PROT_EXEC,
+			MAP_FIXED|MAP_PRIVATE, 0);
+		read_exec(bprm->inode, fd_offset, (char *) N_TXTADDR(ex),
+			  ex.a_text+ex.a_data, 0);
+#else
 		do_mmap(NULL, 0, ex.a_text+ex.a_data,
 			PROT_READ|PROT_WRITE|PROT_EXEC,
 			MAP_FIXED|MAP_PRIVATE, 0);
 		read_exec(bprm->inode, 32, (char *) 0, ex.a_text+ex.a_data, 0);
+#endif
 	} else {
 		if (ex.a_text & 0xfff || ex.a_data & 0xfff)
 			printk(KERN_NOTICE "executable not page aligned\n");
diff -u --recursive --new-file v1.3.38/linux/fs/ext/inode.c linux/fs/ext/inode.c
--- v1.3.38/linux/fs/ext/inode.c	Mon Sep 18 14:54:05 1995
+++ linux/fs/ext/inode.c	Thu Nov  9 08:24:08 1995
@@ -10,13 +10,7 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/sched.h>
 #include <linux/ext_fs.h>
@@ -459,16 +453,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type ext_fs_type = {
         ext_read_super, "ext", 1, NULL
 };
 
 int init_module(void)
 {
-        register_filesystem(&ext_fs_type);
-        return 0;
+        return register_filesystem(&ext_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/ext2/super.c linux/fs/ext2/super.c
--- v1.3.38/linux/fs/ext2/super.c	Wed Oct  4 14:14:33 1995
+++ linux/fs/ext2/super.c	Thu Nov  9 08:24:08 1995
@@ -13,13 +13,7 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <stdarg.h>
 
@@ -687,16 +681,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type ext2_fs_type = {
         ext2_read_super, "ext2", 1, NULL
 };
 
 int init_module(void)
 {
-        register_filesystem(&ext2_fs_type);
-        return 0;
+        return register_filesystem(&ext2_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/hpfs/hpfs_caps.c linux/fs/hpfs/hpfs_caps.c
--- v1.3.38/linux/fs/hpfs/hpfs_caps.c	Sun Sep  3 12:27:00 1995
+++ linux/fs/hpfs/hpfs_caps.c	Wed Nov  8 12:34:15 1995
@@ -62,14 +62,6 @@
    code pages OS/2 is using.  Recoding from on-disk names to UTF-8
    could use the code page tags, though this is not what OS/2 does. */
 
-#ifdef MODULE
-#include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
 
 static const unsigned char tb_cp850_to_latin1[128] =
 {
diff -u --recursive --new-file v1.3.38/linux/fs/hpfs/hpfs_fs.c linux/fs/hpfs/hpfs_fs.c
--- v1.3.38/linux/fs/hpfs/hpfs_fs.c	Mon Sep 18 14:54:06 1995
+++ linux/fs/hpfs/hpfs_fs.c	Thu Nov  9 08:24:09 1995
@@ -12,13 +12,7 @@
  *   linux/fs/isofs  Copyright (C) 1991  Eric Youngdale
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/fs.h>
 #include <linux/hpfs_fs.h>
@@ -1743,16 +1737,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type hpfs_fs_type = {
         hpfs_read_super, "hpfs", 1, NULL
 };
 
 int init_module(void)
 {
-        register_filesystem(&hpfs_fs_type);
-        return 0;
+        return register_filesystem(&hpfs_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/dir.c linux/fs/isofs/dir.c
--- v1.3.38/linux/fs/isofs/dir.c	Fri Jul  7 13:42:58 1995
+++ linux/fs/isofs/dir.c	Wed Nov  8 12:24:18 1995
@@ -8,14 +8,7 @@
  *  isofs directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/errno.h>
-
-#include <asm/segment.h>
-
 #include <linux/fs.h>
 #include <linux/iso_fs.h>
 #include <linux/kernel.h>
@@ -25,6 +18,8 @@
 #include <linux/malloc.h>
 #include <linux/sched.h>
 #include <linux/locks.h>
+
+#include <asm/segment.h>
 
 static int isofs_readdir(struct inode *, struct file *, void *, filldir_t);
 
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/file.c linux/fs/isofs/file.c
--- v1.3.38/linux/fs/isofs/file.c	Tue Jun 27 14:11:39 1995
+++ linux/fs/isofs/file.c	Wed Nov  8 12:24:55 1995
@@ -8,13 +8,6 @@
  *  isofs regular file handling primitives
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/sched.h>
 #include <linux/iso_fs.h>
 #include <linux/fcntl.h>
@@ -23,7 +16,8 @@
 #include <linux/stat.h>
 #include <linux/locks.h>
 
-#include <linux/dirent.h>
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #define	NBUF	32
 
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/inode.c linux/fs/isofs/inode.c
--- v1.3.38/linux/fs/isofs/inode.c	Mon Sep 18 14:54:06 1995
+++ linux/fs/isofs/inode.c	Thu Nov  9 08:24:09 1995
@@ -8,13 +8,7 @@
  *
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/stat.h>
 #include <linux/sched.h>
@@ -798,16 +792,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type iso9660_fs_type = {
 	isofs_read_super, "iso9660", 1, NULL
 };
 
 int init_module(void)
 {
-	register_filesystem(&iso9660_fs_type);
-	return 0;
+	return register_filesystem(&iso9660_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/namei.c linux/fs/isofs/namei.c
--- v1.3.38/linux/fs/isofs/namei.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/isofs/namei.c	Wed Nov  8 12:25:38 1995
@@ -6,10 +6,6 @@
  *  (C) 1991  Linus Torvalds - minix filesystem
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/iso_fs.h>
 #include <linux/kernel.h>
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/rock.c linux/fs/isofs/rock.c
--- v1.3.38/linux/fs/isofs/rock.c	Mon Sep 18 14:54:06 1995
+++ linux/fs/isofs/rock.c	Wed Nov  8 12:25:38 1995
@@ -5,9 +5,6 @@
  *
  *  Rock Ridge Extensions to iso9660
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
 
 #include <linux/stat.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/symlink.c linux/fs/isofs/symlink.c
--- v1.3.38/linux/fs/isofs/symlink.c	Tue Jun 27 14:11:40 1995
+++ linux/fs/isofs/symlink.c	Wed Nov  8 12:25:38 1995
@@ -9,18 +9,14 @@
  *  extensions to iso9660
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/iso_fs.h>
 #include <linux/stat.h>
 #include <linux/malloc.h>
+
+#include <asm/segment.h>
 
 static int isofs_readlink(struct inode *, char *, int);
 static int isofs_follow_link(struct inode *, struct inode *, int, int, struct inode **);
diff -u --recursive --new-file v1.3.38/linux/fs/isofs/util.c linux/fs/isofs/util.c
--- v1.3.38/linux/fs/isofs/util.c	Mon Jan 23 10:38:29 1995
+++ linux/fs/isofs/util.c	Wed Nov  8 12:26:10 1995
@@ -9,11 +9,6 @@
  * the bsd386 iso9660 filesystem, by Pace Williamson.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-
 int
 isonum_711 (char * p)
 {
diff -u --recursive --new-file v1.3.38/linux/fs/minix/bitmap.c linux/fs/minix/bitmap.c
--- v1.3.38/linux/fs/minix/bitmap.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/minix/bitmap.c	Wed Nov  8 12:21:24 1995
@@ -6,10 +6,6 @@
 
 /* bitmap.c contains the code that handles the inode and block bitmaps */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/minix_fs.h>
 #include <linux/stat.h>
diff -u --recursive --new-file v1.3.38/linux/fs/minix/dir.c linux/fs/minix/dir.c
--- v1.3.38/linux/fs/minix/dir.c	Thu Jun  8 22:19:07 1995
+++ linux/fs/minix/dir.c	Wed Nov  8 12:22:48 1995
@@ -6,10 +6,6 @@
  *  minix directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/string.h>
 #include <linux/errno.h>
 #include <linux/fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/minix/file.c linux/fs/minix/file.c
--- v1.3.38/linux/fs/minix/file.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/minix/file.c	Wed Nov  8 12:22:08 1995
@@ -6,13 +6,6 @@
  *  minix regular file handling primitives
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/sched.h>
 #include <linux/minix_fs.h>
 #include <linux/kernel.h>
@@ -20,6 +13,9 @@
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #define	NBUF	32
 
diff -u --recursive --new-file v1.3.38/linux/fs/minix/fsync.c linux/fs/minix/fsync.c
--- v1.3.38/linux/fs/minix/fsync.c	Mon Jan 23 10:38:29 1995
+++ linux/fs/minix/fsync.c	Wed Nov  8 12:23:33 1995
@@ -8,13 +8,6 @@
  *  minix fsync primitive
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
@@ -24,6 +17,8 @@
 #include <linux/fs.h>
 #include <linux/minix_fs.h>
 
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #define blocksize BLOCK_SIZE
 #define addr_per_block 512
diff -u --recursive --new-file v1.3.38/linux/fs/minix/inode.c linux/fs/minix/inode.c
--- v1.3.38/linux/fs/minix/inode.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/minix/inode.c	Thu Nov  9 08:24:09 1995
@@ -4,13 +4,7 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/sched.h>
 #include <linux/minix_fs.h>
@@ -530,16 +524,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type minix_fs_type = {
 	minix_read_super, "minix", 1, NULL
 };
 
 int init_module(void)
 {
-	register_filesystem(&minix_fs_type);
-	return 0;
+	return register_filesystem(&minix_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/minix/namei.c linux/fs/minix/namei.c
--- v1.3.38/linux/fs/minix/namei.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/minix/namei.c	Wed Nov  8 12:22:48 1995
@@ -4,10 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/minix_fs.h>
 #include <linux/kernel.h>
diff -u --recursive --new-file v1.3.38/linux/fs/minix/symlink.c linux/fs/minix/symlink.c
--- v1.3.38/linux/fs/minix/symlink.c	Tue Jun 27 14:11:43 1995
+++ linux/fs/minix/symlink.c	Wed Nov  8 12:22:48 1995
@@ -6,17 +6,13 @@
  *  minix symlink handling code
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/minix_fs.h>
 #include <linux/stat.h>
+
+#include <asm/segment.h>
 
 static int minix_readlink(struct inode *, char *, int);
 static int minix_follow_link(struct inode *, struct inode *, int, int, struct inode **);
diff -u --recursive --new-file v1.3.38/linux/fs/minix/truncate.c linux/fs/minix/truncate.c
--- v1.3.38/linux/fs/minix/truncate.c	Tue Aug  8 12:31:39 1995
+++ linux/fs/minix/truncate.c	Wed Nov  8 12:21:35 1995
@@ -4,10 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/minix_fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/buffer.c linux/fs/msdos/buffer.c
--- v1.3.38/linux/fs/msdos/buffer.c	Mon Jan 23 10:38:29 1995
+++ linux/fs/msdos/buffer.c	Wed Nov  8 12:20:38 1995
@@ -1,6 +1,8 @@
-#ifdef MODULE
-#include <linux/module.h>
-#endif
+/*
+ * linux/fs/msdos/buffer.c
+ *
+ *
+ */
 
 #include <linux/mm.h>
 #include <linux/malloc.h>
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/dir.c linux/fs/msdos/dir.c
--- v1.3.38/linux/fs/msdos/dir.c	Tue Jun 27 14:11:43 1995
+++ linux/fs/msdos/dir.c	Wed Nov  8 12:16:19 1995
@@ -6,17 +6,13 @@
  *  MS-DOS directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
 #include <linux/string.h>
+
+#include <asm/segment.h>
 
 #include "msbuffer.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/fat.c linux/fs/msdos/fat.c
--- v1.3.38/linux/fs/msdos/fat.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/msdos/fat.c	Wed Nov  8 12:15:44 1995
@@ -4,10 +4,6 @@
  *  Written 1992,1993 by Werner Almesberger
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/msdos_fs.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/file.c linux/fs/msdos/file.c
--- v1.3.38/linux/fs/msdos/file.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/msdos/file.c	Wed Nov  8 12:18:34 1995
@@ -6,12 +6,7 @@
  *  MS-DOS regular file handling primitives
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
 
 #include <linux/sched.h>
 #include <linux/locks.h>
@@ -21,6 +16,9 @@
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/string.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #include "msbuffer.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/inode.c linux/fs/msdos/inode.c
--- v1.3.38/linux/fs/msdos/inode.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/msdos/inode.c	Thu Nov  9 08:24:09 1995
@@ -4,13 +4,7 @@
  *  Written 1992,1993 by Werner Almesberger
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/msdos_fs.h>
 #include <linux/kernel.h>
@@ -506,9 +500,8 @@
 	    ~MSDOS_SB(inode->i_sb)->fs_umask;
 	return 0;
 }
-#ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
+#ifdef MODULE
 
 static struct file_system_type msdos_fs_type = {
 	msdos_read_super, "msdos", 1, NULL
@@ -516,8 +509,7 @@
 
 int init_module(void)
 {
-	register_filesystem(&msdos_fs_type);
-	return 0;
+	return register_filesystem(&msdos_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/misc.c linux/fs/msdos/misc.c
--- v1.3.38/linux/fs/msdos/misc.c	Mon Oct 23 18:02:17 1995
+++ linux/fs/msdos/misc.c	Wed Nov  8 12:19:23 1995
@@ -4,10 +4,6 @@
  *  Written 1992,1993 by Werner Almesberger
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/mmap.c linux/fs/msdos/mmap.c
--- v1.3.38/linux/fs/msdos/mmap.c	Tue Jul 11 10:02:58 1995
+++ linux/fs/msdos/mmap.c	Wed Nov  8 12:21:07 1995
@@ -6,9 +6,6 @@
  *
  *	msdos mmap handling
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
 
 #include <linux/stat.h>
 #include <linux/sched.h>
@@ -19,9 +16,10 @@
 #include <linux/mman.h>
 #include <linux/string.h>
 #include <linux/malloc.h>
+#include <linux/msdos_fs.h>
+
 #include <asm/segment.h>
 #include <asm/system.h>
-#include <linux/msdos_fs.h>
 
 /*
  * Fill in the supplied page for mmap
diff -u --recursive --new-file v1.3.38/linux/fs/msdos/namei.c linux/fs/msdos/namei.c
--- v1.3.38/linux/fs/msdos/namei.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/msdos/namei.c	Wed Nov  8 12:19:59 1995
@@ -4,18 +4,14 @@
  *  Written 1992,1993 by Werner Almesberger
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/sched.h>
 #include <linux/msdos_fs.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/stat.h>
+
+#include <asm/segment.h>
 
 #include "msbuffer.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/dir.c linux/fs/nfs/dir.c
--- v1.3.38/linux/fs/nfs/dir.c	Mon Sep 18 14:54:07 1995
+++ linux/fs/nfs/dir.c	Wed Nov  8 12:26:10 1995
@@ -6,10 +6,6 @@
  *  nfs directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/stat.h>
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/file.c linux/fs/nfs/file.c
--- v1.3.38/linux/fs/nfs/file.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/nfs/file.c	Wed Nov  8 12:28:13 1995
@@ -14,13 +14,6 @@
  *  nfs regular file handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
@@ -29,6 +22,9 @@
 #include <linux/mm.h>
 #include <linux/nfs_fs.h>
 #include <linux/malloc.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
 
 static int nfs_file_read(struct inode *, struct file *, char *, int);
 static int nfs_file_write(struct inode *, struct file *, const char *, int);
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/inode.c linux/fs/nfs/inode.c
--- v1.3.38/linux/fs/nfs/inode.c	Fri Oct  6 14:35:16 1995
+++ linux/fs/nfs/inode.c	Thu Nov  9 08:24:09 1995
@@ -13,16 +13,7 @@
  *
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
-
-#include <asm/system.h>
-#include <asm/segment.h>
 
 #include <linux/sched.h>
 #include <linux/nfs_fs.h>
@@ -33,6 +24,9 @@
 #include <linux/errno.h>
 #include <linux/locks.h>
 
+#include <asm/system.h>
+#include <asm/segment.h>
+
 extern int close_fp(struct file *filp);
 
 static int nfs_notify_change(struct inode *, struct iattr *);
@@ -298,16 +292,13 @@
 
 /* Every kernel module contains stuff like this. */
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type nfs_fs_type = {
 	nfs_read_super, "nfs", 0, NULL
 };
 
 int init_module(void)
 {
-	register_filesystem(&nfs_fs_type);
-	return 0;
+	return register_filesystem(&nfs_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/mmap.c linux/fs/nfs/mmap.c
--- v1.3.38/linux/fs/nfs/mmap.c	Tue Jul 11 10:02:58 1995
+++ linux/fs/nfs/mmap.c	Wed Nov  8 12:28:13 1995
@@ -9,9 +9,6 @@
  *	Copyright (C) 1993
  *
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
 
 #include <linux/stat.h>
 #include <linux/sched.h>
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/proc.c linux/fs/nfs/proc.c
--- v1.3.38/linux/fs/nfs/proc.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/nfs/proc.c	Wed Nov  8 12:28:13 1995
@@ -33,10 +33,6 @@
 #define NFS_PROC_DEBUG
 #endif
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/param.h>
 #include <linux/sched.h>
 #include <linux/mm.h>
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/rpcsock.c linux/fs/nfs/rpcsock.c
--- v1.3.38/linux/fs/nfs/rpcsock.c	Wed Nov  8 07:11:37 1995
+++ linux/fs/nfs/rpcsock.c	Wed Nov  8 12:28:13 1995
@@ -19,10 +19,6 @@
  *  Copyright (C) 1995, Olaf Kirch <okir@monad.swb.de>
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/types.h>
 #include <linux/malloc.h>
 #include <linux/sched.h>
@@ -30,11 +26,12 @@
 #include <linux/errno.h>
 #include <linux/socket.h>
 #include <linux/fcntl.h>
-#include <asm/segment.h>
 #include <linux/in.h>
 #include <linux/net.h>
 #include <linux/mm.h>
 #include <linux/rpcsock.h>
+
+#include <asm/segment.h>
 
 #define msleep(sec)	{ current->timeout = sec * HZ / 1000; \
 			  current->state = TASK_INTERRUPTIBLE; \
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/sock.c linux/fs/nfs/sock.c
--- v1.3.38/linux/fs/nfs/sock.c	Fri Oct  6 14:35:16 1995
+++ linux/fs/nfs/sock.c	Wed Nov  8 12:28:13 1995
@@ -18,20 +18,17 @@
  *
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/nfs_fs.h>
 #include <linux/errno.h>
 #include <linux/socket.h>
 #include <linux/fcntl.h>
-#include <asm/segment.h>
 #include <linux/in.h>
 #include <linux/net.h>
 #include <linux/mm.h>
 #include <linux/rpcsock.h>
+
+#include <asm/segment.h>
 
 /* JEJB/JSP 2/7/94
  * this must match the value of NFS_SLACK_SPACE in linux/fs/nfs/proc.c 
diff -u --recursive --new-file v1.3.38/linux/fs/nfs/symlink.c linux/fs/nfs/symlink.c
--- v1.3.38/linux/fs/nfs/symlink.c	Tue Jun 27 14:11:43 1995
+++ linux/fs/nfs/symlink.c	Wed Nov  8 12:28:13 1995
@@ -8,12 +8,6 @@
  *  nfs symlink handling code
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/nfs_fs.h>
@@ -21,6 +15,8 @@
 #include <linux/mm.h>
 #include <linux/malloc.h>
 #include <linux/string.h>
+
+#include <asm/segment.h>
 
 static int nfs_readlink(struct inode *, char *, int);
 static int nfs_follow_link(struct inode *, struct inode *, int, int,
diff -u --recursive --new-file v1.3.38/linux/fs/proc/array.c linux/fs/proc/array.c
--- v1.3.38/linux/fs/proc/array.c	Sun Oct 29 11:38:49 1995
+++ linux/fs/proc/array.c	Thu Nov  9 10:39:02 1995
@@ -450,15 +450,14 @@
 		state = "RSDZTD"[tsk->state];
 	vsize = eip = esp = 0;
 	if (tsk->mm) {
+		struct vm_area_struct *vma = tsk->mm->mmap;
+		while (vma) {
+			vsize += vma->vm_end - vma->vm_start;
+			vma = vma->vm_next;
+		}
 		if (tsk->kernel_stack_page) {
 			eip = KSTK_EIP(tsk);
 			esp = KSTK_ESP(tsk);
-			vsize = (  (tsk->mm->end_code - tsk->mm->start_code)	/* text */
-				 + (tsk->mm->end_data - tsk->mm->start_data)	/* data */
-				 + (tsk->mm->brk - tsk->mm->start_brk));	/* bss + heap */
-			if (esp) {
-				vsize += tsk->mm->start_stack - esp;		/* stack */
-			}
 		}
 	}
 	wchan = get_wchan(tsk);
@@ -482,11 +481,12 @@
 	else
 		tty_pgrp = -1;
 
-	/* scale priority and nice values from timeslices to 0..40 */
+	/* scale priority and nice values from timeslices to -20..20 */
 	priority = tsk->counter;
-	priority = (priority * 10 + 5) / DEF_PRIORITY;
+	priority = (priority * 10 + DEF_PRIORITY / 2) / DEF_PRIORITY - 20;
 	nice = tsk->priority;
-	nice = (nice * 20 + 10) / DEF_PRIORITY;
+	nice = (nice * 20 + DEF_PRIORITY / 2) / DEF_PRIORITY - 20;
+
 	return sprintf(buffer,"%d (%s) %c %d %d %d %d %d %lu %lu \
 %lu %lu %lu %ld %ld %ld %ld %ld %ld %lu %lu %ld %lu %lu %lu %lu %lu %lu %lu %lu %lu \
 %lu %lu %lu %lu\n",
diff -u --recursive --new-file v1.3.38/linux/fs/smbfs/inode.c linux/fs/smbfs/inode.c
--- v1.3.38/linux/fs/smbfs/inode.c	Wed Nov  8 07:11:40 1995
+++ linux/fs/smbfs/inode.c	Thu Nov  9 08:24:09 1995
@@ -405,8 +405,6 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 /* looks ugly, taken from gcc-info */
 static void *shut_up_gcc = (&shut_up_gcc, kernel_version);
 
@@ -425,8 +423,7 @@
 #endif
 
         smb_init_dir_cache();
-        register_filesystem(&smb_fs_type);
-        return 0;
+        return register_filesystem(&smb_fs_type);
 }
 
 void
diff -u --recursive --new-file v1.3.38/linux/fs/smbfs/sock.c linux/fs/smbfs/sock.c
--- v1.3.38/linux/fs/smbfs/sock.c	Wed Nov  8 07:11:40 1995
+++ linux/fs/smbfs/sock.c	Thu Nov  9 09:41:00 1995
@@ -26,6 +26,42 @@
 
 #define _S(nr) (1<<((nr)-1))
 
+static int _recvfrom(struct socket *sock, unsigned char *ubuf, int size, int noblock, unsigned flags,
+                struct sockaddr_in *sa, int *addr_len)
+{
+        struct iovec iov;
+        struct msghdr msg;
+
+        iov.iov_base = ubuf;
+        iov.iov_len  = size;
+
+        msg.msg_name      = (void *)sa;
+        msg.msg_namelen   = 0;
+        if (addr_len)
+                msg.msg_namelen = *addr_len;
+        msg.msg_accrights = NULL;
+        msg.msg_iov       = &iov;
+        msg.msg_iovlen    = 1;
+
+        return sock->ops->recvmsg(sock, &msg, size, noblock, flags, addr_len);
+}
+
+static int _send(struct socket *sock, const void *buff, int len, int nonblock, unsigned flags) {
+        struct iovec iov;
+        struct msghdr msg;
+
+        iov.iov_base = (void *)buff;
+        iov.iov_len  = len;
+
+        msg.msg_name      = NULL;
+        msg.msg_namelen   = 0;
+        msg.msg_accrights = NULL;
+        msg.msg_iov       = &iov;
+        msg.msg_iovlen    = 1;
+
+        return sock->ops->sendmsg(sock, &msg, len, nonblock, flags);
+}
+
 static void
 smb_data_callback(struct sock *sk,int len)
 {
@@ -40,13 +76,13 @@
                 fs = get_fs();
                 set_fs(get_ds());
 
-		result = sock->ops->recvfrom(sock, (void *)peek_buf, 1, 1,
+		result = _recvfrom(sock, (void *)peek_buf, 1, 1,
                                              MSG_PEEK, NULL, NULL);
 
                 while ((result != -EAGAIN) && (peek_buf[0] == 0x85)) {
 
                         /* got SESSION KEEP ALIVE */
-                        result = sock->ops->recvfrom(sock, (void *)peek_buf,
+                        result = _recvfrom(sock, (void *)peek_buf,
                                                      4, 1, 0, NULL, NULL);
 
                         DDPRINTK("smb_data_callback:"
@@ -55,7 +91,7 @@
                         if (result == -EAGAIN)
                                 break;
 
-                        result = sock->ops->recvfrom(sock, (void *)peek_buf,
+                        result = _recvfrom(sock, (void *)peek_buf,
                                                      1, 1, MSG_PEEK,
                                                      NULL, NULL);
 
@@ -190,7 +226,7 @@
 
 	fs = get_fs();
 	set_fs(get_ds());
-        result = sock->ops->recvfrom(sock, (void *)peek_buf, 4, 0,
+        result = _recvfrom(sock, (void *)peek_buf, 4, 0,
                                      0, NULL, NULL);
         set_fs(fs);
 
@@ -236,8 +272,7 @@
 
         while (already_read < len) {
                 
-                result = sock->ops->
-                        recvfrom(sock,
+                result = _recvfrom(sock,
                                  (void *)(target+already_read),
                                  len - already_read, 0, 0,
                                  NULL, NULL);
@@ -488,7 +523,7 @@
 	fs = get_fs();
 	set_fs(get_ds());
 
-        result = sock->ops->send(sock, (void *)buffer, len, 0, 0);
+        result = _send(sock, (void *)buffer, len, 0, 0);
         if (result < 0) {
                 printk("smb_request: send error = %d\n", result);
         }
@@ -556,7 +591,7 @@
 
         DDPRINTK("smb_request: len = %d cmd = 0x%X\n", len, buffer[8]);
 
-        result = sock->ops->send(sock, (void *)buffer, len, 0, 0);
+        result = _send(sock, (void *)buffer, len, 0, 0);
         if (result < 0) {
                 printk("smb_trans2_request: send error = %d\n", result);
         }
@@ -627,7 +662,7 @@
         DPRINTK("smb_request_read_raw: buffer=%X, sock=%X\n",
                 (unsigned int)buffer, (unsigned int)sock);
 
-        result = sock->ops->send(sock, (void *)buffer, len, 0, 0);
+        result = _send(sock, (void *)buffer, len, 0, 0);
 
         DPRINTK("smb_request_read_raw: send returned %d\n", result);
 
@@ -695,11 +730,11 @@
 
         smb_encode_smb_length(nb_header, length);
 
-        result = sock->ops->send(sock, (void *)nb_header, 4, 0, 0);
+        result = _send(sock, (void *)nb_header, 4, 0, 0);
 
         if (result == 4) {
                 set_fs(fs);     /* source is in user-land */
-                result = sock->ops->send(sock, (void *)source, length, 0, 0);
+                result = _send(sock, (void *)source, length, 0, 0);
                 set_fs(get_ds());
         } else {
                 result = -EIO;
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/balloc.c linux/fs/sysv/balloc.c
--- v1.3.38/linux/fs/sysv/balloc.c	Mon Jan 23 10:38:29 1995
+++ linux/fs/sysv/balloc.c	Wed Nov  8 12:35:23 1995
@@ -19,10 +19,6 @@
  *  This file contains code for allocating/freeing blocks.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/sysv_fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/dir.c linux/fs/sysv/dir.c
--- v1.3.38/linux/fs/sysv/dir.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/sysv/dir.c	Wed Nov  8 12:35:23 1995
@@ -13,17 +13,13 @@
  *  SystemV/Coherent directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/errno.h>
 #include <linux/fs.h>
 #include <linux/sysv_fs.h>
 #include <linux/stat.h>
 #include <linux/string.h>
+
+#include <asm/segment.h>
 
 static int sysv_dir_read(struct inode * inode, struct file * filp, char * buf, int count)
 {
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/file.c linux/fs/sysv/file.c
--- v1.3.38/linux/fs/sysv/file.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/sysv/file.c	Wed Nov  8 12:35:23 1995
@@ -13,12 +13,6 @@
  *  SystemV/Coherent regular file handling primitives
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/sysv_fs.h>
@@ -27,6 +21,8 @@
 #include <linux/stat.h>
 #include <linux/string.h>
 #include <linux/locks.h>
+
+#include <asm/segment.h>
 
 #define	NBUF	32
 
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/fsync.c linux/fs/sysv/fsync.c
--- v1.3.38/linux/fs/sysv/fsync.c	Mon Jan 23 10:38:29 1995
+++ linux/fs/sysv/fsync.c	Wed Nov  8 12:36:10 1995
@@ -14,10 +14,6 @@
  *  SystemV/Coherent fsync primitive
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/errno.h>
 #include <linux/stat.h>
 
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/ialloc.c linux/fs/sysv/ialloc.c
--- v1.3.38/linux/fs/sysv/ialloc.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/sysv/ialloc.c	Wed Nov  8 12:35:23 1995
@@ -19,10 +19,6 @@
  *  This file contains code for allocating/freeing inodes.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/inode.c linux/fs/sysv/inode.c
--- v1.3.38/linux/fs/sysv/inode.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/sysv/inode.c	Thu Nov  9 08:24:09 1995
@@ -20,13 +20,7 @@
  *  the superblock.
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -979,8 +973,6 @@
 
 /* Every kernel module contains stuff like this. */
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type sysv_fs_type[3] = {
 	{sysv_read_super, "xenix", 1, NULL},
 	{sysv_read_super, "sysv", 1, NULL},
@@ -990,10 +982,12 @@
 int init_module(void)
 {
 	int i;
+	int ouch;
 
-	for (i = 0; i < 3; i++)
-		register_filesystem(&sysv_fs_type[i]);
-
+	for (i = 0; i < 3; i++) {
+		if ((ouch = register_filesystem(&sysv_fs_type[i])) != 0)
+			return ouch;
+	}
 	return 0;
 }
 
@@ -1002,6 +996,7 @@
 	int i;
 
 	for (i = 0; i < 3; i++)
+		/* No error message if this breaks... that's OK... */
 		unregister_filesystem(&sysv_fs_type[i]);
 }
 
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/namei.c linux/fs/sysv/namei.c
--- v1.3.38/linux/fs/sysv/namei.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/sysv/namei.c	Wed Nov  8 12:36:10 1995
@@ -11,10 +11,6 @@
  *  Copyright (C) 1993  Bruno Haible
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/symlink.c linux/fs/sysv/symlink.c
--- v1.3.38/linux/fs/sysv/symlink.c	Tue Jun 27 14:11:44 1995
+++ linux/fs/sysv/symlink.c	Wed Nov  8 12:36:10 1995
@@ -13,16 +13,12 @@
  *  SystemV/Coherent symlink handling code
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/sysv_fs.h>
 #include <linux/stat.h>
+
+#include <asm/segment.h>
 
 static int sysv_readlink(struct inode *, char *, int);
 static int sysv_follow_link(struct inode *, struct inode *, int, int, struct inode **);
diff -u --recursive --new-file v1.3.38/linux/fs/sysv/truncate.c linux/fs/sysv/truncate.c
--- v1.3.38/linux/fs/sysv/truncate.c	Mon Jan 23 10:38:30 1995
+++ linux/fs/sysv/truncate.c	Wed Nov  8 12:36:10 1995
@@ -11,10 +11,6 @@
  *  Copyright (C) 1993  Bruno Haible
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/sysv_fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/check.c linux/fs/umsdos/check.c
--- v1.3.38/linux/fs/umsdos/check.c	Mon Jan 23 10:38:30 1995
+++ linux/fs/umsdos/check.c	Wed Nov  8 12:32:32 1995
@@ -1,8 +1,8 @@
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/system.h>
+/*
+ * linux/fs/umsdos/check.c
+ *
+ *
+ */
 
 #include <linux/signal.h>
 #include <linux/sched.h>
@@ -13,6 +13,8 @@
 #include <linux/types.h>
 #include <linux/ptrace.h>
 #include <linux/mman.h>
+
+#include <asm/system.h>
 
 extern unsigned long high_memory;
 
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/dir.c linux/fs/umsdos/dir.c
--- v1.3.38/linux/fs/umsdos/dir.c	Sun Oct 29 11:38:49 1995
+++ linux/fs/umsdos/dir.c	Wed Nov  8 12:32:32 1995
@@ -7,12 +7,6 @@
  *  Extended MS-DOS directory handling functions
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/sched.h>
 #include <linux/string.h>
 #include <linux/fs.h>
@@ -22,6 +16,8 @@
 #include <linux/limits.h>
 #include <linux/umsdos_fs.h>
 #include <linux/malloc.h>
+
+#include <asm/segment.h>
 
 #define PRINTK(x)
 #define Printk(x) printk x
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/emd.c linux/fs/umsdos/emd.c
--- v1.3.38/linux/fs/umsdos/emd.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/umsdos/emd.c	Wed Nov  8 12:32:32 1995
@@ -5,19 +5,17 @@
  *
  *  Extended MS-DOS directory handling functions
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
 
 #include <linux/types.h>
 #include <linux/fcntl.h>
 #include <linux/kernel.h>
-#include <asm/segment.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/string.h>
 #include <linux/msdos_fs.h>
 #include <linux/umsdos_fs.h>
+
+#include <asm/segment.h>
 
 #define PRINTK(x)
 #define Printk(x) printk x
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/file.c linux/fs/umsdos/file.c
--- v1.3.38/linux/fs/umsdos/file.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/umsdos/file.c	Wed Nov  8 12:32:32 1995
@@ -7,13 +7,6 @@
  *  Extended MS-DOS regular file handling primitives
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
@@ -23,6 +16,8 @@
 #include <linux/msdos_fs.h>
 #include <linux/umsdos_fs.h>
 
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #define PRINTK(x)
 #define Printk(x)	printk x
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/inode.c linux/fs/umsdos/inode.c
--- v1.3.38/linux/fs/umsdos/inode.c	Mon Jun 12 16:49:41 1995
+++ linux/fs/umsdos/inode.c	Thu Nov  9 08:24:09 1995
@@ -6,13 +6,7 @@
  *
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
@@ -501,16 +495,13 @@
 
 #ifdef MODULE
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type umsdos_fs_type = {
 	UMSDOS_read_super, "umsdos", 1, NULL
 };
 
 int init_module(void)
 {
-	register_filesystem(&umsdos_fs_type);
-	return 0;
+	return register_filesystem(&umsdos_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/ioctl.c linux/fs/umsdos/ioctl.c
--- v1.3.38/linux/fs/umsdos/ioctl.c	Fri Jul  7 08:54:52 1995
+++ linux/fs/umsdos/ioctl.c	Wed Nov  8 12:32:32 1995
@@ -5,9 +5,6 @@
  *
  *  Extended MS-DOS ioctl directory handling functions
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
 
 #include <asm/segment.h>
 #include <linux/errno.h>
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/mangle.c linux/fs/umsdos/mangle.c
--- v1.3.38/linux/fs/umsdos/mangle.c	Wed Aug  2 13:21:15 1995
+++ linux/fs/umsdos/mangle.c	Wed Nov  8 12:33:39 1995
@@ -5,10 +5,7 @@
  *
  * Control the mangling of file name to fit msdos name space.
  * Many optimisation by GLU == dglaude@is1.vub.ac.be (GLAUDE DAVID)
-*/
-#ifdef MODULE
-#include <linux/module.h>
-#endif
+ */
 
 #include <linux/errno.h>
 #include <linux/ctype.h>
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/namei.c linux/fs/umsdos/namei.c
--- v1.3.38/linux/fs/umsdos/namei.c	Tue Aug  8 12:31:41 1995
+++ linux/fs/umsdos/namei.c	Wed Nov  8 12:33:39 1995
@@ -5,10 +5,7 @@
  *	Inspired from linux/fs/msdos/... by Werner Almesberger
  *
  * Maintain and access the --linux alternate directory file.
-*/
-#ifdef MODULE
-#include <linux/module.h>
-#endif
+ */
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/rdir.c linux/fs/umsdos/rdir.c
--- v1.3.38/linux/fs/umsdos/rdir.c	Fri Jul  7 08:54:52 1995
+++ linux/fs/umsdos/rdir.c	Wed Nov  8 12:33:39 1995
@@ -7,12 +7,6 @@
  *  (For directory without EMD file).
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/msdos_fs.h>
@@ -21,6 +15,8 @@
 #include <linux/limits.h>
 #include <linux/umsdos_fs.h>
 #include <linux/malloc.h>
+
+#include <asm/segment.h>
 
 #define PRINTK(x)
 #define Printk(x) printk x
diff -u --recursive --new-file v1.3.38/linux/fs/umsdos/symlink.c linux/fs/umsdos/symlink.c
--- v1.3.38/linux/fs/umsdos/symlink.c	Mon Jan 23 10:38:30 1995
+++ linux/fs/umsdos/symlink.c	Wed Nov  8 12:33:39 1995
@@ -6,12 +6,6 @@
  *
  *  Extended MS-DOS regular file handling primitives
  */
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
 
 #include <linux/sched.h>
 #include <linux/fs.h>
@@ -22,8 +16,12 @@
 #include <linux/umsdos_fs.h>
 #include <linux/malloc.h>
 
+#include <asm/segment.h>
+#include <asm/system.h>
+
 #define PRINTK(x)
 #define Printk(x)	printk x
+
 /*
 	Read the data associate with the symlink.
 	Return length read in buffer or  a negative error code.
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/bitmap.c linux/fs/xiafs/bitmap.c
--- v1.3.38/linux/fs/xiafs/bitmap.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/xiafs/bitmap.c	Wed Nov  8 12:30:22 1995
@@ -11,10 +11,6 @@
 
 /* bitmap.c contains the code that handles the inode and block bitmaps */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/locks.h>
 #include <linux/xia_fs.h>
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/dir.c linux/fs/xiafs/dir.c
--- v1.3.38/linux/fs/xiafs/dir.c	Thu Jun  8 22:39:49 1995
+++ linux/fs/xiafs/dir.c	Wed Nov  8 12:30:22 1995
@@ -9,17 +9,14 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
 #include <linux/sched.h>
 #include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/xia_fs.h>
 #include <linux/stat.h>
+
+#include <asm/segment.h>
 
 #include "xiafs_mac.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/file.c linux/fs/xiafs/file.c
--- v1.3.38/linux/fs/xiafs/file.c	Wed Aug  2 13:21:16 1995
+++ linux/fs/xiafs/file.c	Wed Nov  8 12:30:22 1995
@@ -9,13 +9,6 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/xia_fs.h>
@@ -24,6 +17,9 @@
 #include <linux/fcntl.h>
 #include <linux/stat.h>
 #include <linux/locks.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #include "xiafs_mac.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/fsync.c linux/fs/xiafs/fsync.c
--- v1.3.38/linux/fs/xiafs/fsync.c	Mon Jan 23 10:38:30 1995
+++ linux/fs/xiafs/fsync.c	Wed Nov  8 12:30:22 1995
@@ -8,13 +8,6 @@
  *  xiafs fsync primitive
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-#include <asm/system.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/stat.h>
@@ -23,6 +16,9 @@
 
 #include <linux/fs.h>
 #include <linux/xia_fs.h>
+
+#include <asm/segment.h>
+#include <asm/system.h>
 
 #include "xiafs_mac.h"
 
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/inode.c linux/fs/xiafs/inode.c
--- v1.3.38/linux/fs/xiafs/inode.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/xiafs/inode.c	Thu Nov  9 08:24:09 1995
@@ -9,13 +9,7 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/sched.h>
 #include <linux/xia_fs.h>
@@ -521,16 +515,13 @@
 
 /* Every kernel module contains stuff like this. */
 
-char kernel_version[] = UTS_RELEASE;
-
 static struct file_system_type xiafs_fs_type = {
 	xiafs_read_super, "xiafs", 1, NULL
 };
 
 int init_module(void)
 {
-	register_filesystem(&xiafs_fs_type);
-	return 0;
+	return register_filesystem(&xiafs_fs_type);
 }
 
 void cleanup_module(void)
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/namei.c linux/fs/xiafs/namei.c
--- v1.3.38/linux/fs/xiafs/namei.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/xiafs/namei.c	Wed Nov  8 12:32:32 1995
@@ -9,10 +9,6 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/sched.h>
 #include <linux/xia_fs.h>
 #include <linux/kernel.h>
@@ -20,6 +16,7 @@
 #include <linux/stat.h>
 #include <linux/fcntl.h>
 #include <linux/errno.h>
+
 #include <asm/segment.h>
 
 #include "xiafs_mac.h"
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/symlink.c linux/fs/xiafs/symlink.c
--- v1.3.38/linux/fs/xiafs/symlink.c	Tue Jun 27 14:11:44 1995
+++ linux/fs/xiafs/symlink.c	Wed Nov  8 12:30:22 1995
@@ -9,17 +9,13 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
-#include <asm/segment.h>
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/xia_fs.h>
 #include <linux/stat.h>
+
+#include <asm/segment.h>
 
 static int 
 xiafs_readlink(struct inode *, char *, int);
diff -u --recursive --new-file v1.3.38/linux/fs/xiafs/truncate.c linux/fs/xiafs/truncate.c
--- v1.3.38/linux/fs/xiafs/truncate.c	Mon Jan 23 10:38:30 1995
+++ linux/fs/xiafs/truncate.c	Wed Nov  8 12:30:22 1995
@@ -9,10 +9,6 @@
  *  This software may be redistributed per Linux Copyright.
  */
 
-#ifdef MODULE
-#include <linux/module.h>
-#endif
-
 #include <linux/errno.h>
 #include <linux/sched.h>
 #include <linux/xia_fs.h>
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/a.out.h linux/include/asm-alpha/a.out.h
--- v1.3.38/linux/include/asm-alpha/a.out.h	Sun Oct 29 11:38:49 1995
+++ linux/include/asm-alpha/a.out.h	Thu Nov  9 10:04:33 1995
@@ -32,7 +32,7 @@
 	__u64 text_start;	/* with a few additions that actually make sense */
 	__u64 data_start;
 	__u64 bss_start;
-	__u32 gprmask, fprmask;	/* but what are these? */
+	__u32 gprmask, fprmask;	/* bitmask of general & floating point regs used in binary */
 	__u64 gpvalue;
 };
 
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/floppy.h linux/include/asm-alpha/floppy.h
--- v1.3.38/linux/include/asm-alpha/floppy.h	Mon Oct 23 18:02:18 1995
+++ linux/include/asm-alpha/floppy.h	Thu Nov  9 08:24:09 1995
@@ -34,13 +34,8 @@
 	/* Nothing to do on an Alpha */
 }
 
-#ifdef MODULE
-int FDC1 = 0x3f0;
-int FDC2 = -1;
-#else
-#define FDC1 0x3f0
+static int FDC1 = 0x3f0;
 static int FDC2 = -1;
-#endif
 
 /*
  * Again, the CMOS information doesn't work on the alpha..
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/io.h linux/include/asm-alpha/io.h
--- v1.3.38/linux/include/asm-alpha/io.h	Wed Nov  8 07:11:40 1995
+++ linux/include/asm-alpha/io.h	Thu Nov  9 10:04:33 1995
@@ -156,19 +156,23 @@
 /*
  * String version of IO memory access ops:
  */
-extern void memcpy_fromio(void *, unsigned long, unsigned long);
-extern void memcpy_toio(unsigned long, void *, unsigned long);
-extern void memset_io(unsigned long, int, unsigned long);
+extern void _memcpy_fromio(void *, unsigned long, unsigned long);
+extern void _memcpy_toio(unsigned long, void *, unsigned long);
+extern void _memset_io(unsigned long, int, unsigned long);
+
+#define memcpy_fromio(to,from,len)	_memcpy_fromio((to),(unsigned long)(from),(len))
+#define memcpy_toio(to,from,len)	_memcpy_toio((unsigned long)(to),(from),(len))
+#define memset_io(addr,c,len)		_memset_io((unsigned long)(addr),(c),(len))
 
 /*
  * String versions of in/out ops:
  */
-extern void insb (unsigned long port, void *src, unsigned long count);
-extern void insw (unsigned long port, void *src, unsigned long count);
-extern void insl (unsigned long port, void *src, unsigned long count);
-extern void outsb (unsigned long port, void *dst, unsigned long count);
-extern void outsw (unsigned long port, void *dst, unsigned long count);
-extern void outsl (unsigned long port, void *dst, unsigned long count);
+extern void insb (unsigned long port, void *dst, unsigned long count);
+extern void insw (unsigned long port, void *dst, unsigned long count);
+extern void insl (unsigned long port, void *dst, unsigned long count);
+extern void outsb (unsigned long port, const void *src, unsigned long count);
+extern void outsw (unsigned long port, const void *src, unsigned long count);
+extern void outsl (unsigned long port, const void *src, unsigned long count);
 
 /*
  * XXX - We don't have csum_partial_copy_fromio() yet, so we cheat here and 
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/resource.h linux/include/asm-alpha/resource.h
--- v1.3.38/linux/include/asm-alpha/resource.h	Fri Jun  2 13:51:17 1995
+++ linux/include/asm-alpha/resource.h	Thu Nov  9 10:04:33 1995
@@ -21,4 +21,21 @@
 
 #define RLIM_NLIMITS	9
 
-#endif
+#ifdef __KERNEL__
+
+#define INIT_RLIMITS							\
+{									\
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_CPU */	\
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_FSIZE */	\
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_DATA */	\
+    {_STK_LIM, _STK_LIM},			/* RLIMIT_STACK */	\
+    {       0, LONG_MAX},			/* RLIMIT_CORE */	\
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_RSS */	\
+    { NR_OPEN,  NR_OPEN},			/* RLIMIT_NOFILE */	\
+    {LONG_MAX, LONG_MAX},			/* RLIMIT_AS */		\
+    {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER},	/* RLIMIT_NPROC */	\
+}
+
+#endif /* __KERNEL__ */
+
+#endif /* _ALPHA_RESOURCE_H */
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/string.h linux/include/asm-alpha/string.h
--- v1.3.38/linux/include/asm-alpha/string.h	Wed Nov  8 07:11:41 1995
+++ linux/include/asm-alpha/string.h	Thu Nov  9 10:04:33 1995
@@ -1,6 +1,8 @@
 #ifndef __ALPHA_STRING_H__
 #define __ALPHA_STRING_H__
 
+#ifdef __KERNEL__
+
 extern void * __constant_c_memset(void *, unsigned long, long);
 extern void * __memset(void *, char, size_t);
 
@@ -26,5 +28,7 @@
  __memset((s),(c),(count)))
 
 #define __HAVE_ARCH_STRLEN
+
+#endif /* __KERNEL__ */
 
 #endif /* __ALPHA_STRING_H__ */
diff -u --recursive --new-file v1.3.38/linux/include/asm-alpha/system.h linux/include/asm-alpha/system.h
--- v1.3.38/linux/include/asm-alpha/system.h	Sun Oct 29 11:38:49 1995
+++ linux/include/asm-alpha/system.h	Thu Nov  9 10:04:33 1995
@@ -100,37 +100,37 @@
 /*
  * Give prototypes to shut up gcc.
  */
-extern inline unsigned long xchg_u32 (volatile int * m, unsigned long val);
-extern inline unsigned long xchg_u64 (volatile long * m, unsigned long val);
+extern inline unsigned long xchg_u32 (volatile int * m, unsigned long new_val);
+extern inline unsigned long xchg_u64 (volatile long * m, unsigned long new_val);
 
-extern inline unsigned long xchg_u32(volatile int * m, unsigned long val)
+extern inline unsigned long xchg_u32(volatile int * m, unsigned long new_val)
 {
-	unsigned long dummy, dummy2;
+	unsigned long old_val;
 
-	__asm__ __volatile__(
-		"\n1:\t"
-		"ldl_l %0,%1\n\t"
-		"bis %2,%2,%3\n\t"
-		"stl_c %3,%1\n\t"
-		"beq %3,1b\n"
-		: "=r" (val), "=m" (*m), "=r" (dummy), "=r" (dummy2)
-		: "1" (*m), "2" (val));
-	return val;
+	__asm__ __volatile__("\n1:\t"
+			     "ldl_l %0,%2\n\t"
+			     "bis %3,%3,$25\n\t"
+			     "stl_c $25,%1\n\t"
+			     "beq $25,1b\n"
+			     : "=r"(old_val), "=m"(*m)
+			     : "m"(*m), "r"(new_val)
+			     : "$25");
+	return old_val;
 }
 
-extern inline unsigned long xchg_u64(volatile long * m, unsigned long val)
+extern inline unsigned long xchg_u64(volatile long * m, unsigned long new_val)
 {
-	unsigned long dummy, dummy2;
+	unsigned long old_val;
 
-	__asm__ __volatile__(
-		"\n1:\t"
-		"ldq_l %0,%1\n\t"
-		"bis %2,%2,%3\n\t"
-		"stq_c %3,%1\n\t"
-		"beq %3,1b\n"
-		: "=r" (val), "=m" (*m), "=r" (dummy), "=r" (dummy2)
-		: "1" (*m), "2" (val));
-	return val;
+	__asm__ __volatile__("\n1:\t"
+			     "ldq_l %0,%2\n\t"
+			     "bis %3,%3,$25\n\t"
+			     "stq_c $25,%1\n\t"
+			     "beq $25,1b\n"
+			     : "=r"(old_val), "=m"(*m)
+			     : "m"(*m), "r"(new_val)
+			     : "$25");
+	return old_val;
 }
 
 #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
diff -u --recursive --new-file v1.3.38/linux/include/asm-i386/bitops.h linux/include/asm-i386/bitops.h
--- v1.3.38/linux/include/asm-i386/bitops.h	Wed Nov  8 07:11:41 1995
+++ linux/include/asm-i386/bitops.h	Wed Nov  8 07:06:25 1995
@@ -24,6 +24,7 @@
  */
 struct __dummy { unsigned long a[100]; };
 #define ADDR (*(struct __dummy *) addr)
+#define CONST_ADDR (*(const struct __dummy *) addr)
 
 extern __inline__ int set_bit(int nr, void * addr)
 {
@@ -68,7 +69,7 @@
 
 	__asm__ __volatile__("btl %2,%1\n\tsbbl %0,%0"
 		:"=r" (oldbit)
-		:"m" (ADDR),"ir" (nr));
+		:"m" (CONST_ADDR),"ir" (nr));
 	return oldbit;
 }
 
diff -u --recursive --new-file v1.3.38/linux/include/asm-i386/floppy.h linux/include/asm-i386/floppy.h
--- v1.3.38/linux/include/asm-i386/floppy.h	Mon Oct 23 18:02:18 1995
+++ linux/include/asm-i386/floppy.h	Thu Nov  9 08:24:09 1995
@@ -34,13 +34,8 @@
 	/* Nothing to do on an i386 */
 }
 
-#ifdef MODULE
-int FDC1 = 0x3f0;
-int FDC2 = -1;
-#else
-#define FDC1 0x3f0
+static int FDC1 = 0x3f0;
 static int FDC2 = -1;
-#endif
 
 #define FLOPPY0_TYPE	((CMOS_READ(0x10) >> 4) & 15)
 #define FLOPPY1_TYPE	(CMOS_READ(0x10) & 15)
diff -u --recursive --new-file v1.3.38/linux/include/asm-i386/resource.h linux/include/asm-i386/resource.h
--- v1.3.38/linux/include/asm-i386/resource.h	Sat Jun 10 18:35:54 1995
+++ linux/include/asm-i386/resource.h	Thu Nov  9 10:04:33 1995
@@ -20,4 +20,16 @@
 
 #define RLIM_NLIMITS	8
 
+#ifdef __KERNEL__
+
+#define INIT_RLIMITS							\
+{									\
+    {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX},				\
+    {LONG_MAX, LONG_MAX}, {_STK_LIM, _STK_LIM},				\
+    {       0, LONG_MAX}, {LONG_MAX, LONG_MAX},				\
+    {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, {NR_OPEN, NR_OPEN}	\
+}
+
+#endif /* __KERNEL__ */
+
 #endif
diff -u --recursive --new-file v1.3.38/linux/include/asm-mips/floppy.h linux/include/asm-mips/floppy.h
--- v1.3.38/linux/include/asm-mips/floppy.h	Wed Nov  8 07:11:41 1995
+++ linux/include/asm-mips/floppy.h	Thu Nov  9 08:24:09 1995
@@ -52,19 +52,11 @@
 #define FLOPPY0_TYPE 4		/* this is wrong for the Olli M700, but who cares... */
 #define FLOPPY1_TYPE 0
 
-#ifdef MODULE
-#define FDC1			((boot_info.machtype == MACH_ACER_PICA_61 || \
-				boot_info.machtype == MACH_MIPS_MAGNUM_4000 || \
-				boot_info.machtype == MACH_OLIVETTI_M700) ? \
-				0xe0003000 : 0x3f0)
-int FDC2=-1;
-#else
 #define FDC1			((boot_info.machtype == MACH_ACER_PICA_61 || \
 				boot_info.machtype == MACH_MIPS_MAGNUM_4000 || \
 				boot_info.machtype == MACH_OLIVETTI_M700) ? \
 				0xe0003000 : 0x3f0)
 static int FDC2=-1;
-#endif /* MODULE */
 
 #define N_FDC 1			/* do you *really* want a second controller? */
 #define N_DRIVE 8
diff -u --recursive --new-file v1.3.38/linux/include/linux/major.h linux/include/linux/major.h
--- v1.3.38/linux/include/linux/major.h	Mon Oct 16 18:38:24 1995
+++ linux/include/linux/major.h	Wed Nov  8 07:06:25 1995
@@ -19,8 +19,8 @@
  *      --------------------   --------------------   --------------------
  *  0 - unnamed                unnamed                minor 0 = true nodev
  *  1 - /dev/mem               ramdisk
- *  2 -                        floppy
- *  3 -                        ide0 or hd
+ *  2 - /dev/ptyp*             floppy
+ *  3 - /dev/ttyp*             ide0 or hd
  *  4 - /dev/tty*
  *  5 - /dev/tty; /dev/cua*
  *  6 - lp
@@ -55,7 +55,9 @@
 #define UNNAMED_MAJOR	0
 #define MEM_MAJOR	1
 #define FLOPPY_MAJOR	2
+#define PTY_MASTER_MAJOR 2
 #define IDE0_MAJOR	3
+#define PTY_SLAVE_MAJOR 3
 #define HD_MAJOR	IDE0_MAJOR
 #define TTY_MAJOR	4
 #define TTYAUX_MAJOR	5
diff -u --recursive --new-file v1.3.38/linux/include/linux/mm.h linux/include/linux/mm.h
--- v1.3.38/linux/include/linux/mm.h	Mon Oct 23 18:02:19 1995
+++ linux/include/linux/mm.h	Thu Nov  9 10:33:46 1995
@@ -179,12 +179,11 @@
 extern void clear_page_tables(struct task_struct * tsk);
 extern int new_page_tables(struct task_struct * tsk);
 extern int copy_page_tables(struct task_struct * to);
-extern int clone_page_tables(struct task_struct * to);
-extern int unmap_page_range(unsigned long from, unsigned long size);
+
+extern int zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size);
+extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma);
 extern int remap_page_range(unsigned long from, unsigned long to, unsigned long size, pgprot_t prot);
 extern int zeromap_page_range(unsigned long from, unsigned long size, pgprot_t prot);
-extern int copy_page_range(struct mm_struct *dst, struct mm_struct *src, struct vm_area_struct *vma);
-extern int zap_page_range(struct mm_struct *mm, unsigned long address, unsigned long size);
 
 extern void vmtruncate(struct inode * inode, unsigned long offset);
 extern void handle_mm_fault(struct vm_area_struct *vma, unsigned long address, int write_access);
diff -u --recursive --new-file v1.3.38/linux/include/linux/module.h linux/include/linux/module.h
--- v1.3.38/linux/include/linux/module.h	Wed Nov  8 07:11:42 1995
+++ linux/include/linux/module.h	Thu Nov  9 08:24:09 1995
@@ -7,21 +7,25 @@
 #ifndef _LINUX_MODULE_H
 #define _LINUX_MODULE_H
 
-#ifdef MODVERSIONS
-# ifndef __GENKSYMS__
+#ifdef __GENKSYMS__
+#  define _set_ver(sym,vers) sym
+#  define MODVERSIONS
+#else /* ! __GENKSYMS__ */
+# ifdef MODVERSIONS
+#  undef CONFIG_MODVERSIONS /* the *.ver files need this... */
+#  define CONFIG_MODVERSIONS /* the *.ver files need this... */
 #  ifdef MODULE
 #   define _set_ver(sym,vers) sym ## _R ## vers
 #   include <linux/modversions.h>
-#  else /* MODULE */
+#  else /* !MODULE */
 #   ifdef EXPORT_SYMTAB
 #    define _set_ver(sym,vers) sym
 #    include <linux/modversions.h>
 #   endif /* EXPORT_SYMTAB */
 #  endif /* MODULE */
-# else /* __GENKSYMS__ */
-#  define _set_ver(sym,vers) sym
-# endif /* __GENKSYMS__ */
-#endif /* MODVERSIONS */
+#  undef CONFIG_MODVERSIONS /* the *.ver files needed this... */
+# endif /* MODVERSIONS */
+#endif /* __GENKSYMS__ */
 
 /* values of module.state */
 #define MOD_UNINITIALIZED 0
diff -u --recursive --new-file v1.3.38/linux/include/linux/random.h linux/include/linux/random.h
--- v1.3.38/linux/include/linux/random.h	Mon Oct 16 18:38:24 1995
+++ linux/include/linux/random.h	Wed Nov  8 07:06:25 1995
@@ -12,11 +12,13 @@
 #define RNDGETENTCNT	0x01080000
 #define RNDADDTOENTCNT	0x01080001
 #define RNDGETPOOL	0x01080002
+#define RNDADDENTROPY	0x01080003
+#define RNDZAPENTCNT	0x01080004
 
-struct rand_pool_state {
+struct rand_pool_info {
 	int	entropy_count;
-	int	pool_size;
-	__u32	pool[0];
+	int	buf_size;
+	__u32	buf[0];
 };
 
 /* Exported functions */
@@ -33,14 +35,8 @@
 void add_blkdev_randomness(int major);
 
 void get_random_bytes(void *buf, int nbytes);
-int read_random(struct inode * inode, struct file * file,
-		char * buf, int nbytes);
-int read_random_unlimited(struct inode * inode, struct file * file,
-			  char * buf, int nbytes);
-int write_random(struct inode * inode, struct file * file,
-		 const char * buffer, int count);
-int random_ioctl(struct inode * inode, struct file * file,
-		 unsigned int cmd, unsigned long arg);
+
+struct file_operations random_fops, urandom_fops;
 
 #endif /* __KERNEL___ */
 
diff -u --recursive --new-file v1.3.38/linux/include/linux/sched.h linux/include/linux/sched.h
--- v1.3.38/linux/include/linux/sched.h	Wed Nov  8 07:11:42 1995
+++ linux/include/linux/sched.h	Thu Nov  9 10:33:46 1995
@@ -267,10 +267,7 @@
 /* utime */	0,0,0,0,0, \
 /* flt */	0,0,0,0,0,0, \
 /* swp */	0,0,0,0,0, \
-/* rlimits */   { {LONG_MAX, LONG_MAX}, {LONG_MAX, LONG_MAX},  \
-		  {LONG_MAX, LONG_MAX}, {_STK_LIM, _STK_LIM},  \
-		  {       0, LONG_MAX}, {LONG_MAX, LONG_MAX}, \
-		  {MAX_TASKS_PER_USER, MAX_TASKS_PER_USER}, {NR_OPEN, NR_OPEN}}, \
+/* rlimits */   INIT_RLIMITS, \
 /* math */	0, \
 /* comm */	"swapper", \
 /* fs info */	0,NULL, \
diff -u --recursive --new-file v1.3.38/linux/include/linux/symtab_begin.h linux/include/linux/symtab_begin.h
--- v1.3.38/linux/include/linux/symtab_begin.h	Wed Nov  8 07:11:42 1995
+++ linux/include/linux/symtab_begin.h	Thu Nov  9 08:24:09 1995
@@ -1,7 +1,6 @@
-#include <linux/config.h>
 #include <linux/linkage.h>
 
-#ifdef CONFIG_MODVERSIONS
+#ifdef MODVERSIONS
 # undef _set_ver
 # undef X
 
@@ -15,9 +14,9 @@
 #  endif /* !MODULE */
 #  define X(a) a
 # endif /* !__GENKSYMS__ */
-#else /* !CONFIG_MODVERSIONS */
+#else /* !MODVERSIONS */
 # define X(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
-#endif /* !CONFIG_MODVERSIONS */
+#endif /* MODVERSIONS */
 
 #define EMPTY {0,0}
 	0, 0, 0, {
diff -u --recursive --new-file v1.3.38/linux/include/linux/symtab_end.h linux/include/linux/symtab_end.h
--- v1.3.38/linux/include/linux/symtab_end.h	Wed Nov  8 07:11:42 1995
+++ linux/include/linux/symtab_end.h	Thu Nov  9 08:24:09 1995
@@ -1,4 +1,4 @@
-#ifdef MODVERSIONS /* MODVERSIONS */
+#ifdef MODVERSIONS
 #undef _set_ver
 #if defined(MODULE) && !defined(__GENKSYMS__)
 #define _set_ver(sym,vers) sym ## _R ## vers
diff -u --recursive --new-file v1.3.38/linux/include/linux/tty.h linux/include/linux/tty.h
--- v1.3.38/linux/include/linux/tty.h	Wed Nov  8 07:11:42 1995
+++ linux/include/linux/tty.h	Wed Nov  8 07:26:07 1995
@@ -26,7 +26,7 @@
 #define MAX_NR_USER_CONSOLES 63	/* must be root to allocate above this */
 		/* Note: the ioctl VT_GETSTATE does not work for
 		   consoles 16 and higher (since it returns a short) */
-#define NR_PTYS		64
+#define NR_PTYS		256
 #define NR_LDISCS	16
 
 /*
diff -u --recursive --new-file v1.3.38/linux/include/net/sock.h linux/include/net/sock.h
--- v1.3.38/linux/include/net/sock.h	Wed Nov  8 07:11:42 1995
+++ linux/include/net/sock.h	Thu Nov  9 10:33:51 1995
@@ -172,7 +172,7 @@
  */
  
 	volatile unsigned short	backoff;
-	volatile short		err;
+	volatile int		err;
 	unsigned char		protocol;
 	volatile unsigned char	state;
 	volatile unsigned char	ack_backlog;
diff -u --recursive --new-file v1.3.38/linux/ipc/shm.c linux/ipc/shm.c
--- v1.3.38/linux/ipc/shm.c	Fri Oct 13 14:44:45 1995
+++ linux/ipc/shm.c	Wed Nov  8 11:29:15 1995
@@ -360,9 +360,9 @@
  */
 
 static struct vm_operations_struct shm_vm_ops = {
-	shm_open,		/* open */
-	shm_close,		/* close */
-	NULL,			/* unmap */
+	shm_open,		/* open - callback for a new vm-area open */
+	shm_close,		/* close - callback for when the vm-area is released */
+	NULL,			/* no need to sync pages at unmap */
 	NULL,			/* protect */
 	NULL,			/* sync */
 	NULL,			/* advise */
@@ -569,8 +569,6 @@
 {
 	struct shmid_ds *shp;
 	int id;
-
-	unmap_page_range (shmd->vm_start, shmd->vm_end - shmd->vm_start);
 
 	/* remove from the list of attaches of the shm segment */
 	id = SWP_OFFSET(shmd->vm_pte) & SHM_ID_MASK;
diff -u --recursive --new-file v1.3.38/linux/kernel/Makefile linux/kernel/Makefile
--- v1.3.38/linux/kernel/Makefile	Mon Aug 28 14:52:23 1995
+++ linux/kernel/Makefile	Thu Nov  9 08:24:09 1995
@@ -14,19 +14,9 @@
 O_OBJS    = sched.o dma.o fork.o exec_domain.o panic.o printk.o sys.o \
 	module.o exit.o signal.o itimer.o info.o time.o softirq.o \
 	resource.o
-
-SYMTAB_OBJS = ksyms.o
-O_OBJS     += $(SYMTAB_OBJS)
-
-ifdef CONFIG_MODVERSIONS
-$(O_TARGET): $(SYMTAB_OBJS:.o=.ver)
-dep: $(SYMTAB_OBJS:.o=.ver)
-fastdep: $(SYMTAB_OBJS:.o=.ver)
-endif
+OX_OBJS = ksyms.o
 
 include $(TOPDIR)/Rules.make
-
-include ../versions.mk
 
 sched.o: sched.c
 	$(CC) $(CFLAGS) $(PROFILING) -fno-omit-frame-pointer -c $<
diff -u --recursive --new-file v1.3.38/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- v1.3.38/linux/kernel/ksyms.c	Wed Nov  8 07:11:43 1995
+++ linux/kernel/ksyms.c	Thu Nov  9 08:24:09 1995
@@ -9,8 +9,8 @@
  * by Bjorn Ekwall <bj0rn@blox.se>
  */
 
-#include <linux/autoconf.h>
 #include <linux/module.h>
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/blkdev.h>
@@ -32,7 +32,6 @@
 #include <linux/locks.h>
 #include <linux/string.h>
 #include <linux/delay.h>
-#include <linux/config.h>
 #include <linux/sem.h>
 #include <linux/minix_fs.h>
 #include <linux/ext2_fs.h>
@@ -191,8 +190,6 @@
 	X(verify_area),
 	X(do_mmap),
 	X(do_munmap),
-	X(zeromap_page_range),
-	X(unmap_page_range),
 	X(insert_vm_struct),
 	X(merge_segments),
 
diff -u --recursive --new-file v1.3.38/linux/mm/memory.c linux/mm/memory.c
--- v1.3.38/linux/mm/memory.c	Wed Nov  8 07:11:43 1995
+++ linux/mm/memory.c	Wed Nov  8 11:48:34 1995
@@ -118,60 +118,30 @@
 	pmd_free(pmd);
 }
 	
-int new_page_tables(struct task_struct * tsk)
-{
-	pgd_t * page_dir, * new_pg;
-	int i;
-
-	if (!(new_pg = pgd_alloc()))
-		return -ENOMEM;
-	page_dir = pgd_offset(&init_mm, 0);
-	for (i = USER_PTRS_PER_PGD ; i < PTRS_PER_PGD ; i++)
-		new_pg[i] = page_dir[i];
-	SET_PAGE_DIR(tsk, new_pg);
-	tsk->mm->pgd = new_pg;
-	return 0;
-}
-
 /*
  * This function clears all user-level page tables of a process - this
- * is needed by execve(), so that old pages aren't in the way. Note that
- * unlike 'free_page_tables()', this function still leaves a valid
- * page-table-tree in memory: it just removes the user pages. The two
- * functions are similar, but there is a fundamental difference.
+ * is needed by execve(), so that old pages aren't in the way.
  */
 void clear_page_tables(struct task_struct * tsk)
 {
 	int i;
 	pgd_t * page_dir;
 
-	if (!tsk)
-		return;
-	if (tsk == task[0])
-		panic("task[0] (swapper) doesn't support exec()\n");
-	page_dir = pgd_offset(tsk->mm, 0);
-	if (!page_dir) {
-		printk("%s trying to clear NULL page-directory: not good\n", tsk->comm);
-		return;
-	}
-	if (pgd_inuse(page_dir)) {
-		if (new_page_tables(tsk))
-			oom(tsk);
-		pgd_free(page_dir);
-		return;
-	}
-	if (page_dir == swapper_pg_dir) {
+	page_dir = tsk->mm->pgd;
+	if (!page_dir || page_dir == swapper_pg_dir) {
 		printk("%s trying to clear kernel page-directory: not good\n", tsk->comm);
 		return;
 	}
 	for (i = 0 ; i < USER_PTRS_PER_PGD ; i++)
 		free_one_pgd(page_dir + i);
 	invalidate();
-	return;
 }
 
 /*
- * This function frees up all page tables of a process when it exits.
+ * This function frees up all page tables of a process when it exits. It
+ * is the same as "clear_page_tables()", except it also changes the process'
+ * page table directory to the kernel page tables and then frees the old
+ * page table directory.
  */
 void free_page_tables(struct task_struct * tsk)
 {
@@ -184,10 +154,6 @@
 		return;
 	}
 	SET_PAGE_DIR(tsk, swapper_pg_dir);
-	if (pgd_inuse(page_dir)) {
-		pgd_free(page_dir);
-		return;
-	}
 	tsk->mm->pgd = swapper_pg_dir;	/* or else... */
 	for (i = 0 ; i < PTRS_PER_PGD ; i++)
 		free_one_pgd(page_dir + i);
@@ -195,6 +161,21 @@
 	invalidate();
 }
 
+int new_page_tables(struct task_struct * tsk)
+{
+	pgd_t * page_dir, * new_pg;
+	int i;
+
+	if (!(new_pg = pgd_alloc()))
+		return -ENOMEM;
+	page_dir = pgd_offset(&init_mm, 0);
+	for (i = USER_PTRS_PER_PGD ; i < PTRS_PER_PGD ; i++)
+		new_pg[i] = page_dir[i];
+	SET_PAGE_DIR(tsk, new_pg);
+	tsk->mm->pgd = new_pg;
+	return 0;
+}
+
 static inline void copy_one_pte(pte_t * old_pte, pte_t * new_pte)
 {
 	pte_t pte = *old_pte;
@@ -324,7 +305,7 @@
 	swap_free(pte_val(page));
 }
 
-static inline void unmap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size)
+static inline void zap_pte_range(pmd_t * pmd, unsigned long address, unsigned long size)
 {
 	pte_t * pte;
 	unsigned long end;
@@ -332,7 +313,7 @@
 	if (pmd_none(*pmd))
 		return;
 	if (pmd_bad(*pmd)) {
-		printk("unmap_pte_range: bad pmd (%08lx)\n", pmd_val(*pmd));
+		printk("zap_pte_range: bad pmd (%08lx)\n", pmd_val(*pmd));
 		pmd_clear(pmd);
 		return;
 	}
@@ -350,7 +331,7 @@
 	} while (address < end);
 }
 
-static inline void unmap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size)
+static inline void zap_pmd_range(pgd_t * dir, unsigned long address, unsigned long size)
 {
 	pmd_t * pmd;
 	unsigned long end;
@@ -358,7 +339,7 @@
 	if (pgd_none(*dir))
 		return;
 	if (pgd_bad(*dir)) {
-		printk("unmap_pmd_range: bad pgd (%08lx)\n", pgd_val(*dir));
+		printk("zap_pmd_range: bad pgd (%08lx)\n", pgd_val(*dir));
 		pgd_clear(dir);
 		return;
 	}
@@ -368,7 +349,7 @@
 	if (end > PGDIR_SIZE)
 		end = PGDIR_SIZE;
 	do {
-		unmap_pte_range(pmd, address, end - address);
+		zap_pte_range(pmd, address, end - address);
 		address = (address + PMD_SIZE) & PMD_MASK; 
 		pmd++;
 	} while (address < end);
@@ -384,21 +365,12 @@
 
 	dir = pgd_offset(mm, address);
 	while (address < end) {
-		unmap_pmd_range(dir, address, end - address);
+		zap_pmd_range(dir, address, end - address);
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	}
 	invalidate();
 	return 0;
-}
-
-/*
- * a more complete version of free_page_tables which performs with page
- * granularity.
- */
-int unmap_page_range(unsigned long address, unsigned long size)
-{
-	return zap_page_range(current->mm, address, size);
 }
 
 static inline void zeromap_pte_range(pte_t * pte, unsigned long address, unsigned long size, pte_t zero_pte)
diff -u --recursive --new-file v1.3.38/linux/mm/mmap.c linux/mm/mmap.c
--- v1.3.38/linux/mm/mmap.c	Wed Nov  8 07:11:43 1995
+++ linux/mm/mmap.c	Wed Nov  8 11:24:48 1995
@@ -773,7 +773,7 @@
 		kfree(mpnt);
 	}
 
-	unmap_page_range(addr, len);
+	zap_page_range(current->mm, addr, len);
 	return 0;
 }
 
diff -u --recursive --new-file v1.3.38/linux/net/Makefile linux/net/Makefile
--- v1.3.38/linux/net/Makefile	Wed Nov  8 07:11:43 1995
+++ linux/net/Makefile	Wed Nov  8 12:40:50 1995
@@ -32,6 +32,15 @@
 endif
 
 L_TARGET     := network.a
-L_OBJS	     := socket.o protocols.o netlink.o $(join $(SUB_DIRS),$(SUB_DIRS:%=/%.o))
+L_OBJS	     := socket.o protocols.o $(join $(SUB_DIRS),$(SUB_DIRS:%=/%.o))
+M_OBJS	     :=
+
+ifeq ($(CONFIG_NETLINK),y)
+L_OBJS += netlink.o
+else
+  ifeq ($(CONFIG_NETLINK),m)
+    M_OBJS += netlink.o
+  endif
+endif
 
 include $(TOPDIR)/Rules.make
diff -u --recursive --new-file v1.3.38/linux/net/ipv4/Config.in linux/net/ipv4/Config.in
--- v1.3.38/linux/net/ipv4/Config.in	Mon Oct 23 18:02:22 1995
+++ linux/net/ipv4/Config.in	Wed Nov  8 12:48:56 1995
@@ -7,13 +7,15 @@
   bool 'IP: firewalling' CONFIG_IP_FIREWALL
 fi
 bool 'IP: accounting' CONFIG_IP_ACCT
-tristate 'IP: tunneling' CONFIG_NET_IPIP
-if [ "$CONFIG_IP_FORWARD" = "y" -a "$CONFIG_IP_FIREWALL" = "y" ]; then
-  bool 'IP: firewall packet logging' CONFIG_IP_FIREWALL_VERBOSE
-  bool 'IP: masquerading (ALPHA)' CONFIG_IP_MASQUERADE
-fi
-if [ "$CONFIG_IP_FORWARD" = "y" -a "$CONFIG_IP_MULTICAST" = "y" ]; then
-  bool 'IP: multicast routing(in progress)' CONFIG_IP_MROUTE
+if [ "$CONFIG_IP_FORWARD" = "y" ]; then
+  tristate 'IP: tunneling' CONFIG_NET_IPIP
+  if [ "$CONFIG_IP_FIREWALL" = "y" ]; then
+    bool 'IP: firewall packet logging' CONFIG_IP_FIREWALL_VERBOSE
+    bool 'IP: masquerading (ALPHA)' CONFIG_IP_MASQUERADE
+  fi
+  if [ "$CONFIG_IP_MULTICAST" = "y" ]; then
+    bool 'IP: multicast routing(in progress)' CONFIG_IP_MROUTE
+  fi
 fi
 comment '(it is safe to leave these untouched)'
 bool 'IP: PC/TCP compatibility mode' CONFIG_INET_PCTCP
diff -u --recursive --new-file v1.3.38/linux/net/ipv4/Makefile linux/net/ipv4/Makefile
--- v1.3.38/linux/net/ipv4/Makefile	Wed Nov  8 07:11:45 1995
+++ linux/net/ipv4/Makefile	Wed Nov  8 12:46:19 1995
@@ -30,6 +30,10 @@
 
 ifeq ($(CONFIG_NET_IPIP),y)
 IPV4_OBJS += ipip.o
+else
+  ifeq ($(CONFIG_NET_IPIP),m)
+  M_OBJS += ipip.o
+  endif
 endif
 
 ifdef CONFIG_INET
diff -u --recursive --new-file v1.3.38/linux/net/ipv4/ipip.c linux/net/ipv4/ipip.c
--- v1.3.38/linux/net/ipv4/ipip.c	Wed Nov  8 07:11:46 1995
+++ linux/net/ipv4/ipip.c	Thu Nov  9 08:24:09 1995
@@ -19,28 +19,26 @@
  *
  */
  
+#include <linux/module.h>
+
+#include <linux/config.h>
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/in.h>
+#include <linux/tcp.h>
+#include <linux/udp.h>
+#include <linux/firewall.h>
+#include <linux/config.h>	/* For CONFIG_FIREWALL */
+
 #include <net/datalink.h>
 #include <net/sock.h>
 #include <net/ip.h>
 #include <net/icmp.h>
-#include <linux/tcp.h>
-#include <linux/udp.h>
 #include <net/protocol.h>
 #include <net/ipip.h>
-#include <linux/firewall.h>
-
-#include <linux/config.h>
-
-#include <linux/module.h>
-
-#if ( defined(CONFIG_NET_IPIP) && defined(CONFIG_IP_FORWARD)) || defined(MODULE)
-
 
 /*
  *	The IPIP protocol driver.
@@ -114,6 +112,7 @@
 }
 
 #ifdef MODULE
+
 static struct inet_protocol ipip_protocol = {
   ipip_rcv,             /* IPIP handler          */
   NULL,                 /* Will be UDP fraglist handler */
@@ -142,5 +141,4 @@
 		printk("ipip close: can't remove protocol\n");
 }
 
-#endif
 #endif
diff -u --recursive --new-file v1.3.38/linux/net/ipv4/rarp.c linux/net/ipv4/rarp.c
--- v1.3.38/linux/net/ipv4/rarp.c	Wed Nov  8 07:11:46 1995
+++ linux/net/ipv4/rarp.c	Wed Nov  8 12:43:20 1995
@@ -31,12 +31,7 @@
  *
  */
 
-#include <linux/config.h>
-
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#endif
 
 #include <linux/types.h>
 #include <linux/string.h>
@@ -48,6 +43,8 @@
 #include <linux/errno.h>
 #include <linux/if_arp.h>
 #include <linux/in.h>
+#include <linux/config.h>
+
 #include <asm/system.h>
 #include <asm/segment.h>
 #include <stdarg.h>
@@ -68,8 +65,6 @@
 #include <linux/proc_fs.h>
 #include <linux/stat.h>
 
-#if	defined(CONFIG_INET_RARP) || defined(MODULE)
-
 extern int (*rarp_ioctl_hook)(unsigned int,void*);
 
 /*
@@ -555,10 +550,7 @@
 	rarp_ioctl_hook = rarp_ioctl;
 }
 
-
-#endif
 #ifdef MODULE
-char kernel_version[] = UTS_RELEASE;
 
 int init_module(void)
 {
@@ -568,22 +560,18 @@
 
 void cleanup_module(void)
 {
-	if (MOD_IN_USE)
-	  ;
-	else {
-		struct rarp_table *rt, *rt_next;
-		proc_net_unregister(PROC_NET_RARP);
-		rarp_ioctl_hook = NULL;
-		cli();
-		/* Destroy the RARP-table */
-		rt = rarp_tables;
-		rarp_tables = NULL;
-		sti();
-		/* ... and free it. */
-		for ( ; rt != NULL; rt = rt_next) {
-			rt_next = rt->next;
-			rarp_release_entry(rt);
-		}
+	struct rarp_table *rt, *rt_next;
+	proc_net_unregister(PROC_NET_RARP);
+	rarp_ioctl_hook = NULL;
+	cli();
+	/* Destroy the RARP-table */
+	rt = rarp_tables;
+	rarp_tables = NULL;
+	sti();
+	/* ... and free it. */
+	for ( ; rt != NULL; rt = rt_next) {
+		rt_next = rt->next;
+		rarp_release_entry(rt);
 	}
 }
 
diff -u --recursive --new-file v1.3.38/linux/net/netlink.c linux/net/netlink.c
--- v1.3.38/linux/net/netlink.c	Tue Oct 10 18:46:39 1995
+++ linux/net/netlink.c	Wed Nov  8 12:42:01 1995
@@ -11,16 +11,7 @@
  * 
  */
 
-#include <linux/config.h>
-
-#if defined(CONFIG_NETLINK) || defined(MODULE)
-#ifdef MODULE
 #include <linux/module.h>
-#include <linux/version.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
 
 #include <linux/errno.h>
 #include <linux/kernel.h>
@@ -134,6 +125,7 @@
 	if(active_map&(1<<minor))
 	{
 		open_map|=(1<<minor);
+		MOD_INC_USE_COUNT;
 		return 0;
 	}
 	return -EUNATCH;
@@ -220,15 +212,11 @@
 	return ret;
 }
 
-
-#ifdef MODULE
-char kernel_version[]=UTS_RELEASE;
-
-int init_module(void)
+int init_netlink(void)
 {
 	int ct;
-	printk("Network Kernel/User communications module 0.03\n");
-	if (register_chrdev(NET_MAJOR,"netlink",&netlink_fops)) {
+
+	if(register_chrdev(NET_MAJOR,"netlink", &netlink_fops)) {
 		printk("netlink: unable to get major %d\n", NET_MAJOR);
 		return -EIO;
 	}
@@ -240,25 +228,17 @@
 	return 0;
 }
 
-void cleanup_module(void)
+#ifdef MODULE
+
+int init_module(void)
 {
-	unregister_chrdev(NET_MAJOR,"netlink");
+	printk("Network Kernel/User communications module 0.03\n");
+	return init_netlink();
 }
 
-#else
-
-void init_netlink(void)
+void cleanup_module(void)
 {
-	int ct;
-	/* Keep quiet on booting, we don't want too many messages */
-	if(register_chrdev(NET_MAJOR,"netlink", &netlink_fops))
-		printk("netlink: unable to get major %d\n", NET_MAJOR);
-	for(ct=0;ct<MAX_LINKS;ct++)
-	{
-		skb_queue_head_init(&skb_queue_rd[ct]);
-		netlink_handler[ct]=netlink_err;
-	}
+	unregister_chrdev(NET_MAJOR,"netlink");
 }
 
-#endif
 #endif
diff -u --recursive --new-file v1.3.38/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v1.3.38/linux/net/unix/af_unix.c	Wed Nov  8 07:11:47 1995
+++ linux/net/unix/af_unix.c	Thu Nov  9 09:12:14 1995
@@ -796,6 +796,20 @@
 	}
 	return sent;
 }
+
+/*
+ * Sleep until data has arrive. But check for races..
+ */
+static void unix_data_wait(unix_socket * sk)
+{
+	cli();
+	if (!skb_peek(&sk->receive_queue)) {
+		sk->socket->flags |= SO_WAITDATA;
+		interruptible_sleep_on(sk->sleep);
+		sk->socket->flags &= ~SO_WAITDATA;
+	}
+	sti();
+}
 		
 static int unix_recvmsg(struct socket *sock, struct msghdr *msg, int size, int noblock, int flags, int *addr_len)
 {
@@ -818,10 +832,7 @@
 	if(sk->err)
 		return sock_error(sk);
 	
-/*	printk("get rcv sem\n");*/
 	down(&sk->protinfo.af_unix.readsem);		/* Lock the socket */
-/*	printk("got rcv sem\n");*/
-
 	while(ct--)
 	{
 		int done=0;
@@ -831,42 +842,23 @@
 		
 		while(done<len)
 		{
-			if(copied & (flags&MSG_PEEK))
-			{
-				up(&sk->protinfo.af_unix.readsem);
-				return copied;
-			}
-			cli();
-			skb=skb_peek(&sk->receive_queue);
+			if (copied && (flags & MSG_PEEK))
+				goto out;
+			if (copied == size)
+				goto out;
+			skb=skb_dequeue(&sk->receive_queue);
 			if(skb==NULL)
 			{
 				up(&sk->protinfo.af_unix.readsem);
 				if(sk->shutdown & RCV_SHUTDOWN)
-				{
-					sti();
 					return copied;
-				}
 				if(copied)
-				{
-					sti();
 					return copied;
-				}
 				if(noblock)
-				{
-					sti();
 					return -EAGAIN;
-				}
-				sk->socket->flags |= SO_WAITDATA;
-				interruptible_sleep_on(sk->sleep);
-				sk->socket->flags &= ~SO_WAITDATA;
-				if( current->signal & ~current->blocked)
-				{
-					sti();
-					if(copied)
-						return copied;
+				if(current->signal & ~current->blocked)
 					return -ERESTARTSYS;
-				}
-				sti();
+				unix_data_wait(sk);
 				down(&sk->protinfo.af_unix.readsem);
 				continue;
 			}
@@ -884,29 +876,23 @@
 						*addr_len=sizeof(short);
 			}
 			num=min(skb->len,size-copied);
+			memcpy_tofs(sp, skb->data, num);
 			copied+=num;
 			done+=num;
-			if(flags&MSG_PEEK)
-			{
-				memcpy_tofs(sp, skb->data, num);
-				break;
-			}
-			else
-			{
-				memcpy_tofs(sp, skb->data,num);
-				skb_pull(skb,num);
-				sp+=num;
-				if(skb->len==0)
-				{
-					skb_unlink(skb);
-					kfree_skb(skb, FREE_WRITE);
-					if(sock->type==SOCK_DGRAM)
-						break;
-				}
+			sp+=num;
+			if (!(flags & MSG_PEEK))
+				skb_pull(skb, num);
+			/* put the skb back if we didn't use it up.. */
+			if (skb->len) {
+				skb_queue_head(&sk->receive_queue, skb);
+				continue;
 			}
-			sti();
-		}	
-	}	
+			kfree_skb(skb, FREE_WRITE);
+			if(sock->type==SOCK_DGRAM)
+				goto out;
+		}
+	}
+out:
 	up(&sk->protinfo.af_unix.readsem);
 	return copied;
 }
diff -u --recursive --new-file v1.3.38/linux/scripts/Makefile linux/scripts/Makefile
--- v1.3.38/linux/scripts/Makefile	Sun Oct 29 11:38:50 1995
+++ linux/scripts/Makefile	Thu Nov  9 09:31:14 1995
@@ -1,14 +1,20 @@
+HOSTCFLAGS=-g
 HEADER=header.tk
 TAIL=tail.tk
 
 kconfig.tk: ../arch/${ARCH}/config.in tkparse ${HEADER} ${TAIL}
-	./tkparse < ../arch/${ARCH}/config.in > kconfig.tmp
-	cp ${HEADER} ./kconfig.tk
+	./tkparse < ../arch/${ARCH}/config.in  > kconfig.tmp
+	@if [ -f /usr/local/bin/wish ];	then \
+		echo '#!'"/usr/local/bin/wish -f" > kconfig.tk; \
+	else \
+		echo '#!'"/usr/bin/wish -f" > kconfig.tk; \
+	fi
+	cat ${HEADER} >> ./kconfig.tk
 	cat kconfig.tmp >> kconfig.tk
 	rm -f kconfig.tmp
+	echo "set defaults \"arch/${ARCH}/config.in\"" >> kconfig.tk
 	cat ${TAIL} >> kconfig.tk
 	chmod 755 kconfig.tk
-
 
 tkparse: tkparse.o tkcond.o tkgen.o
 	${HOSTCC} -o tkparse tkparse.o tkcond.o tkgen.o
diff -u --recursive --new-file v1.3.38/linux/scripts/header.tk linux/scripts/header.tk
--- v1.3.38/linux/scripts/header.tk	Mon Oct 23 18:02:24 1995
+++ linux/scripts/header.tk	Thu Nov  9 09:31:14 1995
@@ -1,5 +1,3 @@
-#!/usr/bin/wish -f
-
 #
 # Used to determine size of canvas inserted for booleans. It holds the
 # place where the 'm' button goes in a tristate, and keeps the look and feel
@@ -52,7 +50,7 @@
 	pack $w.back -side bottom -pady 10
 
 	focus $w
-	wm geometry $w +30+35	
+	wm geometry $w +30+35
 
 	$w.tb.text delete 1.0 end
 	set f [open |$command]
@@ -86,7 +84,34 @@
 	pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
 	pack $w.f -pady 10 -side bottom -padx 10 -anchor w
 	focus $w
-	wm geometry $w +30+35	
+	global winx; global winy
+	set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+	wm geometry $w +$winx+$winy
+}
+
+proc maybe_exit { w } {
+	catch {destroy $w}
+	toplevel $w -class Dialog
+	label $w.bm -bitmap questhead
+	pack  $w.bm -pady 10 -side top -padx 10
+	message $w.m -width 400 -aspect 300 \
+		-text "Changes will be lost.  Are you sure?"  -relief raised \
+		-fg black
+	pack  $w.m -pady 10 -side top -padx 10
+	wm title $w "Are you sure?" 
+
+	set oldFocus [focus]
+	frame $w.f
+	button $w.f.back -text "OK" -activebackground green -width 20 \
+		-command "exit"
+	button $w.f.canc -text "Cancel" -activebackground red \
+		-width 20 -command "destroy $w; focus $oldFocus"
+	pack $w.f.back $w.f.canc -side left -pady 10 -padx 45
+	pack $w.f -pady 10 -side bottom -padx 10 -anchor w
+	focus $w
+	global winx; global winy
+	set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+	wm geometry $w +$winx+$winy
 }
 
 proc read_config_file { w } {
@@ -110,7 +135,9 @@
 		pack $w.f.back -side bottom -pady 10 -anchor s
 		pack $w.f -pady 10 -side top -padx 10 -anchor s
 		focus $w
-		wm geometry $w +30+35
+		global winx; global winy
+		set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+		wm geometry $w +$winx+$winy
 	}
 }
 
@@ -136,12 +163,15 @@
 		pack $w.f.back -side bottom -pady 10 -anchor s
 		pack $w.f -pady 10 -side top -padx 10 -anchor s
 		focus $w
-		wm geometry $w +30+35
+		global winx; global winy
+		set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+		wm geometry $w +$winx+$winy
 	}
 }
 
 proc read_config { filename } {
 	set file1 [open $filename r]
+	clear_choices
 	while { [gets $file1 line] >= 0} {
 		if [regexp {([0-9A-Z_]+)=([ynm])} $line foo var value] {
 			if { $value == "y" } then { set cmd "global $var; set $var 1" }
@@ -155,8 +185,11 @@
 		}
 	}
 	close $file1
+	update_choices
+	update_mainmenu .rdupd
 }
 proc write_comment { file1 file2 text } {
+    	puts $file1 ""
 	puts $file1 "#"
 	puts $file1 "# $text"
 	puts $file1 "#"
@@ -180,7 +213,7 @@
 	}
 }
 
-proc bool {w mnum line text variable default} {
+proc bool {w mnum line text variable} {
 	frame $w.x$line
 	global modbutton_width
 	global modbutton_height
@@ -210,7 +243,7 @@
 	}
 }
 
-proc int { w mnum line text variable default } {
+proc int { w mnum line text variable } {
 	frame $w.x$line
 	button $w.x$line.help -text "Help" -relief raised \
 		-command "dohelp .dohelp $variable "
@@ -235,6 +268,7 @@
 
 	set filefound 0
 	set found 0
+	set lineno 0
 	if { [file readable Documentation/Configure.help] == 1} then {
 		set f [open Documentation/Configure.help r]
 		set filefound 1	
@@ -247,15 +281,23 @@
 				if { $found == 0 } continue 
 			}
 			if { [string length $line1 ] == 0 } break
-			append message $line
+			if { [string  range $line1 0 0 ] == "#" } continue
+			if { $lineno == 0 } then {
+			    append message $line1
+ 			    append message ":"
+			} else {
+ 			    append message " "
+			    append message $line1
+			}
+			set lineno [expr $lineno + 1]
 		}
 		close $f
 	}
 
 	if { $found == 0 } then {
 		if { $filefound == 0 } then {
-		message $w.m -width 400 -aspect 300 -text \
-			"No help available - unable to open file Documentation/Configure.help"  -relief raised -fg black
+		message $w.m -width 750 -aspect 300 -text \
+			"No help available - unable to open file Documentation/Configure.help.  This file is available from http://math-www.uni-paderborn.de/~axel/config_help.html or ftp://sunsite.unc.edu/pub/Linux/kernel/config/krnl_cnfg_hlp_1.X.XX.tgz"  -relief raised -fg black
 		} else {
 		message $w.m -width 400 -aspect 300 -text \
 			"No help available for $varname"  -relief raised -fg black
@@ -277,7 +319,9 @@
 	pack $w.f.back -side bottom -pady 10 -anchor s
 	pack $w.f -pady 10 -side top -padx 10 -anchor s
 	focus $w
-	wm geometry $w +30+35
+	global winx; global winy
+	set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+	wm geometry $w +$winx+$winy
 }
 
 proc wrapup {w }  {
@@ -296,7 +340,9 @@
 	pack $w.f.back -side bottom -pady 10 -anchor s
 	pack $w.f -pady 10 -side top -padx 10 -anchor s
 	focus $w
-	wm geometry $w +30+35
+	global winx; global winy
+	set winx [expr [winfo x .]+30]; set winy [expr [winfo y .]+30]
+	wm geometry $w +$winx+$winy
 
 }
 
@@ -304,7 +350,7 @@
 #nothing for now.
 }
 
-proc tristate {w mnum line text variable default} {
+proc tristate {w mnum line text variable } {
 	frame $w.x$line
 	radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
 		-width 2 -command "update_menu$mnum .menu$mnum"
@@ -319,7 +365,7 @@
 	pack $w.x$line -anchor w
 }
 
-proc dep_tristate {w mnum line text variable default} {
+proc dep_tristate {w mnum line text variable } {
 	frame $w.x$line
 	radiobutton $w.x$line.y -text "y" -variable $variable -value 1 \
 		-width 2 -command "update_menu$mnum .menu$mnum"
@@ -334,6 +380,11 @@
 	pack $w.x$line -anchor w
 }
 
+
+proc do_sound {w mnum line} {
+	message $w.x$line -width 400 -aspect 300 -text "Note: The sound drivers cannot as of yet be configured via the X-based interface" -relief raised
+	pack $w.x$line -side top -pady 10
+}
 
 #
 # Next set up the particulars for the top level menu, and define a few
diff -u --recursive --new-file v1.3.38/linux/scripts/tail.tk linux/scripts/tail.tk
--- v1.3.38/linux/scripts/tail.tk	Mon Oct 23 18:02:24 1995
+++ linux/scripts/tail.tk	Thu Nov  9 09:31:14 1995
@@ -18,23 +18,31 @@
 		if { [lindex $argv 0] != "-D" } then {
 			read_config .config
 		}
+		else
+		{
+			read_config $defaults
+		}
 	} else {
 		read_config .config
 	}
+} else {
+	read_config $defaults
 }
 
+update_mainmenu .f0
+
 button .f0r_bot.save -text "Write Configuration" -width 25 -command {
 	writeconfig .config include/linux/autoconf.h; wrapup .wrap }
 
-button .f0r_bot.quit -text "Quit" -command { exit } -width 25 \
+button .f0r_bot.quit -text "Quit" -command { maybe_exit .maybe } -width 25 \
 	-activebackground red -activeforeground white
 
 button .f0l_bot.store -text "Store Configuration to file" -width 25 -command {
-	load_configfile .load "Store Configuration" write_config_file
+	load_configfile .load "Save Configuration in file" write_config_file
 }
 
 button .f0l_bot.load -text "Load Configuration" -width 25 -command {
-	load_configfile .load "Load Configuration" read_config_file
+	load_configfile .load "Load Configuration from file" read_config_file
 }
 
 pack  .f0r_bot.save .f0r_bot.quit -padx 25 -ipadx 10 -ipady 2 -anchor w
diff -u --recursive --new-file v1.3.38/linux/scripts/tkcond.c linux/scripts/tkcond.c
--- v1.3.38/linux/scripts/tkcond.c	Mon Oct 23 18:02:24 1995
+++ linux/scripts/tkcond.c	Thu Nov  9 10:04:33 1995
@@ -29,6 +29,7 @@
  * If the input condition contains '(' or ')' it would screw us up, but for now
  * this is not a problem.
  */
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include "tkparse.h"
@@ -52,7 +53,15 @@
 	  cnd->op = op_or;
 	  break;
 	case op_or:
-	  cnd->op = op_and;
+	  /*
+	   * This is not turned into op_and - we need to keep track
+	   * of what operators were used here since we have an optimization
+	   * later on to remove duplicate conditions, and having
+	   * inverted ors in there would make it harder if we did not
+	   * distinguish an inverted or from an and we inserted because
+	   * of nested ifs.
+	   */
+	  cnd->op = op_and1;
 	  break;
 	case op_neq:
 	  cnd->op = op_eq;
@@ -82,6 +91,54 @@
 }
 
 /*
+ * Walk all of the conditions, and look for choice values.  Convert
+ * the tokens into something more digestable.
+ */
+void fix_choice_cond()
+{
+  struct condition * cond;
+  struct condition * cond2;
+  struct kconfig * cfg;
+  char tmpbuf[10];
+
+  for(cfg = config;cfg != NULL; cfg = cfg->next)
+    {
+      if( cfg->cond == NULL )
+	{
+	  continue;
+	}
+
+      for(cond = cfg->cond; cond != NULL; cond = cond->next)
+	{
+	  if( cond->op != op_kvariable )
+	    continue;
+
+	  if( cond->variable.cfg->tok != tok_choice )
+	    continue;
+
+	  /*
+	   * Look ahead for what we are comparing this to.  There should
+	   * be one operator inbetween.
+	   */
+	  cond2 = cond->next->next;
+	  sprintf(tmpbuf, "%d", cond->variable.cfg->choice_value);
+
+	  if( strcmp(cond2->variable.str, "y") == 0 )
+	    {
+	      cond->variable.cfg = cond->variable.cfg->choice_label;
+	      cond2->variable.str = strdup(tmpbuf);
+	    }
+	  else
+	    {
+	      fprintf(stderr,"Ooops\n");
+	      exit(0);
+	    }
+	}
+
+    }
+}
+
+/*
  * Walk the stack of conditions, and clone all of them with "&&" operators
  * gluing them together.  The conditions from each level of the stack
  * are wrapped in parenthesis so as to guarantee that the results
@@ -135,6 +192,7 @@
 		    {
 		      if( cfg->tok != tok_bool && cfg->tok != tok_int
 			 && cfg->tok != tok_tristate 
+			 && cfg->tok != tok_choice
 			 && cfg->tok != tok_dep_tristate)
 			{
 			  continue;
@@ -146,6 +204,10 @@
 			  break;
 			}
 		    }
+		  if( cfg == NULL )
+		    {
+		      new->variable.str = strdup(ocond->variable.str);
+		    }
 		}
 	      else
 		{
@@ -288,11 +350,13 @@
 	  cfg->tok = tok_nop;
 	  break;
 	case tok_comment:
+	case tok_define:
 	case tok_menuoption:
 	case tok_bool:
 	case tok_tristate:
 	case tok_dep_tristate:
 	case tok_int:
+	case tok_choice:
 	  /*
 	   * We need to duplicate the chain of conditions and attach them to
 	   * this token.
@@ -303,6 +367,12 @@
 	  break;
 	}
     }
+
+  /*
+   * Fix any conditions involving the "choice" operator.
+   */
+  fix_choice_cond();
+
   /*
    * Walk through and see if there are multiple options that control the
    * same kvariable.  If there are we need to treat them a little bit
@@ -320,6 +390,7 @@
 	    {
 	      switch(cfg1->tok)
 		{
+		case tok_define:
 		case tok_bool:
 		case tok_tristate:
 		case tok_dep_tristate:
diff -u --recursive --new-file v1.3.38/linux/scripts/tkgen.c linux/scripts/tkgen.c
--- v1.3.38/linux/scripts/tkgen.c	Wed Nov  8 07:11:47 1995
+++ linux/scripts/tkgen.c	Thu Nov  9 09:31:14 1995
@@ -20,7 +20,7 @@
  * of submenus.  I need to fix the window titles before it would really be
  * appropriate to enable this.
  */
-/* #define PREVLAST_LIMITED_RANGE */
+#define PREVLAST_LIMITED_RANGE
 
 /*
  * This is the total number of submenus that we have.
@@ -67,12 +67,14 @@
 	    int menu_num,
 	    int line_num)
 {
+  int i;
   struct condition * ocond;
 
+  ocond = cond;
+
   /*
    * First write any global declarations we need for this conditional.
    */
-  ocond = cond;
   while(cond != NULL )
     {
       switch(cond->op){
@@ -89,15 +91,16 @@
       }
       cond = cond->next;
     }
-
+  
   /*
    * Now write this option.
    */
-  if( (item->flags & GLOBAL_WRITTEN) == 0)
+  if(   (item->flags & GLOBAL_WRITTEN) == 0
+     && (item->optionname != NULL) )
     {
-	printf("\tglobal %s\n", item->optionname);
+      printf("\tglobal %s\n", item->optionname);
+      item->flags |= GLOBAL_WRITTEN;
     }
-
   /*
    * Now generate the body of the conditional.
    */
@@ -116,6 +119,7 @@
 	printf(" != ");
 	break;
       case op_and:
+      case op_and1:
 	printf(" && ");
 	break;
       case op_or:
@@ -133,6 +137,9 @@
       case op_kvariable:
 	printf("$%s", cond->variable.cfg->optionname);
 	break;
+      case op_shellcmd:
+	printf("[exec %s]", cond->variable.str);
+	break;
       case op_constant:
 	if( strcmp(cond->variable.str, "y") == 0 )
 	  printf("1");
@@ -141,7 +148,7 @@
 	else if( strcmp(cond->variable.str, "m") == 0 )
 	  printf("2");
 	else
-	  printf("'%s'", cond->variable);
+	  printf("\"%s\"", cond->variable);
 	break;
       }
       cond = cond->next;
@@ -155,6 +162,9 @@
    */
   switch(item->tok)
     {
+    case tok_define:
+      printf("} then { set %s %s } \n",  item->optionname, item->value);
+      break;
     case tok_menuoption:
       printf("} then { .f0.x%d configure -state normal } else { .f0.x%d configure -state disabled }\n",
 	     menu_num, menu_num);
@@ -189,7 +199,7 @@
       printf(".menu%d.x%d.y configure -state disabled;",menu_num, line_num);
       printf(".menu%d.x%d.n configure -state disabled;",menu_num, line_num);
       printf(".menu%d.x%d.l configure -state disabled;",menu_num, line_num);
-      printf("set %s [ expr $%s | 16 ];", item->optionname, item->optionname);
+      printf("set %s [expr $%s|16];", item->optionname, item->optionname);
       printf("}\n");
 #endif
       break;
@@ -229,6 +239,10 @@
       printf("set %s [expr $%s|16];", item->optionname, item->optionname);
       printf("}\n");
       break;
+    case tok_choose:
+    case tok_choice:
+      fprintf(stderr,"Fixme\n");
+      exit(0);
     default:
       break;
     }
@@ -283,6 +297,7 @@
 	printf(" != ");
 	break;
       case op_and:
+      case op_and1:
 	printf(" && ");
 	break;
       case op_or:
@@ -297,6 +312,9 @@
       case op_variable:
 	printf("$%s", cond->variable.str);
 	break;
+      case op_shellcmd:
+	printf("[exec %s]", cond->variable.str);
+	break;
       case op_kvariable:
 	printf("$%s", cond->variable.cfg->optionname);
 	break;
@@ -308,7 +326,7 @@
 	else if( strcmp(cond->variable.str, "m") == 0 )
 	  printf("2");
 	else
-	  printf("'%s'", cond->variable);
+	  printf("\"%s\"", cond->variable);
 	break;
       }
       cond = cond->next;
@@ -323,6 +341,9 @@
    */
   switch(item->tok)
     {
+    case tok_define:
+      printf("} then {write_variable $cfg $autocfg %s %s $notmod }\n", item->optionname, item->value);
+      break;
     case tok_comment:
       printf("} then {write_comment $cfg $autocfg \"%s\"}\n", item->label);
       break;
@@ -336,6 +357,10 @@
       printf("} then { write_variable $cfg $autocfg %s $%s $notmod }\n", 
 	     item->optionname, item->optionname);
       break;
+    case tok_choose:
+    case tok_choice:
+      fprintf(stderr,"Fixme\n");
+      exit(0);
     default:
       break;
     }
@@ -384,7 +409,7 @@
   printf("}\n\n\n");
 
   /*
-   * Now we generate the companion procedure for the muen we just
+   * Now we generate the companion procedure for the menu we just
    * generated.  This procedure contains all of the code to
    * disable/enable widgets based upon the settings of the other
    * widgets, and will be called first when the window is mapped,
@@ -392,6 +417,7 @@
    */
   printf("proc update_menu%d {w}  {\n", menu_num);
 
+  printf("\tupdate_define\n");
   clear_globalflags(config);
   for(cfg = config;cfg != NULL; cfg = cfg->next)
     {
@@ -399,6 +425,25 @@
        * Skip items not for this menu, or ones having no conditions.
        */
       if (cfg->menu_number != menu_num ) continue;
+      if (cfg->tok != tok_define) continue;
+      /*
+       * Clear all of the booleans that are defined in this menu.
+       */
+      if(   (cfg->flags & GLOBAL_WRITTEN) == 0
+	 && (cfg->optionname != NULL) )
+	{
+	  printf("\tglobal %s\n", cfg->optionname);
+	  cfg->flags |= GLOBAL_WRITTEN;
+	  printf("\tset %s 0\n", cfg->optionname);
+	}
+
+    }
+  for(cfg = config;cfg != NULL; cfg = cfg->next)
+    {
+      /*
+       * Skip items not for this menu, or ones having no conditions.
+       */
+      if (cfg->menu_number != menu_num ) continue;
       if (cfg->tok == tok_menuoption) continue;
       if (cfg->cond != NULL ) 
 	generate_if(cfg, cfg->cond, menu_num, cfg->menu_line);
@@ -453,6 +498,9 @@
       case tok_tristate:
       case tok_dep_tristate:
       case tok_int:
+      case tok_choose:
+      case tok_choice:
+      case tok_sound:
 	tot++;
 	break;
       default:
@@ -474,12 +522,14 @@
  */
 dump_tk_script(struct kconfig *scfg)
 {
+  int i;
   int menu_num =0;
   int menu_max =0;
   int menu_min =0;
   int menu_line = 0;
   int menu_maxlines = 0;
   struct kconfig * cfg;
+  struct kconfig * cfg1 = NULL;
   char * menulabel;
 
   /*
@@ -510,6 +560,9 @@
 	case tok_tristate:
 	case tok_dep_tristate:
 	case tok_int:
+	case tok_choose:
+	case tok_choice:
+	case tok_sound:
 	  /*
 	   * If we have overfilled the menu, then go to the next one.
 	   */
@@ -523,6 +576,8 @@
 	  cfg->submenu_end = menu_max;
 	  cfg->menu_line = menu_line++;
 	  break;
+	case tok_define:
+	  cfg->menu_number = -1;
 	default:
 	  break;
 	};
@@ -530,10 +585,8 @@
 
   /*
    * Record this so we can set up the prev/next buttons correctly.
-   * We will be adding one more menu for sound configuration, so
-   * take this into account.
    */
-  tot_menu_num = menu_num+1;
+  tot_menu_num = menu_num;
 
   /*
    * Now start generating the actual wish script that we will use.
@@ -577,14 +630,35 @@
 	      start_proc(menulabel, cfg->menu_number, FALSE);
 	      menu_num = cfg->menu_number;
 	    }
-	  printf("\tbool $w %d %d \"%s\" %s %s\n",
+	  printf("\tbool $w %d %d \"%s\" %s\n",
 		 cfg->menu_number,
 		 cfg->menu_line,
 		 cfg->label,
-		 cfg->optionname,
-		 cfg->dflt);
+		 cfg->optionname);
 	  break;
 
+	case tok_choice:
+	  printf("\t$w.line%d.menu add radiobutton -label \"%s\" -variable %s -value %d -command \"update_menu%d .menu%d\"\n",
+		 cfg1->menu_line,
+		 cfg->label,
+		 cfg1->optionname,
+		 cfg->choice_value,
+		 cfg->menu_number, cfg->menu_number);
+	  break;
+	case tok_choose:
+	  if( cfg->menu_number != menu_num )
+	    {
+	      end_proc(menu_num, menu_min, menu_max);
+	      start_proc(menulabel, cfg->menu_number, FALSE);
+	      menu_num = cfg->menu_number;
+	    }
+	  printf("\tmenubutton $w.line%d -text \"%s\" -menu $w.line%d.menu \\\n",
+		 cfg->menu_line, cfg->label, cfg->menu_line);
+	  printf("\t	-relief raised -width 35\n");
+	  printf("\tpack $w.line%d -anchor w\n", cfg->menu_line);
+	  printf("\tmenu $w.line%d.menu\n", cfg->menu_line);
+	  cfg1 = cfg;
+	  break;
 	case tok_tristate:
 	  if( cfg->menu_number != menu_num )
 	    {
@@ -592,12 +666,11 @@
 	      start_proc(menulabel, cfg->menu_number, FALSE);
 	      menu_num = cfg->menu_number;
 	    }
-	  printf("\ttristate $w %d %d \"%s\" %s %s\n",
+	  printf("\ttristate $w %d %d \"%s\" %s\n",
 		 cfg->menu_number,
 		 cfg->menu_line,
 		 cfg->label,
-		 cfg->optionname,
-		 cfg->dflt);
+		 cfg->optionname);
 	  break;
 	case tok_dep_tristate:
 	  if( cfg->menu_number != menu_num )
@@ -606,12 +679,11 @@
 	      start_proc(menulabel, cfg->menu_number, FALSE);
 	      menu_num = cfg->menu_number;
 	    }
-	  printf("\tdep_tristate $w %d %d \"%s\" %s %s\n",
+	  printf("\tdep_tristate $w %d %d \"%s\" %s\n",
 		 cfg->menu_number,
 		 cfg->menu_line,
 		 cfg->label,
 		 cfg->optionname,
-		 cfg->dflt,
 		 cfg->depend);
 	  break;
 	case tok_int:
@@ -621,12 +693,23 @@
 	      start_proc(menulabel, cfg->menu_number, FALSE);
 	      menu_num = cfg->menu_number;
 	    }
-	  printf("\tint $w %d %d \"%s\" %s %s\n",
+	  printf("\tint $w %d %d \"%s\" %s\n",
 		 cfg->menu_number,
 		 cfg->menu_line,
 		 cfg->label,
-		 cfg->optionname,
-		 cfg->dflt);
+		 cfg->optionname);
+	  break;
+	case tok_sound:
+	  if( cfg->menu_number != menu_num )
+	    {
+	      end_proc(menu_num, menu_min, menu_max);
+	      start_proc(menulabel, cfg->menu_number, FALSE);
+	      menu_num = cfg->menu_number;
+	    }
+	  printf("\tdo_sound $w %d %d\n",
+		 cfg->menu_number,
+		 cfg->menu_line);
+	  break;
 	default:
 	  break;
 	}
@@ -638,6 +721,7 @@
    */
   end_proc(menu_num, menu_min, menu_max);
 
+#ifdef ERIC_DONT_DEF
   /*
    * Generate the code for configuring the sound driver.  Right now this
    * cannot be done from the X script, but we insert the menu anyways.
@@ -650,11 +734,11 @@
   printf("\tlabel $w.m0 -bitmap error\n");
   printf("\tmessage $w.m1 -width 400 -aspect 300 -text \"The sound drivers cannot as of yet be configured via the X-based interface\" -relief raised\n");
   printf("\tpack $w.m0 $w.m1 -side top -pady 10\n");
-
   /*
    * Close out the last menu.
    */
   end_proc(menu_num, menu_num, menu_num);
+#endif
 
   /*
    * The top level menu also needs an update function.  When we exit a
@@ -678,6 +762,26 @@
 
   printf("}\n\n\n");
 
+#if 0
+  /*
+   * Generate some code to set the variables that are "defined".
+   */
+  for(cfg = config;cfg != NULL; cfg = cfg->next)
+    {
+      /*
+       * Skip items not for this menu, or ones having no conditions.
+       */
+      if( cfg->tok != tok_define) continue;
+      if (cfg->cond != NULL ) 
+	generate_if(cfg, cfg->cond, menu_num, cfg->menu_line);
+      else
+	{
+	  printf("\twrite_define %s %s\n", cfg->optionname, cfg->value);
+	}
+
+    }
+#endif
+
   /*
    * Now generate code to load the default settings into the variables.
    * Note that the script in tail.tk will attempt to load .config,
@@ -688,18 +792,14 @@
       switch (cfg->tok)
 	{
 	case tok_int:
-	    printf("set %s %s\n", cfg->optionname, cfg->dflt);
-	    break;
 	case tok_bool:
 	case tok_tristate:
 	case tok_dep_tristate:
-	  if( strcmp(cfg->dflt, "y") == 0 )
-	    printf("set %s 1\n", cfg->optionname);
-	  else if( strcmp(cfg->dflt, "n") == 0 )
-	    printf("set %s 0\n", cfg->optionname);
-	  else if( strcmp(cfg->dflt, "m") == 0 )
-	    printf("set %s 2\n", cfg->optionname);
+	case tok_choice:
+	  printf("set %s 0\n", cfg->optionname);
 	  break;
+	case tok_choose:
+	  printf("set %s %d\n", cfg->optionname, cfg->choice_value);
 	default:
 	  break;
 	}
@@ -731,6 +831,8 @@
 	case tok_bool:
 	case tok_tristate:
 	case tok_dep_tristate:
+	case tok_define:
+	case tok_choose:
 	  if(cfg->flags & GLOBAL_WRITTEN) break;
 	  cfg->flags |= GLOBAL_WRITTEN;
 	  printf("\tglobal %s\n", cfg->optionname);
@@ -752,6 +854,25 @@
 		{
 		  printf("\twrite_comment $cfg $autocfg \"%s\"\n", cfg->label);
 		}
+#if 0
+	      else if(cfg->tok == tok_define)
+		{
+		  printf("\twrite_define %s %s\n", cfg->optionname,
+			 cfg->value);
+		}
+#endif
+	      else if (cfg->tok == tok_choose )
+		{
+		  for(cfg1 = cfg->next; 
+		      cfg1 != NULL && cfg1->tok == tok_choice;
+		      cfg1 = cfg1->next)
+		    {
+		      printf("\tif { $%s == %d } then { write_variable $cfg $autocfg %s 1 $notmod }\n",
+			     cfg->optionname,
+			     cfg1->choice_value,
+			     cfg1->optionname);
+		    }
+		}
 	      else
 		{
 		  printf("\twrite_variable $cfg $autocfg %s $%s $notmod\n",
@@ -769,6 +890,62 @@
   printf("\tclose $autocfg\n");
   printf("}\n\n\n");
 
+  /*
+   * Finally write a simple function that updates the master choice
+   * variable depending upon what values were loaded from a .config
+   * file.  
+   */
+  printf("proc clear_choices { } {\n");
+  for(cfg = scfg; cfg != NULL; cfg = cfg->next)
+    {
+      if( cfg->tok != tok_choose ) continue;
+      for(cfg1 = cfg->next; 
+	  cfg1 != NULL && cfg1->tok == tok_choice;
+	  cfg1 = cfg1->next)
+	{
+	  printf("\tglobal %s; set %s 0\n",  cfg1->optionname, cfg1->optionname);
+	}
+    }
+  printf("}\n\n\n");
+
+  printf("proc update_choices { } {\n");
+  for(cfg = scfg; cfg != NULL; cfg = cfg->next)
+    {
+      if( cfg->tok != tok_choose ) continue;
+      printf("\tglobal %s\n", cfg->optionname);
+      for(cfg1 = cfg->next; 
+	  cfg1 != NULL && cfg1->tok == tok_choice;
+	  cfg1 = cfg1->next)
+	{
+	  printf("\tglobal %s\n", cfg1->optionname);
+	  printf("\tif { $%s == 1 } then { set %s %d }\n",
+		 cfg1->optionname,
+		 cfg->optionname,
+		 cfg1->choice_value);
+	}
+    }
+  printf("}\n\n\n");
+
+  printf("proc update_define { } {\n");
+  clear_globalflags(config);
+  for(cfg = scfg; cfg != NULL; cfg = cfg->next)
+    {
+      if( cfg->tok != tok_define ) continue;
+      printf("\tglobal %s; set %s 0\n",  cfg->optionname,  cfg->optionname);
+      cfg->flags |= GLOBAL_WRITTEN;
+    }
+  for(cfg = scfg; cfg != NULL; cfg = cfg->next)
+    {
+      if( cfg->tok != tok_define ) continue;
+      if (cfg->cond != NULL ) 
+	generate_if(cfg, cfg->cond, -1, 0);
+      else
+	{
+	  printf("\tset %s %s\n",
+		 cfg->optionname, cfg->value);
+	}
+    }
+  printf("}\n\n\n");
   /*
    * That's it.  We are done.  The output of this file will have header.tk
    * prepended and tail.tk appended to create an executable wish script.
diff -u --recursive --new-file v1.3.38/linux/scripts/tkparse.c linux/scripts/tkparse.c
--- v1.3.38/linux/scripts/tkparse.c	Sun Oct 29 11:38:50 1995
+++ linux/scripts/tkparse.c	Thu Nov  9 10:04:33 1995
@@ -18,6 +18,7 @@
  *
  * This file contains the code to do the first parse of config.in.
  */
+#include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include "tkparse.h"
@@ -29,6 +30,10 @@
 static int menus_seen = 0;
 static char * current_file = NULL;
 static int do_source(char * filename);
+static char * get_string(char *pnt, char ** labl);
+static int choose_number = 0;
+
+
 /*
  * Simple function just to skip over spaces and tabs in config.in.
  */
@@ -93,6 +98,13 @@
 	continue;
       }
 
+    if( *pnt == '-' && pnt[1] == 'o' )
+      {
+	cpnt->op = op_or;
+	pnt += 2;
+	continue;
+      }
+
     if( *pnt == '!' && pnt[1] == '=' )
       {
 	cpnt->op = op_neq;
@@ -116,6 +128,18 @@
 
     if( *pnt != '"' ) goto error;  /* This cannot be right. */
     pnt++;
+    if( *pnt == '`' )
+      {
+	cpnt->op = op_shellcmd;
+	pnt1 = varname;
+	pnt++;
+	while(*pnt && *pnt != '`') *pnt1++ = *pnt++;
+	*pnt1++ = '\0';
+	cpnt->variable = strdup(varname);
+	if( *pnt == '`' ) pnt++;
+	if( *pnt == '"' ) pnt++;
+	continue;
+      }
     if( *pnt == '$' )
       {
 	cpnt->op = op_variable;
@@ -141,9 +165,11 @@
 
  error:
   if(current_file != NULL) 
-    printf("Bad if clause at line %d(%s):%s\n", lineno, current_file, opnt);
+    fprintf(stderr, 
+	    "Bad if clause at line %d(%s):%s\n", lineno, current_file, opnt);
   else
-    printf("Bad if clause at line %d:%s\n", lineno, opnt);
+    fprintf(stderr,
+	    "Bad if clause at line %d:%s\n", lineno, opnt);
   return NULL;
 }
 
@@ -190,6 +216,44 @@
   return pnt;
 }
 
+static char * parse_choices(struct kconfig * choice_kcfg, char * pnt)
+{
+  struct kconfig * kcfg;
+  int index = 1;
+
+  /*
+   * Choices appear in pairs of strings.  The parse is fairly trivial.
+   */
+  while(1)
+    {
+      pnt = skip_whitespace(pnt);
+      if(*pnt == '\0') break;
+
+      kcfg = (struct kconfig *) malloc(sizeof(struct kconfig));
+      memset(kcfg, 0, sizeof(struct kconfig));
+      kcfg->tok = tok_choice;
+      if( clast != NULL )
+	{
+	  clast->next = kcfg;
+	  clast = kcfg;
+	}
+      else
+	{
+	  clast = config = kcfg;
+	}
+
+      pnt = get_string(pnt, &kcfg->label);
+      pnt = skip_whitespace(pnt);
+      pnt = get_string(pnt, &kcfg->optionname);
+      kcfg->choice_label = choice_kcfg;
+      kcfg->choice_value = index++;
+      if( strcmp(kcfg->label, choice_kcfg->value) == 0 )
+	choice_kcfg->choice_value = kcfg->choice_value;
+    }
+
+}
+
+
 /*
  * This function grabs one text token from the input buffer
  * and returns a pointer to a copy of just the identifier.
@@ -229,6 +293,8 @@
 int parse(char * pnt) {
   enum token tok;
   struct kconfig * kcfg;
+  char tmpbuf[24];
+
   /*
    * Ignore comments and leading whitespace.
    */
@@ -260,11 +326,26 @@
       tok = tok_menuoption;
       pnt += 15;
     }
+  else if      (strncmp(pnt, "$MAKE -C drivers/sound", 22) == 0) 
+    {
+      pnt += 22;
+      tok = tok_sound;
+    }
   else if (strncmp(pnt, "comment", 7) == 0) 
     {
       tok = tok_comment;
       pnt += 7;
     }
+  else if (strncmp(pnt, "choice", 6) == 0) 
+    {
+      tok = tok_choose;
+      pnt += 6;
+    }
+  else if (strncmp(pnt, "define_bool", 11) == 0) 
+    {
+      tok = tok_define;
+      pnt += 11;
+    }
   else if (strncmp(pnt, "bool", 4) == 0) 
     {
       tok = tok_bool;
@@ -303,7 +384,13 @@
 
   if( tok == tok_unknown)
     {
-      printf("unknown command=%s\n", pnt);
+      if( clast != NULL && clast->tok == tok_if 
+	  && strcmp(pnt,"then") == 0) return 0;
+      if( current_file != NULL )
+	fprintf(stderr, "unknown command=%s(%s %d)\n", pnt,
+		current_file, lineno);
+      else
+	fprintf(stderr, "unknown command=%s(%d)\n", pnt,lineno);
       return 1;
     }
 
@@ -332,6 +419,25 @@
    */
   switch (tok)
     {
+    case tok_choose:
+      pnt = get_qstring(pnt, &kcfg->label);
+      pnt = get_qstring(pnt, &kcfg->optionname);
+      pnt = get_string(pnt, &kcfg->value);
+      /*
+       * Now we need to break apart the individual options into their
+       * own configuration structures.
+       */
+      parse_choices(kcfg, kcfg->optionname);
+      free(kcfg->optionname);
+      sprintf(tmpbuf, "tmpvar_%d", choose_number++);
+      kcfg->optionname = strdup(tmpbuf);
+      break;
+    case tok_define:
+      pnt = get_string(pnt, &kcfg->optionname);
+      if(*pnt == 'y' || *pnt == 'Y' ) kcfg->value = "1";
+      if(*pnt == 'n' || *pnt == 'N' ) kcfg->value = "0";
+      if(*pnt == 'm' || *pnt == 'M' ) kcfg->value = "2";
+      break;
     case tok_menuname:
       pnt = get_qstring(pnt, &kcfg->label);
       break;
@@ -340,12 +446,10 @@
     case tok_int:
       pnt = get_qstring(pnt, &kcfg->label);
       pnt = get_string(pnt, &kcfg->optionname);
-      pnt = get_string(pnt, &kcfg->dflt);
       break;
     case tok_dep_tristate:
       pnt = get_qstring(pnt, &kcfg->label);
       pnt = get_string(pnt, &kcfg->optionname);
-      pnt = get_string(pnt, &kcfg->dflt);
       pnt = skip_whitespace(pnt);
       if( *pnt == '$') pnt++;
       pnt = get_string(pnt, &kcfg->depend.str);
@@ -371,6 +475,7 @@
       break;
     case tok_else:
     case tok_fi:
+    case tok_sound:
       break;
     case tok_if:
       /*
@@ -432,55 +537,78 @@
 static int do_source(char * filename)
 {
   char buffer[1024];
+  int  offset;
   int old_lineno;
+  char * old_file;
   char * pnt;
   FILE * infile;
 
-  infile = fopen(filename,"r");
+  if( strcmp(filename, "-") == 0 )
+    infile = stdin;
+  else
+    infile = fopen(filename,"r");
+
+  /*
+   * If our cwd was in the scripts directory, we might have to go up one
+   * to find the sourced file.
+   */
+  if(!infile) {
+    strcpy (buffer, "../");
+    strcat (buffer, filename);
+    infile = fopen(buffer,"r");
+  }
+
   if(!infile) {
     fprintf(stderr,"Unable to open file %s\n", filename);
     return 1;
   }
   old_lineno = lineno;
   lineno = 0;
-  current_file = filename;
-  while (fgets(buffer, sizeof(buffer), infile))
+  if( infile != stdin ) {
+    old_file = current_file;
+    current_file = filename;
+  }
+  offset = 0;
+  while(1)
     {
+      fgets(&buffer[offset], sizeof(buffer) - offset, infile);
+      if(feof(infile)) break;
+
       /*
        * Strip the trailing return character.
        */
       pnt = buffer + strlen(buffer) - 1;
-      if( *pnt == '\n') *pnt = 0;
+      if( *pnt == '\n') *pnt-- = 0;
       lineno++;
-      parse(buffer);
+      if( *pnt == '\\' )
+	{
+	  offset = pnt - buffer;
+	}
+      else
+	{
+	  parse(buffer);
+	  offset = 0;
+	}
     }
   fclose(infile);
-  current_file = NULL;
+  if( infile != stdin ) {
+    current_file = old_file;
+  }
   lineno = old_lineno;
   return 0;
 }
 
 main(int argc, char * argv[])
 {
+  char buffer[1024];
   char * pnt;
   struct kconfig * cfg;
-  char buffer[1024];
   int    i;
 
   /*
-   * Loop over every input line, and parse it into the tables.
+   * Read stdin to get the top level script.
    */
-  while(fgets(buffer, sizeof(buffer), stdin))
-    {
-      /*
-       * Strip the trailing return character.
-       */
-      pnt = buffer + strlen(buffer) - 1;
-      if( *pnt == '\n') *pnt = 0;
-      lineno++;
-      parse(buffer);
-    }
-
+  do_source("-");
 
   if( menus_seen == 0 )
     {
@@ -558,7 +686,7 @@
 	case tok_tristate:
 	case tok_dep_tristate:
 	case tok_int:
-	  printf("%s %s %s\n", cfg->label, cfg->optionname, cfg->dflt);
+	  printf("%s %s\n", cfg->label, cfg->optionname);
 	  break;
 	case tok_if:
 	  dump_if(cfg->cond);
diff -u --recursive --new-file v1.3.38/linux/scripts/tkparse.h linux/scripts/tkparse.h
--- v1.3.38/linux/scripts/tkparse.h	Mon Oct 23 18:02:25 1995
+++ linux/scripts/tkparse.h	Thu Nov  9 09:31:14 1995
@@ -11,6 +11,10 @@
   tok_else, 
   tok_fi, 
   tok_int,
+  tok_sound,
+  tok_define,
+  tok_choose,
+  tok_choice,
   tok_unknown
 };
 
@@ -18,12 +22,14 @@
   op_eq,
   op_neq,
   op_and,
+  op_and1,
   op_or,
   op_bang,
   op_lparen,
   op_rparen,
   op_variable,
   op_kvariable,
+  op_shellcmd,
   op_constant,
   op_nuked
 };
@@ -43,21 +49,24 @@
 
 #define GLOBAL_WRITTEN  1
 #define CFG_DUP 	2
+#define UNSAFE		4
 
 struct kconfig
 {
-  struct kconfig * next;
-  int flags;
-  enum token tok;
-  char   menu_number;
-  char   menu_line;
-  char   submenu_start;
-  char   submenu_end;
-  char * optionname;
-  char * dflt;
-  char * label;
-  union var depend;
-  struct condition * cond;
+  struct kconfig 	* next;
+  int 			  flags;
+  enum 			  token tok;
+  char   		  menu_number;
+  char   		  menu_line;
+  char   		  submenu_start;
+  char   		  submenu_end;
+  char 			* optionname;
+  char 			* label;
+  char 			* value;
+  int   		  choice_value;
+  struct kconfig        * choice_label;
+  union var 		  depend;
+  struct condition 	* cond;
 };
 
 extern struct kconfig * config;
diff -u --recursive --new-file v1.3.38/linux/versions.mk linux/versions.mk
--- v1.3.38/linux/versions.mk	Sun Sep  3 12:27:06 1995
+++ linux/versions.mk	Thu Jan  1 02:00:00 1970
@@ -1,31 +0,0 @@
-ifdef CONFIG_MODVERSIONS
-TOPINCL := $(TOPDIR)/include/linux
-
-# Uses SYMTAB_OBJS
-# Separate the object into "normal" objects and "exporting" objects
-# Exporting objects are: all objects that define symbol tables
-#
-# Add dependence on $(SYMTAB_OBJS) to the main target
-#
-
-.SUFFIXES: .ver
-
-.c.ver:
-	@if [ ! -x /sbin/genksyms ]; then echo "Please read: README.modules"; fi
-	$(CC) $(CFLAGS) -E -DCONFIG_MODVERSIONS -D__GENKSYMS__ $< | /sbin/genksyms -w $(TOPINCL)/modules
-	@ln -sf $(TOPINCL)/modules/$@ .
-
-$(SYMTAB_OBJS): $(TOPINCL)/modversions.h
-	$(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
-
-$(SYMTAB_OBJS:.o=.ver): $(TOPINCL)/autoconf.h
-
-$(TOPINCL)/modversions.h: $(SYMTAB_OBJS:.o=.ver)
-	@echo updating $(TOPINCL)/modversions.h
-	@(cd $(TOPINCL)/modules; for f in *.ver;\
-	do echo "#include <linux/modules/$${f}>"; done) \
-	> $(TOPINCL)/modversions.h
-
-fastdep: $(TOPINCL)/modversions.h
-
-endif
