From 085c69220f3ab2f01fb840407815e56523544c8f Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Sun, 2 Jul 2006 23:12:43 +0000 Subject: fluxbox: Add more geometry defaults for gpe apps --- packages/fluxbox/fluxbox-gpe/apps.gpe | 50 ++++++++++++++++++++++++++++++++--- packages/fluxbox/fluxbox-gpe_1.0rc.bb | 2 +- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/packages/fluxbox/fluxbox-gpe/apps.gpe b/packages/fluxbox/fluxbox-gpe/apps.gpe index 24d095f0fc..7aca442752 100644 --- a/packages/fluxbox/fluxbox-gpe/apps.gpe +++ b/packages/fluxbox/fluxbox-gpe/apps.gpe @@ -1,5 +1,6 @@ [app] (title=Panel 0) [Deco] {NONE} + [Sticky] {yes} [end] [app] (title=Panel 1) [Deco] {NONE} @@ -8,6 +9,49 @@ [Dimensions] {635 440} [end] [app] (title=x-terminal-emulator) - [Dimensions] {635 440} -[end] - + [Dimensions] {635 440} +[end] +[app] (abiword) + [Dimensions] {635 440} + [Sticky] {no} +[end] +[app] (gpe-filemanager) + [Dimensions] {635 440} + [Sticky] {yes} +[end] +[app] (gpe-info) + [Dimensions] {424 336} +[end] +[app] (gpe-edit) + [Dimensions] {635 440} +[end] +[app] (gpe-calculator) + [Dimensions] {266 321} +[end] +[app] (main) + [Dimensions] {635 440} +[end] +[app] (Gnumeric) + [Dimensions] {635 440} +[end] +[app] (gpdf) + [Dimensions] {635 440} +[end] +[app] (main_window) + [Dimensions] {635 440} +[end] +[app] (gaim) + [Dimensions] {635 440} +[end] +[app] (gpe-calendar) + [Dimensions] {380 343} +[end] +[app] (gpe-mini-browser) + [Dimensions] {635 440} +[end] +[app] (figment) + [Dimensions] {635 440} +[end] +[app] (gpe-sketchbook) + [Dimensions] {471 314} +[end] diff --git a/packages/fluxbox/fluxbox-gpe_1.0rc.bb b/packages/fluxbox/fluxbox-gpe_1.0rc.bb index 6becbe365d..50c5d6ce1d 100644 --- a/packages/fluxbox/fluxbox-gpe_1.0rc.bb +++ b/packages/fluxbox/fluxbox-gpe_1.0rc.bb @@ -13,7 +13,7 @@ RCONFLICTS = "fluxbox" ###################################################################################### -PR = "r0" +PR = "r1" S = "${WORKDIR}/fluxbox-${PV}" ###################################################################################### -- cgit v1.2.3 From 602af584cc98ccfa10ca30cd850ec0ac92fe8ac0 Mon Sep 17 00:00:00 2001 From: Matthias Hentges Date: Mon, 3 Jul 2006 02:37:00 +0000 Subject: fluxbox: Add mult-machine support for geometry defaults --- packages/fluxbox/fluxbox-gpe/apps.gpe | 57 ------------------------ packages/fluxbox/fluxbox-gpe/apps.gpe.akita | 57 ++++++++++++++++++++++++ packages/fluxbox/fluxbox-gpe/apps.gpe.default | 7 +++ packages/fluxbox/fluxbox-gpe/fluxbox-gpe-session | 14 +++++- packages/fluxbox/fluxbox-gpe_1.0rc.bb | 8 ++-- 5 files changed, 80 insertions(+), 63 deletions(-) delete mode 100644 packages/fluxbox/fluxbox-gpe/apps.gpe create mode 100644 packages/fluxbox/fluxbox-gpe/apps.gpe.akita create mode 100644 packages/fluxbox/fluxbox-gpe/apps.gpe.default diff --git a/packages/fluxbox/fluxbox-gpe/apps.gpe b/packages/fluxbox/fluxbox-gpe/apps.gpe deleted file mode 100644 index 7aca442752..0000000000 --- a/packages/fluxbox/fluxbox-gpe/apps.gpe +++ /dev/null @@ -1,57 +0,0 @@ -[app] (title=Panel 0) - [Deco] {NONE} - [Sticky] {yes} -[end] -[app] (title=Panel 1) - [Deco] {NONE} -[end] -[app] (title=rxvt) - [Dimensions] {635 440} -[end] -[app] (title=x-terminal-emulator) - [Dimensions] {635 440} -[end] -[app] (abiword) - [Dimensions] {635 440} - [Sticky] {no} -[end] -[app] (gpe-filemanager) - [Dimensions] {635 440} - [Sticky] {yes} -[end] -[app] (gpe-info) - [Dimensions] {424 336} -[end] -[app] (gpe-edit) - [Dimensions] {635 440} -[end] -[app] (gpe-calculator) - [Dimensions] {266 321} -[end] -[app] (main) - [Dimensions] {635 440} -[end] -[app] (Gnumeric) - [Dimensions] {635 440} -[end] -[app] (gpdf) - [Dimensions] {635 440} -[end] -[app] (main_window) - [Dimensions] {635 440} -[end] -[app] (gaim) - [Dimensions] {635 440} -[end] -[app] (gpe-calendar) - [Dimensions] {380 343} -[end] -[app] (gpe-mini-browser) - [Dimensions] {635 440} -[end] -[app] (figment) - [Dimensions] {635 440} -[end] -[app] (gpe-sketchbook) - [Dimensions] {471 314} -[end] diff --git a/packages/fluxbox/fluxbox-gpe/apps.gpe.akita b/packages/fluxbox/fluxbox-gpe/apps.gpe.akita new file mode 100644 index 0000000000..7aca442752 --- /dev/null +++ b/packages/fluxbox/fluxbox-gpe/apps.gpe.akita @@ -0,0 +1,57 @@ +[app] (title=Panel 0) + [Deco] {NONE} + [Sticky] {yes} +[end] +[app] (title=Panel 1) + [Deco] {NONE} +[end] +[app] (title=rxvt) + [Dimensions] {635 440} +[end] +[app] (title=x-terminal-emulator) + [Dimensions] {635 440} +[end] +[app] (abiword) + [Dimensions] {635 440} + [Sticky] {no} +[end] +[app] (gpe-filemanager) + [Dimensions] {635 440} + [Sticky] {yes} +[end] +[app] (gpe-info) + [Dimensions] {424 336} +[end] +[app] (gpe-edit) + [Dimensions] {635 440} +[end] +[app] (gpe-calculator) + [Dimensions] {266 321} +[end] +[app] (main) + [Dimensions] {635 440} +[end] +[app] (Gnumeric) + [Dimensions] {635 440} +[end] +[app] (gpdf) + [Dimensions] {635 440} +[end] +[app] (main_window) + [Dimensions] {635 440} +[end] +[app] (gaim) + [Dimensions] {635 440} +[end] +[app] (gpe-calendar) + [Dimensions] {380 343} +[end] +[app] (gpe-mini-browser) + [Dimensions] {635 440} +[end] +[app] (figment) + [Dimensions] {635 440} +[end] +[app] (gpe-sketchbook) + [Dimensions] {471 314} +[end] diff --git a/packages/fluxbox/fluxbox-gpe/apps.gpe.default b/packages/fluxbox/fluxbox-gpe/apps.gpe.default new file mode 100644 index 0000000000..d7a0a83f22 --- /dev/null +++ b/packages/fluxbox/fluxbox-gpe/apps.gpe.default @@ -0,0 +1,7 @@ +[app] (title=Panel 0) + [Deco] {NONE} + [Sticky] {yes} +[end] +[app] (title=Panel 1) + [Deco] {NONE} +[end] diff --git a/packages/fluxbox/fluxbox-gpe/fluxbox-gpe-session b/packages/fluxbox/fluxbox-gpe/fluxbox-gpe-session index ca0afea35d..f6e03ede7e 100644 --- a/packages/fluxbox/fluxbox-gpe/fluxbox-gpe-session +++ b/packages/fluxbox/fluxbox-gpe/fluxbox-gpe-session @@ -4,10 +4,20 @@ # # Install "apps" file with defaults for GPE usage -if test -e /usr/share/fluxbox/apps.gpe + +MACHINE="`cat /proc/cpuinfo | sed -n "/^Hardware/s/.*\:\ \(.*\)/\1/p"`" + +case $MACHINE in +*Akita | *Spitz | *Borzoi | *Terrier) + APPS="apps.gpe.akita";; +*) + APPS="apps.gpe.default";; +esac + +if test -e /usr/share/fluxbox/$APPS then mkdir -p $HOME/.fluxbox - test -e $HOME/.fluxbox/apps || cp /usr/share/fluxbox/apps.gpe $HOME/.fluxbox/apps + test -e $HOME/.fluxbox/apps || cp /usr/share/fluxbox/$APPS $HOME/.fluxbox/apps fi diff --git a/packages/fluxbox/fluxbox-gpe_1.0rc.bb b/packages/fluxbox/fluxbox-gpe_1.0rc.bb index 50c5d6ce1d..0d962ca6f5 100644 --- a/packages/fluxbox/fluxbox-gpe_1.0rc.bb +++ b/packages/fluxbox/fluxbox-gpe_1.0rc.bb @@ -13,14 +13,14 @@ RCONFLICTS = "fluxbox" ###################################################################################### -PR = "r1" +PR = "r2" S = "${WORKDIR}/fluxbox-${PV}" ###################################################################################### SRC_URI = "http://switch.dl.sourceforge.net/sourceforge/fluxbox/fluxbox-${PV}.tar.gz \ file://gpe-init.patch;patch=1\ - file://apps.gpe \ + file://apps.gpe.* \ file://style.gpe-default \ file://fluxbox-gpe-session \ file://fluxbox-gpe.session" @@ -37,7 +37,7 @@ FILES_${PN} = "/usr/bin \ /usr/share/fluxbox/init \ /usr/share/fluxbox/keys \ /usr/share/fluxbox/menu \ - /usr/share/fluxbox/apps.gpe \ + /usr/share/fluxbox/apps.gpe* \ /usr/share/fluxbox/session \ /usr/share/fluxbox/styles/gpe-default" @@ -59,7 +59,7 @@ do_install_append() { install -d ${D}/usr/share/fluxbox install -d ${D}/usr/share/fluxbox/styles - install -m 0644 ${WORKDIR}/apps.gpe ${D}/usr/share/fluxbox + install -m 0644 ${WORKDIR}/apps.gpe.* ${D}/usr/share/fluxbox install -m 0755 ${WORKDIR}/fluxbox-gpe.session ${D}/usr/share/fluxbox/session install -m 0644 ${WORKDIR}/style.gpe-default ${D}/usr/share/fluxbox/styles/gpe-default install -m 0755 ${WORKDIR}/fluxbox-gpe-session ${D}/usr/bin -- cgit v1.2.3 From 9b820e6f7a397dbf74f92b2596bd58fd2528283b Mon Sep 17 00:00:00 2001 From: Jamie Lenehan Date: Mon, 3 Jul 2006 03:09:47 +0000 Subject: lilo-sh 0.21: Add lilo-sh, a port of the LILO bootloader to the sh architecture. Required for the titan SH4 boards to boot from the internal flash which has a translation layer to make it look like a standard block device. --- packages/lilo-sh/.mtn2git_empty | 0 packages/lilo-sh/files/.mtn2git_empty | 0 packages/lilo-sh/files/lilo-0.21-1.1.patch | 35 + packages/lilo-sh/files/lilo-0.21-include.patch | 10 + packages/lilo-sh/files/lilo-0.21-loopdev.patch | 11 + packages/lilo-sh/files/lilo-0.21-second.patch | 36 + packages/lilo-sh/files/lilo-linkgear.patch | 1039 +++++++++++++ packages/lilo-sh/files/lilo-noconfig-h.patch | 23 + packages/lilo-sh/files/lilo-sh-linux.patch | 1971 ++++++++++++++++++++++++ packages/lilo-sh/files/lilo.patch | 42 + packages/lilo-sh/files/lilo.raid1 | 552 +++++++ packages/lilo-sh/lilo-sh_21.bb | 41 + 12 files changed, 3760 insertions(+) create mode 100644 packages/lilo-sh/.mtn2git_empty create mode 100644 packages/lilo-sh/files/.mtn2git_empty create mode 100644 packages/lilo-sh/files/lilo-0.21-1.1.patch create mode 100644 packages/lilo-sh/files/lilo-0.21-include.patch create mode 100644 packages/lilo-sh/files/lilo-0.21-loopdev.patch create mode 100644 packages/lilo-sh/files/lilo-0.21-second.patch create mode 100644 packages/lilo-sh/files/lilo-linkgear.patch create mode 100644 packages/lilo-sh/files/lilo-noconfig-h.patch create mode 100644 packages/lilo-sh/files/lilo-sh-linux.patch create mode 100644 packages/lilo-sh/files/lilo.patch create mode 100644 packages/lilo-sh/files/lilo.raid1 create mode 100644 packages/lilo-sh/lilo-sh_21.bb diff --git a/packages/lilo-sh/.mtn2git_empty b/packages/lilo-sh/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/lilo-sh/files/.mtn2git_empty b/packages/lilo-sh/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/lilo-sh/files/lilo-0.21-1.1.patch b/packages/lilo-sh/files/lilo-0.21-1.1.patch new file mode 100644 index 0000000000..dfbab2a82c --- /dev/null +++ b/packages/lilo-sh/files/lilo-0.21-1.1.patch @@ -0,0 +1,35 @@ +--- lilo/Makefile- Fri Dec 4 15:35:07 1998 ++++ lilo/Makefile Wed Mar 17 01:04:07 1999 +@@ -24,7 +24,7 @@ + # VARSETUP Enables use of variable-size setup segments. + # XL_SECS=n Support for extra large (non-standard) floppies. + +-CONFIG=-DIGNORECASE -DVARSETUP -DREWRITE_TABLE ++CONFIG=-DIGNORECASE -DVARSETUP -DREWRITE_TABLE -DLARGE_EBDA -DONE_SHOT + + # End of configuration variables + +--- lilo/second.S- Fri Dec 4 15:20:07 1998 ++++ lilo/second.S Wed Mar 17 01:03:53 1999 +@@ -830,9 +830,20 @@ + call load1 + seg es + mov CL_MAGIC_ADDR,#CL_MAGIC ! set magic number ++#ifndef LCF_LARGE_EBDA + seg es + mov word ptr CL_OFFSET,#PARMLINE+SECOND_SS + ! set parameter line offset ++#else ++ mov di,#0x8000 ++ mov si,#PARMLINE ++ mov cx,#CL_LENGTH ++ rep ++ movsb ++ seg es ++ mov word ptr CL_OFFSET,#0x8000 ++ ! set parameter line offset ++#endif + pop si ! restore SI + lodsw ! get flags bit map + mov bx,ax + diff --git a/packages/lilo-sh/files/lilo-0.21-include.patch b/packages/lilo-sh/files/lilo-0.21-include.patch new file mode 100644 index 0000000000..61e298013c --- /dev/null +++ b/packages/lilo-sh/files/lilo-0.21-include.patch @@ -0,0 +1,10 @@ +--- lilo.orig/common.h Wed Oct 14 17:44:28 1998 ++++ lilo/common.h Mon Dec 7 18:05:17 1998 +@@ -7,6 +7,7 @@ + #define COMMON_H + + #include ++#include + #include + + #include "lilo.h" diff --git a/packages/lilo-sh/files/lilo-0.21-loopdev.patch b/packages/lilo-sh/files/lilo-0.21-loopdev.patch new file mode 100644 index 0000000000..e739c5b104 --- /dev/null +++ b/packages/lilo-sh/files/lilo-0.21-loopdev.patch @@ -0,0 +1,11 @@ +--- lilo/device.c.oot Mon Jan 10 09:37:00 2000 ++++ lilo/device.c Mon Jan 10 09:37:37 2000 +@@ -192,4 +192,8 @@ + sprintf(tmp,"/dev/sdb%d",i); + cache_add(tmp,0x810+i); + } ++ for (i = 0; i <= 7; i++) { ++ sprintf(tmp,"/dev/loop%d",i); ++ cache_add(tmp,0x700+i); ++ } + } diff --git a/packages/lilo-sh/files/lilo-0.21-second.patch b/packages/lilo-sh/files/lilo-0.21-second.patch new file mode 100644 index 0000000000..12a9af04c7 --- /dev/null +++ b/packages/lilo-sh/files/lilo-0.21-second.patch @@ -0,0 +1,36 @@ +I have a problem to report with lilo, and the fix for it. I am not sure +whether this is the right place for it though, I am also CCing the lilo +maintainer Werner Almesberger. + +When lilo gets control from the bios (whether lilo is on disk, or on the +floppy), it is checking the wrong location when it tries to parse the +parameter line construction area to determine whether it needs to clean +up extra blank spaces. This is causing lilo to eat up the last character(s) +of the command line that it passes to the kernel. + +Specifically, the code + +cpcodn: cmp byte ptr (di-1),#32 ! last was space ? + +is using the memory contents of ds:di-1 for the compare. It should +really be using es:di-1. I checked, ds=0x0b00 around here, so the +code ended up checking 0x0b00:(di-1) instead of 0x9000:(di-1). It +is quite possible that the memory that lilo checks has garbage, +causing it to make wrong decision. A "seg es" just before the cmp +fixes the problem. I am attaching the patch below. + +Kanoj + +--- second.0 Mon Sep 20 13:52:01 1999 ++++ second.S Tue Sep 28 10:20:54 1999 +@@ -816,7 +816,8 @@ + je cpcodsp ! yes -> discard next + lodsb ! get next byte + jmp cpcolp +-cpcodn: cmp byte ptr (di-1),#32 ! last was space ? ++cpcodn: seg es ++ cmp byte ptr (di-1),#32 ! last was space ? + jne nocopt ! no -> go on + dec di ! discard it + nocopt: mov si,options ! append variable options + diff --git a/packages/lilo-sh/files/lilo-linkgear.patch b/packages/lilo-sh/files/lilo-linkgear.patch new file mode 100644 index 0000000000..598a92a7af --- /dev/null +++ b/packages/lilo-sh/files/lilo-linkgear.patch @@ -0,0 +1,1039 @@ +diff -Naur --exclude=CVS --exclude='*.orig' lilo/Makefile lilosh/Makefile +--- lilo/Makefile 2006-02-01 21:16:29.000000000 +0000 ++++ lilosh/Makefile 2006-02-01 21:23:37.000000000 +0000 +@@ -40,7 +40,6 @@ + + SHELL=/bin/sh + +-CROSS_COMPILE = sh3-linux- + CC =$(CROSS_COMPILE)gcc + LD =$(CROSS_COMPILE)ld + OBJCOPY =$(CROSS_COMPILE)objcopy +@@ -72,10 +71,10 @@ + $(OBJCOPY) -R .comment -S second.exe -O binary second.bin + + first.exe: first.o +- $(LD) -EL -e start first.o -o first.exe -Ttext 0x8c200000 ++ $(LD) -EL -e start first.o -o first.exe -Ttext 0x88a00000 + + second.exe: second.o string.o +- $(LD) -T second.lds -EL second.o string.o -o second.exe -Ttext 0x8c201000 ++ $(LD) -T second.lds -EL second.o string.o -o second.exe -Ttext 0x88a01000 + + first.o: first.S + $(CC) $(CFLAGS) -c first.S +diff -Naur --exclude=CVS --exclude='*.orig' lilo/boot.c lilosh/boot.c +--- lilo/boot.c 1997-06-20 12:48:28.000000000 +0000 ++++ lilosh/boot.c 2006-01-31 19:46:21.000000000 +0000 +@@ -11,6 +11,7 @@ + #include + #include + #include ++#include + + #include "config.h" + #include "common.h" +@@ -70,6 +71,7 @@ + geo_close(&geo); + if (verbose > 1) + printf("Mapped %d sector%s.\n",sectors,sectors == 1 ? "" : "s"); ++ memset(&descr->initrd, 0, sizeof(descr->initrd)); + if ((initrd = cfg_get_strg(cf_kernel,"initrd")) || (initrd = cfg_get_strg( + cf_options,"initrd"))) { + if (!modern_kernel) die("Kernel doesn't support initial RAM disks"); +diff -Naur --exclude=CVS --exclude='*.orig' lilo/bsect.c lilosh/bsect.c +--- lilo/bsect.c 1998-10-14 20:30:32.000000000 +0000 ++++ lilosh/bsect.c 2004-10-01 19:05:58.000000000 +0000 +@@ -189,11 +189,11 @@ + } + } + bsect.par_1.prompt = cfg_get_flag(cf_options,"prompt"); +- if (delay*100/55 > 0xffff) die("Maximum delay is one hour."); +- else bsect.par_1.delay = delay*100/55; ++ if (delay >= 36000) die("Maximum delay is one hour."); ++ else bsect.par_1.delay = delay; + if (timeout == -1) bsect.par_1.timeout = 0xffff; +- else if (timeout*100/55 >= 0xffff) die("Maximum timeout is one hour."); +- else bsect.par_1.timeout = timeout*100/55; ++ else if (timeout >= 36000) die("Maximum timeout is one hour."); ++ else bsect.par_1.timeout = timeout; + if (!(keytable = cfg_get_strg(cf_options,"keytable"))) { + int i; + +diff -Naur --exclude=CVS --exclude='*.orig' lilo/defs.h lilosh/defs.h +--- lilo/defs.h 2006-02-01 21:16:29.000000000 +0000 ++++ lilosh/defs.h 2004-05-19 16:39:08.000000000 +0000 +@@ -1,2 +1,3 @@ + extern void *memcpy (void *__dest, const void *__src, unsigned int __n); + extern int strlen (__const char *__s); ++extern void *memset(void *s, int c, unsigned int n); +diff -Naur --exclude=CVS --exclude='*.orig' lilo/first.S lilosh/first.S +--- lilo/first.S 2006-02-01 21:16:29.000000000 +0000 ++++ lilosh/first.S 2006-02-01 22:02:02.000000000 +0000 +@@ -1,4 +1,4 @@ +-/* $Id: first.S,v 1.16 2000/11/26 07:11:58 gniibe Exp $ ++/* $Id: first.S,v 1.1.1.1 2002/05/15 06:44:39 bmann Exp $ + * + * Primary boot loader + * +@@ -54,7 +54,7 @@ + ! /* ^--- Minor Version*/ + #endif + +-/* x86 LILO parameters (Not used for SuperH... yet) */ ++/* x86 LILO parameters (port and sparam not used for SuperH... yet) */ + timeout:.word 0 ! input timeout + delay: .word 0 ! boot delay + port: .byte 0 ! COM port (0 = unused, 1 = COM1, etc.) +@@ -67,11 +67,13 @@ + d1_cx: .word 0 + d1_dx: .word 0 + d1_al: .byte 0 ++ .byte 0 ! align next .word + + /* Second descripter sector (Filled by LILO command) */ + d2_cx: .word 0 + d2_dx: .word 0 + d2_al: .byte 0 ++ .byte 0 ! align next .word + + /* Default command-line sector (Filled by LILO command) */ + dc_cx: .word 0 +@@ -87,11 +89,13 @@ + ms_cx: .word 0 + ms_dx: .word 0 + ms_al: .byte 0 ++ .byte 0 ! align next .word + + /* Second descripter sector (Filled by LILO command) */ + kt_cx: .word 0 ! keyboard translation table + kt_dx: .word 0 + kt_al: .byte 0 ++ .byte 0 ! align next .long + + d_addr: ! second stage sector addresses + +diff -Naur --exclude=CVS --exclude='*.orig' lilo/geometry.c lilosh/geometry.c +--- lilo/geometry.c 2006-02-01 21:15:51.000000000 +0000 ++++ lilosh/geometry.c 2006-02-01 22:13:05.000000000 +0000 +@@ -16,6 +16,7 @@ + #include + #include + #include ++#include + + #include "config.h" + #include "lilo.h" +@@ -37,7 +38,7 @@ + + + DT_ENTRY *disktab = NULL; +-int old_disktab = 0; ++static int old_disktab = 0; + + + void geo_init(char *name) +@@ -297,6 +298,7 @@ + case MAJOR_ESDI: + /* fall through */ + case MAJOR_XT: ++ /* fall through */ + geo->device = 0x80+(MINOR(device) >> 6)+(MAJOR(device) == MAJOR_HD ? + 0 : last_dev(MAJOR_HD,64)); + if (ioctl(fd,HDIO_GETGEO,&hdprm) < 0) +@@ -353,6 +355,17 @@ + geo->sectors = hdprm.sectors; + geo->start = hdprm.start; + break; ++ case MAJOR_NAND: ++ /* fall through */ ++ geo->device = 0x80+(MINOR(device)); ++ if (ioctl(fd,HDIO_GETGEO,&hdprm) < 0) ++ die("geo_query_dev HDIO_GETGEO (dev 0x%04x): %s",device, ++ strerror(errno)); ++ geo->heads = hdprm.heads; ++ geo->cylinders = hdprm.cylinders; ++ geo->sectors = hdprm.sectors; ++ geo->start = hdprm.start; ++ break; + + default: + die("Sorry, don't know how to handle device 0x%04x",device); +diff -Naur --exclude=CVS --exclude='*.orig' lilo/geometry.h lilosh/geometry.h +--- lilo/geometry.h 2006-02-01 21:15:51.000000000 +0000 ++++ lilosh/geometry.h 2006-02-01 22:14:07.000000000 +0000 +@@ -8,7 +8,6 @@ + + #include "lilo.h" + +- + typedef struct { + int device,heads; + int cylinders,sectors; +@@ -29,6 +28,7 @@ + + extern DT_ENTRY *disktab; + ++ + void geo_init(char *name); + + /* Loads the disk geometry table. */ +diff -Naur --exclude=CVS --exclude='*.orig' lilo/lilo.c lilosh/lilo.c +--- lilo/lilo.c 2006-02-01 21:15:51.000000000 +0000 ++++ lilosh/lilo.c 2006-02-01 21:56:56.000000000 +0000 +@@ -85,11 +85,11 @@ + if (verbose > 0) { + bsect_read(cfg_get_strg(cf_options,"boot"),&boot); + printf("Global settings:\n"); +- tsecs = (boot.par_1.delay*55+50)/100; ++ tsecs = boot.par_1.delay; + printf(" Delay before booting: %d.%d seconds\n",tsecs/10,tsecs % 10); + if (boot.par_1.timeout == 0xffff) printf(" No command-line timeout\n"); + else { +- tsecs = (boot.par_1.timeout*55+50)/100; ++ tsecs = boot.par_1.timeout; + printf(" Command-line timeout: %d.%d seconds\n",tsecs/10, + tsecs % 10); + } +@@ -411,11 +411,11 @@ + else if (st.st_mode & (S_IWGRP | S_IWOTH)) + fprintf(stderr,"Warning: %s should be writable only for " + "root\n",config_file); +- else if ((cfg_get_strg(cf_all,"password") || cfg_get_strg( +- cf_options,"password")) && (st.st_mode & (S_IRGRP | +- S_IROTH))) +- fprintf(stderr,"Warning: %s should be readable only " +- "for root if using PASSWORD\n",config_file); ++ else if ((cfg_get_strg(cf_all,"password") || cfg_get_strg( ++ cf_options,"password")) && (st.st_mode & (S_IRGRP | ++ S_IROTH))) ++ fprintf(stderr,"Warning: %s should be readable only " ++ "for root if using PASSWORD\n",config_file); + } + } + preload_dev_cache(); +@@ -491,7 +491,7 @@ + md_disk.cylinders = geo.cylinders; + md_disk.start = geo.start; + } +- ++ + pass++; + if (uninstall) + bsect_uninstall(uninst_dev ? uninst_dev : cfg_get_strg(cf_options, +@@ -517,8 +517,8 @@ + cf_options,"delay")) : 0,cfg_get_strg(cf_options,"timeout") ? + to_number(cfg_get_strg(cf_options,"timeout")) : -1); + if (more) { +- cfg_init(cf_top); +- if (cfg_parse(cf_top)) cfg_error("Syntax error"); ++ cfg_init(cf_top); ++ if (cfg_parse(cf_top)) cfg_error("Syntax error"); + } + if (!bsect_number()) die("No images have been defined."); + check_fallback(); +diff -Naur --exclude=CVS --exclude='*.orig' lilo/lilo.h lilosh/lilo.h +--- lilo/lilo.h 2006-02-01 21:15:44.000000000 +0000 ++++ lilosh/lilo.h 2006-02-01 21:28:33.000000000 +0000 +@@ -39,6 +39,7 @@ + #define MAJOR_DAC960 48 /* First Mylex DAC960 PCI RAID controller */ + #define MAJOR_IDE5 55 /* IDE on fifth interface */ + #define MAJOR_IDE6 57 /* IDE on sixth interface */ ++#define MAJOR_NAND 240 /* proprietary (board-level) nand flash block device */ + #define COMPAQ_SMART2_MAJOR 72 /* First Smart/2 Major */ + + #define MAX_IMAGES ((SECTOR_SIZE*2-2)/sizeof(IMAGE_DESCR)) +diff -Naur --exclude=CVS --exclude='*.orig' lilo/md-int.h lilosh/md-int.h +--- lilo/md-int.h 2006-02-01 21:15:51.000000000 +0000 ++++ lilosh/md-int.h 2006-02-01 22:11:13.000000000 +0000 +@@ -287,4 +287,4 @@ + #define RAID5_ALGORITHM_LEFT_SYMMETRIC 2 + #define RAID5_ALGORITHM_RIGHT_SYMMETRIC 3 + +-#endif _MD_H ++#endif /* _MD_H */ +diff -Naur --exclude=CVS --exclude='*.orig' lilo/md-int.h~ lilosh/md-int.h~ +--- lilo/md-int.h~ 1970-01-01 00:00:00.000000000 +0000 ++++ lilosh/md-int.h~ 2006-02-01 21:15:51.000000000 +0000 +@@ -0,0 +1,290 @@ ++/* ++ md.h : Multiple Devices driver for Linux ++ Copyright (C) 1994-96 Marc ZYNGIER ++ or ++ ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ ++ You should have received a copy of the GNU General Public License ++ (for example /usr/src/linux/COPYING); if not, write to the Free ++ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ++*/ ++ ++#ifndef MD_INT_H ++#define MD_INT_H ++ ++/* don't include the kernel RAID header! */ ++#define _MD_H ++ ++typedef unsigned int md_u32; ++typedef unsigned short md_u16; ++typedef unsigned char md_u8; ++ ++#include ++#include ++ ++/* ++ * Different major versions are not compatible. ++ * Different minor versions are only downward compatible. ++ * Different patchlevel versions are downward and upward compatible. ++ */ ++ ++struct md_version { ++ int major; ++ int minor; ++ int patchlevel; ++}; ++ ++/* ++ * default readahead ++ */ ++#define MD_READAHEAD (256 * 1024) ++ ++/* These are the ioctls for md versions < 0.50 */ ++#define REGISTER_MD_DEV _IO (MD_MAJOR, 1) ++#define START_MD _IO (MD_MAJOR, 2) ++#define STOP_MD _IO (MD_MAJOR, 3) ++ ++/* status */ ++#define RAID_VERSION _IOR (MD_MAJOR, 0x10, struct md_version) ++#define GET_ARRAY_INFO _IOR (MD_MAJOR, 0x11, md_array_info_t) ++#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, md_disk_info_t) ++#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) ++ ++/* configuration */ ++#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) ++#define ADD_NEW_DISK _IOW (MD_MAJOR, 0x21, md_disk_info_t) ++#define HOT_REMOVE_DISK _IO (MD_MAJOR, 0x22) ++#define SET_ARRAY_INFO _IOW (MD_MAJOR, 0x23, md_array_info_t) ++#define SET_DISK_INFO _IO (MD_MAJOR, 0x24) ++#define WRITE_RAID_INFO _IO (MD_MAJOR, 0x25) ++#define UNPROTECT_ARRAY _IO (MD_MAJOR, 0x26) ++#define PROTECT_ARRAY _IO (MD_MAJOR, 0x27) ++#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) ++ ++/* usage */ ++#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, struct md_param) ++#define START_ARRAY _IO (MD_MAJOR, 0x31) ++#define STOP_ARRAY _IO (MD_MAJOR, 0x32) ++#define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) ++#define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) ++ ++ ++/* for raid < 0.50 only */ ++#define MD_PERSONALITY_SHIFT 16 ++ ++#define MD_RESERVED 0UL ++#define LINEAR 1UL ++#define STRIPED 2UL ++#define RAID0 STRIPED ++#define RAID1 3UL ++#define RAID5 4UL ++#define TRANSLUCENT 5UL ++#define LVM 6UL ++#define MAX_PERSONALITY 7UL ++ ++/* ++ * MD superblock. ++ * ++ * The MD superblock maintains some statistics on each MD configuration. ++ * Each real device in the MD set contains it near the end of the device. ++ * Some of the ideas are copied from the ext2fs implementation. ++ * ++ * We currently use 4096 bytes as follows: ++ * ++ * word offset function ++ * ++ * 0 - 31 Constant generic MD device information. ++ * 32 - 63 Generic state information. ++ * 64 - 127 Personality specific information. ++ * 128 - 511 12 32-words descriptors of the disks in the raid set. ++ * 512 - 911 Reserved. ++ * 912 - 1023 Disk specific descriptor. ++ */ ++ ++/* ++ * If x is the real device size in bytes, we return an apparent size of: ++ * ++ * y = (x & ~(MD_RESERVED_BYTES - 1)) - MD_RESERVED_BYTES ++ * ++ * and place the 4kB superblock at offset y. ++ */ ++#define MD_RESERVED_BYTES (64 * 1024) ++#define MD_RESERVED_SECTORS (MD_RESERVED_BYTES / 512) ++#define MD_RESERVED_BLOCKS (MD_RESERVED_BYTES / BLOCK_SIZE) ++ ++#define MD_NEW_SIZE_SECTORS(x) ((x & ~(MD_RESERVED_SECTORS - 1)) - MD_RESERVED_SECTORS) ++#define MD_NEW_SIZE_BLOCKS(x) ((x & ~(MD_RESERVED_BLOCKS - 1)) - MD_RESERVED_BLOCKS) ++ ++#define MD_SB_BYTES 4096 ++#define MD_SB_WORDS (MD_SB_BYTES / 4) ++#define MD_SB_BLOCKS (MD_SB_BYTES / BLOCK_SIZE) ++#define MD_SB_SECTORS (MD_SB_BYTES / 512) ++ ++/* ++ * The following are counted in 32-bit words ++ */ ++#define MD_SB_GENERIC_OFFSET 0 ++#define MD_SB_PERSONALITY_OFFSET 64 ++#define MD_SB_DISKS_OFFSET 128 ++#define MD_SB_DESCRIPTOR_OFFSET 992 ++ ++#define MD_SB_GENERIC_CONSTANT_WORDS 32 ++#define MD_SB_GENERIC_STATE_WORDS 32 ++#define MD_SB_GENERIC_WORDS (MD_SB_GENERIC_CONSTANT_WORDS + MD_SB_GENERIC_STATE_WORDS) ++#define MD_SB_PERSONALITY_WORDS 64 ++#define MD_SB_DISKS_WORDS 384 ++#define MD_SB_DESCRIPTOR_WORDS 32 ++#define MD_SB_RESERVED_WORDS (1024 - MD_SB_GENERIC_WORDS - MD_SB_PERSONALITY_WORDS - MD_SB_DISKS_WORDS - MD_SB_DESCRIPTOR_WORDS) ++#define MD_SB_EQUAL_WORDS (MD_SB_GENERIC_WORDS + MD_SB_PERSONALITY_WORDS + MD_SB_DISKS_WORDS) ++#define MD_SB_DISKS (MD_SB_DISKS_WORDS / MD_SB_DESCRIPTOR_WORDS) ++ ++/* ++ * Device "operational" state bits ++ */ ++#define MD_DISK_FAULTY 0 /* disk is faulty / operational */ ++#define MD_DISK_ACTIVE 1 /* disk is running or spare disk */ ++#define MD_DISK_SYNC 2 /* disk is in sync with the raid set */ ++ ++typedef struct md_device_descriptor_s { ++ md_u32 number; /* 0 Device number in the entire set */ ++ md_u32 major; /* 1 Device major number */ ++ md_u32 minor; /* 2 Device minor number */ ++ md_u32 raid_disk; /* 3 The role of the device in the raid set */ ++ md_u32 state; /* 4 Operational state */ ++ md_u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5]; ++} md_descriptor_t; ++ ++#define MD_SB_MAGIC 0xa92b4efc ++ ++/* ++ * Superblock state bits ++ */ ++#define MD_SB_CLEAN 0 ++#define MD_SB_ERRORS 1 ++ ++typedef struct md_superblock_s { ++ /* ++ * Constant generic information ++ */ ++ md_u32 md_magic; /* 0 MD identifier */ ++ md_u32 major_version; /* 1 major version to which the set conforms */ ++ md_u32 minor_version; /* 2 minor version ... */ ++ md_u32 patch_version; /* 3 patchlevel version ... */ ++ md_u32 gvalid_words; /* 4 Number of used words in this section */ ++ md_u32 set_magic; /* 5 Raid set identifier */ ++ md_u32 ctime; /* 6 Creation time */ ++ md_u32 level; /* 7 Raid personality */ ++ md_u32 size; /* 8 Apparent size of each individual disk */ ++ md_u32 nr_disks; /* 9 total disks in the raid set */ ++ md_u32 raid_disks; /* 10 disks in a fully functional raid set */ ++ md_u32 md_minor; /* 11 preferred MD minor device number */ ++ md_u32 gstate_creserved[MD_SB_GENERIC_CONSTANT_WORDS - 12]; ++ ++ /* ++ * Generic state information ++ */ ++ md_u32 utime; /* 0 Superblock update time */ ++ md_u32 state; /* 1 State bits (clean, ...) */ ++ md_u32 active_disks; /* 2 Number of currently active disks */ ++ md_u32 working_disks; /* 3 Number of working disks */ ++ md_u32 failed_disks; /* 4 Number of failed disks */ ++ md_u32 spare_disks; /* 5 Number of spare disks */ ++ md_u32 gstate_sreserved[MD_SB_GENERIC_STATE_WORDS - 6]; ++ ++ /* ++ * Personality information ++ */ ++ md_u32 layout; /* 0 the array's physical layout */ ++ md_u32 chunk_size; /* 1 chunk size in bytes */ ++ md_u32 pstate_reserved[MD_SB_PERSONALITY_WORDS - 2]; ++ ++ /* ++ * Disks information ++ */ ++ md_descriptor_t disks[MD_SB_DISKS]; ++ ++ /* ++ * Reserved ++ */ ++ md_u32 reserved[MD_SB_RESERVED_WORDS]; ++ ++ /* ++ * Active descriptor ++ */ ++ md_descriptor_t descriptor; ++ ++} md_superblock_t; ++ ++/* ++ * options passed in raidstart: ++ */ ++ ++#define MAX_CHUNK_SIZE (4096*1024) ++ ++struct md_param ++{ ++ int personality; /* 1,2,3,4 */ ++ int chunk_size; /* in bytes */ ++ int max_fault; /* unused for now */ ++}; ++ ++typedef struct md_array_info_s { ++ /* ++ * Generic constant information ++ */ ++ md_u32 major_version; ++ md_u32 minor_version; ++ md_u32 patch_version; ++ md_u32 ctime; ++ md_u32 level; ++ md_u32 size; ++ md_u32 nr_disks; ++ md_u32 raid_disks; ++ md_u32 md_minor; ++ md_u32 not_persistent; ++ ++ /* ++ * Generic state information ++ */ ++ md_u32 utime; /* 0 Superblock update time */ ++ md_u32 state; /* 1 State bits (clean, ...) */ ++ md_u32 active_disks; /* 2 Number of currently active disks */ ++ md_u32 working_disks; /* 3 Number of working disks */ ++ md_u32 failed_disks; /* 4 Number of failed disks */ ++ md_u32 spare_disks; /* 5 Number of spare disks */ ++ ++ /* ++ * Personality information ++ */ ++ md_u32 layout; /* 0 the array's physical layout */ ++ md_u32 chunk_size; /* 1 chunk size in bytes */ ++ ++} md_array_info_t; ++ ++typedef struct md_disk_info_s { ++ /* ++ * configuration/status of one particular disk ++ */ ++ md_u32 number; ++ md_u32 major; ++ md_u32 minor; ++ md_u32 raid_disk; ++ md_u32 state; ++ ++} md_disk_info_t; ++ ++ ++/* ++ * Supported RAID5 algorithms ++ */ ++#define RAID5_ALGORITHM_LEFT_ASYMMETRIC 0 ++#define RAID5_ALGORITHM_RIGHT_ASYMMETRIC 1 ++#define RAID5_ALGORITHM_LEFT_SYMMETRIC 2 ++#define RAID5_ALGORITHM_RIGHT_SYMMETRIC 3 ++ ++#endif _MD_H +diff -Naur --exclude=CVS --exclude='*.orig' lilo/partition.c lilosh/partition.c +--- lilo/partition.c 1998-10-14 20:12:42.000000000 +0000 ++++ lilosh/partition.c 2006-01-31 19:51:58.000000000 +0000 +@@ -13,6 +13,8 @@ + #include + + #include ++#include ++#include + + #include "config.h" + #include "lilo.h" +@@ -23,7 +25,7 @@ + + + /* For older kernels ... */ +- ++#if 0 + #ifndef DOS_EXTENDED_PARTITION + #define DOS_EXTENDED_PARTITION EXTENDED_PARTITION + #endif +@@ -31,6 +33,7 @@ + #ifndef LINUX_EXTENDED_PARTITION + #define LINUX_EXTENDED_PARTITION EXTENDED_PARTITION + #endif ++#endif + + + void part_verify(int dev_nr,int type) +diff -Naur --exclude=CVS --exclude='*.orig' lilo/second.c lilosh/second.c +--- lilo/second.c 2006-02-01 21:16:41.000000000 +0000 ++++ lilosh/second.c 2006-02-01 20:25:07.000000000 +0000 +@@ -1,4 +1,4 @@ +-/* $Id: second.c,v 1.22 2000/11/26 07:11:16 gniibe Exp $ ++/* $Id: second.c,v 1.6 2004/10/01 19:05:58 cpchen Exp $ + * + * Secondary boot loader + * +@@ -12,7 +12,35 @@ + */ + + #include "defs.h" ++#include "common.h" + ++#define TAB_CHAR '\t' ++#define BACKSPACE '\b' ++ ++#define R64CNT 0xFFC80000 ++#define RSECCNT 0xFFC80004 ++#define RMINCNT 0xFFC80008 ++#define RHRCNT 0xFFC8000C ++#define RSECAR 0xFFC80020 ++#define RMINAR 0xFFC80024 ++#define RHRAR 0xFFC80028 ++#define RWKAR 0xFFC8002C ++#define RDAYAR 0xFFC80030 ++#define RMONAR 0xFFC80034 ++#define RTCRCR1 0xFFC80038 ++#define RTCRCR2 0xFFC8003C ++ ++#ifndef BCD_TO_BIN ++#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) ++#endif ++ ++#ifndef BIN_TO_BCD ++#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10) ++#endif ++ ++static inline char get_char(void); ++static void dump_image_names(DESCR_SECTORS *); ++static IMAGE_DESCR * descr_label_match(char *); + static void put_string (unsigned char *); + static int get_sector_address (unsigned long, int *, unsigned long *); + static int load_sectors (unsigned long, unsigned long); +@@ -30,19 +58,35 @@ + static inline char highhex (int x) { return hexchars[(x >> 4) & 0xf]; } + static inline char lowhex (int x) { return hexchars[x & 0xf]; } + static void printouthex (int); ++static void set_delay(short delay); ++static inline int lilo_timeout() { ++ return *((char *) RTCRCR1) & 0x01; ++} + + static unsigned long base_pointer = 0; /* Avoid BSS */ + static unsigned long kernel_image = 0; /* Avoid BSS */ ++static unsigned long initrd_start = 0; ++static unsigned long initrd_end = 0; ++ ++#define INPUT_BUF_SIZE 256 ++static char input_buffer[INPUT_BUF_SIZE]; + + /* Sector descriptor */ + #define SD_DESCR1 24 ++#define SD_DESCR1_MEM 0x3200 + #define SD_DESCR2 29 ++#define SD_DESCR2_MEM 0x3400 + #define SD_DEFCMD 34 + /* 39 prompt (byte) */ + /* 40 length (word) */ + #define SD_MSG 42 + #define SD_KBDTBL 47 + ++/* use the section attribute and linker script to force the start function to ++ the beginning of the second stage reserved area. ++ This is where first.S will jmp */ ++void start (unsigned long base) __attribute__((section(".entry"))); ++ + static inline char *string_set (char *dest, const char *str) + { + int len = strlen (str); +@@ -53,11 +97,16 @@ + void + start (unsigned long base) + { +- base_pointer = base; ++ base_pointer = base; ++ unsigned char ch; ++ int input_idx; ++ IMAGE_DESCR *image_descr; ++ int desc; ++ int defer_delay=0; + + put_string ("I"); +- load_sectors (SD_DESCR1, 0x3200); +- load_sectors (SD_DESCR2, 0x3400); ++ load_sectors (SD_DESCR1, SD_DESCR1_MEM); ++ load_sectors (SD_DESCR2, SD_DESCR2_MEM); + put_string ("L"); + /* XXX: checksum */ + +@@ -73,30 +122,72 @@ + /* XXX: check signature */ + /* Input command line */ + /* XXX: Is there default command line? Use it! */ +- put_string ("boot: "); +- put_string ("first-image\n"); /* XXX: should handle input commandline... */ + +- /* Structure of descriptor +- [ checksum 2byte ] +- [ DESCR_SIZE:52-byte +- (image-name (16-byte) +- passwd (16-byte) +- rd_size (4-byte) +- initrd (5-byte sector desc) +- start (5-byte sector desc) +- start_page (16-bit) +- flags (16-bit) +- vga_mode (16-bit) +- ) +- ] * 19 +- */ ++ /* Structure of descriptor ++ [ checksum 2byte ] ++ [ DESCR_SIZE:52-byte ++ (image-name (16-byte) ++ passwd (16-byte) ++ rd_size (4-byte) ++ initrd (5-byte sector desc) ++ start (5-byte sector desc) ++ start_page (16-bit) ++ flags (16-bit) ++ vga_mode (16-bit) ++ ) ++ ] * 19 ++ */ ++ ++ input_buffer[0] = '\0'; ++ if (((BOOT_SECTOR *) base_pointer)->par_1.prompt) { ++ if (((BOOT_SECTOR *) base_pointer)->par_1.timeout != 0xffff) ++ set_delay(((BOOT_SECTOR *) base_pointer)->par_1.timeout); ++boot_loop: ++ input_idx = 0; ++ put_string ("boot: "); ++ while ((ch=get_char()) != 0x0d && input_idx < INPUT_BUF_SIZE-1) { ++ switch (ch) { ++ case TAB_CHAR: ++ defer_delay = 1; ++ dump_image_names((DESCR_SECTORS *) (base_pointer + SD_DESCR1_MEM)); ++ goto boot_loop; ++ break; ++ case BACKSPACE: ++ defer_delay = 1; ++ if (input_idx) --input_idx; ++ break; ++ case 0x00FF: ++ break; ++ default: ++ defer_delay = 1; ++ input_buffer[input_idx++] = ch; ++ break; ++ } ++ if (!defer_delay && lilo_timeout()) ++ break; ++ } ++ input_buffer[input_idx++] = ' '; ++ input_buffer[input_idx] = '\0'; ++ if ( ! (image_descr = descr_label_match(input_buffer)) ) { ++ put_string("No such image. [Tab] shows a list.\n"); ++ goto boot_loop; ++ } ++ } ++ else { ++ // dispatch the default image after the delayed timeout ++ // 0 or default == immediate dispatch ++ set_delay(((BOOT_SECTOR *) base_pointer)->par_1.delay); ++ do { ++ } while (!lilo_timeout()); /* NULL */ ++ image_descr = descr_label_match(input_buffer); ++ } + + put_string ("Loading "); +- put_string ((char *)(base_pointer+0x3200+2)); /* Image name */ ++ put_string (image_descr->name); /* Image name */ + + kernel_image = base_pointer + 0x10000 - 0x400; + { +- int desc = 0x3200+2+16+16+4+5; /* kernel image */ ++ desc = (int) image_descr+(16+16+4+5) - (int) base_pointer; + + /* Skip two sectors: Fallback command line and options */ + desc = load_sectors_with_maps (desc, 0, &kernel_image); +@@ -108,7 +199,21 @@ + put_string ("."); + } + } +- put_string ("done.\n"); ++ put_string ("done.\n\n"); ++ ++ desc = (int) image_descr+(16+16+4) - (int) base_pointer; ++ initrd_start = kernel_image = 0x88000000 + memory_size() / 2; ++ desc = load_sectors_with_maps (desc, 0, &kernel_image); ++ if (desc) { ++ put_string("ramdisk image loading"); ++ put_string("."); ++ while (desc != 0) { ++ desc = load_sectors_with_maps (desc, 0, &kernel_image); ++ put_string("."); ++ } ++ put_string ("done.\n\n"); ++ } ++ initrd_end = kernel_image; + + #if 0 + { +@@ -123,24 +228,39 @@ + + /* XXX: kernel paramerter setting */ + { +- unsigned long parm = base_pointer - 0x200000 + 0x1000; ++ unsigned long parm = base_pointer + (~0x9cf000+1); + char *cmdline = (char *)(parm+256); + int mem_size; +- unsigned char *p; ++ unsigned char *p, *debug_p; + + *(long *)parm = 1; /* Read only mount? */ + *(long *)(parm+4) = 0; /* RAMDISK Flags */ + *(long *)(parm+8) = 0x0301; /* Root device: XXX should get from cls.. */ + *(long *)(parm+12) = 1; /* Loader type (LILO = 1) */ +- *(long *)(parm+16) = 0; /* Initrd start */ +- *(long *)(parm+20) = 0; /* Initrd size */ ++ if (initrd_end - initrd_start) { ++ initrd_start += ~0x88030000 + 1; ++ *(long *)(parm+16) = initrd_start; /* Initrd start */ ++ initrd_end += ~0x88030000 + 1; /* Initrd size */ ++ *(long *)(parm+20) = initrd_end + (~initrd_start + 1);/* Initrd size */ ++ } ++ else { ++ *(long *)(parm+16) = 0; /* Initrd start */ ++ *(long *)(parm+20) = 0; /* Initrd size */ ++ } + *(long *)(parm+24) = 0; /* Not defined yet */ + + /* XXX: Should take the line from command line sector... */ ++ if (*input_buffer) { ++ debug_p = cmdline; ++ cmdline = string_set(cmdline, input_buffer); ++ *cmdline = '\0'; ++ } ++ + #define DC_MAGIC 0xf4f2 /* magic number of default cmd. line sector */ + p = (unsigned char *)(base_pointer+0x3600); + if(p[0] == (DC_MAGIC & 0xff) && p[1] == (DC_MAGIC >> 8)) + cmdline = string_set(cmdline, p+2); ++ + cmdline = string_set(cmdline, (char *)(base_pointer + 0x10000 - 0x200)); + + #if 0 +@@ -231,7 +351,7 @@ + /* There's next map */ + return 0x3000+505; + } +- ++ + static int + machine_type (void) + { +@@ -296,6 +416,77 @@ + : "memory"); + } + ++static char inline ++get_char(void) ++{ ++ register long __sc0 __asm__ ("r0") = 1; /* OUTPUT */ ++ ++ asm volatile ("trapa #0x3F" ++ : "=z" (__sc0) ++ : "0" (__sc0) ++ : "memory"); ++ return __sc0; ++} ++ ++static IMAGE_DESCR * ++descr_label_match(char * boot_buffer) ++{ ++ IMAGE_DESCR *descr = ++ ((DESCR_SECTORS *) (base_pointer + SD_DESCR1_MEM))->d.descr; ++ char * buf_ptr=boot_buffer; ++ char * name; ++ ++ while (*boot_buffer && (*boot_buffer == ' ' || *boot_buffer == '\t')) ++ ++boot_buffer; ++ ++ if ( ! *boot_buffer ) { ++ return descr; ++ } ++ ++ for ( buf_ptr=boot_buffer; *descr->name; ++descr, buf_ptr=boot_buffer) { ++ name = descr->name; ++ for ( ; *name == *buf_ptr; ++name, ++buf_ptr) ; ++ if (!*name && (!*buf_ptr || *buf_ptr == ' ' || *buf_ptr == '\t')) { ++ // overwrite the boot_buffer with the string after the ++ // boot image name. ++ while (*boot_buffer++ = *buf_ptr++) ; ++ return descr; ++ } ++ } ++ return NULL; ++} ++ ++static void ++dump_image_names(DESCR_SECTORS *descr_area) ++{ ++ int buf_idx=0, name_len; ++ char * name; ++ IMAGE_DESCR *descr = descr_area->d.descr; ++ ++ put_string("\n"); ++ for ( ; *descr->name; ++descr) ++ { ++ name = descr->name; ++ name_len = strlen(name); ++ memcpy(input_buffer + buf_idx, name, name_len); ++ buf_idx += name_len; ++ name_len = MAX_IMAGE_NAME+1 - name_len; ++ memset(input_buffer + buf_idx, ' ', name_len); ++ buf_idx += name_len; ++ if ( buf_idx >= 78 ) { ++ input_buffer[buf_idx++] = '\n'; ++ input_buffer[buf_idx++] = '\0'; ++ put_string(input_buffer); ++ buf_idx = 0; ++ } ++ } ++ if (buf_idx) { ++ input_buffer[buf_idx++] = '\n'; ++ input_buffer[buf_idx] = '\0'; ++ put_string(input_buffer); ++ } ++} ++ + static void inline + put_string_1 (unsigned char *str, long len) + { +@@ -344,15 +535,17 @@ + unsigned char *p = (unsigned char *)(sector_desc+base_pointer); + int len; + ++ + /* Number of sectors */ + len = (int)p[4]; + if (len == 0) + return 0; + + /* p[2]: drive number */ +- if ((int)p[2] < 0xc0) ++ if ((int)p[2] < 0xc0) { + /* XXX: should return error */ + put_string ("ERROR: Sector address is not in LBA\n"); ++ } + + *devp = (int)p[2] & 0x0f; + +@@ -394,8 +587,56 @@ + + return -1; + } +- +-#if 0 ++ ++static void set_delay(short delay) ++{ ++ char rtc_sec, rtc_min, rtc_hr; ++ int alarm_time; ++ char arm_sec, arm_min, arm_hr; ++ char regval; ++ char tenths, seconds, minutes, hour; ++ ++ // Make sure the RTC is running ++ *(char*)RTCRCR2 = 0x09; ++ ++ // Make sure ENB bits are off ++ *(char*)RWKAR &= 0x7f; ++ *(char*)RDAYAR &= 0x7f; ++ *(char*)RMONAR &= 0x7f; ++ ++ // Read time ++ do { ++ *(char*)RTCRCR1 = 0x00; // Clear CF-bit ++ rtc_sec = *(char*)RSECCNT; ++ rtc_min = *(char*)RMINCNT; ++ rtc_hr = *(char*)RHRCNT; ++ } while ((*(char*)RTCRCR1 & 0x80) != 0); ++ ++ BCD_TO_BIN(rtc_hr); ++ BCD_TO_BIN(rtc_min); ++ BCD_TO_BIN(rtc_sec); ++ ++ alarm_time = ((rtc_hr * 60) + rtc_min) * 60 + rtc_sec + (delay / 10); ++ ++ arm_sec = alarm_time % 60; ++ arm_min = (alarm_time / 60) % 60; ++ arm_hr = alarm_time / 3600; ++ if (arm_hr >= 24) ++ arm_hr = arm_hr - 24; ++ ++ BIN_TO_BCD(arm_sec); ++ BIN_TO_BCD(arm_min); ++ BIN_TO_BCD(arm_hr); ++ ++ *(char*)RSECAR = arm_sec | 0x80; ++ *(char*)RMINAR = arm_min | 0x80; ++ *(char*)RHRAR = arm_hr | 0x80; ++ ++ // Clear AF bit ++ *(char*)RTCRCR1 = 0; ++} ++ ++#if 1 + static void + printouthex(int x) + { +@@ -408,4 +649,14 @@ + + put_string (z); + } ++ ++static void dump_desc(char * desc) ++{ ++ printouthex((int) desc[0]); ++ printouthex((int) desc[1]); ++ printouthex((int) desc[2]); ++ printouthex((int) desc[3]); ++ printouthex((int) desc[4]); ++ put_string("\n"); ++} + #endif +diff -Naur --exclude=CVS --exclude='*.orig' lilo/second.lds lilosh/second.lds +--- lilo/second.lds 2006-02-01 21:16:41.000000000 +0000 ++++ lilosh/second.lds 2006-01-31 22:44:27.000000000 +0000 +@@ -83,6 +83,7 @@ + .plt : { *(.plt) } + .text : + { ++ *(.entry) + *(.text) + *(.text.*) + *(.stub) +diff -Naur --exclude=CVS --exclude='*.orig' lilo/string.c lilosh/string.c +--- lilo/string.c 2006-02-01 21:16:41.000000000 +0000 ++++ lilosh/string.c 2004-05-19 16:39:08.000000000 +0000 +@@ -20,3 +20,8 @@ + + return dest; + } ++ ++void * memset(void * dest, int val, unsigned int count) ++{ ++ while (count--) *((char *)dest++) = val; ++} diff --git a/packages/lilo-sh/files/lilo-noconfig-h.patch b/packages/lilo-sh/files/lilo-noconfig-h.patch new file mode 100644 index 0000000000..01b6cbddd3 --- /dev/null +++ b/packages/lilo-sh/files/lilo-noconfig-h.patch @@ -0,0 +1,23 @@ +Stop it looking for config.h. It doesn't need it and trying to include this +from libc-headers results in an compile time error. + +--- lilo/lilo.h 2006/06/28 05:40:25 1.1 ++++ lilo/lilo.h 2006/06/28 05:40:36 +@@ -11,17 +11,6 @@ + #ifndef LILO_H + #define LILO_H + +-/* +- * Starting with 2.1.something, Linux kernels put VGA constants and segment +- * definitions into asm/boot.h instead of linux/config.h +- */ +- +-#ifdef HAS_BOOT_H +-#include +-#else +-#include +-#endif +- + #define VERSION 20 /* Boot sector, map file, and chain loader format + revision. This number does not necessarily have + to correspond to the version number of the entire diff --git a/packages/lilo-sh/files/lilo-sh-linux.patch b/packages/lilo-sh/files/lilo-sh-linux.patch new file mode 100644 index 0000000000..0eadf26cff --- /dev/null +++ b/packages/lilo-sh/files/lilo-sh-linux.patch @@ -0,0 +1,1971 @@ +This is the patch that upgrade lilo to match the version included in +the old lilosh CVS. + +diff -ruN lilo.orig/ChangeLog lilo/ChangeLog +--- lilo.orig/ChangeLog Thu Jan 1 09:00:00 1970 ++++ lilo/ChangeLog Thu Dec 7 16:17:10 2000 +@@ -0,0 +1,44 @@ ++2000-11-26 NIIBE Yutaka ++ ++ * first.S (done): Flush the cache. ++ * second.c (start): Call cache_flush. ++ (cache_flush): New function. ++ ++2000-11-25 NIIBE Yutaka ++ ++ * first.S: Don't put '$' for register spec. ++ * second.c (start): Don't put '$' for register spec. ++ (machine_type, memory_size, io_base, put_string_1, read_sectors): ++ Likewise. ++ * second.lds: Use new tool chain's ldscript. ++ * defs.h: Add declaration of memcpy. ++ ++2000-09-09 NIIBE Yutaka ++ ++ * first.S (real_start): Set argument 0 for cache enable call. ++ ++2000-08-19 NIIBE Yutaka ++ ++ * second.c (get_sector_address): Bug fix for # of sector == 0. ++ (start): Support machine types of CqREEK and SolutionEngine. ++ ++ * first.S (load_sector_address): Bug fix for checking LBA. ++ (real_start): Call "enable cache" BIOS feature. ++ ++2000-08-05 NIIBE Yutaka ++ ++ * Makefile (first.o): Added -traditional for "'" in comments. ++ ++ * second.c (machine_type, serial_type, memory_size, io_base): New ++ functions. ++ (start): Implement kernel command line handling a bit. ++ (read_sectors): Emit error message. ++ (get_sector_address): Emit error message. ++ ++ * first.S (read_a_sector): Implement error handling. ++ (load_sector_address): Check if it's LBA. ++ ++2000-07-22 NIIBE Yutaka ++ ++ * second.c (start): Don't load two magic sectors at the memory ++ of executable image. +diff -ruN lilo.orig/Makefile lilo/Makefile +--- lilo.orig/Makefile Fri Dec 8 10:10:02 2000 ++++ lilo/Makefile Fri Dec 8 11:46:04 2000 +@@ -39,76 +39,55 @@ + GO=-DGO=0x`sed '/go/s/^.*go 0 \(....\) A.*$$/\1/p;d' first.lis` + + SHELL=/bin/sh +-CC=cc +-CPP=$(CC) -E +-AS86=as86 -0 -a +-LD86=ld86 -0 + +-CFLAGS=-Wall -g $(PCONFIG) +-LDFLAGS=#-Xlinker -qmagic ++CROSS_COMPILE = sh3-linux- ++CC =$(CROSS_COMPILE)gcc ++LD =$(CROSS_COMPILE)ld ++OBJCOPY =$(CROSS_COMPILE)objcopy ++STRIP =$(CROSS_COMPILE)strip ++ ++CFLAGS = -O2 -I. -pipe -fPIC $(CONFIG) -DPATH_MAX=255 ++CPP=$(CC) -E -traditional ++ ++#CFLAGS=-Wall -g $(PCONFIG) ++#LDFLAGS=#-Xlinker -qmagic + + OBJS=lilo.o map.o geometry.o boot.o device.o common.o bsect.o cfg.o temp.o \ + partition.o identify.o + +-.SUFFIXES: .img .b ++.SUFFIXES: .b + +-all: check-config lilo boot.b dump.b os2_d.b chain.b dparam.com \ +- activate +- +-check-config: +- $(CPP) check-config.cpp $(PCONFIG) >/dev/null ++all: lilo boot.b + + .c.o: + $(CC) -c $(CFLAGS) $*.c + +-.s.o: +- $(AS86) -w -o $*.o $*.s +- +-.o.img: +- $(LD86) -s -o $*.img $*.o ++boot.b: first.bin second.bin ++ cat first.bin second.bin >boot.b + +-.img.b: +- dd if=$*.img of=$*.b bs=32 skip=1 ++first.bin: first.exe ++ $(OBJCOPY) -S first.exe -O binary first.bin + +-activate: activate.c +- $(CC) -Wall -s -O -o activate activate.c $(LDFLAGS) +- +-dparam.com: dparam.img +- dd if=dparam.img of=dparam.com bs=288 skip=1 +- +-lilo: $(OBJS) +- $(CC) -o lilo $(LDFLAGS) $(OBJS) ++second.bin: second.exe ++ $(OBJCOPY) -R .comment -S second.exe -O binary second.bin + +-boot.b: first.b second.b +- (dd if=first.b bs=512 conv=sync; dd if=second.b) >boot.b ++first.exe: first.o ++ $(LD) -EL -e start first.o -o first.exe -Ttext 0x8c200000 + +-first.s: first.S lilo.h lilo +- $(CPP) $(PCONFIG) `./lilo -X` first.S -o first.s ++second.exe: second.o string.o ++ $(LD) -T second.lds -EL second.o string.o -o second.exe -Ttext 0x8c201000 + +-second.s: second.S lilo.h lilo +- $(CPP) $(PCONFIG) $(GO) `./lilo -X` second.S -o second.s ++first.o: first.S ++ $(CC) $(CFLAGS) -c first.S + +-chain.s: chain.S lilo.h +- $(CPP) $(PCONFIG) $(GO) chain.S -o chain.s ++second.o: second.c ++ $(CC) $(CFLAGS) -c second.c + +-os2_d.s: chain.S lilo.h +- $(CPP) $(PCONFIG) $(GO) chain.S -DDOS_D -o os2_d.s ++string.o: string.c ++ $(CC) $(CFLAGS) -c string.c + +-#dos_d.s: chain.S lilo.h first.lis +-# $(CPP) $(PCONFIG) $(GO) chain.S -DDOS_D -o dos_d.s +- +-dump.s: dump.S lilo.h first.lis +- $(CPP) $(PCONFIG) `./lilo -X` dump.S -DDOS_D -o dump.s \ +- -DGO=0x`sed '/go/s/^.*go 0 \(....\) A.*$$/\1/p;d' first.lis` +- +-xxx.s: chain.S lilo.h +- $(CPP) chain.S -DXXX -o xxx.s +- +-first.o first.lis: first.s +- $(AS86) -w -o first.o -l first.lis first.s +- +-second.lis: second.s +- $(AS86) -w -l second.lis second.s ++lilo: $(OBJS) ++ $(CC) -o lilo $(LDFLAGS) $(OBJS) + + install: all + if [ ! -d $$ROOT$(SBIN_DIR) ]; then mkdir $$ROOT$(SBIN_DIR); fi +@@ -118,13 +97,9 @@ + mkdir $$ROOT$(USRSBIN_DIR); fi + if [ -f $$ROOT$(BOOT_DIR)/boot.b ]; then \ + mv $$ROOT$(BOOT_DIR)/boot.b $$ROOT$(BOOT_DIR)/boot.old; fi +- if [ -f $$ROOT$(BOOT_DIR)/chain.b ]; then \ +- mv $$ROOT$(BOOT_DIR)/chain.b $$ROOT$(BOOT_DIR)/chain.old; fi +- if [ -f $$ROOT$(BOOT_DIR)/os2_d.b ]; then \ +- mv $$ROOT$(BOOT_DIR)/os2_d.b $$ROOT$(BOOT_DIR)/os2_d.old; fi +- cp boot.b chain.b os2_d.b $$ROOT$(BOOT_DIR) ++ cp boot.b $$ROOT$(BOOT_DIR) + cp lilo $$ROOT$(SBIN_DIR) +- strip $$ROOT$(SBIN_DIR)/lilo ++ $(STRIP) $$ROOT$(SBIN_DIR)/lilo + cp keytab-lilo.pl $$ROOT$(USRSBIN_DIR) + @if [ -e $$ROOT/etc/lilo/install ]; then echo; \ + echo -n "$$ROOT/etc/lilo/install is obsolete. LILO is now ";\ +@@ -142,11 +117,8 @@ + && mv ../lilo ../lilo-`cat VERSION` + + clean: +- rm -f *.o *.img *.lis first.s second.s chain.s \ +- os2_d.s dump.s tmp_make first.b second.b +- +-spotless: clean +- rm -f lilo activate boot.b chain.b os2_d.b dump.b dparam.com ++ rm -f *.o *.exe *.bin tmp_make ++ rm -f lilo boot.b + + ### Dependencies + activate.o : activate.c +diff -ruN lilo.orig/chain.S lilo/chain.S +--- lilo.orig/chain.S Thu Oct 15 05:14:25 1998 ++++ lilo/chain.S Thu Jan 1 09:00:00 1970 +@@ -1,255 +0,0 @@ +-/* chain.S - LILO boot chainer */ +- +-/* Copyright 1992-1998 Werner Almesberger. See file COPYING for details. */ +- +- +-#define LILO_ASM +-#include "lilo.h" +- +- +- .text +- +- .globl _main +- .org 0 +- +-_main: jmp start +- +- .org 6 +- +- .ascii "LILO" +- .word STAGE_CHAIN +- .word VERSION +- +-offset: .word 0 +-drive: .byte 0 +- .byte 0 ! head, always zero +- +-hint: .word drvmap ! pointer to drive map +- +-ptable: .blkw 0x20 ! partition table to preload +- +-start: cli ! set SS:SP to 0:7C00 +- xor ax,ax +- mov ss,ax +- mov ax,#0x7c00 +- mov sp,ax +- sti +- mov ax,#SETUPSEG ! move boot sector to default location +- mov ds,ax +- xor ax,ax +- mov es,ax +- mov cx,#256 +-mtmp = SETUPSECS-1 ! broken math ... +- mov si,#mtmp*512 +- mov di,#BOOTSEG*16 +- rep +- movsw +-#ifdef DOS_D +-dos4: seg es +- mov byte ptr BOOTSEG*16+0x24,#0x81 +-#endif +- mov cx,#0x20 ! move partition table +- mov si,#ptable +- mov di,#PART_TABLE +- rep +- movsw +- ! mess with the partition table +-#if defined(LCF_REWRITE_TABLE) || defined(LCF_READONLY) +- mov si,#prtmap ! get partition table change rules +-prtclp: lodsw ! bios == 0 indicates end +- or al,al +- jz pmend ! at end -> quit +- cmp al,cache ! already in cache ? +- je incache ! yes -> no loading required +- push ax ! save table data +- call flush ! flush the cache +- pop ax +- push ax +- mov cache,al ! remember drive in cache +- cmp al,drive ! boot drive ? +- jne noc ! no -> load into scratch area +- xor ax,ax ! load at 0000:0600 +- mov bx,#PARTS_LOAD +- jmp loadit +-noc: mov ax,ds +- mov bx,#PARTS_SCR ! scratch area +-loadit: mov es,ax ! set up pointers and remember them +- mov ces,ax +- mov cbx,bx +- mov ax,#0x201 ! load partition table, one sector +- mov dx,cache ! drive from cache (DH = 0) +- mov cx,#1 +- int 0x13 ! load it +- jc wrfail ! error -> abort +- pop ax ! get BIOS and offset +-incache:les bx,cbx ! load pointer +- add bx,#PART_TABLE_OFFSET ! move to partition table +- add bl,ah ! offset is always in [0x1be,0x1fd] +- lodsw ! see what we need to do +- seg es ! match ? +- cmp byte ptr (bx),al +- jne nocng ! no -> do not change +- seg es ! change +- mov byte ptr (bx),ah +- mov byte ptr dirty,#1 ! mark as dirty +-nocng: br prtclp ! next one +- +-flush: test byte ptr dirty,#1 ! dirty ? +- jz noflush ! no -> do not write +- mov ax,#0x301 ! write one sector +- mov dx,cache ! get the drive +- or dl,dl ! nothing cached ? +- jz noflush ! no -> do not flush +- les bx,cbx ! reload pointer +- int 0x13 ! write ... +- jc wrfail ! argl +-noflush:ret +-pmend: call flush ! flush table +- br nopp ! and proceed +-wrfail: mov si,#failmsg ! complain +- call say +- mov ax,#FIRSTSEG ! try to restart LILO +- jmpi #GO,FIRSTSEG +- +-cache: .byte 0 ! drive, 0 means not cached +- .byte 0 ! head, always 0 +-cbx: .blkw 1 +-ces: .blkw 1 +-dirty: .byte 0 +- +-#endif +- +-nopp: +- mov ax,drvmap ! need to install mapper ? +- or ax,ax +- jz noimap ! no -> go on +- call swap13 +-noimap: +- +- mov si,offset ! DS:SI and ES:SI point to the partition +- add si,#PART_TABLE +- mov dx,drive ! initialize DX (drive and head) +- xor ax,ax ! set DS and ES to zero +-#ifdef XXX +- mov ax,ds +- mov es,ax +- mov si,#lilosig +- mov bx,#cmd +- mov dl,#0xfe +-#else +- mov ds,ax +- mov es,ax +-#endif +- mov bp,#0 ! might help some boot problems +- mov ax,#0xaa55 ! boot signature (just in case ...) +- jmpi #BOOTSEG*16,0 ! start boot sector +- +-#ifdef XXX +-lilosig:.ascii "LILO" +-cmd: .ascii "98" +- .byte 0 +-#endif +- +-#if defined(LCF_REWRITE_TABLE) +- +-! Display a NUL-terminated string on the console +- +-say: lodsb ! get byte +- or al,al ! NUL ? +- jz aret ! yes -> done +- mov ah,#14 ! display, tty-style +- xor bh,bh +- int 0x10 +- jmp say ! next one +-aret: ret ! done +- +-failmsg:.ascii "Rewrite error." +- .byte 13,10,0 +- +-#endif +- +-swap13: seg es ! allocate 1 kB +- dec word ptr [0x413] +- int 0x12 ! get start segment +- mov cl,#6 +- shl ax,cl +- cli ! disable interrupts +- xor bx,bx ! zero a few registers +- mov di,bx +- seg es ! change offset +- xchg bx,[0x4c] +- mov old13of,bx +- mov bx,ax ! change segment +- seg es +- xchg bx,[0x4e] +- mov old13sg,bx +- mov es,ax ! move drive swapper +- mov si,#new13 +- mov cx,#new13end-new13 +- rep +- movsb +- sti ! enable interrupts +- ret ! done +- +-new13: push ax ! save AX (contains function code in AH) +- push bp ! need BP to mess with stack +- mov bp,sp +- ! Stack layout: +- ! +- ! +8 INT flags +- ! +6 INT CS +- ! +4 INT IP +- ! +2 AX +- ! BP+0 BP +- pushf ! push flags (to act like interrupt) +- push si +- mov si,#drvmap-new13 +-mapfl: seg cs ! get next entry +- lodsw +- or ax,ax ! at end ? +- jz nomap ! yes -> do not map +- cmp dl,al ! match ? +- jne mapfl ! no -> continue +- mov dl,ah ! map drive +-nomap: pop si ! restore SI +- mov 8(bp),ax ! overwrite old flags (to remember mapping) +- mov ax,2(bp) ! restore AX +- mov bp,(bp) ! restore BP +- .byte 0x9a ! CALL FAR +-old13of:.word 0 +-old13sg:.word 0 +- push bp ! save BP again +- mov bp,sp +- ! New stack layout: +- ! +- ! +10 mapping (was flags) +- ! +8 INT CS +- ! +6 INT IP +- ! +4 AX +- ! +2 obsolete BP +- ! BP+0 BP +- xchg ax,4(bp) ! save AX and get command +- pushf ! fix driver number, if necessary +- cmp ah,#8 ! do not fix +- je done13 +- cmp ah,#0x15 ! do not fix +- je done13 +- mov ax,10(bp) ! no mapping ? +- or ax,ax +- jz done13 +- mov dl,al ! fix mapping +-done13: mov ax,4(bp) ! restore AX +- pop 10(bp) ! restore flags +- pop bp ! get BP +- add sp,#4 ! fix SP +- iret ! done +- +-drvmap: .blkw DRVMAP_SIZE+1 +- +-new13end: +- +-#if defined(LCF_REWRITE_TABLE) +-prtmap: .blkw PRTMAP_SIZE*2+1 ! only first word of last entry is read +-#endif +- +-theend: +diff -ruN lilo.orig/chain.old.S lilo/chain.old.S +--- lilo.orig/chain.old.S Wed Jun 18 16:42:15 1997 ++++ lilo/chain.old.S Thu Jan 1 09:00:00 1970 +@@ -1,260 +0,0 @@ +-/* chain.S - LILO boot chainer */ +- +-/* Copyright 1992-1997 Werner Almesberger. See file COPYING for details. */ +- +- +-#define LILO_ASM +-#include "lilo.h" +- +- +- .text +- +- .globl _main +- .org 0 +- +-_main: jmp start +- +- .org 2 +- +- .ascii "LILO" +- .word STAGE_CHAIN +- .word VERSION +- +-offset: .word 0 +-drive: .byte 0 +- .byte 0 ! head, always zero +- +-start: cli ! set SS:SP to 0:7C00 +- xor ax,ax +- mov ss,ax +- mov ax,#0x7c00 +- mov sp,ax +- sti +- mov ax,#SETUPSEG ! move boot sector to default location +- mov ds,ax +- xor ax,ax +- mov es,ax +- mov cx,#256 +- mov si,#512 +- mov di,#BOOTSEG*16 +- rep +- movsw +- push bx ! save secret message +-#ifdef DOS_D +-#if 0 +- seg es +- cmp byte ptr BOOTSEG*16+0x26,#0x29 +- je dos4 +- mov bx,#baddos ! complain +- call say +- mov ax,#FIRSTSEG ! restart LILO +- jmpi #GO,FIRSTSEG +-#endif +-dos4: seg es +- mov byte ptr BOOTSEG*16+0x24,#0x81 +-#endif +- mov cx,#0x20 ! move partition table +- mov si,#PART_TABLE_OFFSET +- mov di,#PART_TABLE +- rep +- movsw +-#if defined(SWAP_HD) || defined(SWAP_FD) +- call swap13 +-#endif +- ! table entry +- pop bx ! get secret message (active partition) +-#ifdef LCF_REWRITE_TABLE +- or bl,bl ! none set ? +- jz tonopp ! yes -> do not patch +-br tonopp +- cmp bx,#0x81 ! valid code ? +- jb towrfail ! no -> abort +- cmp bx,#0x84 +- jna wrokay ! yes -> continue +-towrfail:br wrfail +-tonopp: br nopp +-wrokay: push bx ! save BX +- xor ax,ax ! ES becomes 0 +- mov es,ax +- mov ax,#0x201 ! load partition table, one sector +- mov dx,#0x80 ! first drive +- mov cx,#1 +- mov bx,#PARTS_LOAD +- int 0x13 ! load it +- jc wrfail ! error -> abort +- mov cx,#4 ! process all four entries +- mov bx,#PART_TABLE +-ptchpt: seg es ! clear all active flags +- mov byte ptr (bx),#0 +-#if defined(LCF_FIX_TYPE) && defined(LCF_HIDE_DOS) +- seg es +- mov al,(bx+4) ! get partition type +- cmp al,#PART_DOS12 ! hidden ? +- je hideme ! no -> hide it +- cmp al,#PART_DOS16 +- je hideme +- cmp al,#PART_DOS32 +- jne nonrel ! already hidden -> continue +-hideme: add al,#HIDDEN_OFF ! write back corrected value +- seg es +- mov (bx+4),al +-#endif +-nonrel: add bx,#16 ! next entry +- loop ptchpt +- pop bx ! compute active flag position +- dec bx +- shl bl,1 +- shl bx,1 +- shl bx,1 +- shl bx,1 +- cmp bx,offset ! right ? +- jne wrfail ! no -> abort +- seg es ! set active flag +- mov byte ptr (bx+PART_TABLE),#0x80 +-#ifdef LCF_FIX_TYPE +- seg es ! is this a +- mov al,byte ptr (bx+PART_TABLE+4) +- cmp al,#PART_HDOS12 ! hidden ? +- je unhideme ! yes -> unhide it +- cmp al,#PART_HDOS16 +- je unhideme +- cmp al,#PART_HDOS32 +- jne nounhid ! not hidden -> continue +-unhideme:sub al,#HIDDEN_OFF ! write back corrected value +- seg es +- mov (bx+PART_TABLE+4),al +-#endif +-nounhid:mov ax,#0x301 ! save it (restore all registers for +- mov dx,#0x80 ! paranoia) +- mov cx,#1 +- mov bx,#0x600 +- int 0x13 ! write ... +- jc wrfail ! argl +- mov bx,#passmsg ! confirm modification +- call say +- jmp nopp +-wrfail: mov bx,#failmsg ! complain +- call say +- mov ax,#FIRSTSEG ! restart LILO +- jmpi #GO,FIRSTSEG +-#endif +-nopp: mov si,offset ! DS:SI and ES:SI point to the partition +- add si,#PART_TABLE +- mov dx,drive ! initialize DX (drive and head) +- xor ax,ax ! set DS and ES to zero +-#ifdef XXX +- mov ax,ds +- mov es,ax +- mov si,#lilosig +- mov bx,#cmd +- mov dl,#0xfe +-#else +- mov ds,ax +- mov es,ax +-#endif +- mov bp,#0 ! might help some boot problems +- mov ax,#0xaa55 ! boot signature (just in case ...) +- jmpi #BOOTSEG*16,0 ! start boot sector +- +-#ifdef XXX +-lilosig:.ascii "LILO" +-cmd: .ascii "98" +- .byte 0 +-#endif +- +-#if defined(DOS_D) || defined(LCF_REWRITE_TABLE) +- +-! Display a NUL-terminated string on the console +- +-say: mov al,(bx) ! get byte +- or al,al ! NUL ? +- jz aret ! yes -> done +- push bx ! save pointer +- mov ah,#14 ! display, tty-style +- xor bh,bh +- int 0x10 +- pop bx +- inc bx ! next one +- jmp say +-aret: ret ! done +- +-#ifdef DOS_D +-baddos: .ascii "Need DOS version 4 or newer." +- .byte 13,10,0 +-#endif +- +-failmsg:.ascii "Rewrite error." +- .byte 13,10,0 +- +-passmsg:.ascii "Rewrote the partition table." +- .byte 13,10,0 +- +-#endif +- +-#if defined(SWAP_HD) || defined(SWAP_FD) +- +-swap13: seg es ! allocate 1 kB +- dec word ptr [0x413] +- int 0x12 ! get start segment +- mov cl,#6 +- shl ax,cl +- cli ! disable interrupts +- xor bx,bx ! zero a few registers +- mov di,bx +- seg es ! change offset +- xchg bx,[0x4c] +- mov old13of,bx +- mov bx,ax ! change segment +- seg es +- xchg bx,[0x4e] +- mov old13sg,bx +- mov es,ax ! move drive swapper +- mov si,#new13 +- mov cx,#new13end-new13 +- rep +- movsb +- sti ! enable interrupts +- ret ! done +- +-new13: seg cs ! save function code +- mov fcode-new13,ah +- test dl,#0x80 ! hard disk drive ? +-#ifdef SWAP_FD +- jnz noswap ! yes -> go on +-#else +- jz noswap ! no -> go on +-#endif +- xor dl,#1 ! swap drive 0 and 1 +-noswap: pushf +- .byte 0x9a ! CALL FAR +-old13of:.word 0 +-old13sg:.word 0 +- pushf ! fix driver number, if necessary +- seg cs +- cmp byte ptr fcode-new13,#8 ! do not fix +- je done13 +- seg cs +- cmp byte ptr fcode-new13,#0x15 ! do not fix +- je done13 +- test dl,#0x80 ! hard disk drive ? +-#ifdef SWAP_FD +- jnz done13 ! yes -> go on +-#else +- jz done13 ! no -> go on +-#endif +- xor dl,#1 ! fix it +-done13: seg cs +- mov tmpbx-new13,bx ! restore flags +- mov bx,sp +- seg ss +- pop 6(bx) +- seg cs +- mov bx,tmpbx-new13 +- iret ! done +-new13end: +-fcode: .byte 0 ! function code +-tmpbx: .word 0 +- +-#endif +- +-theend: +diff -ruN lilo.orig/defs.h lilo/defs.h +--- lilo.orig/defs.h Thu Jan 1 09:00:00 1970 ++++ lilo/defs.h Thu Dec 7 16:17:10 2000 +@@ -0,0 +1,2 @@ ++extern void *memcpy (void *__dest, const void *__src, unsigned int __n); ++extern int strlen (__const char *__s); +diff -ruN lilo.orig/dump.S lilo/dump.S +--- lilo.orig/dump.S Wed Jun 18 16:42:22 1997 ++++ lilo/dump.S Thu Jan 1 09:00:00 1970 +@@ -1,131 +0,0 @@ +-/* dump.S - LILO register d