diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/arch/ia64/Kconfig 002-2.6.0-ia64.patch/arch/ia64/Kconfig
--- 000-virgin/arch/ia64/Kconfig	Mon Jan 12 10:03:35 2004
+++ 002-2.6.0-ia64.patch/arch/ia64/Kconfig	Mon Jan 12 10:07:43 2004
@@ -619,6 +619,33 @@ config MAGIC_SYSRQ
 	  keys are documented in <file:Documentation/sysrq.txt>. Don't say Y
 	  unless you really know what this hack does.
 
+config IA64_EARLY_PRINTK
+	bool "Early printk support"
+	depends on DEBUG_KERNEL && !IA64_GENERIC
+	help
+	  Selecting this option uses the VGA screen or serial console for
+	  printk() output before the consoles are initialised.  It is useful
+	  for debugging problems early in the boot process, but only if you
+	  have a suitable VGA/serial console attached.  If you're unsure,
+	  select N.
+
+config IA64_EARLY_PRINTK_UART
+	bool "Early printk on MMIO serial port"
+	depends on IA64_EARLY_PRINTK
+
+config IA64_EARLY_PRINTK_UART_BASE
+	hex "UART MMIO base address"
+	depends on IA64_EARLY_PRINTK_UART
+	default "ff5e0000"
+
+config IA64_EARLY_PRINTK_VGA
+	bool "Early printk on VGA"
+	depends on IA64_EARLY_PRINTK
+
+config IA64_EARLY_PRINTK_SGI_SN
+	bool "Early printk on SGI SN serial console"
+	depends on IA64_EARLY_PRINTK && (IA64_GENERIC || IA64_SGI_SN2)
+
 config DEBUG_SLAB
 	bool "Debug memory allocations"
 	depends on DEBUG_KERNEL
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/acpi/tables.c 002-2.6.0-ia64.patch/drivers/acpi/tables.c
--- 000-virgin/drivers/acpi/tables.c	Mon Jan 12 10:03:36 2004
+++ 002-2.6.0-ia64.patch/drivers/acpi/tables.c	Mon Jan 12 10:07:43 2004
@@ -276,10 +276,17 @@ acpi_get_table_header_early (
 
 	/* Map the DSDT header via the pointer in the FADT */
 	if (id == ACPI_DSDT) {
-		struct acpi_table_fadt *fadt = (struct acpi_table_fadt *) *header;
+		struct fadt_descriptor_rev2 *fadt = (struct fadt_descriptor_rev2 *) *header;
+
+		if (fadt->revision == 3 && fadt->Xdsdt) {
+			*header = (void *) __acpi_map_table(fadt->Xdsdt,
+					sizeof(struct acpi_table_header));
+		} else if (fadt->V1_dsdt) {
+			*header = (void *) __acpi_map_table(fadt->V1_dsdt,
+					sizeof(struct acpi_table_header));
+		} else
+			*header = 0;
 
-		*header = (void *) __acpi_map_table(fadt->dsdt_addr,
-				sizeof(struct acpi_table_header));
 		if (!*header) {
 			printk(KERN_WARNING PREFIX "Unable to map DSDT\n");
 			return -ENODEV;
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/media/radio/Makefile 002-2.6.0-ia64.patch/drivers/media/radio/Makefile
--- 000-virgin/drivers/media/radio/Makefile	Thu Jan  8 22:59:44 2004
+++ 002-2.6.0-ia64.patch/drivers/media/radio/Makefile	Mon Jan 12 10:07:43 2004
@@ -2,6 +2,8 @@
 # Makefile for the kernel character device drivers.
 #
 
+obj-y		:= dummy.o
+
 miropcm20-objs	:= miropcm20-rds-core.o miropcm20-radio.o
 
 obj-$(CONFIG_RADIO_AZTECH) += radio-aztech.o
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/media/radio/dummy.c 002-2.6.0-ia64.patch/drivers/media/radio/dummy.c
--- 000-virgin/drivers/media/radio/dummy.c	Wed Dec 31 16:00:00 1969
+++ 002-2.6.0-ia64.patch/drivers/media/radio/dummy.c	Mon Jan 12 10:07:43 2004
@@ -0,0 +1 @@
+/* just so the linker knows what kind of object files it's deadling with... */
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/media/video/Makefile 002-2.6.0-ia64.patch/drivers/media/video/Makefile
--- 000-virgin/drivers/media/video/Makefile	Thu Jan  8 22:59:26 2004
+++ 002-2.6.0-ia64.patch/drivers/media/video/Makefile	Mon Jan 12 10:07:43 2004
@@ -7,6 +7,7 @@ bttv-objs	:=	bttv-driver.o bttv-cards.o 
 zoran-objs      :=	zr36120.o zr36120_i2c.o zr36120_mem.o
 zr36067-objs	:=	zoran_procfs.o zoran_device.o \
 			zoran_driver.o zoran_card.o
+obj-y		:=	dummy.o
 
 obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o
 
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/media/video/dummy.c 002-2.6.0-ia64.patch/drivers/media/video/dummy.c
--- 000-virgin/drivers/media/video/dummy.c	Wed Dec 31 16:00:00 1969
+++ 002-2.6.0-ia64.patch/drivers/media/video/dummy.c	Mon Jan 12 10:07:43 2004
@@ -0,0 +1 @@
+/* just so the linker knows what kind of object files it's deadling with... */
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/net/tulip/media.c 002-2.6.0-ia64.patch/drivers/net/tulip/media.c
--- 000-virgin/drivers/net/tulip/media.c	Thu Jan  8 22:59:19 2004
+++ 002-2.6.0-ia64.patch/drivers/net/tulip/media.c	Mon Jan 12 10:07:43 2004
@@ -278,6 +278,10 @@ void tulip_select_media(struct net_devic
 				for (i = 0; i < init_length; i++)
 					outl(init_sequence[i], ioaddr + CSR12);
 			}
+
+			(void) inl(ioaddr + CSR6); /* flush CSR12 writes */
+			udelay(500);		/* Give MII time to recover */
+
 			tmp_info = get_u16(&misc_info[1]);
 			if (tmp_info)
 				tp->advertising[phy_num] = tmp_info | 1;
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/serial/serial_core.c 002-2.6.0-ia64.patch/drivers/serial/serial_core.c
--- 000-virgin/drivers/serial/serial_core.c	Mon Jan 12 10:03:36 2004
+++ 002-2.6.0-ia64.patch/drivers/serial/serial_core.c	Mon Jan 12 10:07:43 2004
@@ -1865,6 +1865,9 @@ uart_set_options(struct uart_port *port,
 	if (!port->ops)
 		return 0;	/* "console=" on ia64 */
 
+	if (!port->ops)
+		return 0;
+
 	port->ops->set_termios(port, &termios, NULL);
 	co->cflag = termios.c_cflag;
 
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/drivers/usb/serial/ipaq.c 002-2.6.0-ia64.patch/drivers/usb/serial/ipaq.c
--- 000-virgin/drivers/usb/serial/ipaq.c	Thu Jan  8 22:59:56 2004
+++ 002-2.6.0-ia64.patch/drivers/usb/serial/ipaq.c	Mon Jan 12 10:07:43 2004
@@ -222,7 +222,7 @@ static int ipaq_open(struct usb_serial_p
 	 * discipline instead of queueing.
 	 */
 
-	port->tty->low_latency = 1;
+	port->tty->low_latency = 0;
 	port->tty->raw = 1;
 	port->tty->real_raw = 1;
 
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/include/linux/module.h 002-2.6.0-ia64.patch/include/linux/module.h
--- 000-virgin/include/linux/module.h	Thu Jan  8 22:59:55 2004
+++ 002-2.6.0-ia64.patch/include/linux/module.h	Mon Jan 12 10:07:43 2004
@@ -60,10 +60,11 @@ search_extable(const struct exception_ta
 #define __module_cat(a,b) ___module_cat(a,b)
 #define __MODULE_INFO(tag, name, info)					  \
 static const char __module_cat(name,__LINE__)[]				  \
+  __attribute_used__							  \
   __attribute__((section(".modinfo"),unused)) = __stringify(tag) "=" info
 
-#define MODULE_GENERIC_TABLE(gtype,name)			\
-extern const struct gtype##_id __mod_##gtype##_table		\
+#define MODULE_GENERIC_TABLE(gtype,name)		\
+extern const struct gtype##_id __mod_##gtype##_table	\
   __attribute__ ((unused, alias(__stringify(name))))
 
 #define THIS_MODULE (&__this_module)
@@ -142,6 +143,7 @@ void *__symbol_get_gpl(const char *symbo
 #define __CRC_SYMBOL(sym, sec)					\
 	extern void *__crc_##sym __attribute__((weak));		\
 	static const unsigned long __kcrctab_##sym		\
+	__attribute_used__					\
 	__attribute__((section("__kcrctab" sec), unused))	\
 	= (unsigned long) &__crc_##sym;
 #else
@@ -155,6 +157,7 @@ void *__symbol_get_gpl(const char *symbo
 	__attribute__((section("__ksymtab_strings")))		\
 	= MODULE_SYMBOL_PREFIX #sym;                    	\
 	static const struct kernel_symbol __ksymtab_##sym	\
+	__attribute_used__					\
 	__attribute__((section("__ksymtab" sec), unused))	\
 	= { (unsigned long)&sym, __kstrtab_##sym }
 
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/include/linux/moduleparam.h 002-2.6.0-ia64.patch/include/linux/moduleparam.h
--- 000-virgin/include/linux/moduleparam.h	Thu Jan  8 22:59:27 2004
+++ 002-2.6.0-ia64.patch/include/linux/moduleparam.h	Mon Jan 12 10:07:43 2004
@@ -52,6 +52,7 @@ struct kparam_array
 #define __module_param_call(prefix, name, set, get, arg, perm)		\
 	static char __param_str_##name[] __initdata = prefix #name;	\
 	static struct kernel_param const __param_##name			\
+	__attribute_used__						\
     __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \
 	= { __param_str_##name, perm, set, get, arg }
 
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/include/linux/nfs_fs.h 002-2.6.0-ia64.patch/include/linux/nfs_fs.h
--- 000-virgin/include/linux/nfs_fs.h	Mon Jan 12 10:03:37 2004
+++ 002-2.6.0-ia64.patch/include/linux/nfs_fs.h	Mon Jan 12 10:07:43 2004
@@ -447,7 +447,7 @@ static inline loff_t
 nfs_size_to_loff_t(__u64 size)
 {
 	loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1;
-	if (size > maxsz)
+	if (size > (__u64) maxsz)
 		return maxsz;
 	return (loff_t) size;
 }
diff -Naurp -X /home/jbarnes/dontdiff 000-virgin/kernel/printk.c 002-2.6.0-ia64.patch/kernel/printk.c
--- 000-virgin/kernel/printk.c	Mon Jan 12 10:03:37 2004
+++ 002-2.6.0-ia64.patch/kernel/printk.c	Mon Jan 12 10:09:49 2004
@@ -407,6 +407,12 @@ static void _call_console_drivers(unsign
 			__call_console_drivers(start, end);
 		}
 	}
+#ifdef CONFIG_IA64_EARLY_PRINTK
+	if (!console_drivers) {
+		void early_printk (const char *str, size_t len);
+		early_printk(&LOG_BUF(start), end - start);
+	}
+#endif
 }
 
 /*
@@ -742,7 +748,11 @@ void register_console(struct console * c
 		 * for us.
 		 */
 		spin_lock_irqsave(&logbuf_lock, flags);
+#ifdef CONFIG_IA64_EARLY_PRINTK
+		con_start = log_end;
+#else
 		con_start = log_start;
+#endif
 		spin_unlock_irqrestore(&logbuf_lock, flags);
 	}
 	release_console_sem();
@@ -837,3 +847,117 @@ int printk_ratelimit(void)
 	return 0;
 }
 EXPORT_SYMBOL(printk_ratelimit);
+
+#ifdef CONFIG_IA64_EARLY_PRINTK
+
+#include <asm/io.h>
+
+# ifdef CONFIG_IA64_EARLY_PRINTK_VGA
+
+
+#define VGABASE		((char *)0xc0000000000b8000)
+#define VGALINES	24
+#define VGACOLS		80
+
+static int current_ypos = VGALINES, current_xpos = 0;
+
+static void
+early_printk_vga (const char *str, size_t len)
+{
+	char c;
+	int  i, k, j;
+
+	while (len-- > 0) {
+		c = *str++;
+		if (current_ypos >= VGALINES) {
+			/* scroll 1 line up */
+			for (k = 1, j = 0; k < VGALINES; k++, j++) {
+				for (i = 0; i < VGACOLS; i++) {
+					writew(readw(VGABASE + 2*(VGACOLS*k + i)),
+					       VGABASE + 2*(VGACOLS*j + i));
+				}
+			}
+			for (i = 0; i < VGACOLS; i++) {
+				writew(0x720, VGABASE + 2*(VGACOLS*j + i));
+			}
+			current_ypos = VGALINES-1;
+		}
+		if (c == '\n') {
+			current_xpos = 0;
+			current_ypos++;
+		} else if (c != '\r')  {
+			writew(((0x7 << 8) | (unsigned short) c),
+			       VGABASE + 2*(VGACOLS*current_ypos + current_xpos++));
+			if (current_xpos >= VGACOLS) {
+				current_xpos = 0;
+				current_ypos++;
+			}
+		}
+	}
+}
+
+# endif /* CONFIG_IA64_EARLY_PRINTK_VGA */
+
+# ifdef CONFIG_IA64_EARLY_PRINTK_UART
+
+#include <linux/serial_reg.h>
+#include <asm/system.h>
+
+static void early_printk_uart(const char *str, size_t len)
+{
+	static char *uart = NULL;
+	unsigned long uart_base;
+	char c;
+
+	if (!uart) {
+		uart_base = 0;
+#  ifdef CONFIG_SERIAL_8250_HCDP
+		{
+			extern unsigned long hcdp_early_uart(void);
+			uart_base = hcdp_early_uart();
+		}
+#  endif
+#  if CONFIG_IA64_EARLY_PRINTK_UART_BASE
+		if (!uart_base)
+			uart_base = CONFIG_IA64_EARLY_PRINTK_UART_BASE;
+#  endif
+		if (!uart_base)
+			return;
+
+		uart = ioremap(uart_base, 64);
+		if (!uart)
+			return;
+	}
+
+	while (len-- > 0) {
+		c = *str++;
+		while ((readb(uart + UART_LSR) & UART_LSR_TEMT) == 0)
+			cpu_relax(); /* spin */
+
+		writeb(c, uart + UART_TX);
+
+		if (c == '\n')
+			writeb('\r', uart + UART_TX);
+	}
+}
+
+# endif /* CONFIG_IA64_EARLY_PRINTK_UART */
+
+#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN
+extern int early_printk_sn_sal(const char *str, int len);
+#endif
+
+void early_printk(const char *str, size_t len)
+{
+#ifdef CONFIG_IA64_EARLY_PRINTK_UART
+	early_printk_uart(str, len);
+#endif
+#ifdef CONFIG_IA64_EARLY_PRINTK_VGA
+	early_printk_vga(str, len);
+#endif
+#ifdef CONFIG_IA64_EARLY_PRINTK_SGI_SN
+ 	early_printk_sn_sal(str, len);
+#endif
+}
+
+#endif /* CONFIG_IA64_EARLY_PRINTK */
