diff -u --recursive --new-file v2.0.17/linux/CREDITS linux/CREDITS
--- v2.0.17/linux/CREDITS	Sat Aug 17 21:19:25 1996
+++ linux/CREDITS	Mon Sep  2 20:10:47 1996
@@ -1273,11 +1273,11 @@
 S: USA
 
 N: Leo Spiekman
-E: spiekman@et.tudelft.nl
-W: http://dutettk.et.tudelft.nl/~spiekman
+E: leo@netlabs.net
+W: http://www.netlabs.net/hp/leo/
 D: Optics Storage 8000AT cdrom driver
-S: Utrecht
-S: The Netherlands
+S: Cliffwood, NJ 07721
+S: USA
 
 N: Henrik Storner
 E: storner@osiris.ping.dk
diff -u --recursive --new-file v2.0.17/linux/Documentation/Changes linux/Documentation/Changes
--- v2.0.17/linux/Documentation/Changes	Sun Sep  1 09:15:32 1996
+++ linux/Documentation/Changes	Tue Sep  3 13:03:55 1996
@@ -34,7 +34,7 @@
 bunshou no nihongo ban wa
 http://jf.gee.kyoto-u.ac.jp/JF/v2.0/Changes-2.0.html ni arimasu.
 
-Last updated: August 29, 1996.
+Last updated: September 02, 1996.
 Current Author: Chris Ricker (gt1355b@prism.gatech.edu).
 
 Current Releases
@@ -350,8 +350,10 @@
    Frame relay support for Linux is now available as well.  Currently,
 only Sangoma cards are supported, but the interface is such that others
 will be as drivers become available.  To use this, grab
-ftp://ftp.invlogic.com/linux/frad-0.15.tgz and
-ftp://ftp.invlogic.com/linux/routing.tgz.
+ftp://linux.invlogic.com/pub/fr/frad-0.15.tgz (soon to be
+frad-0.20.tgz).  Another package of interest is
+ftp://linux.invlogic.com/pub/routing/routing.tgz (which allows Linux to
+make routing decisions based on packet source).
 
 Networking
 ==========
diff -u --recursive --new-file v2.0.17/linux/Documentation/oops-tracing.txt linux/Documentation/oops-tracing.txt
--- v2.0.17/linux/Documentation/oops-tracing.txt	Sat May 11 10:08:34 1996
+++ linux/Documentation/oops-tracing.txt	Wed Sep  4 20:37:21 1996
@@ -70,3 +70,81 @@
 
 		Linus
 
+
+---------------------------------------------------------------------------
+Notes on Oops tracing with klogd:
+
+In order to help Linus and the other kernel developers there has been
+substantial support incorporated into klogd for processing protection
+faults.  In order to have full support for address resolution at least
+version 1.3-pl3 of the sysklogd package should be used.
+
+When a protection fault occurs the klogd daemon automatically
+translates important addresses in the kernel log messages to their
+symbolic equivalents.  This translated kernel message is then
+forwarded through whatever reporting mechanism klogd is using.  The
+protection fault message can be simply cut out of the message files
+and forwarded to the kernel developers.
+
+Two types of address resolution are performed by klogd.  The first is
+static translation and the second is dynamic translation.  Static
+translation uses the System.map file in much the same manner that
+ksymoops does.  In order to do static translation the klogd daemon
+must be able to find a system map file at daemon initialization time.
+See the klogd man page for information on how klogd searches for map
+files.
+
+Dynamic address translation is important when kernel loadable modules
+are being used.  Since memory for kernel modules is allocated from the
+kernel's dynamic memory pools there are no fixed locations for either
+the start of the module or for functions and symbols in the module.
+
+The kernel supports system calls which allow a program to determine
+which modules are loaded and their location in memory.  Using these
+system calls the klogd daemon builds a symbol table which can be used
+to debug a protection fault which occurs in a loadable kernel module.
+
+At the very minimum klogd will provide the name of the module which
+generated the protection fault.  There may be additional symbolic
+information available if the developer of the loadable module chose to
+export symbol information from the module.
+
+Since the kernel module environment can be dynamic there must be a
+mechanism for notifying the klogd daemon when a change in module
+environment occurs.  There are command line options available which
+allow klogd to signal the currently executing daemon that symbol
+information should be refreshed.  See the klogd manual page for more
+information.
+
+A patch is included with the sysklogd distribution which modifies the
+modules-2.0.0 package to automatically signal klogd whenever a module
+is loaded or unloaded.  Applying this patch provides essentially
+seamless support for debugging protection faults which occur with
+kernel loadable modules.
+
+The following is an example of a protection fault in a loadable module
+processed by klogd:
+---------------------------------------------------------------------------
+Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc
+Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, ^Pr3 = 0062d000
+Aug 29 09:51:01 blizard kernel: *pde = 00000000
+Aug 29 09:51:01 blizard kernel: Oops: 0002
+Aug 29 09:51:01 blizard kernel: CPU:    0
+Aug 29 09:51:01 blizard kernel: EIP:    0010:[oops:_oops+16/3868]
+Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212
+Aug 29 09:51:01 blizard kernel: eax: 315e97cc   ebx: 003a6f80   ecx: 001be77b   edx: 00237c0c
+Aug 29 09:51:01 blizard kernel: esi: 00000000   edi: bffffdb3   ebp: 00589f90   esp: 00589f8c
+Aug 29 09:51:01 blizard kernel: ds: 0018   es: 0018   fs: 002b   gs: 002b   ss: 0018
+Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000)
+Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001 
+Aug 29 09:51:01 blizard kernel:        00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00 
+Aug 29 09:51:01 blizard kernel:        bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036 
+Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128] 
+Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3 
+---------------------------------------------------------------------------
+
+Dr. G.W. Wettstein           Oncology Research Div. Computing Facility
+Roger Maris Cancer Center    INTERNET: greg@wind.rmcc.com
+820 4th St. N.
+Fargo, ND  58122
+Phone: 701-234-7556
diff -u --recursive --new-file v2.0.17/linux/Makefile linux/Makefile
--- v2.0.17/linux/Makefile	Mon Sep  2 15:18:25 1996
+++ linux/Makefile	Tue Sep  3 13:03:49 1996
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 0
-SUBLEVEL = 17
+SUBLEVEL = 18
 
 ARCH = i386
 
diff -u --recursive --new-file v2.0.17/linux/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
--- v2.0.17/linux/arch/i386/boot/compressed/Makefile	Wed Jul 17 14:59:14 1996
+++ linux/arch/i386/boot/compressed/Makefile	Wed Sep  4 20:37:14 1996
@@ -58,7 +58,7 @@
 	  $(ENCAPS) $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \
 	else \
 	  echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
-	  ld -m elf_i386 -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \
+	  $(LD) -m elf_i386 -r -o piggy.o -b binary $$tmppiggy.gz -b elf32-i386 -T $$tmppiggy.lnk; \
 	fi; \
 	rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk
 else
diff -u --recursive --new-file v2.0.17/linux/arch/i386/mm/fault.c linux/arch/i386/mm/fault.c
--- v2.0.17/linux/arch/i386/mm/fault.c	Thu Apr 25 08:43:05 1996
+++ linux/arch/i386/mm/fault.c	Wed Sep  4 14:22:28 1996
@@ -87,7 +87,7 @@
 	if (error_code & 1) {
 #ifdef TEST_VERIFY_AREA
 		if (regs->cs == KERNEL_CS)
-			printk("WP fault at %08x\n", regs->eip);
+			printk("WP fault at %08lx\n", regs->eip);
 #endif
 		do_wp_page(current, vma, address, error_code & 2);
 		return;
diff -u --recursive --new-file v2.0.17/linux/arch/i386/mm/init.c linux/arch/i386/mm/init.c
--- v2.0.17/linux/arch/i386/mm/init.c	Thu Apr 11 14:52:00 1996
+++ linux/arch/i386/mm/init.c	Thu Sep  5 08:39:23 1996
@@ -198,7 +198,7 @@
 			address += PAGE_SIZE;
 		}
 	}
-	flush_tlb();
+	local_flush_tlb();
 	return free_area_init(start_mem, end_mem);
 }
 
@@ -272,10 +272,10 @@
 /* test if the WP bit is honoured in supervisor mode */
 	if (wp_works_ok < 0) {
 		pg0[0] = pte_val(mk_pte(0, PAGE_READONLY));
-		flush_tlb();
+		local_flush_tlb();
 		__asm__ __volatile__("movb 0,%%al ; movb %%al,0": : :"ax", "memory");
 		pg0[0] = 0;
-		flush_tlb();
+		local_flush_tlb();
 		if (wp_works_ok < 0)
 			wp_works_ok = 0;
 	}
diff -u --recursive --new-file v2.0.17/linux/arch/m68k/atari/stdma.c linux/arch/m68k/atari/stdma.c
--- v2.0.17/linux/arch/m68k/atari/stdma.c	Mon May 20 07:54:26 1996
+++ linux/arch/m68k/atari/stdma.c	Tue Sep  3 20:10:17 1996
@@ -132,7 +132,7 @@
 
 int stdma_others_waiting(void)
 {
-	return stdma_wait != NULL;
+	return waitqueue_active(&stdma_wait);
 }
 
 
diff -u --recursive --new-file v2.0.17/linux/drivers/block/xd.c linux/drivers/block/xd.c
--- v2.0.17/linux/drivers/block/xd.c	Tue Jul  2 19:08:41 1996
+++ linux/drivers/block/xd.c	Wed Sep  4 16:57:37 1996
@@ -752,6 +752,8 @@
 void cleanup_module(void)
 {
 	unregister_blkdev(MAJOR_NR, "xd");
+	free_irq(xd_irq, NULL);
+	free_dma(xd_dma);
 }
 #endif /* MODULE */
 
diff -u --recursive --new-file v2.0.17/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v2.0.17/linux/drivers/char/tty_io.c	Mon Sep  2 15:18:26 1996
+++ linux/drivers/char/tty_io.c	Wed Sep  4 10:16:33 1996
@@ -380,8 +380,9 @@
 			continue;
 		if (filp->private_data != tty)
 			continue;
-		if (filp->f_inode
-		    && filp->f_inode->i_rdev == CONSOLE_DEV)
+		if (!filp->f_inode)
+			continue;
+		if (filp->f_inode->i_rdev == CONSOLE_DEV)
 			continue;
 		if (filp->f_op != &tty_fops)
 			continue;
diff -u --recursive --new-file v2.0.17/linux/drivers/isdn/pcbit/layer2.h linux/drivers/isdn/pcbit/layer2.h
--- v2.0.17/linux/drivers/isdn/pcbit/layer2.h	Tue Apr 23 12:31:35 1996
+++ linux/drivers/isdn/pcbit/layer2.h	Wed Sep  4 20:37:14 1996
@@ -14,7 +14,7 @@
 #ifndef LAYER2_H
 #define LAYER2_H
 
-#include <bytesex.h>
+#include <asm/byteorder.h>
 
 #define BANK1 0x0000U /* PC -> Board */
 #define BANK2 0x01ffU /* Board -> PC */
@@ -85,7 +85,7 @@
 */
 
 struct msg_fmt {
-#if __BYTE_ORDER == 1234              /* Little Endian */
+#ifdef __LITTLE_ENDIAN              /* Little Endian */
   u_char scmd;
   u_char cmd;
   u_char proc;
diff -u --recursive --new-file v2.0.17/linux/drivers/net/ac3200.c linux/drivers/net/ac3200.c
--- v2.0.17/linux/drivers/net/ac3200.c	Fri Mar  1 07:50:42 1996
+++ linux/drivers/net/ac3200.c	Tue Sep  3 09:08:40 1996
@@ -137,7 +137,7 @@
 	for (i = 0; i < 4; i++)
 		if (inl(ioaddr + AC_ID_PORT) != AC_EISA_ID) {
 			printk("EISA ID mismatch, %8x vs %8x.\n",
-				   inl(ioaddr + AC_EISA_ID), AC_EISA_ID); 
+				   inl(ioaddr + AC_ID_PORT), AC_EISA_ID); 
 			return ENODEV;
 		}
 
diff -u --recursive --new-file v2.0.17/linux/drivers/scsi/ncr53c8xx.c linux/drivers/scsi/ncr53c8xx.c
--- v2.0.17/linux/drivers/scsi/ncr53c8xx.c	Sun Sep  1 09:15:33 1996
+++ linux/drivers/scsi/ncr53c8xx.c	Wed Sep  4 10:43:08 1996
@@ -4325,6 +4325,7 @@
 	lcb_p lp;
 	int target, lun;
 	int i;
+	u_char scntl3;
 
 	printf("%s: releasing host resources\n", ncr_name(np));
 
@@ -4371,12 +4372,15 @@
 
 	/*
 	**	Reset NCR chip
+	**	Preserve scntl3 for automatic clock detection.
 	*/
 
 	printf("%s: resetting chip\n", ncr_name(np));
+	scntl3 = INB (nc_scntl3);
 	OUTB (nc_istat,  SRST);
 	DELAY (1000);
 	OUTB (nc_istat,  0   );
+	OUTB (nc_scntl3, scntl3);
 
 	/*
 	**	Release Memory mapped IO region and IO mapped region
@@ -7353,7 +7357,7 @@
 	 */
 
 	if ((scntl3 & 7) < 3) {
-		printf ("%s: assuming 40MHz clock", ncr_name(np));
+		printf ("%s: assuming 40MHz clock\n", ncr_name(np));
 		scntl3 = 3; /* assume 40MHz if no value supplied by BIOS */
 	}
 
diff -u --recursive --new-file v2.0.17/linux/drivers/sound/lowlevel/Makefile linux/drivers/sound/lowlevel/Makefile
--- v2.0.17/linux/drivers/sound/lowlevel/Makefile	Thu May 16 11:05:57 1996
+++ linux/drivers/sound/lowlevel/Makefile	Wed Sep  4 20:37:14 1996
@@ -9,7 +9,7 @@
 endif
 
 lowlevel.o:	$(OBJS)
-	ld -r -o lowlevel.o $(OBJS)
+	$(LD) -r -o lowlevel.o $(OBJS)
 
 clean:
 	rm -f core x y z *~ *.o
diff -u --recursive --new-file v2.0.17/linux/fs/binfmt_elf.c linux/fs/binfmt_elf.c
--- v2.0.17/linux/fs/binfmt_elf.c	Thu Aug 29 19:15:14 1996
+++ linux/fs/binfmt_elf.c	Wed Sep  4 10:43:08 1996
@@ -258,7 +258,7 @@
 			    eppnt->p_filesz + ELF_PAGEOFFSET(eppnt->p_vaddr),
 			    elf_prot,
 			    elf_type,
-			    ELF_PAGESTART(eppnt->p_offset));
+			    eppnt->p_offset - ELF_PAGEOFFSET(eppnt->p_vaddr));
 	    
 	    if (error > -1024UL) {
 	      /* Real error */
@@ -585,7 +585,8 @@
 					elf_prot,
 					(MAP_FIXED | MAP_PRIVATE |
 					 MAP_DENYWRITE | MAP_EXECUTABLE),
-					ELF_PAGESTART(elf_ppnt->p_offset));
+					(elf_ppnt->p_offset -
+					 ELF_PAGEOFFSET(elf_ppnt->p_vaddr)));
 			
 #ifdef LOW_ELF_STACK
 			if (ELF_PAGESTART(elf_ppnt->p_vaddr) < elf_stack) 
@@ -802,10 +803,12 @@
 	/* Now use mmap to map the library into memory. */
 	error = do_mmap(file,
 			ELF_PAGESTART(elf_phdata->p_vaddr),
-			elf_phdata->p_filesz + ELF_PAGEOFFSET(elf_phdata->p_vaddr),
+			(elf_phdata->p_filesz +
+			 ELF_PAGEOFFSET(elf_phdata->p_vaddr)),
 			PROT_READ | PROT_WRITE | PROT_EXEC,
 			MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE,
-			ELF_PAGESTART(elf_phdata->p_offset));
+			(elf_phdata->p_offset -
+			 ELF_PAGEOFFSET(elf_phdata->p_vaddr)));
 
 	k = elf_phdata->p_vaddr + elf_phdata->p_filesz;
 	if (k > elf_bss) elf_bss = k;
diff -u --recursive --new-file v2.0.17/linux/fs/buffer.c linux/fs/buffer.c
--- v2.0.17/linux/fs/buffer.c	Sun Sep  1 09:15:33 1996
+++ linux/fs/buffer.c	Wed Sep  4 09:41:51 1996
@@ -1046,10 +1046,6 @@
 		return NULL;
 	bh = unused_list;
 	unused_list = bh->b_next_free;
-	bh->b_next_free = NULL;
-	bh->b_data = NULL;
-	bh->b_size = 0;
-	bh->b_state = 0;
 	return bh;
 }
 
@@ -1070,11 +1066,18 @@
 		bh = get_unused_buffer_head();
 		if (!bh)
 			goto no_grow;
+
+		bh->b_dev = B_FREE;  /* Flag as unused */
 		bh->b_this_page = head;
 		head = bh;
-		bh->b_data = (char *) (page+offset);
+
+		bh->b_state = 0;
+		bh->b_next_free = NULL;
+		bh->b_count = 0;
 		bh->b_size = size;
-		bh->b_dev = B_FREE;  /* Flag as unused */
+
+		bh->b_data = (char *) (page+offset);
+		bh->b_list = 0;
 	}
 	return head;
 /*
@@ -1128,13 +1131,11 @@
  * This function expects the page to be locked and may return before I/O is complete.
  * You then have to check page->locked, page->uptodate, and maybe wait on page->wait.
  */
-int brw_page(int rw, unsigned long address, kdev_t dev, int b[], int size, int bmap)
+int brw_page(int rw, struct page *page, kdev_t dev, int b[], int size, int bmap)
 {
 	struct buffer_head *bh, *prev, *next, *arr[MAX_BUF_PER_PAGE];
 	int block, nr;
-	struct page *page;
 
-	page = mem_map + MAP_NR(address);
 	if (!PageLocked(page))
 		panic("brw_page: page not locked for I/O");
 	clear_bit(PG_uptodate, &page->flags);
@@ -1144,7 +1145,7 @@
 	 * They do _not_ show up in the buffer hash table!
 	 * They are _not_ registered in page->buffers either!
 	 */
-	bh = create_buffers(address, size);
+	bh = create_buffers(page_address(page), size);
 	if (!bh) {
 		clear_bit(PG_locked, &page->flags);
 		wake_up(&page->wait);
@@ -1336,7 +1337,7 @@
 	} while (i > 0);
 
 	/* IO start */
-	brw_page(READ, page_address(page), inode->i_dev, nr, inode->i_sb->s_blocksize, 1);
+	brw_page(READ, page, inode->i_dev, nr, inode->i_sb->s_blocksize, 1);
 	return 0;
 }
 
@@ -1422,7 +1423,7 @@
 			return 0;
 		if (tmp->b_count || buffer_protected(tmp) ||
 		    buffer_dirty(tmp) || buffer_locked(tmp) ||
-		    buffer_waiting(bh))
+		    buffer_waiting(tmp))
 			return 0;
 		if (priority && buffer_touched(tmp))
 			return 0;
diff -u --recursive --new-file v2.0.17/linux/fs/nfs/rpcsock.c linux/fs/nfs/rpcsock.c
--- v2.0.17/linux/fs/nfs/rpcsock.c	Thu Jun  6 21:22:24 1996
+++ linux/fs/nfs/rpcsock.c	Tue Sep  3 20:10:17 1996
@@ -564,7 +564,7 @@
 	unsigned long	t0 = jiffies;
 
 	rsock->shutdown = 1;
-	while (rsock->pending || rsock->backlog) {
+	while (rsock->pending || waitqueue_active(&rsock->backlog)) {
 		interruptible_sleep_on(&rsock->shutwait);
 		if (current->signal & ~current->blocked)
 			return -EINTR;
diff -u --recursive --new-file v2.0.17/linux/fs/umsdos/inode.c linux/fs/umsdos/inode.c
--- v2.0.17/linux/fs/umsdos/inode.c	Mon Mar 11 11:25:58 1996
+++ linux/fs/umsdos/inode.c	Tue Sep  3 20:10:17 1996
@@ -227,7 +227,7 @@
 	if (S_ISDIR(inode->i_mode)
 		&& (inode->u.umsdos_i.u.dir_info.creating != 0
 			|| inode->u.umsdos_i.u.dir_info.looking != 0
-			|| inode->u.umsdos_i.u.dir_info.p != NULL)){
+			|| waitqueue_active(&inode->u.umsdos_i.u.dir_info.p))){
 		Printk (("read inode %d %d %p\n"
 			,inode->u.umsdos_i.u.dir_info.creating
 			,inode->u.umsdos_i.u.dir_info.looking
diff -u --recursive --new-file v2.0.17/linux/include/asm-i386/irq.h linux/include/asm-i386/irq.h
--- v2.0.17/linux/include/asm-i386/irq.h	Mon Sep  2 15:18:26 1996
+++ linux/include/asm-i386/irq.h	Wed Sep  4 10:29:24 1996
@@ -90,7 +90,7 @@
 	"outb %al,$0x21\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0xE0+"#nr",%al\n\t" \
+	"1:\tmovb $0x60+"#nr",%al\n\t" \
 	"outb %al,$0x20\n\t"
 
 #define ACK_SECOND(mask,nr) \
@@ -102,11 +102,11 @@
 	"outb %al,$0xA1\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0xE0+"#nr",%al\n\t" \
+	"1:\tmovb $0x60+"#nr",%al\n\t" \
 	"outb %al,$0xA0\n\t" \
 	"jmp 1f\n" \
 	"1:\tjmp 1f\n" \
-	"1:\tmovb $0xE2,%al\n\t" \
+	"1:\tmovb $0x62,%al\n\t" \
 	"outb %al,$0x20\n\t"
 
 #define UNBLK_FIRST(mask) \
diff -u --recursive --new-file v2.0.17/linux/include/asm-i386/pgtable.h linux/include/asm-i386/pgtable.h
--- v2.0.17/linux/include/asm-i386/pgtable.h	Wed Jul 17 10:35:40 1996
+++ linux/include/asm-i386/pgtable.h	Thu Sep  5 08:29:26 1996
@@ -53,6 +53,7 @@
 
 #define flush_tlb() __flush_tlb()
 #define flush_tlb_all() __flush_tlb()
+#define local_flush_tlb() __flush_tlb()
 
 static inline void flush_tlb_mm(struct mm_struct *mm)
 {
diff -u --recursive --new-file v2.0.17/linux/include/linux/fs.h linux/include/linux/fs.h
--- v2.0.17/linux/include/linux/fs.h	Thu Jul 25 20:26:46 1996
+++ linux/include/linux/fs.h	Thu Sep  5 15:29:10 1996
@@ -653,7 +653,7 @@
 extern int generic_readpage(struct inode *, struct page *);
 extern int generic_file_read(struct inode *, struct file *, char *, int);
 extern int generic_file_mmap(struct inode *, struct file *, struct vm_area_struct *);
-extern int brw_page(int, unsigned long, kdev_t, int [], int, int);
+extern int brw_page(int, struct page *, kdev_t, int [], int, int);
 
 extern void put_super(kdev_t dev);
 unsigned long generate_cluster(kdev_t dev, int b[], int size);
diff -u --recursive --new-file v2.0.17/linux/include/linux/major.h linux/include/linux/major.h
--- v2.0.17/linux/include/linux/major.h	Sat Aug 17 21:19:28 1996
+++ linux/include/linux/major.h	Mon Sep  2 19:33:41 1996
@@ -77,7 +77,7 @@
   ((M) == SCSI_DISK_MAJOR	\
    || (M) == SCSI_CDROM_MAJOR)
 
-static inline int scsi_blk_major(int m) {
+static __inline__ int scsi_blk_major(int m) {
 	return SCSI_BLK_MAJOR(m);
 }
 
diff -u --recursive --new-file v2.0.17/linux/include/linux/pagemap.h linux/include/linux/pagemap.h
--- v2.0.17/linux/include/linux/pagemap.h	Thu Jul 25 20:26:46 1996
+++ linux/include/linux/pagemap.h	Thu Sep  5 15:29:10 1996
@@ -42,13 +42,10 @@
 #undef s
 }
 
-#define page_hash(inode,offset) page_hash_table[_page_hashfn(inode,offset)]
+#define page_hash(inode,offset) (page_hash_table+_page_hashfn(inode,offset))
 
-static inline struct page * find_page(struct inode * inode, unsigned long offset)
+static inline struct page * __find_page(struct inode * inode, unsigned long offset, struct page *page)
 {
-	struct page *page;
-
-	page = page_hash(inode, offset);
 	goto inside;
 	for (;;) {
 		page = page->next_hash;
@@ -67,9 +64,14 @@
 	return page;
 }
 
+static inline struct page *find_page(struct inode * inode, unsigned long offset)
+{
+	return __find_page(inode, offset, *page_hash(inode, offset));
+}
+
 static inline void remove_page_from_hash_queue(struct page * page)
 {
-	struct page **p = &page_hash(page->inode,page->offset);
+	struct page **p = page_hash(page->inode,page->offset);
 
 	page_cache_size--;
 	if (page->next_hash)
@@ -81,10 +83,8 @@
 	page->next_hash = page->prev_hash = NULL;
 }
 
-static inline void add_page_to_hash_queue(struct inode * inode, struct page * page)
+static inline void __add_page_to_hash_queue(struct page * page, struct page **p)
 {
-	struct page **p = &page_hash(inode,page->offset);
-
 	page_cache_size++;
 	set_bit(PG_referenced, &page->flags);
 	page->age = PAGE_AGE_VALUE;
@@ -93,6 +93,12 @@
 		page->next_hash->prev_hash = page;
 	*p = page;
 }
+
+static inline void add_page_to_hash_queue(struct page * page, struct inode * inode, unsigned long offset)
+{
+	__add_page_to_hash_queue(page, page_hash(inode,offset));
+}
+
 
 static inline void remove_page_from_inode_queue(struct page * page)
 {
diff -u --recursive --new-file v2.0.17/linux/init/main.c linux/init/main.c
--- v2.0.17/linux/init/main.c	Sun Sep  1 09:15:33 1996
+++ linux/init/main.c	Thu Sep  5 08:29:26 1996
@@ -959,8 +959,17 @@
 		}
 	}
 #endif
+	
+	/*
+	 *	This keeps serial console MUCH cleaner, but does assume
+	 *	the console driver checks there really is a video device
+	 *	attached (Sparc effectively does).
+	 */
 
-	(void) open("/dev/tty1",O_RDWR,0);
+	if ((open("/dev/tty1",O_RDWR,0) < 0) &&
+	    (open("/dev/ttyS0",O_RDWR,0) < 0))
+		printk("Unable to open a initial console.\n");
+			
 	(void) dup(0);
 	(void) dup(0);
 
diff -u --recursive --new-file v2.0.17/linux/kernel/sched.c linux/kernel/sched.c
--- v2.0.17/linux/kernel/sched.c	Sun Sep  1 09:15:34 1996
+++ linux/kernel/sched.c	Wed Sep  4 07:55:28 1996
@@ -1180,8 +1180,10 @@
 
 	p->policy = policy;
 	p->rt_priority = lp.sched_priority;
+	cli();
 	if (p->next_run)
 		move_last_runqueue(p);
+	sti();
 	schedule();
 
 	return 0;
@@ -1237,8 +1239,9 @@
 
 asmlinkage int sys_sched_yield(void)
 {
+	cli();
 	move_last_runqueue(current);
-
+	sti();
 	return 0;
 }
 
diff -u --recursive --new-file v2.0.17/linux/mm/filemap.c linux/mm/filemap.c
--- v2.0.17/linux/mm/filemap.c	Sat Aug 10 10:03:16 1996
+++ linux/mm/filemap.c	Thu Sep  5 15:20:48 1996
@@ -255,13 +255,14 @@
 }
 
 static inline void add_to_page_cache(struct page * page,
-	struct inode * inode, unsigned long offset)
+	struct inode * inode, unsigned long offset,
+	struct page **hash)
 {
 	page->count++;
 	page->flags &= ~((1 << PG_uptodate) | (1 << PG_error));
 	page->offset = offset;
 	add_page_to_inode_queue(inode, page);
-	add_page_to_hash_queue(inode, page);
+	__add_page_to_hash_queue(page, hash);
 }
 
 /*
@@ -272,32 +273,31 @@
 static unsigned long try_to_read_ahead(struct inode * inode, unsigned long offset, unsigned long page_cache)
 {
 	struct page * page;
+	struct page ** hash;
 
 	offset &= PAGE_MASK;
-	if (!page_cache) {
+	switch (page_cache) {
+	case 0:
 		page_cache = __get_free_page(GFP_KERNEL);
 		if (!page_cache)
-			return 0;
-	}
-	if (offset >= inode->i_size)
-		return page_cache;
-#if 1
-	page = find_page(inode, offset);
-	if (page) {
+			break;
+	default:
+		if (offset >= inode->i_size)
+			break;
+		hash = page_hash(inode, offset);
+		page = __find_page(inode, offset, *hash);
+		if (!page) {
+			/*
+			 * Ok, add the new page to the hash-queues...
+			 */
+			page = mem_map + MAP_NR(page_cache);
+			add_to_page_cache(page, inode, offset, hash);
+			inode->i_op->readpage(inode, page);
+			page_cache = 0;
+		}
 		release_page(page);
-		return page_cache;
 	}
-	/*
-	 * Ok, add the new page to the hash-queues...
-	 */
-	page = mem_map + MAP_NR(page_cache);
-	add_to_page_cache(page, inode, offset);
-	inode->i_op->readpage(inode, page);
-	free_page(page_cache);
-	return 0;
-#else
 	return page_cache;
-#endif
 }
 
 /* 
@@ -457,13 +457,12 @@
 #endif
 
 static inline unsigned long generic_file_readahead(int reada_ok, struct file * filp, struct inode * inode,
-	unsigned long pos, struct page * page,
+	unsigned long ppos, struct page * page,
 	unsigned long page_cache)
 {
 	unsigned long max_ahead, ahead;
-	unsigned long raend, ppos;
+	unsigned long raend;
 
-	ppos = pos & PAGE_MASK;
 	raend = filp->f_raend & PAGE_MASK;
 	max_ahead = 0;
 
@@ -607,7 +606,7 @@
 	} else {
 		unsigned long needed;
 
-		needed = ((pos + count) & PAGE_MASK) - (pos & PAGE_MASK);
+		needed = ((pos + count) & PAGE_MASK) - ppos;
 
 		if (filp->f_ramax < needed)
 			filp->f_ramax = needed;
@@ -619,7 +618,7 @@
 	}
 
 	for (;;) {
-		struct page *page;
+		struct page *page, **hash;
 
 		if (pos >= inode->i_size)
 			break;
@@ -627,7 +626,8 @@
 		/*
 		 * Try to find the data in the page cache..
 		 */
-		page = find_page(inode, pos & PAGE_MASK);
+		hash = page_hash(inode, pos & PAGE_MASK);
+		page = __find_page(inode, pos & PAGE_MASK, *hash);
 		if (!page)
 			goto no_cached_page;
 
@@ -640,7 +640,7 @@
  * the page has been rewritten.
  */
 		if (PageUptodate(page) || PageLocked(page))
-			page_cache = generic_file_readahead(reada_ok, filp, inode, pos, page, page_cache);
+			page_cache = generic_file_readahead(reada_ok, filp, inode, pos & PAGE_MASK, page, page_cache);
 		else if (reada_ok && filp->f_ramax > MIN_READAHEAD)
 				filp->f_ramax = MIN_READAHEAD;
 
@@ -696,7 +696,7 @@
 		 */
 		page = mem_map + MAP_NR(page_cache);
 		page_cache = 0;
-		add_to_page_cache(page, inode, pos & PAGE_MASK);
+		add_to_page_cache(page, inode, pos & PAGE_MASK, hash);
 
 		/*
 		 * Error handling is tricky. If we get a read error,
@@ -764,7 +764,7 @@
 static unsigned long filemap_nopage(struct vm_area_struct * area, unsigned long address, int no_share)
 {
 	unsigned long offset;
-	struct page * page;
+	struct page * page, **hash;
 	struct inode * inode = area->vm_inode;
 	unsigned long old_page, new_page;
 
@@ -776,7 +776,8 @@
 	/*
 	 * Do we have something in the page cache already?
 	 */
-	page = find_page(inode, offset);
+	hash = page_hash(inode, offset);
+	page = __find_page(inode, offset, *hash);
 	if (!page)
 		goto no_cached_page;
 
@@ -841,7 +842,7 @@
 	 */
 	page = mem_map + MAP_NR(new_page);
 	new_page = 0;
-	add_to_page_cache(page, inode, offset);
+	add_to_page_cache(page, inode, offset, hash);
 
 	if (inode->i_op->readpage(inode, page) != 0)
 		goto failure;
diff -u --recursive --new-file v2.0.17/linux/mm/mmap.c linux/mm/mmap.c
--- v2.0.17/linux/mm/mmap.c	Mon Aug  5 10:13:55 1996
+++ linux/mm/mmap.c	Wed Sep  4 10:43:08 1996
@@ -144,7 +144,7 @@
 	if ((len = PAGE_ALIGN(len)) == 0)
 		return addr;
 
-	if (addr > TASK_SIZE || len > TASK_SIZE || addr > TASK_SIZE-len)
+	if (len > TASK_SIZE || addr > TASK_SIZE-len)
 		return -EINVAL;
 
 	/* offset overflow? */
@@ -198,8 +198,6 @@
 
 	if (flags & MAP_FIXED) {
 		if (addr & ~PAGE_MASK)
-			return -EINVAL;
-		if (len > TASK_SIZE || addr > TASK_SIZE - len)
 			return -EINVAL;
 	} else {
 		addr = get_unmapped_area(addr, len);
diff -u --recursive --new-file v2.0.17/linux/mm/page_io.c linux/mm/page_io.c
--- v2.0.17/linux/mm/page_io.c	Mon Jun  3 15:38:37 1996
+++ linux/mm/page_io.c	Tue Sep  3 13:10:36 1996
@@ -168,9 +168,10 @@
  * asynchronous function now --- we must call wait_on_page afterwards
  * if synchronous IO is required.  
  */
-void ll_rw_page(int rw, kdev_t dev, unsigned long page, char * buffer)
+void ll_rw_page(int rw, kdev_t dev, unsigned long offset, char * buffer)
 {
-	int block = page;
+	int block = offset;
+	struct page *page;
 
 	switch (rw) {
 		case READ:
@@ -185,7 +186,8 @@
 		default:
 			panic("ll_rw_page: bad block dev cmd, must be R/W");
 	}
-	if (set_bit(PG_locked, &mem_map[MAP_NR(buffer)].flags))
+	page = mem_map + MAP_NR(buffer);
+	if (set_bit(PG_locked, &page->flags))
 		panic ("ll_rw_page: page already locked");
-	brw_page(rw, (unsigned long) buffer, dev, &block, PAGE_SIZE, 0);
+	brw_page(rw, page, dev, &block, PAGE_SIZE, 0);
 }
diff -u --recursive --new-file v2.0.17/linux/net/ipv4/icmp.c linux/net/ipv4/icmp.c
--- v2.0.17/linux/net/ipv4/icmp.c	Mon Jun  3 13:23:34 1996
+++ linux/net/ipv4/icmp.c	Thu Sep  5 08:29:26 1996
@@ -618,7 +618,9 @@
 	 *	Build and send the packet.
 	 */
 
-	icmp_build_xmit(&icmp_param, saddr, iph->saddr, ((iph->tos & 0x38) | 6));
+	icmp_build_xmit(&icmp_param, saddr, iph->saddr, 
+			icmp_pointers[type].error ? 
+			(iph->tos & 0x1E) | 0xC0 : iph->tos);
 }
 
 
diff -u --recursive --new-file v2.0.17/linux/net/ipv4/raw.c linux/net/ipv4/raw.c
--- v2.0.17/linux/net/ipv4/raw.c	Sat Jun  8 20:06:45 1996
+++ linux/net/ipv4/raw.c	Thu Sep  5 08:29:26 1996
@@ -236,6 +236,10 @@
 		memcpy(&sin, usin, sizeof(sin));
 		if (sin.sin_family && sin.sin_family != AF_INET) 
 			return(-EINVAL);
+		/*
+		 *	Protocol type is host ordered byte.
+		 */
+		sin.sin_port=ntohs(sin.sin_port);
 	}
 	else 
 	{
diff -u --recursive --new-file v2.0.17/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v2.0.17/linux/net/ipv4/tcp.c	Thu Aug 29 19:15:15 1996
+++ linux/net/ipv4/tcp.c	Thu Sep  5 08:29:26 1996
@@ -958,6 +958,7 @@
 			{
 				if (copied)
 					return copied;
+				send_sig(SIGPIPE,current,0);
 				return -EPIPE;
 			}
 
diff -u --recursive --new-file v2.0.17/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v2.0.17/linux/net/unix/af_unix.c	Fri Jul  5 16:57:33 1996
+++ linux/net/unix/af_unix.c	Thu Sep  5 08:32:22 1996
@@ -863,6 +863,12 @@
 		return -EINVAL;
 	}
 		
+	if(sk->shutdown&SEND_SHUTDOWN)
+	{
+		send_sig(SIGPIPE,current,0);
+		return -EPIPE;
+	}
+	
 	if(sunaddr!=NULL)
 	{
 		if(sock->type==SOCK_STREAM)
@@ -973,10 +979,27 @@
 				sock->state=SS_UNCONNECTED;
 				sti();
 				kfree_skb(skb, FREE_WRITE);
+				/*
+				 *	Check with 1003.1g - what should
+				 *	datagram error
+				 */
+				if (!sent)
+					sent = -ECONNRESET;
+				return sent;
+			}
+			/*
+			 *	Stream sockets SIGPIPE
+			 */
+			if(sock->type==SOCK_STREAM && other->dead)
+			{
+				kfree_skb(skb, FREE_WRITE);
+				sti();
 				if(!sent)
-					return -ECONNRESET;
-				else
-					return sent;
+				{
+					send_sig(SIGPIPE,current,0);
+					sent = -EPIPE;
+				}
+				return sent;
 			}
 		}
 		else
