diff -u --recursive --new-file v1.1.41/linux/CHANGES linux/CHANGES
--- v1.1.41/linux/CHANGES	Mon Mar 14 00:25:31 1994
+++ linux/CHANGES	Tue Aug  9 09:32:59 1994
@@ -19,7 +19,7 @@
  - readonly OS/2 filesystem support (HPFS) added (Chris Smith)
  - NTP support (Philip Gladstone, Torsten Duwe, ??)
  - fixed 16MB swap-area limit
- - lots of minor cleanups, buxfixes etc.
+ - lots of minor cleanups, bugfixes etc.
 
 CHANGES since 0.99 patchlevel 12 and earlier:
 
@@ -117,7 +117,7 @@
    it.
 
  - named pipes and normal pipes should hopefully have the right select()
-   semantics in the presense/absense of writers.
+   semantics in the presence/absence of writers.
 
  - QIC-02 tape driver by Hennus Bergman
 
@@ -135,7 +135,7 @@
  - udelay() function for short delays (busy-waiting) added.  Used
    currently only by the QIC driver.
 
- - fork() and sheduler changes to make task switches happen only from
+ - fork() and scheduler changes to make task switches happen only from
    kernel mode to kernel mode.  Cleaner and more portable than the old
    code which counted on being able to task-switch directly into user
    mode.
diff -u --recursive --new-file v1.1.41/linux/CREDITS linux/CREDITS
--- v1.1.41/linux/CREDITS	Mon Aug  8 12:36:40 1994
+++ linux/CREDITS	Tue Aug  9 09:32:59 1994
@@ -129,7 +129,7 @@
 
 N: Thomas Dunbar
 E: tdunbar@vtaix.cc.vt.edu
-D: TeX & METAFONT hacking/maintainence
+D: TeX & METAFONT hacking/maintenance
 S: Dean, Graduate School
 S: Virginia Tech
 S: Blacksburg, Virginia 24061
@@ -581,7 +581,7 @@
 D: Maintainer of sunsite.unc.edu Linux doc archives
 D: Moderator, comp.os.linux.announce
 S: 205 Gray Street NE
-S: Wilson, North Caroilina 27893 
+S: Wilson, North Carolina 27893 
 S: USA
 
 
diff -u --recursive --new-file v1.1.41/linux/MAGIC linux/MAGIC
--- v1.1.41/linux/MAGIC	Tue May 24 00:34:45 1994
+++ linux/MAGIC	Tue Aug  9 09:32:59 1994
@@ -6,7 +6,7 @@
 It is a *very* good idea to protect kernel data structures with magic
 numbers.  This allows you to check at run time whether (a) a structure
 has been clobbered, or (b) you've passed the wrong structure to a
-routine.  This last is especially useful --- particlarly when you are
+routine.  This last is especially useful --- particularly when you are
 passing pointers to structures via a void * pointer.  The tty code,
 for example, does this frequently to pass driver-specific and line
 discipline-specific structures back and forth.
@@ -19,11 +19,11 @@
 	...
 };
 
-Please follow this discpline when you are adding future enhancements
+Please follow this discipline when you are adding future enhancements
 to the kernel!  It has saved me countless hours of debugging,
 especially in the screw cases where an array has been overrun and
 structures following the array have been overwritten.  Using this
-discpline, these cases get detected quickly and safely.
+discipline, these cases get detected quickly and safely.
 
 					Theodore Ts'o
 					31-Mar-94
diff -u --recursive --new-file v1.1.41/linux/Makefile linux/Makefile
--- v1.1.41/linux/Makefile	Mon Aug  8 12:36:40 1994
+++ linux/Makefile	Mon Aug  8 09:42:03 1994
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 1
-SUBLEVEL = 41
+SUBLEVEL = 42
 
 all:	Version zImage
 
diff -u --recursive --new-file v1.1.41/linux/README linux/README
--- v1.1.41/linux/README	Tue Apr 19 10:52:42 1994
+++ linux/README	Tue Aug  9 09:32:59 1994
@@ -71,7 +71,7 @@
 	  but it should not hurt performance. 
 	- A kernel with math-emulation compiled in will still use the
 	  coprocessor if one is present: the math emulation will just
-	  never get used in that case.  The kernel will be slighly larger,
+	  never get used in that case.  The kernel will be slightly larger,
 	  but will work on different machines regardless of whether they
 	  have a math coprocessor or not. 
 	- the "kernel hacking" configuration details usually result in a
@@ -162,7 +162,7 @@
    important: it tells something about why the kernel dumped code (in
    the above example it's due to a bad kernel pointer)
 
- - in debugging dumps like the above, it helps enourmously if you can
+ - in debugging dumps like the above, it helps enormously if you can
    look up what the EIP value means.  The hex value as such doesn't help
    me or anybody else very much: it will depend on your particular
    kernel setup.  What you should do is take the hex value from the EIP
diff -u --recursive --new-file v1.1.41/linux/boot/bootsect.S linux/boot/bootsect.S
--- v1.1.41/linux/boot/bootsect.S	Mon Jul 18 14:48:28 1994
+++ linux/boot/bootsect.S	Tue Aug  9 09:32:59 1994
@@ -242,7 +242,7 @@
 	seg cs
 	mov	root_dev,ax
 
-! after that (everyting loaded), we jump to
+! after that (everything loaded), we jump to
 ! the setup-routine loaded directly after
 ! the bootblock:
 
@@ -397,7 +397,7 @@
 
 /*
  *	print_hex is for debugging purposes, and prints the word
- *	pointed to by ss:bp in hexadecmial.
+ *	pointed to by ss:bp in hexadecimal.
 */
 
 print_hex:
diff -u --recursive --new-file v1.1.41/linux/boot/setup.S linux/boot/setup.S
--- v1.1.41/linux/boot/setup.S	Sat Jul 23 17:38:36 1994
+++ linux/boot/setup.S	Tue Aug  9 09:32:59 1994
@@ -243,7 +243,7 @@
 ! we let the gnu-compiled 32-bit programs do that. We just jump to
 ! absolute address 0x00000, in 32-bit protected mode.
 !
-! Note that the short jump isn't strictly needed, althought there are
+! Note that the short jump isn't strictly needed, although there are
 ! reasons why it might be a good idea. It won't hurt in any case.
 !
 	xor	ax,ax
@@ -408,7 +408,7 @@
 	mov	bh,al		! store current value of CRT-register 0x38
 	mov	ax,#0x0038
 	call	outidx		! disable writing to special regs
-	movb	al,cl		! check wether we can write special reg 0x35
+	movb	al,cl		! check whether we can write special reg 0x35
 	call	inidx
 	movb	bl,al		! save the current value of CRT reg 0x35
 	andb	al,#0xf0	! clear bits 0-3
@@ -436,7 +436,7 @@
 	je	no_s3		! writing is allowed => this is not an S3
 s3_1:	mov	ax,#0x4838	! allow writing to special regs by putting
 	call	outidx		! magic number into CRT-register 0x38
-	movb	al,cl		! check wether we can write special reg 0x35
+	movb	al,cl		! check whether we can write special reg 0x35
 	call	inidx
 	movb	bl,al
 	andb	al,#0xf0
diff -u --recursive --new-file v1.1.41/linux/drivers/block/blk.h linux/drivers/block/blk.h
--- v1.1.41/linux/drivers/block/blk.h	Mon Aug  8 12:36:40 1994
+++ linux/drivers/block/blk.h	Tue Aug  9 09:35:23 1994
@@ -85,7 +85,6 @@
 #ifdef CONFIG_SBPCD
 extern unsigned long sbpcd_init(unsigned long, unsigned long);
 #endif CONFIG_SBPCD
-extern int is_read_only(int dev);
 extern void set_device_ro(int dev,int flag);
 
 extern void rd_load(void);
diff -u --recursive --new-file v1.1.41/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v1.1.41/linux/drivers/block/floppy.c	Mon Aug  8 12:36:42 1994
+++ linux/drivers/block/floppy.c	Tue Aug  9 13:23:13 1994
@@ -1750,6 +1750,8 @@
 			return;
 		}
 		current_type[current_drive] = floppy;
+		floppy_sizes[DRIVE(current_drive) + (FDC(current_drive) << 7)] =
+			floppy->size >> 1;
 		break;
 	}
 
diff -u --recursive --new-file v1.1.41/linux/drivers/block/hd.c linux/drivers/block/hd.c
--- v1.1.41/linux/drivers/block/hd.c	Mon Aug  8 12:36:42 1994
+++ linux/drivers/block/hd.c	Tue Aug  9 12:35:46 1994
@@ -604,9 +604,10 @@
 {
 	DEVICE_INTR = NULL;
 	sti();
-	special_op [DEVICE_NR(CURRENT->dev)] += reset = 1;
+	reset = 1;
 	if (!CURRENT)
 		return;
+	special_op [DEVICE_NR(CURRENT->dev)] ++;
 	printk(KERN_DEBUG "HD timeout\n");
 	cli();
 	if (++CURRENT->errors >= MAX_ERRORS) {
diff -u --recursive --new-file v1.1.41/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- v1.1.41/linux/drivers/block/ll_rw_blk.c	Mon Aug  8 12:36:42 1994
+++ linux/drivers/block/ll_rw_blk.c	Tue Aug  9 12:12:49 1994
@@ -202,6 +202,7 @@
 	if (blk_size[major])
 		if (blk_size[major][MINOR(bh->b_dev)] < (sector + count)>>1) {
 			bh->b_dirt = bh->b_uptodate = 0;
+			bh->b_req = 0;
 			return;
 		}
 	lock_buffer(bh);
diff -u --recursive --new-file v1.1.41/linux/drivers/char/Makefile linux/drivers/char/Makefile
--- v1.1.41/linux/drivers/char/Makefile	Mon Jul 25 17:56:37 1994
+++ linux/drivers/char/Makefile	Mon Aug  8 11:45:06 1994
@@ -20,7 +20,7 @@
 	tty_ioctl.o pty.o vt.o mem.o \
 	defkeymap.o
 
-SRCS  = tty_io.c console.c keyboard.c serial.c \
+SRCS  = tty_io.c n_tty.c console.c keyboard.c serial.c \
 	tty_ioctl.c pty.c vt.c mem.c \
 	defkeymap.c
 
diff -u --recursive --new-file v1.1.41/linux/drivers/char/console.c linux/drivers/char/console.c
--- v1.1.41/linux/drivers/char/console.c	Tue Jul 26 21:39:44 1994
+++ linux/drivers/char/console.c	Tue Aug  9 09:35:37 1994
@@ -9,7 +9,7 @@
  *
  * This module exports the console io functions:
  * 
- *	'long con_init(long)'
+ *	'long console_init(long, long)'
  *	'int con_open(struct tty_struct *tty, struct file * filp)'
  * 	'void update_screen(int new_console)'
  * 	'void blank_screen(void)'
@@ -801,6 +801,7 @@
 	respond_string(buf, tty);
 }
 
+#ifdef CONFIG_SELECTION
 static void mouse_report(int currcons, struct tty_struct * tty,
 			 int butt, int mrx, int mry)
 {
@@ -810,6 +811,7 @@
 		(char)('!' + mry));
 	respond_string(buf, tty);
 }
+#endif
 
 static inline void status_report(int currcons, struct tty_struct * tty)
 {
@@ -1519,7 +1521,7 @@
 }
 
 /*
- *  long con_init(long);
+ *  long console_init(long, long);
  *
  * This routine initalizes console interrupts, and does nothing
  * else. If you want the screen to clear, call tty_write with
@@ -1528,7 +1530,7 @@
  * Reads the information preserved by setup.s to determine the current display
  * type and sets everything accordingly.
  */
-long con_init(long kmem_start)
+long console_init(long kmem_start, long kmem_end)
 {
 	char *display_desc = "????";
 	int currcons = 0;
diff -u --recursive --new-file v1.1.41/linux/drivers/char/n_tty.c linux/drivers/char/n_tty.c
--- v1.1.41/linux/drivers/char/n_tty.c	Mon Aug  8 12:36:42 1994
+++ linux/drivers/char/n_tty.c	Mon Aug  8 09:38:32 1994
@@ -76,7 +76,8 @@
 	if (!tty->link)
 		return;
 
-	wake_up_interruptible(&tty->link->write_wait);
+	if (tty->driver.unthrottle)
+		(tty->driver.unthrottle)(tty);
 	if (tty->link->packet) {
 		tty->ctrl_status |= TIOCPKT_FLUSHREAD;
 		wake_up_interruptible(&tty->link->read_wait);
@@ -895,12 +896,6 @@
 
 	current->state = TASK_RUNNING;
 	current->timeout = 0;
-	/*
-	 * Hack for PTY's; we need to wake up the other tty if there's
-	 * enough space.
-	 */
-	if (tty->link && tty->read_cnt <= TTY_THRESHOLD_UNTHROTTLE)
-		wake_up_interruptible(&tty->link->write_wait);
 	return (b - buf) ? b - buf : retval;
 }
 
diff -u --recursive --new-file v1.1.41/linux/drivers/char/pty.c linux/drivers/char/pty.c
--- v1.1.41/linux/drivers/char/pty.c	Mon Aug  8 12:36:42 1994
+++ linux/drivers/char/pty.c	Mon Aug  8 09:38:32 1994
@@ -85,6 +85,30 @@
 	}
 }
 
+/*
+ * The unthrottle routine is called by the line discipline to signal
+ * that it can receive more characters.  For PTY's, the TTY_THROTTLED
+ * flag is always set, to force the line discpline to always call the
+ * unthrottle routine when there are fewer than TTY_THRESHOLD_UNTHROTTLE 
+ * characters in the queue.  This is necessary since each time this
+ * happens, we need to wake up any sleeping processes that could be
+ * (1) trying to send data to the pty, or (2) waiting in wait_until_sent()
+ * for the pty buffer to be drained.
+ */
+static void pty_unthrottle(struct tty_struct * tty)
+{
+	struct tty_struct *o_tty = tty->link;
+
+	if (!o_tty)
+		return;
+
+	if ((o_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
+	    o_tty->ldisc.write_wakeup)
+		(o_tty->ldisc.write_wakeup)(o_tty);
+	wake_up_interruptible(&o_tty->write_wait);
+	set_bit(TTY_THROTTLED, &tty->flags);
+}
+
 static int pty_write(struct tty_struct * tty, int from_user,
 		       unsigned char *buf, int count)
 {
@@ -177,6 +201,7 @@
 	if (tty->driver.subtype == PTY_TYPE_SLAVE)
 		clear_bit(TTY_SLAVE_CLOSED, &tty->link->flags);
 	wake_up_interruptible(&pty->open_wait);
+	set_bit(TTY_THROTTLED, &tty->flags);
 	if (filp->f_flags & O_NDELAY)
 		return 0;
 	while (!tty->link->count && !(current->signal & ~current->blocked))
@@ -215,6 +240,7 @@
 	pty_driver.write_room = pty_write_room;
 	pty_driver.flush_buffer = pty_flush_buffer;
 	pty_driver.chars_in_buffer = pty_chars_in_buffer;
+	pty_driver.unthrottle = pty_unthrottle;
 
 	pty_slave_driver = pty_driver;
 	pty_slave_driver.name = "ttyp";
diff -u --recursive --new-file v1.1.41/linux/drivers/char/serial.c linux/drivers/char/serial.c
--- v1.1.41/linux/drivers/char/serial.c	Mon Aug  8 12:36:43 1994
+++ linux/drivers/char/serial.c	Mon Aug  8 09:38:32 1994
@@ -1205,7 +1205,7 @@
 	if (serial_paranoia_check(info, tty->device, "rs_put_char"))
 		return;
 
-	if (!tty || tty->stopped || tty->hw_stopped || !info->xmit_buf)
+	if (!tty || !info->xmit_buf)
 		return;
 
 	save_flags(flags); cli();
diff -u --recursive --new-file v1.1.41/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v1.1.41/linux/drivers/char/tty_io.c	Sun Aug  7 03:30:37 1994
+++ linux/drivers/char/tty_io.c	Mon Aug  8 15:40:11 1994
@@ -75,7 +75,7 @@
 extern int do_screendump(int arg);
 
 struct termios tty_std_termios;		/* for the benefit of tty drivers  */
-struct tty_driver *tty_drivers;		/* linked list of tty drivers */
+struct tty_driver *tty_drivers = NULL;	/* linked list of tty drivers */
 struct tty_ldisc ldiscs[NR_LDISCS];	/* line disc dispatch table	*/
 
 /*
@@ -1529,13 +1529,14 @@
  */
 int tty_register_driver(struct tty_driver *driver)
 {
+	int error;
+
 	if (driver->flags & TTY_DRIVER_INSTALLED)
 		return 0;
-	/*
-	 * XXX need to check to see if major device already
-	 * registered, and then handle error checking.
-	 */
-	(void) register_chrdev(driver->major, driver->name, &tty_fops);
+
+	error = register_chrdev(driver->major, driver->name, &tty_fops);
+	if (error)
+		return error;
 
 	if (!driver->put_char)
 		driver->put_char = tty_default_put_char;
@@ -1555,7 +1556,6 @@
 		panic("unable to get major %d for tty device", TTY_MAJOR);
 	if (register_chrdev(TTYAUX_MAJOR,"tty",&tty_fops))
 		panic("unable to get major %d for tty device", TTYAUX_MAJOR);
-	tty_drivers = 0;
 
 	/* Setup the default TTY line discipline. */
 	memset(ldiscs, 0, sizeof(ldiscs));
@@ -1573,7 +1573,6 @@
 	tty_std_termios.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK |
 		ECHOCTL | ECHOKE | IEXTEN;
 	
-	kmem_start = con_init(kmem_start);
 	kmem_start = kbd_init(kmem_start);
 	kmem_start = rs_init(kmem_start);
 	kmem_start = pty_init(kmem_start);
diff -u --recursive --new-file v1.1.41/linux/drivers/scsi/NCR5380.c linux/drivers/scsi/NCR5380.c
--- v1.1.41/linux/drivers/scsi/NCR5380.c	Sun Aug  7 03:30:38 1994
+++ linux/drivers/scsi/NCR5380.c	Mon Aug  8 09:32:46 1994
@@ -705,7 +705,7 @@
  * Inputs : instance, pointer to this instance.  
  */
 
-void NCR5380_print_status (struct Scsi_Host *instance) {
+static void NCR5380_print_status (struct Scsi_Host *instance) {
     struct NCR5380_hostdata *hostdata = (struct NCR5380_hostdata *) 
 	instance->hostdata;
     Scsi_Cmnd *ptr;
diff -u --recursive --new-file v1.1.41/linux/drivers/scsi/seagate.c linux/drivers/scsi/seagate.c
--- v1.1.41/linux/drivers/scsi/seagate.c	Sun Aug  7 03:30:39 1994
+++ linux/drivers/scsi/seagate.c	Tue Aug  9 10:25:33 1994
@@ -670,18 +670,20 @@
  *	target ID are asserted.  A valid initator ID is not on the bus
  *	until IO is asserted, so we must wait for that.
  */
-		
-		for (clock = jiffies + 10, temp = 0; (jiffies < clock) &&
-		    !((temp = STATUS) & (STAT_IO | STAT_BSY)););
+		clock = jiffies + 10;
+		for (;;) {
+			temp = STATUS;
+			if ((temp & STAT_IO) && !(temp & STAT_BSY))
+				break;
 
-		if (jiffies >= clock)
-			{
+			if (jiffies > clock) {
 #if (DEBUG & PHASE_RESELECT)
-			printk("scsi%d : RESELECT timed out while waiting for IO .\n",
-				hostno);
+				printk("scsi%d : RESELECT timed out while waiting for IO .\n",
+					hostno);
 #endif
-			return (DID_BAD_INTR << 16);
+				return (DID_BAD_INTR << 16);
 			}
+		}
 
 /* 
  * 	After I/O is asserted by the target, we can read our ID and its
diff -u --recursive --new-file v1.1.41/linux/drivers/scsi/ultrastor.c linux/drivers/scsi/ultrastor.c
--- v1.1.41/linux/drivers/scsi/ultrastor.c	Mon Jul 25 17:56:39 1994
+++ linux/drivers/scsi/ultrastor.c	Tue Aug  9 09:41:39 1994
@@ -298,15 +298,18 @@
   return rv;
 }
 
-/* This asm is fragile: it doesn't work without the casts and it may
+/* This has been re-implemented with the help of Richard Earnshaw,
+   <rwe@pegasus.esprit.ec.org> and works with gcc-2.5.8 and gcc-2.6.0.
+   The instability noted by jfc below appears to be a bug in
+   gcc-2.5.x when compiling w/o optimization.  --Caleb
+
+   This asm is fragile: it doesn't work without the casts and it may
    not work without optimization.  Maybe I should add a swap builtin
    to gcc.  --jfc  */
 static inline unsigned char xchgb(unsigned char reg,
 				  volatile unsigned char *mem)
 {
-  asm("xchgb %0,%1" :
-      "=q" (reg), "=m" (*(unsigned char *)mem) :
-      "0" (reg), "1" (*(unsigned char *)mem));
+  asm ("xchgb %0, (%2)" : "=q" (reg) : "0" (reg), "q" (mem) : "m");
   return reg;
 }
 
diff -u --recursive --new-file v1.1.41/linux/fs/block_dev.c linux/fs/block_dev.c
--- v1.1.41/linux/fs/block_dev.c	Mon Aug  8 12:36:43 1994
+++ linux/fs/block_dev.c	Tue Aug  9 12:07:16 1994
@@ -175,14 +175,15 @@
 	rblocks = blocks = (left + offset + blocksize - 1) >> blocksize_bits;
 	bhb = bhe = buflist;
 	if (filp->f_reada) {
-	        if(blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
-		  blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
-		if (block + blocks > size)
-			blocks = size - block;
+	        if (blocks < read_ahead[MAJOR(dev)] / (blocksize >> 9))
+			blocks = read_ahead[MAJOR(dev)] / (blocksize >> 9);
 		blocks -= (block % blocks_per_cluster);
-		if(rblocks > blocks) blocks = rblocks;
+		if (rblocks > blocks)
+			blocks = rblocks;
 		
 	}
+	if (block + blocks > size)
+		blocks = size - block;
 
 	/* We do this in a two stage process.  We first try and request
 	   as many blocks as we can, then we wait for the first one to
diff -u --recursive --new-file v1.1.41/linux/fs/buffer.c linux/fs/buffer.c
--- v1.1.41/linux/fs/buffer.c	Sat Jul 23 17:38:37 1994
+++ linux/fs/buffer.c	Tue Aug  9 09:33:00 1994
@@ -422,7 +422,7 @@
 
 /*
  * Why like this, I hear you say... The reason is race-conditions.
- * As we don't lock buffers (unless we are readint them, that is),
+ * As we don't lock buffers (unless we are reading them, that is),
  * something might happen to it while we sleep (ie a read-error
  * will force it bad). This shouldn't really happen currently, but
  * the code is ready.
@@ -675,7 +675,7 @@
  * race-conditions. Most of the code is seldom used, (ie repeating),
  * so it should be much more efficient than it looks.
  *
- * The algoritm is changed: hopefully better, and an elusive bug removed.
+ * The algorithm is changed: hopefully better, and an elusive bug removed.
  *
  * 14.02.92: changed it to sync dirty buffers a bit: better performance
  * when the filesystem starts to get full of dirty blocks (I hope).
@@ -1465,7 +1465,7 @@
  * pages for the buffer cache as much of the time as possible.
  * This way the other buffers on a particular page are likely
  * to be very near each other on the free list, and we will not
- * be expiring data prematurely.  For now we only canibalize buffers
+ * be expiring data prematurely.  For now we only cannibalize buffers
  * of the same size to keep the code simpler.
  */
 static int reassign_cluster(dev_t dev, 
@@ -1619,7 +1619,7 @@
 	return;
 }
 
-/* This is a simple kernel daemon, whose job it is to provide a dynamicly
+/* This is a simple kernel daemon, whose job it is to provide a dynamically
  * response to dirty buffers.  Once this process is activated, we write back
  * a limited number of buffers to the disks and then go back to sleep again.
  * In effect this is a process which never leaves kernel mode, and does not have
@@ -1645,7 +1645,7 @@
 
 
 /* 
- * Here we attempt to write back old buffers.  We also try and flush indoes 
+ * Here we attempt to write back old buffers.  We also try and flush inodes 
  * and supers as well, since this function is essentially "update", and 
  * otherwise there would be no way of ensuring that these quantities ever 
  * get written back.  Ideally, we would have a timestamp on the inodes
diff -u --recursive --new-file v1.1.41/linux/fs/devices.c linux/fs/devices.c
--- v1.1.41/linux/fs/devices.c	Wed Jul 13 01:09:43 1994
+++ linux/fs/devices.c	Mon Aug  8 15:36:52 1994
@@ -66,7 +66,7 @@
 {
 	if (major >= MAX_CHRDEV)
 		return -EINVAL;
-	if (chrdevs[major].fops)
+	if (chrdevs[major].fops && chrdevs[major].fops != fops)
 		return -EBUSY;
 	chrdevs[major].name = name;
 	chrdevs[major].fops = fops;
@@ -77,7 +77,7 @@
 {
 	if (major >= MAX_BLKDEV)
 		return -EINVAL;
-	if (blkdevs[major].fops)
+	if (blkdevs[major].fops && blkdevs[major].fops != fops)
 		return -EBUSY;
 	blkdevs[major].name = name;
 	blkdevs[major].fops = fops;
diff -u --recursive --new-file v1.1.41/linux/fs/isofs/namei.c linux/fs/isofs/namei.c
--- v1.1.41/linux/fs/isofs/namei.c	Sun Aug  7 03:30:41 1994
+++ linux/fs/isofs/namei.c	Tue Aug  9 09:35:37 1994
@@ -64,7 +64,7 @@
  * entry - you'll have to do that yourself if you want to.
  */
 static struct buffer_head * isofs_find_entry(struct inode * dir,
-	const char * name, int namelen, int * ino, int * ino_back)
+	const char * name, int namelen, unsigned long * ino, unsigned long * ino_back)
 {
 	unsigned long bufsize = ISOFS_BUFFER_SIZE(dir);
 	unsigned char bufbits = ISOFS_BUFFER_BITS(dir);
@@ -213,7 +213,7 @@
 int isofs_lookup(struct inode * dir,const char * name, int len,
 	struct inode ** result)
 {
-	int ino, ino_back;
+	unsigned long ino, ino_back;
 	struct buffer_head * bh;
 
 #ifdef DEBUG
diff -u --recursive --new-file v1.1.41/linux/fs/locks.c linux/fs/locks.c
--- v1.1.41/linux/fs/locks.c	Wed Aug  3 09:32:32 1994
+++ linux/fs/locks.c	Tue Aug  9 09:33:00 1994
@@ -358,7 +358,7 @@
 			/*
 			 * Replace the old lock with the new one. Wake up
 			 * anybody waiting for the old one, as the change in
-			 * lock type migth satisfy his needs.
+			 * lock type might satisfy his needs.
 			 */
 			wake_up(&fl->fl_wait);
 			fl->fl_start = caller->fl_start;
diff -u --recursive --new-file v1.1.41/linux/fs/pipe.c linux/fs/pipe.c
--- v1.1.41/linux/fs/pipe.c	Sat May  7 14:54:10 1994
+++ linux/fs/pipe.c	Tue Aug  9 09:33:00 1994
@@ -15,7 +15,7 @@
 
 
 /* We don't use the head/tail construction any more. Now we use the start/len*/
-/* contruction providing full use of PIPE_BUF (multiple of PAGE_SIZE) */
+/* construction providing full use of PIPE_BUF (multiple of PAGE_SIZE) */
 /* Florian Coosmann (FGC)                                ^ current = 1       */
 /* Additionally, we now use locking technique. This prevents race condition  */
 /* in case of paging and multiple read/write on the same pipe. (FGC)         */
diff -u --recursive --new-file v1.1.41/linux/fs/select.c linux/fs/select.c
--- v1.1.41/linux/fs/select.c	Tue May 24 08:47:07 1994
+++ linux/fs/select.c	Tue Aug  9 09:33:00 1994
@@ -191,7 +191,7 @@
 __set_fd_set(nr, (unsigned long *) (fsp), (unsigned long *) (fdp))
 
 /*
- * We can actually return ERESTARTSYS insetad of EINTR, but I'd
+ * We can actually return ERESTARTSYS instead of EINTR, but I'd
  * like to be certain this leads to no problems. So I return
  * EINTR just for safety.
  *
diff -u --recursive --new-file v1.1.41/linux/ibcs/binfmt_coff.c linux/ibcs/binfmt_coff.c
--- v1.1.41/linux/ibcs/binfmt_coff.c	Tue May 24 08:47:07 1994
+++ linux/ibcs/binfmt_coff.c	Tue Aug  9 09:33:00 1994
@@ -4,13 +4,13 @@
  * Compatibility Specification 2 or O'Rilley's book on COFF. The shared
  * libraries are defined only the in the Intel book.
  *
- * This file is based upon code written by Eric Youndale for the ELF object
+ * This file is based upon code written by Eric Youngdale for the ELF object
  * file format.
  *
  * Author: Al Longyear (longyear@sii.com)
  *
  * Latest Revision:
- *    3 Feburary 1994
+ *    3 February 1994
  *      Al Longyear (longyear@sii.com)
  *      Cleared first page of bss section using put_fs_byte.
  */
@@ -162,7 +162,7 @@
 	sections  = COFF_SHORT (coff_hdr->f_nscns);   /* Number of sections */
 	aout_size = COFF_SHORT (coff_hdr->f_opthdr);  /* Size of opt. headr */
 /*
- *  If the file is not executable then reject the exectution. This means
+ *  If the file is not executable then reject the execution. This means
  *  that there must not be external references.
  */
 	if ((flags & COFF_F_EXEC) == 0) {
@@ -173,7 +173,7 @@
 	    break;
 	}
 /*
- *  There must be atleast one section.
+ *  There must be at least one section.
  */
 	if (sections == 0) {
 #ifdef COFF_DEBUG
@@ -509,7 +509,7 @@
 	}
 /*
  *   Construct the bss data for the process. The bss ranges from the
- *   end of the data (which may not be on a page boundry) to the end
+ *   end of the data (which may not be on a page boundary) to the end
  *   of the bss section. Allocate any necessary pages for the data.
  */
 	if (status >= 0 && bss_size != 0) {
@@ -531,8 +531,8 @@
 	    int nIndex;
 	    COFF_SCNHDR *sect_ptr = sect_bufr;
 /*
- *  Find the library sections. (There should be atleast one. It was counted
- *  earlier.) This will evenutally recurse to our code and load the shared
+ *  Find the library sections. (There should be at least one. It was counted
+ *  earlier.) This will eventually recurse to our code and load the shared
  *  library with our own procedures.
  */
 	    for (nIndex = 0; nIndex < sections; ++nIndex) {
@@ -581,7 +581,7 @@
 
 /*
  *  This procedure will load the library listed in the file name given
- *  as the paramter. The result will be non-zero should something fail
+ *  as the parameter. The result will be non-zero should something fail
  *  to load.
  */
 
@@ -624,7 +624,7 @@
     int status = 0;		/* Completion status                  */
     long nbytes;		/* Count of bytes in the header area  */
 /*
- *  Fetch the size of the section. There must be enough room for atleast
+ *  Fetch the size of the section. There must be enough room for at least
  *  one entry.
  */
     nbytes = COFF_LONG (sect->s_size);
@@ -659,7 +659,7 @@
 			    nbytes);                    /* Byte count reqd.  */
 	    set_fs (old_fs);                         /* Restore the selector */
 /*
- *  Check the result. The value returned is the byte count actaully read.
+ *  Check the result. The value returned is the byte count actually read.
  */
 	    if (status >= 0 && status != nbytes) {
 #ifdef COFF_DEBUG
diff -u --recursive --new-file v1.1.41/linux/ibcs/binfmt_elf.c linux/ibcs/binfmt_elf.c
--- v1.1.41/linux/ibcs/binfmt_elf.c	Tue Aug  2 11:27:45 1994
+++ linux/ibcs/binfmt_elf.c	Tue Aug  9 09:33:00 1994
@@ -121,7 +121,7 @@
 
 
 /* This is much more generalized than the library routine read function,
-   so we keep this separate.  Techincally the library read function
+   so we keep this separate.  Technically the library read function
    is only provided so that we can read a.out libraries that have
    an ELF header */
 
diff -u --recursive --new-file v1.1.41/linux/include/asm/string.h linux/include/asm/string.h
--- v1.1.41/linux/include/asm/string.h	Thu Jan  1 02:00:00 1970
+++ linux/include/asm/string.h	Sun Aug  7 14:35:15 1994
@@ -0,0 +1,429 @@
+#ifndef _I386_STRING_H_
+#define _I386_STRING_H_
+
+/*
+ * This string-include defines all string functions as inline
+ * functions. Use gcc. It also assumes ds=es=data space, this should be
+ * normal. Most of the string-functions are rather heavily hand-optimized,
+ * see especially strtok,strstr,str[c]spn. They should work, but are not
+ * very easy to understand. Everything is done entirely within the register
+ * set, making the functions fast and clean. String instructions have been
+ * used through-out, making for "slightly" unclear code :-)
+ *
+ *		Copyright (C) 1991, 1992 Linus Torvalds
+ */
+ 
+extern inline char * strcpy(char * dest,const char *src)
+{
+__asm__ __volatile__(
+	"cld\n"
+	"1:\tlodsb\n\t"
+	"stosb\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b"
+	: /* no output */
+	:"S" (src),"D" (dest):"si","di","ax","memory");
+return dest;
+}
+
+extern inline char * strncpy(char * dest,const char *src,size_t count)
+{
+__asm__ __volatile__(
+	"cld\n"
+	"1:\tdecl %2\n\t"
+	"js 2f\n\t"
+	"lodsb\n\t"
+	"stosb\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n\t"
+	"rep\n\t"
+	"stosb\n"
+	"2:"
+	: /* no output */
+	:"S" (src),"D" (dest),"c" (count):"si","di","ax","cx","memory");
+return dest;
+}
+
+extern inline char * strcat(char * dest,const char * src)
+{
+__asm__ __volatile__(
+	"cld\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"decl %1\n"
+	"1:\tlodsb\n\t"
+	"stosb\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b"
+	: /* no output */
+	:"S" (src),"D" (dest),"a" (0),"c" (0xffffffff):"si","di","ax","cx");
+return dest;
+}
+
+extern inline char * strncat(char * dest,const char * src,size_t count)
+{
+__asm__ __volatile__(
+	"cld\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"decl %1\n\t"
+	"movl %4,%3\n"
+	"1:\tdecl %3\n\t"
+	"js 2f\n\t"
+	"lodsb\n\t"
+	"stosb\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n"
+	"2:\txorl %2,%2\n\t"
+	"stosb"
+	: /* no output */
+	:"S" (src),"D" (dest),"a" (0),"c" (0xffffffff),"g" (count)
+	:"si","di","ax","cx","memory");
+return dest;
+}
+
+extern inline int strcmp(const char * cs,const char * ct)
+{
+register int __res;
+__asm__ __volatile__(
+	"cld\n"
+	"1:\tlodsb\n\t"
+	"scasb\n\t"
+	"jne 2f\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n\t"
+	"xorl %%eax,%%eax\n\t"
+	"jmp 3f\n"
+	"2:\tsbbl %%eax,%%eax\n\t"
+	"orb $1,%%eax\n"
+	"3:"
+	:"=a" (__res):"S" (cs),"D" (ct):"si","di");
+return __res;
+}
+
+extern inline int strncmp(const char * cs,const char * ct,size_t count)
+{
+register int __res;
+__asm__ __volatile__(
+	"cld\n"
+	"1:\tdecl %3\n\t"
+	"js 2f\n\t"
+	"lodsb\n\t"
+	"scasb\n\t"
+	"jne 3f\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n"
+	"2:\txorl %%eax,%%eax\n\t"
+	"jmp 4f\n"
+	"3:\tsbbl %%eax,%%eax\n\t"
+	"orb $1,%%al\n"
+	"4:"
+	:"=a" (__res):"S" (cs),"D" (ct),"c" (count):"si","di","cx");
+return __res;
+}
+
+extern inline char * strchr(const char * s,char c)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"movb %%al,%%ah\n"
+	"1:\tlodsb\n\t"
+	"cmpb %%ah,%%al\n\t"
+	"je 2f\n\t"
+	"testb %%al,%%al\n\t"
+	"jne 1b\n\t"
+	"movl $1,%1\n"
+	"2:\tmovl %1,%0\n\t"
+	"decl %0"
+	:"=a" (__res):"S" (s),"0" (c):"si");
+return __res;
+}
+
+extern inline char * strrchr(const char * s,char c)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"movb %%al,%%ah\n"
+	"1:\tlodsb\n\t"
+	"cmpb %%ah,%%al\n\t"
+	"jne 2f\n\t"
+	"leal -1(%%esi),%0\n"
+	"2:\ttestb %%al,%%al\n\t"
+	"jne 1b"
+	:"=d" (__res):"0" (0),"S" (s),"a" (c):"ax","si");
+return __res;
+}
+
+extern inline size_t strspn(const char * cs, const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"movl %4,%%edi\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %%ecx\n\t"
+	"decl %%ecx\n\t"
+	"movl %%ecx,%%edx\n"
+	"1:\tlodsb\n\t"
+	"testb %%al,%%al\n\t"
+	"je 2f\n\t"
+	"movl %4,%%edi\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"je 1b\n"
+	"2:\tdecl %0"
+	:"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+	:"ax","cx","dx","di");
+return __res-cs;
+}
+
+extern inline size_t strcspn(const char * cs, const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"movl %4,%%edi\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %%ecx\n\t"
+	"decl %%ecx\n\t"
+	"movl %%ecx,%%edx\n"
+	"1:\tlodsb\n\t"
+	"testb %%al,%%al\n\t"
+	"je 2f\n\t"
+	"movl %4,%%edi\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"jne 1b\n"
+	"2:\tdecl %0"
+	:"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+	:"ax","cx","dx","di");
+return __res-cs;
+}
+
+extern inline char * strpbrk(const char * cs,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"movl %4,%%edi\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %%ecx\n\t"
+	"decl %%ecx\n\t"
+	"movl %%ecx,%%edx\n"
+	"1:\tlodsb\n\t"
+	"testb %%al,%%al\n\t"
+	"je 2f\n\t"
+	"movl %4,%%edi\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"jne 1b\n\t"
+	"decl %0\n\t"
+	"jmp 3f\n"
+	"2:\txorl %0,%0\n"
+	"3:"
+	:"=S" (__res):"a" (0),"c" (0xffffffff),"0" (cs),"g" (ct)
+	:"ax","cx","dx","di");
+return __res;
+}
+
+extern inline char * strstr(const char * cs,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+	"cld\n\t" \
+	"movl %4,%%edi\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %%ecx\n\t"
+	"decl %%ecx\n\t"	/* NOTE! This also sets Z if searchstring='' */
+	"movl %%ecx,%%edx\n"
+	"1:\tmovl %4,%%edi\n\t"
+	"movl %%esi,%%eax\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repe\n\t"
+	"cmpsb\n\t"
+	"je 2f\n\t"		/* also works for empty string, see above */
+	"xchgl %%eax,%%esi\n\t"
+	"incl %%esi\n\t"
+	"cmpb $0,-1(%%eax)\n\t"
+	"jne 1b\n\t"
+	"xorl %%eax,%%eax\n\t"
+	"2:"
+	:"=a" (__res):"0" (0),"c" (0xffffffff),"S" (cs),"g" (ct)
+	:"cx","dx","di","si");
+return __res;
+}
+
+extern inline size_t strlen(const char * s)
+{
+register int __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %0\n\t"
+	"decl %0"
+	:"=c" (__res):"D" (s),"a" (0),"0" (0xffffffff):"di");
+return __res;
+}
+
+extern char * ___strtok;
+
+extern inline char * strtok(char * s,const char * ct)
+{
+register char * __res;
+__asm__ __volatile__(
+	"testl %1,%1\n\t"
+	"jne 1f\n\t"
+	"testl %0,%0\n\t"
+	"je 8f\n\t"
+	"movl %0,%1\n"
+	"1:\txorl %0,%0\n\t"
+	"movl $-1,%%ecx\n\t"
+	"xorl %%eax,%%eax\n\t"
+	"cld\n\t"
+	"movl %4,%%edi\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"notl %%ecx\n\t"
+	"decl %%ecx\n\t"
+	"je 7f\n\t"			/* empty delimeter-string */
+	"movl %%ecx,%%edx\n"
+	"2:\tlodsb\n\t"
+	"testb %%al,%%al\n\t"
+	"je 7f\n\t"
+	"movl %4,%%edi\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"je 2b\n\t"
+	"decl %1\n\t"
+	"cmpb $0,(%1)\n\t"
+	"je 7f\n\t"
+	"movl %1,%0\n"
+	"3:\tlodsb\n\t"
+	"testb %%al,%%al\n\t"
+	"je 5f\n\t"
+	"movl %4,%%edi\n\t"
+	"movl %%edx,%%ecx\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"jne 3b\n\t"
+	"decl %1\n\t"
+	"cmpb $0,(%1)\n\t"
+	"je 5f\n\t"
+	"movb $0,(%1)\n\t"
+	"incl %1\n\t"
+	"jmp 6f\n"
+	"5:\txorl %1,%1\n"
+	"6:\tcmpb $0,(%0)\n\t"
+	"jne 7f\n\t"
+	"xorl %0,%0\n"
+	"7:\ttestl %0,%0\n\t"
+	"jne 8f\n\t"
+	"movl %0,%1\n"
+	"8:"
+	:"=b" (__res),"=S" (___strtok)
+	:"0" (___strtok),"1" (s),"g" (ct)
+	:"ax","cx","dx","di","memory");
+return __res;
+}
+
+extern inline void * memcpy(void * to, const void * from, size_t n)
+{
+__asm__ __volatile__(
+	"cld\n\t"
+	"movl %%edx, %%ecx\n\t"
+	"shrl $2,%%ecx\n\t"
+	"rep ; movsl\n\t"
+	"testb $1,%%dl\n\t"
+	"je 1f\n\t"
+	"movsb\n"
+	"1:\ttestb $2,%%dl\n\t"
+	"je 2f\n\t"
+	"movsw\n"
+	"2:\n"
+	: /* no output */
+	:"d" (n),"D" ((long) to),"S" ((long) from)
+	: "cx","di","si","memory");
+return (to);
+}
+
+extern inline void * memmove(void * dest,const void * src, size_t n)
+{
+if (dest<src)
+__asm__ __volatile__(
+	"cld\n\t"
+	"rep\n\t"
+	"movsb"
+	: /* no output */
+	:"c" (n),"S" (src),"D" (dest)
+	:"cx","si","di");
+else
+__asm__ __volatile__(
+	"std\n\t"
+	"rep\n\t"
+	"movsb\n\t"
+	"cld"
+	: /* no output */
+	:"c" (n),
+	 "S" (n-1+(const char *)src),
+	 "D" (n-1+(char *)dest)
+	:"cx","si","di","memory");
+return dest;
+}
+
+extern inline int memcmp(const void * cs,const void * ct,size_t count)
+{
+register int __res;
+__asm__ __volatile__(
+	"cld\n\t"
+	"repe\n\t"
+	"cmpsb\n\t"
+	"je 1f\n\t"
+	"sbbl %%eax,%%eax\n\t"
+	"orb $1,%%al\n"
+	"1:"
+	:"=a" (__res):"0" (0),"S" (cs),"D" (ct),"c" (count)
+	:"si","di","cx");
+return __res;
+}
+
+extern inline void * memchr(const void * cs,char c,size_t count)
+{
+register void * __res;
+if (!count)
+	return NULL;
+__asm__ __volatile__(
+	"cld\n\t"
+	"repne\n\t"
+	"scasb\n\t"
+	"je 1f\n\t"
+	"movl $1,%0\n"
+	"1:\tdecl %0"
+	:"=D" (__res):"a" (c),"D" (cs),"c" (count)
+	:"cx");
+return __res;
+}
+
+extern inline void * memset(void * s,char c,size_t count)
+{
+__asm__ __volatile__(
+	"cld\n\t"
+	"rep\n\t"
+	"stosb"
+	: /* no output */
+	:"a" (c),"D" (s),"c" (count)
+	:"cx","di","memory");
+return s;
+}
+
+#endif
Only in v1.1.41/linux/include/i386: string.h
diff -u --recursive --new-file v1.1.41/linux/include/linux/bios32.h linux/include/linux/bios32.h
--- v1.1.41/linux/include/linux/bios32.h	Wed Aug  3 09:32:32 1994
+++ linux/include/linux/bios32.h	Mon Aug  8 14:46:14 1994
@@ -22,7 +22,7 @@
 #ifndef BIOS32_H
 #define BIOS32_H
 
-long bios32_init (long memory_start, long memory_end);
+unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end);
 
 extern int pcibios_find_class (unsigned long class_code, unsigned short index, 
     unsigned char *bus, unsigned char *device_fn);
@@ -41,4 +41,5 @@
     unsigned char device_fn, unsigned char where, unsigned short value);
 extern pcibios_write_config_dword (unsigned char bus,
     unsigned char device_fn, unsigned char where, unsigned long value);
+
 #endif /* ndef BIOS32_H */
diff -u --recursive --new-file v1.1.41/linux/include/linux/string.h linux/include/linux/string.h
--- v1.1.41/linux/include/linux/string.h	Mon Aug  8 12:36:45 1994
+++ linux/include/linux/string.h	Tue Aug  9 09:36:29 1994
@@ -11,7 +11,7 @@
 extern "C" {
 #endif
 
-#include <i386/string.h>	/* inline functions for i386.. */
+#include <asm/string.h>		/* inline functions for i386.. */
 
 extern char * strcpy(char *, const char *);
 extern char * strncpy(char *, const char *, size_t);
diff -u --recursive --new-file v1.1.41/linux/include/linux/timex.h linux/include/linux/timex.h
--- v1.1.41/linux/include/linux/timex.h	Sun Mar  6 16:14:51 1994
+++ linux/include/linux/timex.h	Tue Aug  9 09:35:37 1994
@@ -117,7 +117,6 @@
  */
 extern long tick;                      /* timer interrupt period */
 extern int tickadj;			/* amount of adjustment per tick */
-extern volatile struct timeval xtime;		/* The current time */
 
 /*
  * phase-lock loop variables
diff -u --recursive --new-file v1.1.41/linux/init/main.c linux/init/main.c
--- v1.1.41/linux/init/main.c	Sun Aug  7 03:30:42 1994
+++ linux/init/main.c	Tue Aug  9 12:37:31 1994
@@ -71,7 +71,8 @@
 extern void init(void);
 extern void init_IRQ(void);
 extern void init_modules(void);
-extern long kmalloc_init (long,long);
+extern long console_init(long, long);
+extern long kmalloc_init(long,long);
 extern long blk_dev_init(long,long);
 extern long chr_dev_init(long,long);
 extern void floppy_init(void);
@@ -228,7 +229,7 @@
       ramdisk_size = ints[1];
 }
 
-int checksetup(char *line)
+static int checksetup(char *line)
 {
 	int i = 0;
 	int ints[11];
@@ -237,11 +238,11 @@
 		int n = strlen(bootsetups[i].str);
 		if (!strncmp(line,bootsetups[i].str,n)) {
 			bootsetups[i].setup_func(get_options(line+n,ints), ints);
-			return(0);
+			return 1;
 		}
 		i++;
 	}
-	return(1);
+	return 0;
 }
 
 unsigned long loops_per_sec = 1;
@@ -316,21 +317,33 @@
 					break;
 				}
 			}
-		} else if (!strcmp(line,"ro"))
+			continue;
+		}
+		if (!strcmp(line,"ro")) {
 			root_mountflags |= MS_RDONLY;
-		else if (!strcmp(line,"rw"))
+			continue;
+		}
+		if (!strcmp(line,"rw")) {
 			root_mountflags &= ~MS_RDONLY;
-		else if (!strcmp(line,"debug"))
+			continue;
+		}
+		if (!strcmp(line,"debug")) {
 			console_loglevel = 10;
-		else if (!strcmp(line,"no-hlt"))
+			continue;
+		}
+		if (!strcmp(line,"no-hlt")) {
 			hlt_works_ok = 0;
-		else if (!strcmp(line,"no387")) {
+			continue;
+		}
+		if (!strcmp(line,"no387")) {
 			hard_math = 0;
 			__asm__("movl %%cr0,%%eax\n\t"
 				"orl $0xE,%%eax\n\t"
 				"movl %%eax,%%cr0\n\t" : : : "ax");
-		} else
-			checksetup(line);
+			continue;
+		}
+		if (checksetup(line))
+			continue;
 		/*
 		 * Then check if it's an environment variable or
 		 * an option.
@@ -421,17 +434,13 @@
 	prof_len >>= 2;
 	memory_start += prof_len * sizeof(unsigned long);
 #endif
+	memory_start = console_init(memory_start,memory_end);
 	memory_start = bios32_init(memory_start,memory_end);
 	memory_start = kmalloc_init(memory_start,memory_end);
 	memory_start = chr_dev_init(memory_start,memory_end);
 	memory_start = blk_dev_init(memory_start,memory_end);
 	sti();
 	calibrate_delay();
-	if (hlt_works_ok) {
-		printk("Checking 'hlt' ...");
-		__asm__ __volatile__("hlt");
-		printk(" ok\n");
-	}
 #ifdef CONFIG_INET
 	memory_start = net_dev_init(memory_start,memory_end);
 #endif
@@ -476,6 +485,11 @@
 		if (!fpu_error)
 			printk("Ok, fpu using %s error reporting.\n",
 				ignore_irq13?"exception 16":"irq13");
+	}
+	if (hlt_works_ok) {
+		printk("Checking 'hlt' instruction... ");
+		__asm__ __volatile__("hlt ; hlt ; hlt ; hlt");
+		printk(" Ok.\n");
 	}
 #ifndef CONFIG_MATH_EMULATION
 	else {
diff -u --recursive --new-file v1.1.41/linux/ipc/shm.c linux/ipc/shm.c
--- v1.1.41/linux/ipc/shm.c	Tue Jul 26 21:39:47 1994
+++ linux/ipc/shm.c	Tue Aug  9 09:33:00 1994
@@ -389,7 +389,7 @@
 
 /*
  * This is really minimal support to make the shared mem stuff
- * ve known by the general VM manager. It should add the vm_ops
+ * be known by the general VM manager. It should add the vm_ops
  * field so that 'munmap()' and friends work correctly on shared
  * memory areas..
  */
@@ -636,7 +636,7 @@
 
 	id = (code >> SHM_ID_SHIFT) & SHM_ID_MASK;
 	if (id > max_shmid) {
-		printk ("shm_no_page: id=%d too big. proc mem corruptedn", id);
+		printk ("shm_no_page: id=%d too big. proc mem corrupted\n", id);
 		return BAD_PAGE | PAGE_SHARED;
 	}
 	shp = shm_segs[id];
diff -u --recursive --new-file v1.1.41/linux/kernel/bios32.c linux/kernel/bios32.c
--- v1.1.41/linux/kernel/bios32.c	Sun Aug  7 03:30:42 1994
+++ linux/kernel/bios32.c	Tue Aug  9 10:48:41 1994
@@ -1,19 +1,19 @@
 /*
  * bios32.c - BIOS32, PCI BIOS functions.
  *
- * Sponsored by 
+ * Sponsored by
  *	iX Multiuser Multitasking Magazine
  *	Hannover, Germany
  *	hm@ix.de
  *
  * Copyright 1993, 1994 Drew Eckhardt
- *      Visionary Computing 
+ *      Visionary Computing
  *      (Unix and Linux consulting and custom programming)
  *      Drew@Colorado.EDU
  *      +1 (303) 786-7975
  *
- * For more information, please consult 
- * 
+ * For more information, please consult
+ *
  * PCI BIOS Specification Revision
  * PCI Local Bus Specification
  * PCI System Design Guide
@@ -22,44 +22,58 @@
  * M/S HF3-15A
  * 5200 N.E. Elam Young Parkway
  * Hillsboro, Oregon 97124-6497
- * +1 (503) 696-2000 
+ * +1 (503) 696-2000
  * +1 (800) 433-5177
- * 
- * Manuals are $25 each or $50 for all three, plus $7 shipping 
+ *
+ * Manuals are $25 each or $50 for all three, plus $7 shipping
  * within the United States, $35 abroad.
  *
  *
- * CHANGELOG : 
+ * CHANGELOG :
  * Jun 17, 1994 : Modified to accomodate the broken pre-PCI BIOS SPECIFICATION
  *	Revision 2.0 present on <thys@dennis.ee.up.ac.za>'s ASUS mainboard.
  */
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/segment.h>
 #include <linux/bios32.h>
 #include <linux/pci.h>
 
-#define PCIBIOS_PCI_FUNCTION_ID 	0xb1
-#define PCIBIOS_PCI_BIOS_PRESENT 	0x01
-#define PCIBIOS_FIND_PCI_DEVICE		0x02
-#define PCIBIOS_FIND_PCI_CLASS_CODE	0x03
-#define PCIBIOS_GENERATE_SPECIAL_CYCLE	0x06
-#define PCIBIOS_READ_CONFIG_BYTE	0x08		
-#define PCIBIOS_READ_CONFIG_WORD	0x09
-#define PCIBIOS_READ_CONFIG_DWORD	0x0a
-#define PCIBIOS_WRITE_CONFIG_BYTE	0x0b
-#define PCIBIOS_WRITE_CONFIG_WORD	0x0c
-#define PCIBIOS_WRITE_CONFIG_DWORD	0x0d
-
-
-union signature {
-    char chars[4];
-    unsigned long scalar;
-};
+/*
+ * It would seem some PCI bioses are buggy, so we don't actually use these
+ * routines unless we need to..
+ */
+#ifdef CONFIG_SCSI_NCR53C7xx
+ #define CONFIG_PCI
+#else
+ #undef CONFIG_PCI
+#endif
 
+#define PCIBIOS_PCI_FUNCTION_ID 	0xb1XX
+#define PCIBIOS_PCI_BIOS_PRESENT 	0xb101
+#define PCIBIOS_FIND_PCI_DEVICE		0xb102
+#define PCIBIOS_FIND_PCI_CLASS_CODE	0xb103
+#define PCIBIOS_GENERATE_SPECIAL_CYCLE	0xb106
+#define PCIBIOS_READ_CONFIG_BYTE	0xb108
+#define PCIBIOS_READ_CONFIG_WORD	0xb109
+#define PCIBIOS_READ_CONFIG_DWORD	0xb10a
+#define PCIBIOS_WRITE_CONFIG_BYTE	0xb10b
+#define PCIBIOS_WRITE_CONFIG_WORD	0xb10c
+#define PCIBIOS_WRITE_CONFIG_DWORD	0xb10d
+
+/* BIOS32 signature: "_32_" */
+#define BIOS32_SIGNATURE	(('_' << 0) + ('3' << 8) + ('2' << 16) + ('_' << 24))
+
+/* PCI signature: "PCI " */
+#define PCI_SIGNATURE		(('P' << 0) + ('C' << 8) + ('I' << 16) + (' ' << 24))
+
+/* PCI service signature: "$PCI" */
+#define PCI_SERVICE		(('$' << 0) + ('P' << 8) + ('C' << 16) + ('I' << 24))
+
 /*
- * This is the standard structure used to identify the entry point 
- * to the BIOS32 Service Directory, as documented in 
+ * This is the standard structure used to identify the entry point
+ * to the BIOS32 Service Directory, as documented in
  * 	Standard BIOS 32-bit Service Directory Proposal
  * 	Revision 0.4 May 24, 1993
  * 	Phoenix Technologies Ltd.
@@ -67,350 +81,387 @@
  * and the PCI BIOS specfication.
  */
 
-static union signature bios32_signature = {"_32_",};
-
 union bios32 {
-    struct {
-	union signature signature;	/* _32_ */
-	long entry;			/* 32 bit physical address */
-	unsigned char revision;		/* Revision level, 0 */
-	unsigned char length;		/* Length in paragraphs should be 01 */
-	unsigned char checksum;		/* All bytes must add up to zero */
-	unsigned char reserved[5]; 	/* Must be zero */
-    } fields;
-    char chars[16];
+	struct {
+		unsigned long signature;	/* _32_ */
+		unsigned long entry;		/* 32 bit physical address */
+		unsigned char revision;		/* Revision level, 0 */
+		unsigned char length;		/* Length in paragraphs should be 01 */
+		unsigned char checksum;		/* All bytes must add up to zero */
+		unsigned char reserved[5]; 	/* Must be zero */
+	} fields;
+	char chars[16];
 };
 
-/* 
+/*
  * Physical address of the service directory.  I don't know if we're
- * allowed to have more than one of these or not, so just in case 
+ * allowed to have more than one of these or not, so just in case
  * we'll make bios32_init() take a memory start parameter and store
  * the array there.
  */
 
-static long bios32_entry = 0;
-static unsigned char bios32_indirect[6]; 
+static unsigned long bios32_entry = 0;
+static struct {
+	unsigned long address;
+	unsigned short segment;
+} bios32_indirect = { 0, KERNEL_CS };
 
-static long pcibios_init (long, long);
- 
-long bios32_init (long memory_start, long memory_end) {
-    union bios32 *check;
-    unsigned char sum;
-    int i, length;
-
-    /*
-     * Follow the standard procedure for locating the BIOS32 Serivce
-     * directory by scanning the permissable address range from 
-     * 0xe0000 through 0xfffff for a valid BIOS32 structure.
-     */
-
-    for (check = (union bios32 *) 0xe0000; check <= (union bios32 *) 0xffff0; 
-	++check) {
-	if (check->fields.signature.scalar == bios32_signature.scalar) {
-	    for (i = sum = 0, length = check->fields.length * 16;
-		i < check->fields.length * 16; ++i) 
-		sum += check->chars[i];
-	    if (sum != 0)
-		continue;
-	    if (check->fields.revision != 0) {
-		printk ("bios32_init : unsupported revision %d at 0x%x, mail drew@colorado.edu\n",
-		    check->fields.revision, (unsigned) check);
-		continue;
-	    }
-	    printk ("bios32_init : BIOS32 Service Directory structure at 0x%x\n", 
-		(unsigned) check);
-	    if (!bios32_entry) {
-		*((long *) bios32_indirect) = bios32_entry = check->fields.entry;
-		*((short *) (bios32_indirect + 4)) = KERNEL_CS;
-		printk ("bios32_init : BIOS32 Service Directory entry at 0x%x\n", 
-		    (unsigned) bios32_entry);
-	    } else 
-		printk ("bios32_init : multiple entries, mail drew@colorado.edu\n");
-	}
-    }
-    if (bios32_entry) {
-	memory_start = pcibios_init (memory_start, memory_end);
-    }
-    return memory_start;
-}
-
-/* 
- * Returns the entry point for the given service, NULL on error 
+#ifdef CONFIG_PCI
+/*
+ * Returns the entry point for the given service, NULL on error
  */
 
-static long bios32_service (long service) {
-    unsigned char return_code;	/* %al */
-    long address;		/* %ebx */
-    long length;		/* %ecx */
-    long entry;			/* %edx */
-
-    __asm__ ("
-	movl $0, %%ebx
-	lcall (%%edi)
-" 
-	: "=al" (return_code), "=ebx" (address), "=ecx" (length), "=edx" (entry)
-    	: "eax" (service), "D" (bios32_indirect) 
-	: "ebx"
-    );
-
-    switch (return_code) {
-    case 0:	
-	return address + entry;
-    case 0x80:	/* Not present */
-	printk ("bios32_service(%ld) : not present\n", service);
-	return 0;
-    default: /* Shouldn't happen */
-	printk ("bios32_service(%ld) : returned 0x%x, mail drew@colorado.edu\n",
-	    service, (int) return_code );
-	return 0;
-    }
-
+static unsigned long bios32_service(unsigned long service)
+{
+	unsigned char return_code;	/* %al */
+	unsigned long address;		/* %ebx */
+	unsigned long length;		/* %ecx */
+	unsigned long entry;		/* %edx */
+
+	__asm__("lcall (%%edi)"
+		: "=a" (return_code),
+		  "=b" (address),
+		  "=c" (length),
+		  "=d" (entry)
+		: "0" (service),
+		  "1" (0),
+		  "D" (&bios32_indirect));
+
+	switch (return_code) {
+		case 0:
+			return address + entry;
+		case 0x80:	/* Not present */
+			printk("bios32_service(%ld) : not present\n", service);
+			return 0;
+		default: /* Shouldn't happen */
+			printk("bios32_service(%ld) : returned 0x%x, mail drew@colorado.edu\n",
+				service, return_code);
+			return 0;
+	}
 }
 
-static union signature pci_signature = {"PCI ",};
-static union signature pci_service = {"$PCI",};
 static long pcibios_entry = 0;
-static unsigned char pci_indirect[6];
+static struct {
+	unsigned long address;
+	unsigned short segment;
+} pci_indirect = { 0, KERNEL_CS };
 
 void NCR53c810_test(void);
 
-static long pcibios_init (long memory_start, long memory_end) {
-    union signature signature;
-    unsigned char present_status;
-    unsigned char major_revision;
-    unsigned char minor_revision;
-    int pack;
-
-    if ((pcibios_entry = bios32_service (pci_service.scalar))) {
-	*((long *) pci_indirect) = pcibios_entry;
-	*((short *) (pci_indirect + 4)) = KERNEL_CS;
-	__asm__ ("
-	    movw $0xb101, %%eax
-	    lcall (%%edi)
-	    jc 1f
-	    xor %%ah, %%ah
-1:
-	    shl $8, %%eax;
-	    movw %%bx, %%ax;
-" 		
-	    : "=edx" (signature.scalar), "=eax" (pack)
-	    : "D" (pci_indirect) 
-	    : "cx"
-	);
-
-	present_status = (pack >> 16) & 0xff;
-	major_revision = (pack >> 8) & 0xff;
-	minor_revision = pack & 0xff;
-	if (present_status || (signature.scalar != pci_signature.scalar)) {
-	    printk ("pcibios_init : %s : BIOS32 Service Directory says PCI BIOS is present,\n"
-		    "    but PCI_BIOS_PRESENT subfunction fails with present status of 0x%x\n"
-		    "    and signature of 0x%08lx (%c%c%c%c).  mail drew@Colorado.EDU\n", 
-		    (signature.scalar == pci_signature.scalar) ?  "WARNING" : "ERROR",
-		    (int) present_status, signature.scalar , signature.chars[0],
-		    signature.chars[1], signature.chars[2], signature.chars[3]);
-
-	    if (signature.scalar != pci_signature.scalar) 
-		pcibios_entry = 0;
-	} 
-	if (pcibios_entry) {
-	    printk ("pcibios_init : PCI BIOS revision %x.%02x entry at 0x%lx\n",
-		(int) major_revision, (int) minor_revision, pcibios_entry);
+static unsigned long pcibios_init(unsigned long memory_start, unsigned long memory_end)
+{
+	unsigned long signature;
+	unsigned char present_status;
+	unsigned char major_revision;
+	unsigned char minor_revision;
+	int pack;
+
+	if ((pcibios_entry = bios32_service(PCI_SERVICE))) {
+		pci_indirect.address = pcibios_entry;
+
+		__asm__("lcall (%%edi)\n\t"
+			"jc 1f\n\t"
+			"xor %%ah, %%ah\n"
+			"1:\tshl $8, %%eax\n\t"
+			"movw %%bx, %%ax"
+			: "=d" (signature),
+			  "=a" (pack)
+			: "1" (PCIBIOS_PCI_BIOS_PRESENT),
+			  "D" (&pci_indirect)
+			: "bx", "cx");
+
+		present_status = (pack >> 16) & 0xff;
+		major_revision = (pack >> 8) & 0xff;
+		minor_revision = pack & 0xff;
+		if (present_status || (signature != PCI_SIGNATURE)) {
+			printk ("pcibios_init : %s : BIOS32 Service Directory says PCI BIOS is present,\n"
+				"	but PCI_BIOS_PRESENT subfunction fails with present status of 0x%x\n"
+				"	and signature of 0x%08lx (%c%c%c%c).  mail drew@Colorado.EDU\n",
+				(signature == PCI_SIGNATURE) ?  "WARNING" : "ERROR",
+				present_status, signature,
+				(char) (signature >>  0), (char) (signature >>  8),
+				(char) (signature >> 16), (char) (signature >> 24));
+
+			if (signature != PCI_SIGNATURE)
+				pcibios_entry = 0;
+		}
+		if (pcibios_entry) {
+			printk ("pcibios_init : PCI BIOS revision %x.%02x entry at 0x%lx\n",
+				major_revision, minor_revision, pcibios_entry);
+		}
 	}
-    }
 
 #if 0
-    NCR53c810_test(); 
+	NCR53c810_test();
 #endif
-    return memory_start;
+	return memory_start;
 }
 
-int pcibios_present (void) {
-    return pcibios_entry ? 1 : 0;
-}
-
-int pcibios_find_class_code (unsigned long class_code, unsigned short index, 
-	unsigned char *bus, unsigned char *device_fn) {
-	unsigned short bx;
-	unsigned short ret;
-	__asm__ ("
-	    movw $0xb103, %%ax
-	    lcall (%%edi)
-	    jc 1f
-	    xor %%ah, %%ah
-1:
-" 
-	    : "=bx" (bx), "=ax" (ret)
-	    : "cx" (class_code), "S" ((int) index), "D" (pci_indirect)
-	);
+int pcibios_present(void)
+{
+	return pcibios_entry ? 1 : 0;
+}
+
+int pcibios_find_class_code (unsigned long class_code, unsigned short index,
+	unsigned char *bus, unsigned char *device_fn)
+{
+	unsigned long bx;
+	unsigned long ret;
+
+	__asm__ ("lcall (%%edi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=b" (bx),
+		  "=a" (ret)
+		: "1" (PCIBIOS_FIND_PCI_CLASS_CODE),
+		  "c" (class_code),
+		  "S" ((int) index),
+		  "D" (&pci_indirect));
 	*bus = (bx >> 8) & 0xff;
 	*device_fn = bx & 0xff;
 	return (int) (ret & 0xff00) >> 8;
 }
 
 
-int pcibios_find_device (unsigned short vendor, unsigned short device_id, 
-	unsigned short index, unsigned char *bus, unsigned char *device_fn) {
+int pcibios_find_device (unsigned short vendor, unsigned short device_id,
+	unsigned short index, unsigned char *bus, unsigned char *device_fn)
+{
 	unsigned short bx;
 	unsigned short ret;
-	__asm__ ("
-	    movw $0xb102, %%ax
-	    lcall (%%edi)
-	    jc 1f
-	    xor %%ah, %%ah
-1:
-" 
-	    : "=bx" (bx), "=ax" (ret)
-	    : "cx" (device_id), "dx" (vendor), "S" ((int) index), "D" (pci_indirect)
-	);
+
+	__asm__("lcall (%%edi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=b" (bx),
+		  "=a" (ret)
+		: "1" (PCIBIOS_FIND_PCI_DEVICE),
+		  "c" (device_id),
+		  "d" (vendor),
+		  "S" ((int) index),
+		  "D" (&pci_indirect));
 	*bus = (bx >> 8) & 0xff;
 	*device_fn = bx & 0xff;
 	return (int) (ret & 0xff00) >> 8;
 }
 
-int pcibios_read_config_byte (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned char *value) {
-    unsigned long ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb108, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=cl" (*value), "=eax" (ret)  
-    	: "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
+int pcibios_read_config_byte(unsigned char bus,
+	unsigned char device_fn, unsigned char where, unsigned char *value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=cb" (*value),
+		  "=a" (ret)
+		: "1" (PCIBIOS_READ_CONFIG_BYTE),
+		  "b" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
 }
 
 int pcibios_read_config_word (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned short *value) {
-    unsigned short ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb109, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=cx" (*value), "=ax" (ret)  
-    	: "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
+	unsigned char device_fn, unsigned char where, unsigned short *value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=c" (*value),
+		  "=a" (ret)
+		: "1" (PCIBIOS_READ_CONFIG_WORD),
+		  "bx" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
 }
 
 int pcibios_read_config_dword (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned long *value) {
-    unsigned short ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb10a, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=ecx" (*value), "=ax" (ret)  
-    	: "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
+	unsigned char device_fn, unsigned char where, unsigned long *value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=ecx" (*value),
+		  "=ax" (ret)
+		: "1" (PCIBIOS_READ_CONFIG_DWORD),
+		  "bx" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
 }
 
 int pcibios_write_config_byte (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned char value) {
-    unsigned short ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb108, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=ax" (ret)  
-    	: "cl" (value), "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
+	unsigned char device_fn, unsigned char where, unsigned char value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=ax" (ret)
+		: "0" (PCIBIOS_WRITE_CONFIG_BYTE),
+		  "c" (value),
+		  "b" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
 }
 
 int pcibios_write_config_word (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned short value) {
-    unsigned short ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb109, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=ax" (ret)  
-    	: "cx" (value), "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
+	unsigned char device_fn, unsigned char where, unsigned short value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=ax" (ret)
+		: "0" (PCIBIOS_WRITE_CONFIG_WORD),
+		  "cx" (value),
+		  "bx" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
 }
 
 int pcibios_write_config_dword (unsigned char bus,
-    unsigned char device_fn, unsigned char where, unsigned long value) {
-    unsigned short ret;
-    unsigned short bx = (bus << 8) | device_fn;
-    __asm__ ("
-	movw $0xb10a, %%ax
-	lcall (%%esi)
-	jc 1f
-	xor %%ah, %%ah
-1:
-"  
-    	: "=ax" (ret)  
-    	: "ecx" (value), "bx" (bx), "D" ((long) where), "S" (pci_indirect)
-    );
-    return (int) (ret & 0xff00) >> 8;
-}
-
-void NCR53c810_test(void) {
-    unsigned char bus, device_fn;
-    unsigned short index;
-    int ret;
-    unsigned char row, col;
-    unsigned long val;
-
-    for (index = 0; index < 4; ++index) {
-	ret = pcibios_find_device ((unsigned short) PCI_VENDOR_ID_NCR, (unsigned short)
-		PCI_DEVICE_ID_NCR_53C810, index, &bus, &device_fn);
-	if (ret) 
-	    break;
-	printk ("ncr53c810 : at PCI bus %d, device %d, function %d.",
-	    (int) bus, (int) ((device_fn & 0xf8) >> 3), (int) (device_fn & 7));
-	for (row = 0; row < 0x3c; row += 0x10) {
-	    printk ("\n    reg 0x%02x    ", row);
-	    for (col = 0; col < 0x10; col += 4) {
-		if (!(ret = pcibios_read_config_dword (bus, device_fn, row+col, &val))) 
-		    printk ("0x%08lx      ", val);
-		else
-		    printk ("error 0x%02x ", ret);
-	    }
+	unsigned char device_fn, unsigned char where, unsigned long value)
+{
+	unsigned long ret;
+	unsigned long bx = (bus << 8) | device_fn;
+
+	__asm__("lcall (%%esi)\n\t"
+		"jc 1f\n\t"
+		"xor %%ah, %%ah\n"
+		"1:"
+		: "=ax" (ret)
+		: "0" (PCIBIOS_WRITE_CONFIG_DWORD),
+		  "c" (value),
+		  "b" (bx),
+		  "D" ((long) where),
+		  "S" (&pci_indirect));
+	return (int) (ret & 0xff00) >> 8;
+}
+
+void NCR53c810_test(void)
+{
+	unsigned char bus, device_fn;
+	unsigned short index;
+	int ret;
+	unsigned char row, col;
+	unsigned long val;
+
+	for (index = 0; index < 4; ++index) {
+		ret = pcibios_find_device (
+			(unsigned short) PCI_VENDOR_ID_NCR,
+			(unsigned short) PCI_DEVICE_ID_NCR_53C810,
+			index, &bus, &device_fn);
+		if (ret)
+			break;
+		printk ("ncr53c810 : at PCI bus %d, device %d, function %d.",
+			bus, ((device_fn & 0xf8) >> 3), (device_fn & 7));
+		for (row = 0; row < 0x3c; row += 0x10) {
+			printk ("\n	reg 0x%02x	", row);
+			for (col = 0; col < 0x10; col += 4) {
+			if (!(ret = pcibios_read_config_dword (bus, device_fn, row+col, &val)))
+				printk ("0x%08lx	  ", val);
+			else
+				printk ("error 0x%02x ", ret);
+			}
+		}
+		printk ("\n");
+	}
+}
+
+char *pcibios_strerror (int error)
+{
+	static char buf[80];
+
+	switch (error) {
+		case PCIBIOS_SUCCESFUL:
+			return "SUCCESFUL";
+
+		case PCIBIOS_FUNC_NOT_SUPPORTED:
+			return "FUNC_NOT_SUPPORTED";
+
+		case PCIBIOS_BAD_VENDOR_ID:
+			return "SUCCESSFUL";
+
+		case PCIBIOS_DEVICE_NOT_FOUND:
+			return "DEVICE_NOT_FOUND";
+
+		case PCIBIOS_BAD_REGISTER_NUMBER:
+			return "BAD_REGISTER_NUMBER";
+
+		default:
+			sprintf (buf, "UNKNOWN RETURN 0x%x", error);
+			return buf;
 	}
-	printk ("\n");
-    }
 }
 
-char *pcibios_strerror (int error) {
-    static char buf[80];
-    switch (error) {
-    case PCIBIOS_SUCCESFUL:
-        return "SUCCESFUL";
-    case PCIBIOS_FUNC_NOT_SUPPORTED:
-        return "FUNC_NOT_SUPPORTED";
-    case PCIBIOS_BAD_VENDOR_ID:
-        return "BAD_VENDOR_ID";
-    case PCIBIOS_DEVICE_NOT_FOUND:
-        return "DEVICE_NOT_FOUND";
-    case PCIBIOS_BAD_REGISTER_NUMBER:
-        return "BAD_REGISTER_NUMBER";
-    default:
-	sprintf (buf, "UNKNOWN RETURN 0x%x", error);
-	return buf;
-    }
+#endif
+
+unsigned long bios32_init(unsigned long memory_start, unsigned long memory_end)
+{
+	union bios32 *check;
+	unsigned char sum;
+	int i, length;
+
+	/*
+	 * Follow the standard procedure for locating the BIOS32 Serivce
+	 * directory by scanning the permissable address range from
+	 * 0xe0000 through 0xfffff for a valid BIOS32 structure.
+	 *
+	 * The PCI BIOS doesn't seem to work too well on many machines,
+	 * so we disable this unless it's really needed (NCR SCSI driver)
+	 */
+
+	for (check = (union bios32 *) 0xe0000; check <= (union bios32 *) 0xffff0; ++check) {
+		if (check->fields.signature != BIOS32_SIGNATURE)
+			continue;
+		length = check->fields.length * 16;
+		if (!length)
+			continue;
+		sum = 0;
+		for (i = 0; i < length ; ++i)
+			sum += check->chars[i];
+		if (sum != 0)
+			continue;
+		if (check->fields.revision != 0) {
+			printk("bios32_init : unsupported revision %d at 0x%p, mail drew@colorado.edu\n",
+				check->fields.revision, check);
+			continue;
+		}
+		printk ("bios32_init : BIOS32 Service Directory structure at 0x%p\n", check);
+		if (!bios32_entry) {
+			bios32_indirect.address = bios32_entry = check->fields.entry;
+			printk ("bios32_init : BIOS32 Service Directory entry at 0x%lx\n", bios32_entry);
+		} else {
+			printk ("bios32_init : multiple entries, mail drew@colorado.edu\n");
+			return memory_start;
+		}
+	}
+#ifdef CONFIG_PCI
+	if (bios32_entry) {
+		memory_start = pcibios_init (memory_start, memory_end);
+	}
+#endif
+	return memory_start;
 }
diff -u --recursive --new-file v1.1.41/linux/kernel/exec_domain.c linux/kernel/exec_domain.c
--- v1.1.41/linux/kernel/exec_domain.c	Tue Jun 21 14:16:26 1994
+++ linux/kernel/exec_domain.c	Tue Aug  9 09:34:44 1994
@@ -17,7 +17,7 @@
 	"Linux",	/* name */
 	no_lcall7,	/* lcall7 causes a seg fault. */
 	0, 0xff,	/* All personalities. */
-	ident_map,	/* Identiy map signals. */
+	ident_map,	/* Identify map signals. */
 	ident_map,	/*  - both ways. */
 	NULL,		/* No usage counter. */
 	NULL		/* Nothing after this in the list. */
diff -u --recursive --new-file v1.1.41/linux/kernel/exit.c linux/kernel/exit.c
--- v1.1.41/linux/kernel/exit.c	Tue Jul 26 21:39:47 1994
+++ linux/kernel/exit.c	Tue Aug  9 09:34:45 1994
@@ -121,7 +121,7 @@
 }
 	
 /*
- * This routine scans the pid tree and make sure the rep invarient still
+ * This routine scans the pid tree and makes sure the rep invariant still
  * holds.  Used for debugging only, since it's very slow....
  *
  * It looks a lot scarier than it really is.... we're doing nothing more
@@ -198,7 +198,7 @@
 
 /*
  * This checks not only the pgrp, but falls back on the pid if no
- * satisfactory prgp is found. I dunno - gdb doesn't work correctly
+ * satisfactory pgrp is found. I dunno - gdb doesn't work correctly
  * without this...
  */
 int session_of_pgrp(int pgrp)
diff -u --recursive --new-file v1.1.41/linux/kernel/irq.c linux/kernel/irq.c
--- v1.1.41/linux/kernel/irq.c	Tue Jun 21 14:16:26 1994
+++ linux/kernel/irq.c	Tue Aug  9 09:34:45 1994
@@ -295,7 +295,7 @@
 /*
  * Note that on a 486, we don't want to do a SIGFPE on a irq13
  * as the irq is unreliable, and exception 16 works correctly
- * (ie as explained in the intel litterature). On a 386, you
+ * (ie as explained in the intel literature). On a 386, you
  * can't use exception 16 due to bad IBM design, so we have to
  * rely on the less exact irq13.
  *
@@ -331,7 +331,7 @@
 	if (request_irq(13,math_error_irq))
 		printk("Unable to get IRQ13 for math-error handler\n");
 
-	/* intialize the bottom half routines. */
+	/* initialize the bottom half routines. */
 	for (i = 0; i < 32; i++) {
 		bh_base[i].routine = NULL;
 		bh_base[i].data = NULL;
diff -u --recursive --new-file v1.1.41/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- v1.1.41/linux/kernel/ksyms.c	Sun Aug  7 03:30:42 1994
+++ linux/kernel/ksyms.c	Tue Aug  9 09:35:37 1994
@@ -51,7 +51,6 @@
 
 #ifdef CONFIG_INET
 extern void snarf_region(unsigned int, unsigned int);
-extern void dev_tint(struct device *);
 extern struct device *irq2dev_map[];
 #endif
 
@@ -188,7 +187,7 @@
 	 */
 	{ NULL, NULL } /* mark end of table */
 	},
-	{ NULL, NULL } /* no module refs */
+	{ { NULL, NULL } /* no module refs */ }
 };
 
 /*
diff -u --recursive --new-file v1.1.41/linux/kernel/module.c linux/kernel/module.c
--- v1.1.41/linux/kernel/module.c	Tue Jun 28 22:30:28 1994
+++ linux/kernel/module.c	Tue Aug  9 09:34:45 1994
@@ -11,7 +11,7 @@
  * This source is covered by the GNU GPL, the same as all kernel sources.
  *
  * Features:
- *	- Supports stacked modules (removeable only of there are no dependants).
+ *	- Supports stacked modules (removable only of there are no dependents).
  *	- Supports table of symbols defined by the modules.
  *	- Supports /proc/ksyms, showing value, name and owner of all
  *	  the symbols defined by all modules (in stack order).
@@ -292,7 +292,7 @@
  * (as that format is quite handy for the kernel...)
  *
  * For every module, the first (pseudo)symbol copied is the module name
- * and the adress of the module struct.
+ * and the address of the module struct.
  * This lets "insmod" keep track of references, and build the array of
  * struct module_refs in the symbol table.
  * The format of the module name is "#module", so that "insmod" can easily
diff -u --recursive --new-file v1.1.41/linux/kernel/panic.c linux/kernel/panic.c
--- v1.1.41/linux/kernel/panic.c	Sun Aug  7 03:30:42 1994
+++ linux/kernel/panic.c	Tue Aug  9 09:34:45 1994
@@ -5,7 +5,7 @@
  */
 
 /*
- * This function is used through-out the kernel (includeinh mm and fs)
+ * This function is used through-out the kernel (including mm and fs)
  * to indicate a major problem.
  */
 #include <stdarg.h>
diff -u --recursive --new-file v1.1.41/linux/kernel/ptrace.c linux/kernel/ptrace.c
--- v1.1.41/linux/kernel/ptrace.c	Sat Aug  6 21:32:07 1994
+++ linux/kernel/ptrace.c	Tue Aug  9 09:34:45 1994
@@ -45,9 +45,9 @@
 }
 
 /*
- * this routine will get a word off of the processes priviledged stack. 
+ * this routine will get a word off of the processes privileged stack. 
  * the offset is how far from the base addr as stored in the TSS.  
- * this routine assumes that all the priviledged stacks are in our
+ * this routine assumes that all the privileged stacks are in our
  * data space.
  */   
 static inline int get_stack_long(struct task_struct *task, int offset)
@@ -60,9 +60,9 @@
 }
 
 /*
- * this routine will put a word on the processes priviledged stack. 
+ * this routine will put a word on the processes privileged stack. 
  * the offset is how far from the base addr as stored in the TSS.  
- * this routine assumes that all the priviledged stacks are in our
+ * this routine assumes that all the privileged stacks are in our
  * data space.
  */
 static inline int put_stack_long(struct task_struct *task, int offset,
@@ -280,7 +280,7 @@
 		/* are we already being traced? */
 		if (current->flags & PF_PTRACED)
 			return -EPERM;
-		/* set the ptrace bit in the proccess flags. */
+		/* set the ptrace bit in the process flags. */
 		current->flags |= PF_PTRACED;
 		return 0;
 	}
@@ -319,7 +319,7 @@
 		return -ESRCH;
 
 	switch (request) {
-	/* when I and D space are seperate, these will need to be fixed. */
+	/* when I and D space are separate, these will need to be fixed. */
 		case PTRACE_PEEKTEXT: /* read word at location addr. */ 
 		case PTRACE_PEEKDATA: {
 			unsigned long tmp;
@@ -366,7 +366,7 @@
 			return 0;
 		}
 
-      /* when I and D space are seperate, this will have to be fixed. */
+      /* when I and D space are separate, this will have to be fixed. */
 		case PTRACE_POKETEXT: /* write the word at location addr. */
 		case PTRACE_POKEDATA:
 			return write_long(child,addr,data);
@@ -376,7 +376,7 @@
 			    addr > sizeof(struct user) - 3)
 				return -EIO;
 
-			addr = addr >> 2; /* temproary hack. */
+			addr = addr >> 2; /* temporary hack. */
 
 			if (addr == ORIG_EAX)
 				return -EIO;
diff -u --recursive --new-file v1.1.41/linux/kernel/sched.c linux/kernel/sched.c
--- v1.1.41/linux/kernel/sched.c	Wed Aug  3 09:32:33 1994
+++ linux/kernel/sched.c	Tue Aug  9 09:34:45 1994
@@ -161,7 +161,7 @@
  * information in task[0] is never used.
  *
  * The "confuse_gcc" goto is used only to get better assembly code..
- * Djikstra probably hates me.
+ * Dijkstra probably hates me.
  */
 asmlinkage void schedule(void)
 {
diff -u --recursive --new-file v1.1.41/linux/kernel/splx.c linux/kernel/splx.c
--- v1.1.41/linux/kernel/splx.c	Wed Aug  3 09:32:33 1994
+++ linux/kernel/splx.c	Tue Aug  9 09:34:45 1994
@@ -2,7 +2,7 @@
  * splx.c - SYSV DDI/DKI ipl manipulation functions
  *
  * Internally, many unices use a range of different interrupt 
- * priveledge levels, ie from "allow all interrupts" (7) to 
+ * privilege levels, ie from "allow all interrupts" (7) to 
  * "allow no interrupts." (0) under SYSV.
  *
  * This a simple splx() function behaves as the SYSV DDI/DKI function does,
@@ -10,7 +10,7 @@
  * level 7 (sti), this implementation only implements those levels.
  * 
  * Also, unlike the current Linux routines, splx() also returns the 
- * old priveledge level so that it can be restored.
+ * old privilege level so that it can be restored.
  */
 
 #include <asm/system.h>
diff -u --recursive --new-file v1.1.41/linux/kernel/sys.c linux/kernel/sys.c
--- v1.1.41/linux/kernel/sys.c	Wed Aug  3 09:32:33 1994
+++ linux/kernel/sys.c	Tue Aug  9 09:34:45 1994
@@ -22,7 +22,7 @@
 #include <asm/io.h>
 
 /*
- * this indicates wether you can reboot with ctrl-alt-del: the default is yes
+ * this indicates whether you can reboot with ctrl-alt-del: the default is yes
  */
 static int C_A_D = 1;
 
@@ -181,7 +181,7 @@
 /*
  * This function gets called by ctrl-alt-del - ie the keyboard interrupt.
  * As it's called within an interrupt, it may NOT sync: the only choice
- * is wether to reboot at once, or just ignore the ctrl-alt-del.
+ * is whether to reboot at once, or just ignore the ctrl-alt-del.
  */
 void ctrl_alt_del(void)
 {
@@ -237,7 +237,7 @@
 }
 
 /*
- * setgid() is implemeneted like SysV w/ SAVED_IDS 
+ * setgid() is implemented like SysV w/ SAVED_IDS 
  */
 asmlinkage int sys_setgid(gid_t gid)
 {
@@ -325,13 +325,13 @@
 }
 
 /*
- * setuid() is implemeneted like SysV w/ SAVED_IDS 
+ * setuid() is implemented like SysV w/ SAVED_IDS 
  * 
  * Note that SAVED_ID's is deficient in that a setuid root program
  * like sendmail, for example, cannot set its uid to be a normal 
  * user and then switch back, because if you're root, setuid() sets
  * the saved uid too.  If you don't like this, blame the bright people
- * in the POSIX commmittee and/or USG.  Note that the BSD-style setreuid()
+ * in the POSIX committee and/or USG.  Note that the BSD-style setreuid()
  * will allow a root program to temporarily drop privileges and be able to
  * regain them by swapping the real and effective uid.  
  */
@@ -681,7 +681,7 @@
 }
 
 /*
- * It would make sense to put struct rusuage in the task_struct,
+ * It would make sense to put struct rusage in the task_struct,
  * except that would make the task_struct be *really big*.  After
  * task_struct gets moved into malloc'ed memory, it would
  * make sense to do this.  It will make moving the rest of the information
diff -u --recursive --new-file v1.1.41/linux/kernel/sys_call.S linux/kernel/sys_call.S
--- v1.1.41/linux/kernel/sys_call.S	Fri Jul 22 16:41:03 1994
+++ linux/kernel/sys_call.S	Tue Aug  9 09:09:23 1994
@@ -205,10 +205,10 @@
 ret_from_sys_call:
 	cmpl $0,_intr_count
 	jne 2f
-	movl _bh_mask,%eax
+9:	movl _bh_mask,%eax
 	andl _bh_active,%eax
 	jne handle_bottom_half
-9:	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
+	movl EFLAGS(%esp),%eax		# check VM86 flag: CS/SS are
 	testl $(VM_MASK),%eax		# different then
 	jne 1f
 	cmpw $(KERNEL_CS),CS(%esp)	# was old code segment supervisor ?
diff -u --recursive --new-file v1.1.41/linux/kernel/time.c linux/kernel/time.c
--- v1.1.41/linux/kernel/time.c	Wed Aug  3 09:32:34 1994
+++ linux/kernel/time.c	Tue Aug  9 09:35:37 1994
@@ -32,7 +32,6 @@
 #define RTC_ALWAYS_BCD 1
 
 #include <linux/timex.h>
-extern struct timeval xtime;
 
 /* converts date to days since 1/1/1970
  * assumes year,mon,day in normal date format
diff -u --recursive --new-file v1.1.41/linux/kernel/traps.c linux/kernel/traps.c
--- v1.1.41/linux/kernel/traps.c	Tue Jun 21 14:16:26 1994
+++ linux/kernel/traps.c	Tue Aug  9 09:34:45 1994
@@ -188,7 +188,7 @@
  * which were in force when the exception condition arose.
  *
  * Note that we play around with the 'TS' bit to hopefully get
- * the correct behaviour even in the presense of the asynchronous
+ * the correct behaviour even in the presence of the asynchronous
  * IRQ13 behaviour
  */
 void math_error(void)
diff -u --recursive --new-file v1.1.41/linux/mm/kmalloc.c linux/mm/kmalloc.c
--- v1.1.41/linux/mm/kmalloc.c	Tue Apr  5 14:52:20 1994
+++ linux/mm/kmalloc.c	Tue Aug  9 09:34:45 1994
@@ -255,7 +255,7 @@
     printk ("%d blocks per page\n",page->nfree);
 #endif
     /* Now we're going to muck with the "global" freelist for this size:
-       this should be uniterruptible */
+       this should be uninterruptible */
     cli ();
     /* 
      * sizes[order].firstfree used to be NULL, otherwise we wouldn't be
diff -u --recursive --new-file v1.1.41/linux/mm/mmap.c linux/mm/mmap.c
--- v1.1.41/linux/mm/mmap.c	Wed Aug  3 09:32:34 1994
+++ linux/mm/mmap.c	Tue Aug  9 09:34:45 1994
@@ -430,7 +430,7 @@
 
 /*
  * Map memory not associated with any file into a process
- * address space.  Adjecent memory is merged.
+ * address space.  Adjacent memory is merged.
  */
 static int anon_map(struct inode *ino, struct file * file, struct vm_area_struct * vma)
 {
diff -u --recursive --new-file v1.1.41/linux/mm/swap.c linux/mm/swap.c
--- v1.1.41/linux/mm/swap.c	Tue Aug  2 11:27:48 1994
+++ linux/mm/swap.c	Tue Aug  9 10:49:50 1994
@@ -102,11 +102,6 @@
 	swap_cache = (unsigned long *) mem_start;
 	swap_cache_size = mem_end >> PAGE_SHIFT;
 	memset(swap_cache, 0, swap_cache_size * sizeof (unsigned long));
-#ifdef SWAP_CACHE_INFO
-	printk("%ld bytes for swap cache allocated\n",
-	       swap_cache_size * sizeof(unsigned long));
-#endif	
-	
 	return (unsigned long) (swap_cache + swap_cache_size);
 }
 
@@ -153,8 +148,8 @@
 				It sounds like ll_rw_swap_file defined
 				it operation size (sector size) based on
 				PAGE_SIZE and the number of block to read.
-				So using bmap ou smap should work even if
-				smap will requiered more blocks.
+				So using bmap or smap should work even if
+				smap will require more blocks.
 			*/
 			int j;
 			unsigned int block = offset << 3;
@@ -355,7 +350,7 @@
  */
 
 /*
- * These are the miminum and maximum number of pages to swap from one process,
+ * These are the minimum and maximum number of pages to swap from one process,
  * before proceeding to the next:
  */
 #define SWAP_MIN	4
@@ -575,7 +570,7 @@
 			}
 			return;
 		}
-		printk("Trying to free free memory (%08lx): memory probabably corrupted\n",addr);
+		printk("Trying to free free memory (%08lx): memory probably corrupted\n",addr);
 		printk("PC = %08lx\n",*(((unsigned long *)&addr)-1));
 		return;
 	}
diff -u --recursive --new-file v1.1.41/linux/net/inet/ipx.c linux/net/inet/ipx.c
--- v1.1.41/linux/net/inet/ipx.c	Wed Aug  3 09:32:35 1994
+++ linux/net/inet/ipx.c	Tue Aug  9 09:35:38 1994
@@ -465,7 +465,7 @@
  
 static int ipx_fcntl(struct socket *sock, unsigned int cmd, unsigned long arg)
 {
-	ipx_socket *sk=(ipx_socket *)sock->data;
+	/* ipx_socket *sk=(ipx_socket *)sock->data; */
 	switch(cmd)
 	{
 		default:
diff -u --recursive --new-file v1.1.41/linux/net/inet/tcp.c linux/net/inet/tcp.c
--- v1.1.41/linux/net/inet/tcp.c	Sat Aug  6 21:32:07 1994
+++ linux/net/inet/tcp.c	Tue Aug  9 09:32:59 1994
@@ -128,7 +128,7 @@
  *				shutdown.  There may still be data in our
  *				buffer that we have to finish sending
  *		
- *	TCP_CLOSED		socket is finished
+ *	TCP_CLOSE		socket is finished
  */
 #include <linux/types.h>
 #include <linux/sched.h>
@@ -798,10 +798,11 @@
 		if (sk->send_head == NULL && skb_peek(&sk->write_queue) == NULL
 				  && sk->timeout == TIME_WRITE) 
 		{
-			if(sk->keepopen)
+			if(sk->keepopen) {
 				reset_timer(sk,TIME_KEEPOPEN,TCP_TIMEOUT_LEN);
-			else
+			} else {
 				delete_timer(sk);
+			}
 		}
   	}
   	t1->ack_seq = ntohl(ack);
@@ -1672,8 +1673,8 @@
 	tcp_send_check(t1, sk->saddr, sk->daddr, sizeof(*t1), sk);
 
 	/*
-	 * Can't just queue this up.
-	 * It should go at the end of the write queue.
+	 * If there is data in the write queue, the fin must be appended to
+	 * the write queue.
  	 */
  	
  	if (skb_peek(&sk->write_queue) != NULL) 
@@ -2514,6 +2515,12 @@
 	{
 		if(sk->debug)
 			printk("Ack ignored %lu %lu\n",ack,sk->sent_seq);
+		/*
+		 * What is all this crap? the ack sequence number is bad or
+		 * old, we should return 0 to ignore the packet. XXX
+		 */
+		return(0);
+#ifdef NOTDEF
 		if (after(ack, sk->sent_seq) ||
 		   (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT)) 
 		{
@@ -2524,6 +2531,7 @@
 			reset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
 		}
 		return(1);
+#endif
 	}
 
 	if (len != th->doff*4) 
@@ -2786,6 +2794,15 @@
 	}
 
 	/*
+	 * XXX someone ought to look at this too.. at the moment, if skb_peek()
+	 * returns non-NULL, we complete ignore the timer stuff in the else
+	 * clause.  We ought to organize the code so that else clause can
+	 * (should) be executed regardless, possibly moving the PROBE timer
+	 * reset over.  The skb_peek() thing should only move stuff to the
+	 * write queue, NOT also manage the timer functions.
+	 */
+
+	/*
 	 * Maybe we can take some stuff off of the write queue,
 	 * and put it onto the xmit queue.
 	 */
@@ -2810,15 +2827,57 @@
 	}
 	else
 	{
+		/*
+		 * from TIME_WAIT we stay in TIME_WAIT as long as we rx packets
+		 * from TCP_CLOSE we don't do anything
+		 *
+		 * from anything else, if there is write data (or fin) pending,
+		 * we use a TIME_WRITE timeout, else if keepalive we reset to
+		 * a KEEPALIVE timeout, else we delete the timer.
+		 *
+		 * We do not set flag for nominal write data, otherwise we may
+		 * force a state where we start to write itsy bitsy tidbits
+		 * of data.
+		 */
+
+		switch(sk->state) {
+		case TCP_TIME_WAIT:
+			/*
+			 * keep us in TIME_WAIT until we stop getting packets,
+			 * reset the timeout.
+			 */
+			reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
+			break;
+		case TCP_CLOSE:
+			/*
+			 * don't touch the timer.
+			 */
+			break;
+		default:
+			/*
+			 * must check send_head, write_queue, and ack_backlog
+			 * to determine which timeout to use.
+			 */
+			if (sk->send_head || skb_peek(&sk->write_queue) != NULL || sk->ack_backlog) {
+				reset_timer(sk, TIME_WRITE, sk->rto);
+			} else if (sk->keepopen) {
+				reset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+			} else {
+				delete_timer(sk);
+			}
+			break;
+		}
+#ifdef NOTDEF
 		if (sk->send_head == NULL && sk->ack_backlog == 0 &&
 		sk->state != TCP_TIME_WAIT && !sk->keepopen) 
 		{
 			if (!sk->dead)
 				sk->write_space(sk);
-			if (sk->keepopen)
+			if (sk->keepopen) {
 				reset_timer(sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
-			else
+			} else {
 				delete_timer(sk);
+			}
 		}
 		else
 		{
@@ -2831,6 +2890,7 @@
 				reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
 			}	
 		}
+#endif
 	}
 
 	if (sk->packets_out == 0 && sk->partial != NULL &&
@@ -3302,7 +3362,7 @@
  *  This deals with incoming fins. 'Linus at 9 O'clock' 8-) 
  *
  *  If we are ESTABLISHED, a received fin moves us to CLOSE-WAIT
- *  (and thence onto LAST-ACK and finally, CLOSED, we never enter
+ *  (and thence onto LAST-ACK and finally, CLOSE, we never enter
  *  TIME-WAIT)
  *
  *  If we are in FINWAIT-1, a received FIN indicates simultanious
@@ -3362,6 +3422,7 @@
 			 * XXX timeout not set properly
 			 */
 
+			tcp_statistics.TcpCurrEstab--;
 			reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
 			/*sk->fin_seq = th->seq+1;*/
 			sk->state = TCP_CLOSING;
diff -u --recursive --new-file v1.1.41/linux/net/inet/timer.c linux/net/inet/timer.c
--- v1.1.41/linux/net/inet/timer.c	Tue May 24 00:35:05 1994
+++ linux/net/inet/timer.c	Tue Aug  9 09:32:58 1994
@@ -86,8 +86,11 @@
 {
 	struct sock *sk = (struct sock*)data;
 	int why = sk->timeout;
-	/* timeout is overwritten by 'delete_timer' and 'reset_timer' */
 
+	/* 
+	 * only process if socket is not in use
+	 */
+
 	cli();
 	if (sk->inuse || in_bh) 
 	{
@@ -100,6 +103,13 @@
 	sk->inuse = 1;
 	sti();
 
+#ifdef NOTDEF
+	/* 
+	 * what the hell is this doing here?  this belongs in tcp.c.
+	 * I believe that this code is the cause of a lot of timer
+	 * screwups, especially during close (like FIN_WAIT1 states
+	 * with a KEEPOPEN timeout rather then a WRITE timeout).
+	 */
 	if (skb_peek(&sk->write_queue) && 
 	      before(sk->window_seq, sk->write_queue.next->h.seq) &&
 	      sk->send_head == NULL &&
@@ -108,6 +118,7 @@
 		reset_timer(sk, TIME_PROBE0, sk->rto);
 	else if (sk->keepopen)
 		reset_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+#endif
 
 	/* Always see if we need to send an ack. */
 
@@ -216,7 +227,13 @@
 			break;
 		}
 		case TIME_KEEPOPEN:
-		/* Send something to keep the connection open. */
+			/* 
+			 * this reset_timer() call is a hack, this is not
+			 * how KEEPOPEN is supposed to work.
+			 */
+			reset_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+
+			/* Send something to keep the connection open. */
 			if (sk->prot->write_wakeup)
 				  sk->prot->write_wakeup (sk);
 			sk->retransmits++;
diff -u --recursive --new-file v1.1.41/linux/net/protocols.c linux/net/protocols.c
--- v1.1.41/linux/net/protocols.c	Tue May 24 00:35:06 1994
+++ linux/net/protocols.c	Tue Aug  9 09:35:23 1994
@@ -1,5 +1,5 @@
 /*
- *	Protocol intialiser table. Here seperately for convenience
+ *	Protocol initializer table. Here separately for convenience
  *
  */
  
diff -u --recursive --new-file v1.1.41/linux/net/socket.c linux/net/socket.c
--- v1.1.41/linux/net/socket.c	Tue Jun 21 14:16:32 1994
+++ linux/net/socket.c	Tue Aug  9 09:35:23 1994
@@ -363,7 +363,7 @@
 
 /*
  *	Read data from a socket. ubuf is a user mode pointer. We make sure the user
- *	area ubuf...ubuf+size-1 is writeable before asking the protocol.
+ *	area ubuf...ubuf+size-1 is writable before asking the protocol.
  */
 
 static int sock_read(struct inode *inode, struct file *file, char *ubuf, int size)
@@ -934,7 +934,7 @@
 
 /*
  *	Send a datagram to a given address. We move the address into kernel
- *	spacee and check the user space data area is readable before invoking
+ *	space and check the user space data area is readable before invoking
  *	the protocol.
  */
 
@@ -1113,7 +1113,7 @@
  *	we have this level of indirection. Not a lot of overhead, since more of
  *	the work is done via read/write/select directly.
  *
- *	I'm now expanding this up to a higher level to seperate the assorted
+ *	I'm now expanding this up to a higher level to separate the assorted
  *	kernel/user space manipulations and global assumptions from the protocol
  *	layers proper - AC.
  */
diff -u --recursive --new-file v1.1.41/linux/zBoot/crypt.h linux/zBoot/crypt.h
--- v1.1.41/linux/zBoot/crypt.h	Wed Dec  1 14:44:15 1993
+++ linux/zBoot/crypt.h	Tue Aug  9 09:35:23 1994
@@ -1,4 +1,4 @@
-/* crypt.h (dummy version) -- do not perform encrytion
+/* crypt.h (dummy version) -- do not perform encryption
  * Hardly worth copyrighting :-)
  */
 
diff -u --recursive --new-file v1.1.41/linux/zBoot/lzw.h linux/zBoot/lzw.h
--- v1.1.41/linux/zBoot/lzw.h	Wed Dec  1 14:44:15 1993
+++ linux/zBoot/lzw.h	Tue Aug  9 09:35:23 1994
@@ -15,7 +15,7 @@
 
 #define	LZW_MAGIC  "\037\235"   /* Magic header for lzw files, 1F 9D */
 
-#define BIT_MASK    0x1f /* Mask for 'number of compresssion bits' */
+#define BIT_MASK    0x1f /* Mask for 'number of compression bits' */
 /* Mask 0x20 is reserved to mean a fourth header byte, and 0x40 is free.
  * It's a pity that old uncompress does not check bit 0x20. That makes
  * extension of the format actually undesirable because old compress
@@ -26,7 +26,7 @@
  */
 
 #define BLOCK_MODE  0x80
-/* Block compresssion: if table is full and compression rate is dropping,
+/* Block compression: if table is full and compression rate is dropping,
  * clear the dictionary.
  */
 
diff -u --recursive --new-file v1.1.41/linux/zBoot/misc.c linux/zBoot/misc.c
--- v1.1.41/linux/zBoot/misc.c	Tue May 31 12:48:22 1994
+++ linux/zBoot/misc.c	Tue Aug  9 09:35:23 1994
@@ -94,7 +94,7 @@
 	free_mem_ptr += size;
 
 	/*
-  	 * The part of the compresed kernel which has already been expanded
+  	 * The part of the compressed kernel which has already been expanded
 	 * is no longer needed. Therefore we can reuse it for malloc.
 	 * With bigger kernels, this is necessary.
 	 */
