Date: Thu, 12 Jun 1997 12:02:43 +0200
From: Roman Hodek <rnhodek@faui22c.informatik.uni-erlangen.de>
To: linux-m68k@phil.uni-sb.de
Cc: Jes.Sorensen@cern.ch
In-Reply-To: <9706120944.AA05583@faui21.informatik.uni-erlangen.de> (message
	from Roman Hodek on Thu, 12 Jun 1997 11:44:27 +0200)
Subject: Re: L68K: Bootstrap problem (2.0.x, compressed ramdisks)
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de


> It's appended below. I also included a old patch from Geert with a fix
[...]

Aarg... forgot the diff... Here it is.

BTW, if someone should ask why Geert's patch was so long and mine so
short: On the Atari, we have always passed to the mover code 
bi.ramdisk.addr and rd_size, not start_mem, mem_size, and rd_size.
So we don't need changes there.

Roman

------------------------------------------------------------------------------

--- linux-2.1.42/arch/m68k/boot/atari/bootstrap.c~	Thu Jun 12 11:28:42 1997
+++ /home/faui21/inf2/i2staff/rnhodek/notebook/src/linux-2.1.42/arch/m68k/boot/atari/bootstrap.c	Thu Jun 12 12:01:35 1997
@@ -8,6 +8,8 @@
 ** for more details.
 **
 ** History:
+**	11 Jun 1997 Fix for unpadded gzipped ramdisks with bootinfo interface
+**		    version 1.0 (Geert, Roman)
 **	01 Feb 1997 Implemented kernel decompression (Roman)
 **	28 Nov 1996 Fixed and tested previous change (James)
 **	27 Nov 1996 Compatibility with bootinfo interface version 1.0 (Geert)
@@ -45,7 +47,6 @@
 #include <ctype.h>
 #include "sysvars.h"
 #include <osbind.h>
-#include <sys/types.h>
 #include <sys/file.h>
 
 /* linux specific include files */
@@ -416,7 +417,7 @@
     kernel_name = "vmlinux";
 
     /* print the startup message */
-    puts("\fLinux/68k Atari Bootstrap version 2.2"
+    puts("\fLinux/68k Atari Bootstrap version 2.4"
 #ifdef USE_BOOTP
 	 " (with BOOTP)"
 #endif
@@ -1055,7 +1056,7 @@
 	  {
 	    for (i = 0; i < kexec_elf.e_phnum; i++)
 	      {
-		printf ("Kernel segment %d at %#lx, size %ld\n", i,
+		printf ("Kernel segment %d at %#lx, size %d\n", i,
 			start_mem + kernel_phdrs[i].p_vaddr - PAGE_SIZE,
 			kernel_phdrs[i].p_memsz);
 	      }
@@ -1071,7 +1072,7 @@
 	  }
 	printf ("\nboot_info is at %#lx\n",
 		start_mem + kernel_size);
-	printf ("\nKernel entry is %#lx\n",
+	printf ("\nKernel entry is %#x\n",
 		elf_kernel ? kexec_elf.e_entry : kexec.a_entry);
 	printf ("ramdisk dest top is %#lx\n", bi.ramdisk.addr + rd_size);
 	printf ("ramdisk lower limit is %#lx\n",
@@ -1299,7 +1300,7 @@
 	compat_bootinfo.cputype |= COMPAT_FPU_68040;
     else if (bi.fputype & FPU_68060)
 	compat_bootinfo.cputype |= COMPAT_FPU_68060;
-    else {
+    else if (bi.fputype) {
 	printf("FPU type 0x%08lx not supported by kernel\n", bi.fputype);
 	return(0);
     }
@@ -1314,6 +1315,7 @@
 	compat_bootinfo.memory[i].size = bi.memory[i].size;
     }
     if (bi.ramdisk.size) {
+	bi.ramdisk.addr &= 0xfffffc00;
 	compat_bootinfo.ramdisk_size = (bi.ramdisk.size+1023)/1024;
 	compat_bootinfo.ramdisk_addr = bi.ramdisk.addr;
     } else {
