I'm not the one that did these, but since you asked... ;-)
The source RPM is available on:
ftp://ftp.caldera.com/pub/eDesktop/Packages/SRPMS/grub-0.5.94-5.src.rpm
and the relevant patches from that are attached.
initrd1G - places the initrd below 1G so large mem machines will boot.
nomeminfo - tries to help some broken BIOSes with mem detection
splash - graphical menu (splash) screen, CD ioctl, etc.
--
Tim Riker - http://rikers.org/ - short SIGs! g
All I need to know I could have learned in Kindergarten
... if I'd just been paying attention.
--- grub-0.5.94/stage2/boot.c.orig Thu Feb 10 10:25:16 2000
+++ grub-0.5.94/stage2/boot.c Thu Feb 10 14:49:49 2000
@@ -544,7 +544,7 @@
return 0;
}
- moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) 0xf000;
+ moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) 0x3000;
memmove ((void *) RAW_ADDR (moveto), (void *) cur_addr, len);
if (cls_hook_seg)
--- grub-0.5.94/stage2/boot.c Thu Feb 10 18:12:26 2000
+++ grub-0.5.94.new/stage2/boot.c Thu Feb 10 16:05:52 2000
@@ -261,17 +261,26 @@
/* copy command-line plus memory hack to staging area */
{
char *src = arg;
- char *dest = (char *) (CL_MY_LOCATION + 4);
-
- memmove ((char *) CL_MY_LOCATION, "mem=", 4);
-
- *((unsigned short *) CL_OFFSET) = CL_MY_LOCATION - CL_BASE_ADDR;
- *((unsigned short *) CL_MAGIC_ADDR) = CL_MAGIC;
-
- dest = convert_to_ascii (dest, 'u', (mbi.mem_upper + 0x400));
- *(dest++) = 'K';
- *(dest++) = ' ';
+ char *dest = (char *) (CL_MY_LOCATION);
+ *((unsigned short *) CL_OFFSET) = CL_MY_LOCATION - CL_BASE_ADDR;
+ *((unsigned short *) CL_MAGIC_ADDR) = CL_MAGIC;
+
+ /* Help Linux to find memory only if more than 64MB are present.
+ * Up to that amount it is fairly capable to find by itself,
+ * and at least newer Phoenix BIOSes are known to put a
+ * 10k hole just before 64MB, but report a proper total.
+ */
+ if (mbi.mem_upper 65535) /* might subtract 1MB lower mem here */
+ {
+ memmove ((char *) CL_MY_LOCATION, "mem=", 4);
+ dest = (char *) (CL_MY_LOCATION + 4);
+
+ dest = convert_to_ascii (dest, 'u', (mbi.mem_upper + 0x400));
+ *(dest++) = 'K';
+ *(dest++) = ' ';
+ }
+
while (*src *src != ' ')
src++;
diff -ur grub-0.5.94.orig/grub/asmstub.c grub-0.5.94/grub/asmstub.c
--- grub-0.5.94.orig/grub/asmstub.c Wed Jan 19 12:58:36 2000
+++ grub-0.5.94/grub/asmstub.c Wed Jan 19 15:38:06 2000
@@ -43,6 +43,8 @@
#ifdef __linux__
# include sys/ioctl.h /* ioctl */
# include linux/hdreg.h /* HDIO_GETGEO */
+# include linux/cdrom.h /* CDROM_GET_CAPABILITY to identify CDs */
+# define SOME_CDROM_IOCTL CDROM_GET_CAPABILITY
# if __GLIBC__ 2
/* Maybe libc doesn't have large file support. */
# include linux/unistd.h /* _llseek */
@@ -56,6 +58,8 @@
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
# include sys/ioctl.h /* ioctl */
# include sys/disklabel.h
+# include sys/cdio.h /* CDIOCCLRDEBUG to identify CDs */
+# define SOME_CDROM_IOCTL CDIOCCLRDEBUG
#endif /* __FreeBSD__ || __NetBSD__ || __OpenBSD__ */
#ifdef HAVE_OPENDISK
@@ -83,6 +87,9 @@
unsigned long boot_drive = 0;
char version_string[] = VERSION;
char config_file[128] = "/boot/grub/menu.lst"; /* FIXME: arbitrary */
+char splashscreen_file[128];
+
+unsigned short cls_hook_seg;
/* Emulation requirements. */
char *grub_scratch_mem = 0;
@@ -538,6 +545,11 @@
fclose (fp);
return 0;
}
+
+ /* Make sure CD-ROMs don't get assigned a BIOS disk number
+ before SCSI disks ! */
+ if (ioctl(fileno(fp), SOME_CDROM_IOCTL, 0) = 0)
+return 0;
fclose (fp);
return 1;
diff -ur grub-0.5.94.orig/stage2/asm.S grub-0.5.94/stage2/asm.S
--- grub-0.5.94.orig/stage2/asm.S Wed Jan 19 12:58:36 2000
+++ grub-0.5.94/stage2/asm.S Wed Jan 19 15:38:06 2000
@@ -1345,7 +1345,7 @@
movb %bl, %al
movb $0xe, %ah
- movw $1, %bx
+ movw $0x8f, %bx /* invert all planes */
int $0x10
DATA32 call EXT_C(real_to_prot)
@@ -1688,24 +1688,45 @@
ENTRY(cls)
- push %ebp
- push %eax
- push %ebx/* save EBX */
+ pusha
call EXT_C(prot_to_real)
.code16
+ movw EXT_C(cls_hook_seg), %ax
+ cmpw $0, %ax
+ je cls_self
+
+
+ mov %ds,%ax
+ push %ax
+
+ mov %es,%ax
+ push %ax
+
+ lcall (cls_hook)
+
+ pop %ax
+ mov %ax,%es
+
+ pop %ax
+ mov %ax,%ds
+
+ jmp cls_ret
+
+cls_self:
+
movb $0xf, %ah
int $0x10 /* Get Current Video mode */
xorb %ah, %ah
+ movw $0x0003, %ax /* hardcode 80x25 color XXX */
int $0x10 /* Set Video mode (clears screen) */
+cls_ret:
DATA32 call EXT_C(real_to_prot)
.code32
- pop %ebx
- pop %eax
- pop %ebp
+ popa
ret
@@ -1861,10 +1882,19 @@
call EXT_C(prot_to_real)
.code16
+ movw EXT_C(cls_hook_seg),%ax
+ cmpw $0, %ax
+ je sa_text
+
+ movb $0xDB, %al
+ movw $0x8f, %bx /* invert all planes */
+ jmp sa_common
+sa_text:
movb $0x8, %ah
int $0x10
- movb $0x9, %ah