--- syslinux-3.63+dfsg.orig/debian/docs
+++ syslinux-3.63+dfsg/debian/docs
@@ -0,0 +1,5 @@
+BUGS
+README
+README.gfxboot
+TODO
+doc/*
--- syslinux-3.63+dfsg.orig/debian/compat
+++ syslinux-3.63+dfsg/debian/compat
@@ -0,0 +1 @@
+6
--- syslinux-3.63+dfsg.orig/debian/changelog
+++ syslinux-3.63+dfsg/debian/changelog
@@ -0,0 +1,870 @@
+syslinux (2:3.63+dfsg-2ubuntu3netbook1) netbook-jaunty; urgency=low
+
+  * Merge from Hardy netbook-common (original work by Steve Magoun)
+    - 20-dont-hide-password.dpatch: for use in recovery tools where the
+    password prompt is used as a confirmation step.
+    - 00list: updated
+  * debian/changelog:
+    - Insert missing changelog entry for original netbook revision.
+
+ -- Bruno Dilly <bruno.dilly@canonical.com>  Wed, 22 Jul 2009 16:24:18 -0300
+
+syslinux (2:3.63+dfsg-2ubuntu3) intrepid; urgency=low
+
+  * Drop mtools back to Recommends now that recommended packages are
+    installed by default.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 15 Jul 2008 13:39:32 +0100
+
+syslinux (2:3.63+dfsg-2ubuntu2) intrepid; urgency=low
+
+  * 13-ubuntu_com32_gfxboot.dpatch: Turn progress operations into no-ops
+    unless gfx_progress_init has been called. Fixes a crash when both com32
+    and gfxboot are used, since loading a com32 object calls load_high which
+    calls gfx_progress_update.
+  * 14-ubuntu_gfxboot_force_prompt.dpatch: Always prompt if a gfxboot menu
+    is set up.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Thu, 19 Jun 2008 14:55:26 +0100
+
+syslinux (2:3.63+dfsg-2ubuntu1) intrepid; urgency=low
+
+  * Resynchronise with Debian. Remaining changes:
+    - debian/control:
+      + Build package for lpia.
+      + Don't build-depend on mingw32.
+      + Depend on mtools.
+    - debian/docs:
+      + Add README.gfxboot.
+    - debian/rules:
+      + Make sure add_crc is executable.
+      + Regenerate keyword hash.
+    - debian/patches/10-ubuntu_makefile.dpatch:
+      + Don't build syslinux.exe.
+    - debian/patches/11-suse_gfxboot.dpatch
+      + Add gfxboot, updated from openSUSE 3.63-13.
+    - debian/patches/12-ubuntu_localboot-gfxdone.dpatch:
+      + Make sure screen is cleared when using gfxboot.
+  * Add descriptions for Ubuntu-specific patches.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Fri, 13 Jun 2008 15:41:30 +0100
+
+syslinux (2:3.63+dfsg-2) unstable; urgency=medium
+
+  * Adding patch from Ryan Finnie <ryan@finnie.org> to extend 64bit
+    autodetection to vesamenu.c32 (Closes: #485656).
+  * Removing watch file.
+  * Bumping policy.
+
+ -- Daniel Baumann <daniel@debian.org>  Tue, 10 Jun 2008 21:08:00 +0200
+
+syslinux (2:3.63+dfsg-1) unstable; urgency=high
+
+  * New upstream release:
+    - Fixes problem with extlinux, which refuses to boot if there are some
+      deleted files on the ext2 filesystem (see upstream changelog for more
+      information).
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 10 Apr 2008 21:17:00 +0200
+
+syslinux (2:3.70~pre8+dfsg-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 31 Mar 2008 21:33:00 +0200
+
+syslinux (2:3.70~pre7+dfsg-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 31 Mar 2008 13:42:00 +0200
+
+syslinux (2:3.62+dfsg-2) unstable; urgency=medium
+
+  * Applied patch from morph <matrixhasu@gmail.com> to fix clean target
+    (Closes: #424225).
+
+ -- Daniel Baumann <daniel@debian.org>  Sat,  5 Apr 2008 08:02:00 +0200
+
+syslinux (2:3.62+dfsg-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Rediffed 02-64bit-autodetection.dpatch.
+  * Disabled 03-define-clk-tck.dpatch for now, seems to introduce strange
+    behaviour with TIMEOUT on pxelinux, needs further investigation.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 31 Mar 2008 13:24:00 +0200
+
+syslinux (2:3.61+dfsg-1) unstable; urgency=medium
+
+  * Rebuild upstream tarball without non-free RFC document (Closes: #463930).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue,  5 Feb 2008 07:28:00 +0100
+
+syslinux (2:3.61-1) unstable; urgency=low
+
+  * New upstream release.
+  * Bumping package to debhelper 6.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  4 Feb 2008 07:16:00 +0100
+
+syslinux (2:3.60-2) experimental; urgency=low
+
+  * Applied update of 02-64bit-autodetection.dpatch from Robert Millan
+    <rmh@aybabtu.com> (Closes: #462157).
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 24 Jan 2008 07:34:00 +0100
+
+syslinux (2:3.55-2) unstable; urgency=medium
+
+  * Applied update of 02-64bit-autodetection.dpatch from Robert Millan
+    <rmh@aybabtu.com> (Closes: #462157).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue, 22 Jan 2008 23:21:00 +0100
+
+syslinux (2:3.60-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Sat, 12 Jan 2008 20:04:00 +0100
+
+syslinux (2:3.55-1) unstable; urgency=low
+
+  * New upstream release.
+  * Don't hide make errors in clean call of rules.
+
+ -- Daniel Baumann <daniel@debian.org>  Sat, 12 Jan 2008 19:59:00 +0100
+
+syslinux (2:3.60~pre6-1) experimental; urgency=low
+
+  * New upstream release.
+  * Removed manpages, went upstream.
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 20 Dec 2007 08:22:00 +0100
+
+syslinux (2:3.54-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 13 Dec 2007 09:45:00 +0100
+
+syslinux (2:3.53-1ubuntu2mbu2) hardy; urgency=low
+
+  * Add 30-add-menu-disabled.dpatch, a backport of 'menu disabled'
+    command from syslinux 3.54
+
+ -- Steve Magoun <steve.magoun@canonical.com>  Mon, 13 Oct 2008 12:57:12 -0400
+
+syslinux (2:3.53-1ubuntu2mbu1) hardy; urgency=low
+
+  * Add 20-dont-hide-password.dpatch, for use in recovery tools where the
+    password prompt is used as a confirmation step.
+
+ -- Steve Magoun <steve.magoun@canonical.com>  Thu, 07 Aug 2008 13:43:06 -0400
+
+syslinux (2:3.53-1ubuntu2) hardy; urgency=low
+
+  * isolinux.asm: Remove reference to non-existent CD2 (LP: #62950).
+
+ -- Evan Dandrea <evand@ubuntu.com>  Tue, 11 Dec 2007 12:12:38 -0500
+
+syslinux (2:3.53-1ubuntu1) hardy; urgency=low
+
+  * Merge from debian unstable, remaining changes:
+    - debian/control:
+      + DebianMaintainerField.
+      + Build package for lpia.
+      + Don't build-depend on mingw32.
+    - debian/docs:
+      + Add README.gfxboot
+    - debian/rules:
+      + Make sure add_crc is executable.
+      + Regenerate keyword hash.
+    - debian/patches/02-64bit-autodetection:
+      + Fix up to apply cleanly again.
+    - debian/patches/10-ubuntu_makefile.dpatch:
+      + Don't build syslinux.exe
+    - debian/patches/11-suse_gfxboot.dpatch
+      + The infamous gfxboot patch. Lovingly updated to match current syslinux.
+    - debian/patches/13-ubuntu_localboot-gfxdone.dpatch:
+      + Make sure screen is cleared when using gfxboot.
+
+ -- Soren Hansen <soren@ubuntu.com>  Mon, 10 Dec 2007 21:03:58 +0100
+
+syslinux (2:3.53-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Sun, 18 Nov 2007 17:26:00 +0100
+
+syslinux (1:3.60~pre3-2) unstable; urgency=low
+
+  * Only build-depending on gcc-multilib on amd64.
+  * Removing old build-dependency against ia32-libs-dev.
+  * Versioning build-depends against nasm.
+
+ -- Daniel Baumann <daniel@debian.org>  Fri, 16 Nov 2007 11:42:00 +0100
+
+syslinux (1:3.60~pre3-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 12 Nov 2007 09:18:00 +0100
+
+syslinux (1:3.60~pre2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Wed, 26 Aug 2007 11:16:00 +0200
+
+syslinux (1:3.60~pre1-1) unstable; urgency=low
+
+  * New upstream release.
+  * Works well with nasm 0.99.02 (Closes: #439418).
+
+ -- Daniel Baumann <daniel@debian.org>  Sat, 25 Aug 2007 08:01:00 +0200
+
+syslinux (1:3.52~pre5-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Sun, 29 Jul 2007 20:55:00 +0200
+
+syslinux (1:3.52~pre3-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Sun, 15 Jul 2007 19:40:00 +0200
+
+syslinux (1:3.51-1) unstable; urgency=low
+
+  * New upstream release.
+  * Temporarily disabled 02-64bit-autodetection.dpatch; doesn't build anymore.
+  * Added Otavio as co-maintainer.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon, 18 Jun 2007 19:04:00 +0200
+
+syslinux (1:3.36-5) unstable; urgency=low
+
+  * Added patch from Otavio Salvador <otavio@debian.org> to add support to
+    change menu vertical and horizontal shifting.
+  * Added define-clk-tck patch from Timo Aaltonen <tjaalton@cc.hut.fi>.
+    It defines CLK_TCK, since the com32 libc API does not have any idea about
+    it, and its include files shadow /usr/include/time.h (which would provide
+    CLOCKS_PER_SEC).
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 31 May 2007 07:43:00 +0200
+
+syslinux (1:3.36-4ubuntu5) gutsy; urgency=low
+
+  * Only build-depend on gcc-multilib on amd64.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 30 Aug 2007 10:26:35 +0000
+
+syslinux (1:3.36-4ubuntu4) gutsy; urgency=low
+
+  * Build package for lpia.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 23 Aug 2007 18:29:28 +0000
+
+syslinux (1:3.36-4ubuntu3) gutsy; urgency=low
+
+  * Restore old Ubuntu changelog entries.
+  * debian/patches/13-ubuntu_localboot-gfxdone.dpatch:
+    - Restore; only a small part of this was applied upstream. Call
+      vgasetmode when switching back to text mode, to make sure that the
+      screen gets cleared.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 07 Aug 2007 02:11:21 +0100
+
+syslinux (1:3.36-4ubuntu2) gutsy; urgency=low
+
+  * mtools changed from recommended package to dependency (LP: #75765)
+
+ -- Nathan Handler <mrcheatr@gmail.com>  Fri, 20 Jul 2007 15:37:24 +0200
+
+syslinux (1:3.36-4ubuntu1) gutsy; urgency=low
+
+  * Merge from Debian unstable, remaining changes:
+    - debian/control:
+      + Drop ia32-libs-dev build-dependency.
+      + Drop mingw32 build-dependency.
+    - debian/docs:
+      + Install README.gfxboot from gfxboot.
+    - debian/rules:
+      + chmod add_crc from gfxboot.
+      + Don't install syslinux.exe.
+    - debian/patches:
+      + 10-ubuntu_makefile.dpatch:
+        Don't build win32-stuff.
+      + 11-suse_gfxboot.dpatch:
+        SuSE gfxboot. Updated from OpenSuSE 10.2.
+      + 12-define_clk_tck.dpatch:
+        com32/samples/keytest.c, com32/libutil/include/libutil.h,
+        com32/include/time.h: Define CLK_TCK, since the com32 libc API
+        does not have any idea about it, and its include files shadow
+        /usr/include/time.h (which would provide CLOCKS_PER_SEC).
+  * Change Maintainer address.
+  * debian/patches:
+    - 12-ubuntu_localboot-gfxdone.dpatch
+      13-ubuntu_gfxboot-cpio-swab.dpatch
+      Dropped because the new gfxboot-patch supercedes them.
+    - 14-gentoo_nossp.dpatch
+      Obsolete, upstream has applied -fno-stack-protector to the relevant
+      bits.
+
+ -- Timo Aaltonen <tjaalton@cc.hut.fi>  Tue, 29 May 2007 17:14:02 +0300
+
+syslinux (1:3.36-4) unstable; urgency=medium
+
+  * Added build-depends on gcc-multilib (Closes: #423514).
+
+ -- Daniel Baumann <daniel@debian.org>  Sat, 12 May 2007 20:33:00 +0200
+
+syslinux (1:3.36-3) unstable; urgency=medium
+
+  * Rebuild because glibc.
+
+ -- Daniel Baumann <daniel@debian.org>  Wed,  9 May 2007 10:36:00 +0200
+
+syslinux (1:3.50~pre6-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Tue,  1 May 2007 12:18:00 +0200
+
+syslinux (1:3.50~pre5-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Wed, 11 Apr 2007 10:11:00 +0200
+
+syslinux (1:3.36-2) unstable; urgency=low
+
+  * Re-uploading previous 3.36-1.
+
+ -- Daniel Baumann <daniel@debian.org>  Wed, 11 Apr 2007 10:09:00 +0200
+
+syslinux (1:3.31-4) unstable; urgency=medium
+
+  * Uploading 3.31-3 from etch again to unstable, to not break debian-installer.
+
+ -- Daniel Baumann <daniel@debian.org>  Fri,  9 Mar 2007 00:57:00 +0100
+
+syslinux (3.40~pre9-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  5 Mar 2007 02:05:00 +0100
+
+syslinux (3.36-1) unstable; urgency=low
+
+  * New upstream release.
+  * Rediffed 02-64bit-autodetection.dpatch.
+
+ -- Daniel Baumann <daniel@debian.org>  Mon,  5 Mar 2007 01:32:00 +0100
+
+syslinux (3.31-3) unstable; urgency=medium
+
+  * Added patch from Robert Millan <rmh@aybabtu.com> to fix
+    02-64bit-autodetection.dpatch (Closes: #410729).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue, 13 Feb 2007 23:17:00 +0100
+
+syslinux (3.31-2) unstable; urgency=medium
+
+  * Including all *.c32 modules (Closes: #391152).
+  * Added patch from Byron Stanoszek <gandalf@winds.org> to autodetect 64bit
+    CPUs (Closes: #408138).
+
+ -- Daniel Baumann <daniel@debian.org>  Sun,  4 Feb 2007 16:52:00 +0100
+
+syslinux (3.35-1) experimental; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Sun,  4 Feb 2007 16:43:00 +0100
+
+syslinux (3.31-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 28 Sep 2006 20:11:00 +0200
+
+syslinux (3.20-2) unstable; urgency=low
+
+  * Including mbr.bin (Closes: #357146).
+
+ -- Daniel Baumann <daniel@debian.org>  Tue, 19 Sep 2006 03:30:00 +0200
+
+syslinux (3.30~pre4-1) experimental; urgency=low
+
+  * New upstream pre-release.
+
+ -- Daniel Baumann <daniel@debian.org>  Wed,  6 Sep 2006 22:51:00 +0200
+
+syslinux (3.20-1) unstable; urgency=low
+
+  * New upstream release.
+  * Taking over the package, Juan Cespedes is MIA.
+
+ -- Daniel Baumann <daniel@debian.org>  Tue,  5 Sep 2006 23:21:00 +0200
+
+syslinux (3.11+3.20pre11-1) experimental; urgency=low
+
+  * New upstream pre-release.
+
+ -- Daniel Baumann <daniel@debian.org>  Thu, 10 Aug 2006 11:31:00 +0200
+
+syslinux (3.11+3.20pre10-1) experimental; urgency=low
+
+  * New upstream pre-release.
+  * Added myself as co-maintainer.
+  * Redone debian directory based on current debhelper templates, additionally:
+    - added watch file.
+    - cleaned up copyright files.
+    - including all manpages as plain files, dropping docbook-to-man.
+    - including com32/modules/menu.c32 into the package.
+    - not using binaries from upstream, building everything from source.
+    - using dpatch for upstream modifications now.
+
+ -- Daniel Baumann <daniel@debian.org>  Sun, 30 Jul 2006 09:43:00 +0200
+
+syslinux (3.11-3ubuntu4) feisty; urgency=low
+
+  * Build with -fno-stack-protector, since package does not link against
+    libc.
+  * com32/samples/keytest.c, com32/libutil/include/libutil.h,
+    com32/include/time.h: Define CLK_TCK, since the com32 libc API does not
+    have any idea about it, and its include files shadow /usr/include/time.h
+    (which would provide CLOCKS_PER_SEC).
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Mon, 12 Mar 2007 13:40:50 +0100
+
+syslinux (3.11-3ubuntu3) feisty; urgency=low
+
+  * debian/control: Update maintainer fields according to debian-
+    maintainer-field spec.
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Fri,  9 Mar 2007 11:58:28 +0000
+
+syslinux (3.11-3ubuntu2) dapper; urgency=low
+
+  * Drop ia32-libs-dev build dependency.
+
+ -- Matthias Klose <doko@ubuntu.com>  Thu, 16 Mar 2006 15:37:14 +0000
+
+syslinux (3.11-3ubuntu1) dapper; urgency=low
+
+  * Resynchronise with Debian.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 17 Jan 2006 23:07:52 +0000
+
+syslinux (3.11-3) unstable; urgency=low
+
+  * Fixed FTBFS bug with latest "make" (closes: #343619)
+  * Added "mkdiskimage" to Debian package (closes: #343617)
+
+ -- Juan Cespedes <cespedes@debian.org>  Sun, 18 Dec 2005 16:54:26 +0100
+
+syslinux (3.11-2ubuntu5) dapper; urgency=low
+
+  * Fix debian/applied-patches/localboot-gfxdone.diff filename.
+  * debian/applied-patches/gfxboot-cpio-swab.diff: Make gfxboot check for
+    byte-swapped cpio archives, so that it's easier to develop gfxboot
+    themes on a powerpc system with qemu.
+  * debian/applied-patches/localboot-gfxdone.diff: Call vgasetmode when
+    switching back to text mode, to make sure that the screen gets cleared.
+  * Makefile: Just export DATE and HEXDATE rather than playing with $(MAKE);
+    current make applies an extra shell evaluation pass to the latter
+    approach and so fails.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 11 Jan 2006 16:02:06 +0000
+
+syslinux (3.11-2ubuntu4) dapper; urgency=low
+
+  * debian/applied-patches/localboot-gfxdone.diff: Turn gfxboot off before
+    booting from a local disk with LOCALBOOT.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Tue, 13 Dec 2005 12:43:29 +0000
+
+syslinux (3.11-2ubuntu3) dapper; urgency=low
+
+  * Apply SuSE's gfxboot patch (debian/applied-patches/gfxboot.diff); thanks
+    to Steffen Winterfeldt for technical support. See README.gfxboot for
+    details.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed,  7 Dec 2005 17:01:51 +0000
+
+syslinux (3.11-2ubuntu2) dapper; urgency=low
+
+  * Install menu.c32 in /usr/lib/syslinux.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 23 Nov 2005 14:55:12 +0000
+
+syslinux (3.11-2ubuntu1) dapper; urgency=low
+
+  * Resynchronise with Debian.
+
+ -- Colin Watson <cjwatson@ubuntu.com>  Wed, 23 Nov 2005 10:34:54 +0000
+
+syslinux (3.11-2) unstable; urgency=low
+
+  * Added correct build-depends for amd64 (Andreas Jochens <aj@andaco.de>)
+                              (Closes: Bug#306123, Bug#249506, Bug#298940)
+  * Acknowledged old NMU (Closes: #269424)
+
+ -- Juan Cespedes <cespedes@debian.org>  Wed, 19 Oct 2005 16:00:38 +0200
+
+syslinux (3.11-1) unstable; urgency=low
+
+  * New upstream version
+  * Updated to new FSF postal address
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue, 18 Oct 2005 16:19:49 +0200
+
+syslinux (2.11-0.1ubuntu4) breezy; urgency=low
+
+  * Make the package build again (Ubuntu: #14605)
+  * sample/chain.c: Replace memcpy() call with a loop since memcpy() is not
+    available (-nostdlib).
+  * memdisk/setup.c: Replace memcmp() call with a per-char comparison since
+    memcmp() is not available.
+  * memdisk/inflate.c: Fix declaration of crc_32_tab[256].
+
+ -- Martin Pitt <martin.pitt@ubuntu.com>  Wed,  7 Sep 2005 17:29:49 +0200
+
+syslinux (2.11-0.1ubuntu3) hoary; urgency=low
+
+  * Don't build or install syslinux.exe; don't build-depend on mingw32
+    (closes: Ubuntu #3416).
+
+ -- Colin Watson <cjwatson@canonical.com>  Thu,  9 Dec 2004 17:30:06 +0100
+
+syslinux (2.11-0.1ubuntu2) hoary; urgency=low
+
+  * Fix amd64 compilation (thanks, Tollef Fog Heen and LaMont Jones).
+
+ -- Daniel Stone <daniel.stone@canonical.com>  Wed,  3 Nov 2004 16:13:25 +0100
+
+syslinux (2.11-0.1ubuntu1) hoary; urgency=low
+
+  * Merge changes from Debian back in.
+  * debian/rules:
+    + Stop attempting to back up sample/*.elf when they are not shipped in the orig.
+
+ -- Daniel Stone <daniel.stone@canonical.com>  Mon,  1 Nov 2004 18:16:33 +0100
+
+syslinux (2.11-0.1) unstable; urgency=low
+
+  * NMU with new upstream release.
+    - ALL: Add an API call to get the configuration file name.
+    - SYSLINUX: Fix bug in 2.10 that prevented it from working
+      correctly for a lot of people. Closes: #269424
+    - SYSLINUX: In the installer, make mtools a bit less fussy.
+    - Make the menu system compile with newer gcc's.
+
+ -- Joey Hess <joeyh@debian.org>  Fri, 10 Sep 2004 12:18:43 -0400
+
+syslinux (2.10-1) unstable; urgency=medium
+
+  * New upstream version, fixing many bugs, among them a problem which
+    prevented syslinux from booting large kernels (thanks to Torsten
+    Knodt <tk-debian@datas-world.de>)   (closes: Bug#224606, Bug#242547)
+                                                    (closes: Bug#258940)
+  * New Standards-Version (3.6.1)
+  * Removed dependency on lilo                      (closes: Bug#235439)
+  * syslinux now uses mtools to install the image, it no longer requires
+    msdos or vfat filesystem in the kernel           (closes: Bug#72124)
+  * Added a "Recommend: mtools" control line        (closes: Bug#201354)
+
+ -- Juan Cespedes <cespedes@debian.org>  Sat, 17 Jul 2004 10:32:37 +0200
+
+syslinux (2.04-1) unstable; urgency=low
+
+  * New upstream version, needed for debian-installer  (closes: #186356)
+  * This new upstream version of syslinux already
+    uses mcopy to generate disk images              (closes: Bug#180660)
+  * New Standards-Version:
+    + Get rid of /usr/doc/syslinux symlink
+  * Replaced all all # comments with /* */ to get rid
+    of gcc-3.3 preprocessor errors                  (closes: Bug#196532)
+
+ -- Juan Cespedes <cespedes@debian.org>  Wed, 11 Jun 2003 11:52:06 +0200
+
+syslinux (2.00-2) unstable; urgency=low
+
+  * Fixed typo in description                       (closes: Bug#178582)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 27 Jan 2003 13:26:42 +0100
+
+syslinux (2.00-1) unstable; urgency=low
+
+  * New upstream version                            (closes: Bug#174565)
+    (thanks to Andrea Bedini <andrea@bedini.homelinux.net>)
+  * Added note about PXE in the description         (closes: Bug#151700)
+  * Added man pages for gethostip, lss16toppm, ppmtolss16
+    (thanks to dann frazier <dannf@dannf.org>)      (closes: Bug#107539)
+
+ -- Juan Cespedes <cespedes@debian.org>  Sun, 26 Jan 2003 13:49:44 +0100
+
+syslinux (1.75-1) unstable; urgency=low
+
+  * New upstream release
+  * Added "memdisk" to the package      (closes: Bug#141605, Bug#143773)
+  * Added "syslinux-debug.bin" to the package       (closes: Bug#143772)
+
+ -- Juan Cespedes <cespedes@debian.org>  Thu, 20 Jun 2002 13:18:22 +0200
+
+syslinux (1.66-1) unstable; urgency=low
+
+  * New upstream version
+  * Boot images shorter than 64K, including memtest86 (closes: Bug#45133)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 21 Jan 2002 01:56:55 +0100
+
+syslinux (1.63-1) unstable; urgency=low
+
+  * New upstream release, fixing "No setup signature found" bug
+    found with some newer kernels (closes: Bug#107345)
+  * Reverted mtools patch for installer (it fails with some
+    high-capacity floppy formats) (closes: Bug#108096)
+
+ -- Juan Cespedes <cespedes@debian.org>  Wed, 22 Aug 2001 01:42:58 +0200
+
+syslinux (1.62-5) unstable; urgency=low
+
+  * Added "Build-Depends: netpbm"                    (closes: Bug#97497)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 14 May 2001 23:38:29 +0200
+
+syslinux (1.62-4) unstable; urgency=low
+
+  * Yet another version of `ppmtolss16' from the author (hpa),
+    fixing a bug regarding color space conversion
+
+ -- Juan Cespedes <cespedes@debian.org>  Sun, 13 May 2001 17:21:02 +0200
+
+syslinux (1.62-3) unstable; urgency=low
+
+  * New version of `ppmtolss16' from the author (hpa)
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue,  8 May 2001 21:39:45 +0200
+
+syslinux (1.62-2) unstable; urgency=medium
+
+  * Changed small typo in manual page names
+    (sylinux -> syslinux)                            (closes: Bug#96553)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon,  7 May 2001 00:30:09 +0200
+
+syslinux (1.62-1) unstable; urgency=medium
+
+  * New upstream version                             (closes: Bug#77269)
+  * This version could fix Bug#56983 and Bug#69140, but I have no
+    way to test it
+  * Added Build-Depends                              (closes: Bug#60729)
+  * New Standards-Version: 3.5.3
+  * Fixed lintian error "copyright-refers-to-old-directory"
+  * Fixed lintian warnings "no-priority-field" and "no-section-field"
+  * Change the installer a bit so that it is no longer needed to run
+    it as root, using mtools                         (closes: Bug#30982)
+  * Added manual page for `syslinux', provided by
+    Arthur Korn <arthur@korn.ch>                     (closes: Bug#18432)
+  * Added manual page for `syslinux2ansi', provided by
+    Kevin Kreamer <kkreamer@etherhogz.org>           (closes: Bug#35264)
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue,  1 May 2001 17:12:49 +0200
+
+syslinux (1.48-2) unstable; urgency=medium
+
+  * New Standards-Version (3.1.1)
+  * Fixed lintian bugs
+  * Note in the package description that filesystem type `msdos' is
+    needed in order to use this program (closes: Bug#23265)
+
+ -- Juan Cespedes <cespedes@debian.org>  Sun, 19 Dec 1999 14:25:45 +0100
+
+syslinux (1.48-1) unstable; urgency=medium
+
+  * New upstream version:
+    + Changed HIGHMEM_MAX to 38000000h
+    + Serial console support
+    + New program PXELINUX to do network booting
+  * FHS support
+  * New Standards-Version: 3.0.1
+  * Almost all the bugs regarding boot problems should be fixed with
+    this upstream version:
+      (closes: Bug#18271, Bug#22366, Bug#22700, Bug#22845, Bug#23181)
+      (closes: Bug#23936, Bug#27755, Bug#28846, Bug#29296, Bug#32138)
+  * Fixed copyright notice in "copybs.asm" (closes: Bug#35531)
+  * "syslinux.com" is now included (closes: Bug#31460)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 25 Oct 1999 11:09:02 +0200
+
+syslinux (1.43-1) unstable; urgency=medium
+
+  * New upstream version:
+    + Add syslinux2ansi script to display the contents of a
+      colorized SYSLINUX file.
+    + Changed the io_delay once again, after a report that the
+      old delay port causes hangs on some systems.
+    + Should fix: Bug#18271, Bug#22366, Bug#22845, Bug#23181,
+      Bug#23936, Bug#27755, Bug#28846, Bug#29296, Bug#32138
+  * Include "syslinux.com": Bug#31460
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue, 30 Mar 1999 12:53:48 +0200
+
+syslinux (1.42-2) frozen unstable; urgency=HIGH
+
+  * Reverted patch for installer (it fails with some mtools versions)
+    (Fixes grave bug: Bug#30791)
+
+ -- Juan Cespedes <cespedes@debian.org>  Thu, 17 Dec 1998 10:33:37 +0100
+
+syslinux (1.42-1) frozen unstable; urgency=medium
+
+  * New upstream version.  Mostly A20 bug fixes.
+  * This should fix at least the following syslinux bugs:
+    Bug#22845, Bug#23181, Bug#23936, Bug#27755, Bug#28846, Bug#29296.
+  * Change the installer a bit so that it is no longer needed to run
+    it as root
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue,  8 Dec 1998 21:20:31 +0100
+
+syslinux (1.40-3) frozen unstable; urgency=medium
+
+  * Added "img1743k.gz" as suggested by Enrique Zanardi <ezanardi@ull.es>
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon,  9 Nov 1998 21:23:21 +0100
+
+syslinux (1.40-2) frozen unstable; urgency=medium
+
+  * Added "safe, slow and stupid" option to the version
+    for the boot floppies to be able to boot even on very
+    buggy bioses. (Bug#23157, Bug#23181).
+  * Increased A20M delay even a bit more, as suggested by
+    Enrique Zanardi.
+  * Changed the aspect of the syslinux banner a bit
+
+ -- Juan Cespedes <cespedes@debian.org>  Sat,  6 Jun 1998 01:05:34 +0200
+
+syslinux (1.40-1) unstable; urgency=low
+
+  * New upstream release:
+  	* Increase A20M delay and put in a test to avoid problems on
+  	  certain IBM Thinkpads (thanks to Donnie Barnes of RedHat
+  	  for vital info on this one.)
+  	* Support COMBOOT style boot command images.
+  	* Support chain loading (foreign operating systems, e.g. DOS).
+  	* Include a new "copybs" DOS utility to copy a boot sector to
+  	  a file (under Linux, use "dd".)
+  	* Fix the DOS installer to work for disks over 32 MB.
+  	* SYSLINUX should now handle disks with more than 65536 tracks.
+  * Changed section from "misc" to "base", to be in sync with then
+    FTP archive
+
+ -- Juan Cespedes <cespedes@debian.org>  Fri,  8 May 1998 11:22:46 +0200
+
+syslinux (1.37-1) frozen unstable; urgency=medium
+
+  * New upstream version (Bug fixes only):
+    + Fix a bug that caused "label" statements in syslinux.cfg to
+      not be handled properly.
+    + Updated the documentation.  Among other things, we now allow
+      up to 128 "label" statements.
+
+ -- Juan Cespedes <cespedes@debian.org>  Tue, 21 Apr 1998 00:19:18 +0200
+
+syslinux (1.36-2) frozen unstable; urgency=medium
+
+  * Re-built for frozen (it fixes the "LABEL" behaviour, required
+    for the boot floppies)
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 20 Apr 1998 19:25:13 +0200
+
+syslinux (1.36-1) unstable; urgency=medium
+
+  * Applied patch to make all the "LABEL" keywords in config file work
+  * New upstream version (bug fixes + new option "KBDMAP")
+
+ -- Juan Cespedes <cespedes@debian.org>  Mon, 20 Apr 1998 02:30:58 +0200
+
+syslinux (1.34-2) unstable; urgency=low
+
+  * Install files as img<size>k.gz instead of img<size>.gz
+
+ -- Juan Cespedes <cespedes@debian.org>  Fri,  6 Mar 1998 20:04:59 +0100
+
+syslinux (1.34-1) unstable; urgency=low
+
+  * New upstream version
+
+ -- Juan Cespedes <cespedes@debian.org>  Thu,  5 Mar 1998 17:50:14 +0100
+
+syslinux (1.33-2) unstable; urgency=low
+
+  * Fixed minor packaging bugs
+
+ -- Juan Cespedes <cespedes@debian.org>  Sat, 28 Feb 1998 22:50:35 +0100
+
+syslinux (1.33-1) unstable; urgency=low
+
+  * New upstream version (fixes:Bug#18654)
+
+ -- Juan Cespedes <cespedes@debian.org>  Fri, 27 Feb 1998 10:42:05 +0100
+
+syslinux (1.32-1) unstable; urgency=low
+
+  * New upstream release
+  * Pristine source
+  * Fixed author email address (hpa@zytor.com instead of hpa@linux.org)
+  * New Standards-Version: 2.4.0.0
+  * gzipped only big files in /usr/doc/syslinux
+  * Changed architecture from all to i386
+
+ -- Juan Cespedes <cespedes@debian.org>  Fri, 20 Feb 1998 22:16:20 +0100
+
+syslinux (1.30-6) unstable; urgency=low
+
+  * New maintainer
+  * New Standards-Version (2.3.0.0)
+  * Changed rules file to no longer use debstd
+
+ -- Juan Cespedes <cespedes@debian.org>  Sat,  1 Nov 1997 16:22:57 +0100
+
+syslinux (1.30-5) unstable; urgency=low
+
+  * Install changelog correctly
+  * #8532: Filed a bug report against ftp.debian.org because the
+    package priorities and section are overridden on master.
+
+ -- Christoph Lameter <clameter@waterf.org>  Wed, 29 Oct 1997 18:47:17 -0800
+
+syslinux (1.30-4) unstable; urgency=low
+
+  * Changed architecture to all
+  * Note in description that syslinux generates Intel Boot disks (from
+    whatever platform you install it on)
+
+ -- Christoph Lameter <clameter@waterf.org>  Thu,  4 Sep 1997 11:16:34 -0700
+
+syslinux (1.30-3) unstable; urgency=low
+
+  * Include Images for 1.44K and 720K to boot Linux on an Atari Computer
+
+ -- Christoph Lameter <clameter@waterf.org>  Tue, 25 Feb 1997 09:27:55 -0800
+
+syslinux (1.30-2) unstable; urgency=low
+
+  * Control file: Priority set to optional and put into section "misc" where loadlin
+    is also. (Bug #5424)
+  * clean up debian directory
+
+ -- Christoph Lameter <clameter@waterf.org>  Mon, 4 Nov 1996 10:42:17 -0800
+
+syslinux (1.30-1) unstable; urgency=low
+
+  * Upstream update. Package made conformant to newest standards.
+
+ -- Christoph Lameter <clameter@waterf.org>  Mon, 4 Nov 1996 10:26:25 -0800
--- syslinux-3.63+dfsg.orig/debian/control
+++ syslinux-3.63+dfsg/debian/control
@@ -0,0 +1,25 @@
+Source: syslinux
+Section: utils
+Priority: optional
+Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Daniel Baumann <daniel@debian.org>
+Uploaders: Otavio Salvador <otavio@debian.org>
+Build-Depends: debhelper (>= 6), dpatch, gcc-multilib [amd64], libc6-dev-i386 [amd64], nasm (>= 0.99.06), netpbm, mtools
+Standards-Version: 3.8.0
+Homepage: http://syslinux.zytor.com/
+
+Package: syslinux
+Architecture: amd64 i386 lpia
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Recommends: mtools
+Description: Bootloader for Linux/i386 using MS-DOS floppies
+ SYSLINUX is a boot loader for the Linux/i386 operating system which operates
+ off an MS-DOS/Windows FAT filesystem. It is intended to simplify first-time
+ installation of Linux, and for creation of rescue and other special-purpose
+ boot disks.
+ .
+ It can also be used as a PXE bootloader during network boots.
+ .
+ SYSLINUX is probably not suitable as a general purpose boot loader. However,
+ SYSLINUX has shown itself to be quite useful in a number of special-purpose
+ applications.
--- syslinux-3.63+dfsg.orig/debian/copyright
+++ syslinux-3.63+dfsg/debian/copyright
@@ -0,0 +1,32 @@
+This package was debianized by Daniel Baumann <daniel@debian.org> on
+Sun, 30 Jul 2006 09:43:00 +0200.
+
+It was downloaded from <http://ftp.kernel.org/pub/linux/utils/boot/syslinux/>.
+
+Upstream Author: H. Peter Anvin <hpa@zytor.com>
+
+Upstream tarball has been rebuild without non-free RFC documents.
+
+License:
+
+	Copyright (C) 1994-2008 H. Peter Anvin <hpa@zytor.com>
+
+	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 of the License, or
+	(at your option) any later version.
+
+	This program is distributed in the hope that it will be useful,
+	but WITHOUT ANY WARRANTY; without even the implied warranty of
+	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+	GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program; if not, write to the Free Software
+	Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+On Debian systems, the complete text of the GNU General Public License
+can be found in /usr/share/common-licenses/GPL file.
+
+The Debian packaging is (C) 2006-2008, Daniel Baumann <daniel@debian.org> and
+is licensed under the GPL, see /usr/share/common-licenses/GPL-2.
--- syslinux-3.63+dfsg.orig/debian/rules
+++ syslinux-3.63+dfsg/debian/rules
@@ -0,0 +1,98 @@
+#!/usr/bin/make -f
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+include /usr/share/dpatch/dpatch.make
+
+DATE=$(shell date +%Y-%m-%d)
+VERSION=$(shell cat version)
+
+upstream:
+	rm -f doc/rfc5071.txt
+
+build: build-stamp
+build-stamp: patch-stamp
+	dh_testdir
+
+	# gfxboot
+	chmod +x add_crc
+	perl genhash.pl < keywords > kwdhash.gen
+
+	# Building package
+	$(MAKE) DATE="Debian-$(DATE)" VERSION="$(VERSION)"
+
+	# Building images
+	install -d -m 0755 build
+
+	for SIZE in 720 1200 1440 1743; \
+	do \
+		dd if=/dev/zero of=build/img$${SIZE}k bs=1k count=$$SIZE || exit 1; \
+	done
+
+	for DRIVE in a: b: c: d:;\
+	do \
+		MTOOLSRC=debian/config/mtoolsrc mformat $$DRIVE || exit 1; \
+	done
+
+	for SIZE in 720 1200 1440 1743; \
+	do \
+		mtools/syslinux -s build/img$${SIZE}k || exit 1; \
+	done
+
+	gzip -9 build/*
+
+	touch build-stamp
+
+clean: unpatch
+	dh_testdir
+	dh_testroot
+	rm -f build-stamp
+
+	# Cleaning package
+	[ ! -f Makefile ] || $(MAKE) clean
+	rm -f .depend memdisk/.depend
+	rm -f dos/syslinux.com extlinux.bin extlinux.bss extlinux.sys isolinux-debug.bin isolinux.bin ldlinux.bin ldlinux.bss ldlinux.sys memdisk/memdisk memdump/memdump.com pxelinux.0
+	rm -rf build
+
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k
+	dh_installdirs
+
+	# Installing package
+	install -d -m 0755 debian/syslinux/usr/bin
+	install -m 0755 gethostip lss16toppm mkdiskimage ppmtolss16 syslinux2ansi.pl mtools/syslinux extlinux/extlinux debian/syslinux/usr/bin
+
+	install -d -m 0755 debian/syslinux/usr/lib/syslinux
+	install -m 0644 build/* debian/syslinux/usr/lib/syslinux
+
+	install -m 0644 copybs.com isolinux.bin isolinux-debug.bin ldlinux.bss ldlinux.sys pxelinux.0 com32/modules/*.c32 com32/menu/*.c32 dos/syslinux.com mbr/mbr.bin memdisk/memdisk debian/syslinux/usr/lib/syslinux
+
+	# Renaming files
+	mv debian/syslinux/usr/bin/syslinux2ansi.pl debian/syslinux/usr/bin/syslinux2ansi
+
+binary-indep: build install
+
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs NEWS
+	dh_installdocs
+	dh_install
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install
--- syslinux-3.63+dfsg.orig/debian/manpages
+++ syslinux-3.63+dfsg/debian/manpages
@@ -0,0 +1 @@
+man/*
--- syslinux-3.63+dfsg.orig/debian/config/mtoolsrc
+++ syslinux-3.63+dfsg/debian/config/mtoolsrc
@@ -0,0 +1,4 @@
+drive a: file="build/img720k"  cylinders=80 heads=2 sectors=9 mformat_only
+drive b: file="build/img1200k" cylinders=80 heads=2 sectors=15 mformat_only
+drive c: file="build/img1440k" cylinders=80 heads=2 sectors=18 mformat_only
+drive d: file="build/img1743k" cylinders=83 heads=2 sectors=21 mformat_only
--- syslinux-3.63+dfsg.orig/debian/patches/00list
+++ syslinux-3.63+dfsg/debian/patches/00list
@@ -0,0 +1,9 @@
+01-flags.dpatch
+02-64bit-autodetection.dpatch
+03-64bit-autodetection-menu.dpatch
+10-ubuntu_makefile.dpatch
+11-suse_gfxboot.dpatch
+12-ubuntu_localboot-gfxdone.dpatch
+13-ubuntu_com32_gfxboot.dpatch
+14-ubuntu_gfxboot_force_prompt.dpatch
+20-dont-hide-password.dpatch
--- syslinux-3.63+dfsg.orig/debian/patches/14-ubuntu_gfxboot_force_prompt.dpatch
+++ syslinux-3.63+dfsg/debian/patches/14-ubuntu_gfxboot_force_prompt.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 14-gfxboot_force_prompt.dpatch by Colin Watson <cjwatson@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Always prompt if a gfxboot menu is set up.
+
+@DPATCH@
+diff -urNad syslinux-3.63+dfsg~/gfxboot.inc syslinux-3.63+dfsg/gfxboot.inc
+--- syslinux-3.63+dfsg~/gfxboot.inc	2008-06-19 13:55:06.000000000 +0100
++++ syslinux-3.63+dfsg/gfxboot.inc	2008-06-19 13:57:12.000000000 +0100
+@@ -749,6 +749,8 @@
+ 
+ gfx_setup_menu_90:
+ 		pop es
++		; if we set up a gfxboot menu, always prompt
++		mov word [ForcePrompt],1
+ 		ret
+ 
+ 
--- syslinux-3.63+dfsg.orig/debian/patches/03-64bit-autodetection-menu.dpatch
+++ syslinux-3.63+dfsg/debian/patches/03-64bit-autodetection-menu.dpatch
@@ -0,0 +1,142 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 03-64bit-autodetection-menu.dpatch by Ryan Finnie <ryan@finnie.org>
+##
+## DP: Allows auto-detection of 64bit CPUs also in vesamenu.c32
+## DP: (Closes: #485656)
+
+@DPATCH@
+
+diff -Naurp syslinux-3.63+dfsg.orig/com32/menu/menu.h syslinux-3.63+dfsg/com32/menu/menu.h
+--- syslinux-3.63+dfsg.orig/com32/menu/menu.h	2008-04-10 17:30:35.000000000 +0000
++++ syslinux-3.63+dfsg/com32/menu/menu.h	2008-06-10 19:03:17.000000000 +0000
+@@ -163,6 +163,8 @@ struct menu {
+   struct color_table *color_table;
+ 
+   struct fkey_help fkeyhelp[12];
++
++  int has_default64;
+ };
+ 
+ extern struct menu *root_menu, *start_menu, *hide_menu, *menu_list;
+diff -Naurp syslinux-3.63+dfsg.orig/com32/menu/readconfig.c syslinux-3.63+dfsg/com32/menu/readconfig.c
+--- syslinux-3.63+dfsg.orig/com32/menu/readconfig.c	2008-04-10 17:30:35.000000000 +0000
++++ syslinux-3.63+dfsg/com32/menu/readconfig.c	2008-06-10 19:03:17.000000000 +0000
+@@ -67,6 +67,56 @@ const char * const kernel_types[] = {
+ };
+ 
+ /*
++ * Test for long mode using cpuid instruction
++ * Based on plugins/cpuid/cpuid.c from win32-loader
++ * Copyright (C) 2007  Robert Millan <rmh@aybabtu.com>
++ * Based on gcc/gcc/config/i386/driver-i386.c
++ * Copyright (C) 2006, 2007  Free Software Foundation, Inc.
++ */
++
++#define cpuid(num,a,b,c,d) \
++  asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \
++		: "=a" (a), "=r" (b), "=c" (c), "=d" (d)  \
++		: "0" (num))
++
++#define bit_LM (1 << 29)
++
++int
++check_64bit ()
++{
++  unsigned int eax, ebx, ecx, edx;
++  unsigned int max_level;
++  unsigned int ext_level;
++  unsigned char has_longmode = 0;
++
++  /* See if we can use cpuid.  */
++  asm volatile ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;"
++		"pushl %0; popfl; pushfl; popl %0; popfl"
++		: "=&r" (eax), "=&r" (ebx)
++		: "i" (0x00200000));
++  if (((eax ^ ebx) & 0x00200000) == 0)
++    goto done;
++
++  /* Check the highest input value for eax.  */
++  cpuid (0, eax, ebx, ecx, edx);
++  /* We only look at the first four characters.  */
++  max_level = eax;
++  if (max_level == 0)
++    goto done;
++
++  cpuid (0x80000000, eax, ebx, ecx, edx);
++  ext_level = eax;
++  if (ext_level < 0x80000000)
++    goto done;
++
++  cpuid (0x80000001, eax, ebx, ecx, edx);
++  has_longmode = !!(edx & bit_LM);
++
++done:
++  return has_longmode;
++}
++
++/*
+  * Search the list of all menus for a specific label
+  */
+ static struct menu *
+@@ -206,6 +256,7 @@ struct labeldata {
+   unsigned int ipappend;
+   unsigned int menuhide;
+   unsigned int menudefault;
++  unsigned int menudefault64;
+   unsigned int menuseparator;
+   unsigned int menudisabled;
+   unsigned int menuindent;
+@@ -273,6 +324,8 @@ record(struct menu *m, struct labeldata 
+   struct menu_entry *me;
+   const struct syslinux_ipappend_strings *ipappend;
+ 
++  int is_64bit = check_64bit();
++
+   if (!ld->label)
+     return;			/* Nothing defined */
+ 
+@@ -361,8 +414,26 @@ record(struct menu *m, struct labeldata 
+       break;
+     }
+ 
+-    if ( ld->menudefault && me->action == MA_CMD )
++    /* If this ld has DEFAULT on it, it's a candidate for the default entry.
++     * But if a 64-bit default has already been set, we know that A) the CPU
++     * is 64-bit, and B) a DEFAULT64 has already occurred, so we don't even
++     * want to attempt 32-bit defaults anymore.  If it's a 64-bit CPU,
++     * regular DEFAULTs can of course be considered for the default,
++     * but any past or future DEFAULT64 (with a corresponding 64-bit CPU)
++     * will eventually win.
++     */
++    if ( ld->menudefault && me->action == MA_CMD && !m->has_default64 )
++      m->defentry = m->nentries-1;
++
++    /* If the CPU is 64-bit and DEFAULT64 is set for this ld, set it as
++     * default.  However, if DEFAULT64 is set and the CPU is NOT 64-bit,
++     * don't even consider it for a default.
++     */
++    if ( ld->menudefault64 && me->action == MA_CMD && is_64bit ) {
+       m->defentry = m->nentries-1;
++      m->has_default64 = 1;
++    }
++
+   }
+ 
+   clear_label_data(ld);
+@@ -620,6 +691,8 @@ static void parse_config_file(FILE *f)
+ 	}
+       } else if ( looking_at(p, "default") ) {
+ 	ld.menudefault = 1;
++      } else if ( looking_at(p, "default64") ) {
++	ld.menudefault64 = 1;
+       } else if ( looking_at(p, "hide") ) {
+ 	ld.menuhide = 1;
+       } else if ( looking_at(p, "passwd") ) {
+@@ -875,6 +948,7 @@ static void parse_config_file(FILE *f)
+       ld.ipappend  = ipappend;
+       ld.menudefault = ld.menuhide = ld.menuseparator =
+ 	ld.menudisabled = ld.menuindent = 0;
++      ld.menudefault64 = 0;
+     } else if ( (ep = is_kernel_type(p, &type)) ) {
+       if ( ld.label ) {
+ 	refstr_put(ld.kernel);
--- syslinux-3.63+dfsg.orig/debian/patches/20-dont-hide-password.dpatch
+++ syslinux-3.63+dfsg/debian/patches/20-dont-hide-password.dpatch
@@ -0,0 +1,19 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 20-dont-hide-password.dpatch by  <steve.magoun@canonical.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: No description.
+
+@DPATCH@
+diff -urNad syslinux-3.53~/com32/menu/menumain.c syslinux-3.53/com32/menu/menumain.c
+--- syslinux-3.53~/com32/menu/menumain.c	2007-11-18 01:55:01.000000000 -0500
++++ syslinux-3.53/com32/menu/menumain.c	2008-08-07 13:41:33.000000000 -0400
+@@ -271,7 +271,7 @@
+       if ( key >= ' ' && key <= 0xFF &&
+ 	   (p-user_passwd) < WIDTH-2*PASSWD_MARGIN-5 ) {
+ 	*p++ = key;
+-	putchar('*');
++	putchar(key);
+       }
+       break;
+     }
--- syslinux-3.63+dfsg.orig/debian/patches/10-ubuntu_makefile.dpatch
+++ syslinux-3.63+dfsg/debian/patches/10-ubuntu_makefile.dpatch
@@ -0,0 +1,25 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 10-makefile.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Don't build Win32 components, in order that mingw32 doesn't have to
+## DP: be in Ubuntu main.
+
+@DPATCH@
+diff -urNad syslinux-3.53-1ubuntu1~/Makefile syslinux-3.53-1ubuntu1/Makefile
+--- syslinux-3.53-1ubuntu1~/Makefile	2007-11-21 19:08:18.000000000 +0100
++++ syslinux-3.53-1ubuntu1/Makefile	2007-12-10 18:56:01.603469789 +0100
+@@ -70,11 +70,12 @@
+ 
+ # syslinux.exe is BTARGET so as to not require everyone to have the
+ # mingw suite installed
++# (Removed from Ubuntu so that we don't need mingw32 in main.)
+ BTARGET  = kwdhash.gen version.gen version.h \
+ 	   ldlinux.bss ldlinux.sys ldlinux.bin \
+ 	   pxelinux.0 isolinux.bin isolinux-debug.bin \
+ 	   extlinux.bin extlinux.bss extlinux.sys
+-BOBJECTS = $(BTARGET) mbr/mbr.bin dos/syslinux.com win32/syslinux.exe \
++BOBJECTS = $(BTARGET) mbr/mbr.bin dos/syslinux.com \
+ 	memdisk/memdisk memdump/memdump.com
+ # BESUBDIRS and IESUBDIRS are "early", i.e. before the root; BSUBDIRS
+ # and ISUBDIRS are "late", after the root.
--- syslinux-3.63+dfsg.orig/debian/patches/02-64bit-autodetection.dpatch
+++ syslinux-3.63+dfsg/debian/patches/02-64bit-autodetection.dpatch
@@ -0,0 +1,129 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 02-64bit-autodetection.dpatch by Byron Stanoszek <gandalf@winds.org>
+## and updated by Robert Millan <rmh@aybabtu.com>.
+##
+## DP: Allows auto-detection of 64bit CPUs (Closes: #408138), see
+## DP: http://syslinux.zytor.com/archives/2007-January/007832.html
+
+@DPATCH@
+
+diff -Naurp syslinux-3.62+dfsg.orig/cpuinit.inc syslinux-3.62+dfsg/cpuinit.inc
+--- syslinux-3.62+dfsg.orig/cpuinit.inc	2008-03-01 23:28:21.000000000 +0000
++++ syslinux-3.62+dfsg/cpuinit.inc	2008-03-31 11:26:04.000000000 +0000
+@@ -48,30 +48,38 @@ skip_checks:
+ 		rep movsd
+ 
+ ;
+-; Check if we're 386 (as opposed to 486+); if so we need to blank out
+-; the WBINVD instruction
++; Determine if we're running on a 64-bit CPU
+ ;
+-; We check for 486 by setting EFLAGS.AC
++
++;
++; Check if this CPU supports the CPUID command
+ ;
+-%if DO_WBINVD
+-		pushfd				; Save the good flags
++		pushfd				; Save the flags again
+ 		pushfd
+ 		pop eax
+ 		mov ebx,eax
+-		xor eax,(1 << 18)		; AC bit
++		xor eax,(1 << 21)		; CPUID bit
+ 		push eax
+ 		popfd
+ 		pushfd
+ 		pop eax
+ 		popfd				; Restore the original flags
+ 		xor eax,ebx
+-		jnz is_486
++		jz is_32bit
+ ;
+-; 386 - Looks like we better blot out the WBINVD instruction
++; Now check for the 64-bit flag (bit 29) in the CPU extended features byte ($8000_0001, edx)
+ ;
+-		mov byte [try_wbinvd],0c3h		; Near RET
+-is_486:
+-%endif	; DO_WBINVD
++		mov eax, 80000000h		; Find last AMD cpuid #
++		cpuid
++		cmp eax, 80000000h
++		jbe is_32bit
++		mov eax, 80000001h		; Read AMD CPU flags
++		cpuid
++		bt edx, 29			; 64-bit if bit 29 is set
++		jnc is_32bit
++
++is_64bit:	mov byte [Is64Bit],1		; Flag that we're 64-bit
++is_32bit:
+ 
+ 		section .data
+ err_noram	db 'It appears your computer has less than '
+diff -Naurp syslinux-3.62+dfsg.orig/keywords syslinux-3.62+dfsg/keywords
+--- syslinux-3.62+dfsg.orig/keywords	2008-03-01 23:28:21.000000000 +0000
++++ syslinux-3.62+dfsg/keywords	2008-03-31 11:26:04.000000000 +0000
+@@ -4,6 +4,7 @@ include
+ append
+ config
+ default
++default64
+ display
+ font
+ implicit
+diff -Naurp syslinux-3.62+dfsg.orig/keywords.inc syslinux-3.62+dfsg/keywords.inc
+--- syslinux-3.62+dfsg.orig/keywords.inc	2008-03-01 23:28:21.000000000 +0000
++++ syslinux-3.62+dfsg/keywords.inc	2008-03-31 11:27:10.000000000 +0000
+@@ -50,6 +50,7 @@ keywd_table:
+ 		keyword include,	pc_opencmd,	pc_include
+ 		keyword append,		pc_append
+ 		keyword default,	pc_default
++		keyword default64,	pc_default64
+ 		keyword display,	pc_opencmd,	get_msg_file
+ 		keyword font,		pc_filecmd,	loadfont
+ 		keyword implicit,	pc_setint16,	AllowImplicit
+diff -Naurp syslinux-3.62+dfsg.orig/kwdhash.gen syslinux-3.62+dfsg/kwdhash.gen
+--- syslinux-3.62+dfsg.orig/kwdhash.gen	2008-03-01 23:28:29.000000000 +0000
++++ syslinux-3.62+dfsg/kwdhash.gen	2008-03-31 11:26:04.000000000 +0000
+@@ -4,6 +4,7 @@ hash_include            equ 0x9a07d8ff
+ hash_append             equ 0xc53999a4
+ hash_config             equ 0xc0c69547
+ hash_default            equ 0xcc5159ed
++hash_default64          equ 0x4567b1c5
+ hash_display            equ 0xd509bc40
+ hash_font               equ 0x0032b1b4
+ hash_implicit           equ 0xa6f50207
+diff -Naurp syslinux-3.62+dfsg.orig/parseconfig.inc syslinux-3.62+dfsg/parseconfig.inc
+--- syslinux-3.62+dfsg.orig/parseconfig.inc	2008-03-01 23:28:21.000000000 +0000
++++ syslinux-3.62+dfsg/parseconfig.inc	2008-03-31 11:26:04.000000000 +0000
+@@ -20,7 +20,20 @@
+ ;
+ ; "default" command
+ ;
+-pc_default:	mov di,default_cmd
++pc_default:	cmp byte [HasDefault64],0	; Check if we accepted 'default64'
++		ja pc_getline			; If so, do nothing
++		mov di,default_cmd
++		call getline
++		mov byte [di-1],0		; null-terminate
++		ret
++
++;
++; "default64" command
++;
++pc_default64:	cmp byte [Is64Bit],0		; Make sure cpu is 64-bit
++		je pc_getline
++		mov byte [HasDefault64],1	; Note that we saw a default64
++		mov di,default_cmd
+ 		call getline
+ 		mov byte [di-1],0		; null-terminate
+ 		ret
+@@ -438,6 +451,8 @@ AllowOptions	dw 1			; User-specified opt
+ IncludeLevel	dw 1			; Nesting level
+ SerialPort	dw 0			; Serial port base (or 0 for no serial port)
+ VKernel		db 0			; Have we seen any "label" statements?
++Is64Bit		db 0			; Is this CPU 64-bit?
++HasDefault64	db 0			; We've seen a 'default64' statement
+ 
+ %if IS_PXELINUX
+ IPAppend	db 0			; Default IPAPPEND option
--- syslinux-3.63+dfsg.orig/debian/patches/01-flags.dpatch
+++ syslinux-3.63+dfsg/debian/patches/01-flags.dpatch
@@ -0,0 +1,23 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 01-flags.dpatch
+##
+## DP: Using mingw cross-compiler.
+
+@DPATCH@
+
+diff -Naur syslinux-3.50-pre15.orig/win32/Makefile syslinux-3.50-pre15/win32/Makefile
+--- syslinux-3.50-pre15.orig/win32/Makefile	2007-05-23 06:28:22.000000000 +0000
++++ syslinux-3.50-pre15/win32/Makefile	2007-05-31 06:50:30.000000000 +0000
+@@ -19,9 +19,9 @@
+ 
+ OSTYPE   = $(shell uname -msr)
+ ifeq ($(findstring CYGWIN,$(OSTYPE)),CYGWIN)
+-WINCC       = gcc
+-WINAR	    = ar
+-WINRANLIB   = ranlib
++WINCC       = i586-mingw32msvc-gcc
++WINAR	    = i586-mingw32msvc-ar
++WINRANLIB   = i586-mingw32msvc-ranlib
+ WINCFLAGS   = -mno-cygwin -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
+ WINPIC	    =
+ WINLDFLAGS  = -mno-cygwin -Os -s
--- syslinux-3.63+dfsg.orig/debian/patches/12-ubuntu_localboot-gfxdone.dpatch
+++ syslinux-3.63+dfsg/debian/patches/12-ubuntu_localboot-gfxdone.dpatch
@@ -0,0 +1,29 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 13-ubuntu_localboot-gfxdone.dpatch by Colin Watson <cjwatson@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Make sure the screen gets cleared when switching back to text mode
+## DP: from gfxboot.
+
+@DPATCH@
+diff -urNad syslinux-3.53-1ubuntu1~/gfxboot.inc syslinux-3.53-1ubuntu1/gfxboot.inc
+--- syslinux-3.53-1ubuntu1~/gfxboot.inc	2007-12-10 19:12:14.068488931 +0100
++++ syslinux-3.53-1ubuntu1/gfxboot.inc	2007-12-10 19:12:14.220491002 +0100
+@@ -548,6 +548,17 @@
+ 		call far [gfx_bc_done]
+ 		mov byte [gfx_ok],0
+ 
++		; make sure the screen gets cleared
++		pusha
++		push ds
++		push es
++		mov ax,cs
++		mov ds,ax
++		call vgasetmode
++		pop es
++		pop ds
++		popa
++
+ 		; reactivate 'cwritestr'
+ 		mov al,[gfx_cwritestr_old]
+ 		cmp al,0c3h
--- syslinux-3.63+dfsg.orig/debian/patches/11-suse_gfxboot.dpatch
+++ syslinux-3.63+dfsg/debian/patches/11-suse_gfxboot.dpatch
@@ -0,0 +1,2369 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 11-suse_gfxboot.dpatch by Colin Watson <cjwatson@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add gfxboot hooks. The original patch was from openSUSE:
+## DP:   http://download.opensuse.org/distribution/SL-OSS-factory/inst-source/suse/src/syslinux-3.63-13.src.rpm
+
+@DPATCH@
+diff -urNad syslinux-3.63+dfsg~/Makefile syslinux-3.63+dfsg/Makefile
+--- syslinux-3.63+dfsg~/Makefile	2008-04-10 18:30:33.000000000 +0100
++++ syslinux-3.63+dfsg/Makefile	2008-06-13 15:08:24.000000000 +0100
+@@ -146,15 +146,16 @@
+ 	$(PERL) genhash.pl < keywords > kwdhash.gen
+ 
+ # Standard rule for {isolinux,isolinux-debug}.bin
+-iso%.bin: iso%.asm kwdhash.gen version.gen
++iso%.bin: iso%.asm kwdhash.gen version.gen gfxboot.inc
+ 	$(NASM) $(NASMOPT) -f bin -DDATE_STR="'$(DATE)'" -DHEXDATE="$(HEXDATE)" \
+ 		-DMAP=$(@:.bin=.map) -l $(@:.bin=.lsr) -o $@ $<
+ 	$(PERL) lstadjust.pl $(@:.bin=.lsr) $(@:.bin=.map) $(@:.bin=.lst)
+ 	$(PERL) checksumiso.pl $@
+ 	$(PERL) checkov.pl $(@:.bin=.map) $@
++	-./add_crc $@
+ 
+ # Standard rule for {ldlinux,pxelinux,extlinux}.bin
+-%.bin: %.asm kwdhash.gen version.gen
++%.bin: %.asm kwdhash.gen version.gen gfxboot.inc
+ 	$(NASM) $(NASMOPT) -f bin -DDATE_STR="'$(DATE)'" -DHEXDATE="$(HEXDATE)" \
+ 		-DMAP=$(@:.bin=.map) -l $(@:.bin=.lsr) -o $@ $<
+ 	$(PERL) lstadjust.pl $(@:.bin=.lsr) $(@:.bin=.map) $(@:.bin=.lst)
+diff -urNad syslinux-3.63+dfsg~/README.gfxboot syslinux-3.63+dfsg/README.gfxboot
+--- syslinux-3.63+dfsg~/README.gfxboot	1970-01-01 01:00:00.000000000 +0100
++++ syslinux-3.63+dfsg/README.gfxboot	2008-06-13 15:08:24.000000000 +0100
+@@ -0,0 +1,41 @@
++Graphical boot screen
++=====================
++
++  syslinux/isolinux support a graphical boot screen using VESA BIOS
++  extensions. (Note that this is different from the graphics support that
++  syslinux comes with).
++
++  To use it you have to prepare a special boot logo file and put a line like
++  this into syslinux.cfg/isolinux.cfg:
++
++    gfxboot foo
++
++  The tools to create 'foo' from the above example are in the gfxboot
++  package. Please _do_ have a look at its documentation before you begin.
++
++  Note that you cannot use comboot images and graphics at the same time as
++  the memory used overlaps the comboot loading area.
++
++  If you encouter problems with the graphics code, hold down SHIFT while
++  syslinux starts. This will put it into 'failsafe' mode that lets you
++  interactively skip critical parts (like monitor detection).
++
++
++
++Spread boot images over several floppy disks (syslinux)
++=======================================================
++
++  You can prepare boot disks with a file system that spans several disks.
++  The 'mkbootdisk' script from the openSUSE project can create a suitable
++  file system.
++
++  syslinux will ask you for disk changes if necessary. To enable this
++  feature, use
++
++    disksize <size_of_single_disk_in_sectors>
++
++  Note that every individual disk must have at least a valid FAT boot
++  sector. syslinux will use the serial number stored there to verify that
++  the correct disk has been inserted (its last hex digit is the zero based
++  disk number).
++
+diff -urNad syslinux-3.63+dfsg~/abort.inc syslinux-3.63+dfsg/abort.inc
+--- syslinux-3.63+dfsg~/abort.inc	2008-04-10 18:30:33.000000000 +0100
++++ syslinux-3.63+dfsg/abort.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -21,6 +21,11 @@
+ ; abort_check: let the user abort with <ESC> or <Ctrl-C>
+ ;
+ abort_check:
++%ifdef WITH_GFX
++		; don't
++		cmp byte [gfx_ok],0
++		jnz .ret1
++%endif
+ 		call pollchar
+ 		jz .ret1
+ 		pusha
+diff -urNad syslinux-3.63+dfsg~/add_crc syslinux-3.63+dfsg/add_crc
+--- syslinux-3.63+dfsg~/add_crc	1970-01-01 01:00:00.000000000 +0100
++++ syslinux-3.63+dfsg/add_crc	2008-06-13 15:08:24.000000000 +0100
+@@ -0,0 +1,57 @@
++#! /usr/bin/perl
++
++use integer;
++
++# for isolinux
++#
++# Ensure checksum over (first sector - 64 bytes) [internally: FirstSecSum]
++# is 0 by adjusting the variable csum_value.
++#
++# Though isolinux checks the integrity with a separate checksum after all
++# data has been loaded this does not help with BIOSes that don't get even
++# the first 2k right. Hence this additional check. :-(
++#
++
++$file = shift;
++$list = "$file";
++$list =~ s/\.bin$/.lsr/;
++
++open F, $list;
++
++while(<F>) {
++  if(/^\s*\d+\s*(\S+)\s*0+\s*(\<\d+\>\s*)?csum_value\s*dd\s*0/) {
++    $ofs = hex $1;
++  }
++}
++close F;
++
++die "oops 1\n" unless $ofs && !($ofs & 3);
++
++# print "$ofs\n";
++
++open F, $file or die "$file: $!\n";
++
++$file_size = -s $file;
++
++sysread F, $buf, $file_size;
++
++close F;
++
++die "oops 1\n" if $file_size != length($buf);
++
++@x = unpack "V512", $buf;
++
++for ($sum = 0, $i = 16; $i < 512; $i++) {
++  $sum += $x[$i];
++}
++
++# printf "0x%08x\n", $sum;
++
++$ns = pack "V", -$sum;
++
++substr($buf, $ofs, 4) = $ns;
++
++open F, ">$file" or die "$file: $!\n";
++
++syswrite F, $buf;
++
+diff -urNad syslinux-3.63+dfsg~/com32/libutil/get_key.c syslinux-3.63+dfsg/com32/libutil/get_key.c
+--- syslinux-3.63+dfsg~/com32/libutil/get_key.c	2008-04-10 18:30:34.000000000 +0100
++++ syslinux-3.63+dfsg/com32/libutil/get_key.c	2008-06-13 15:08:24.000000000 +0100
+@@ -42,6 +42,10 @@
+ #include <getkey.h>
+ #include <libutil.h>
+ 
++#ifndef CLK_TCK
++# define CLK_TCK __sysconf(2)
++#endif
++
+ struct keycode {
+   int code;
+   int seqlen;
+diff -urNad syslinux-3.63+dfsg~/com32/modules/cpuid.c syslinux-3.63+dfsg/com32/modules/cpuid.c
+--- syslinux-3.63+dfsg~/com32/modules/cpuid.c	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/com32/modules/cpuid.c	2008-06-13 15:08:24.000000000 +0100
+@@ -254,7 +254,7 @@
+ 
+ static int smp_scan_config (unsigned long base, unsigned long length)
+ {
+-        unsigned long *bp = base;
++        unsigned long *bp = (unsigned long *) base;
+         struct intel_mp_floating *mpf;
+ 
+ //        printf("Scan SMP from %p for %ld bytes.\n", bp,length);
+diff -urNad syslinux-3.63+dfsg~/com32/samples/keytest.c syslinux-3.63+dfsg/com32/samples/keytest.c
+--- syslinux-3.63+dfsg~/com32/samples/keytest.c	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/com32/samples/keytest.c	2008-06-13 15:08:24.000000000 +0100
+@@ -25,6 +25,10 @@
+ #include <consoles.h>		/* Provided by libutil */
+ #include <getkey.h>
+ 
++#ifndef CLK_TCK
++# define CLK_TCK __sysconf(2)
++#endif
++
+ static void cooked_keys(void)
+ {
+   int key;
+diff -urNad syslinux-3.63+dfsg~/conio.inc syslinux-3.63+dfsg/conio.inc
+--- syslinux-3.63+dfsg~/conio.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/conio.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -49,6 +49,14 @@
+ ;		Assumes CS == DS == ES.
+ ;
+ get_msg_file:
++%ifdef WITH_GFX
++		; don't load if graphics code is active
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		jmp close
++.nogfx:
++%endif
++
+                 mov byte [TextAttribute],07h	; Default grey on white
+ 		mov byte [DisplayMask],07h	; Display text in all modes
+ 		call msg_initvars
+diff -urNad syslinux-3.63+dfsg~/doc/syslinux.txt syslinux-3.63+dfsg/doc/syslinux.txt
+--- syslinux-3.63+dfsg~/doc/syslinux.txt	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/doc/syslinux.txt	2008-06-13 15:08:24.000000000 +0100
+@@ -230,7 +230,7 @@
+         Append nothing.  APPEND with a single hyphen as argument in a
+         LABEL section can be used to override a global APPEND.
+ 
+-  LOCALBOOT type			[ISOLINUX, PXELINUX]
++  LOCALBOOT type			[ISOLINUX, SYSLINUX, PXELINUX]
+ 	On PXELINUX, specifying "LOCALBOOT 0" instead of a "KERNEL"
+ 	option means invoking this particular label will cause a local
+ 	disk boot instead of booting a kernel.
+@@ -244,12 +244,11 @@
+ 	UNDI or PXE stacks are, don't worry -- you don't want them,
+ 	just specify 0.
+ 
+-	On ISOLINUX, the "type" specifies the local drive number to
+-	boot from; 0x00 is the primary floppy drive and 0x80 is the
+-	primary hard drive.  The special value -1 causes ISOLINUX to
+-	report failure to the BIOS, which, on recent BIOSes, should
+-	mean that the next boot device in the boot sequence should be
+-	activated.
++	On ISOLINUX and SYSLINUX, the "type" specifies the local drive
++	number to boot from; 0x00 is the primary floppy drive and 0x80 is
++	the primary hard drive.  The special value -1 causes them to report
++	failure to the BIOS, which, on recent BIOSes, should mean that the
++	next boot device in the boot sequence should be activated.
+ 
+ IMPLICIT flag_val
+         If flag_val is 0, do not load a kernel image unless it has been
+diff -urNad syslinux-3.63+dfsg~/gfxboot.inc syslinux-3.63+dfsg/gfxboot.inc
+--- syslinux-3.63+dfsg~/gfxboot.inc	1970-01-01 01:00:00.000000000 +0100
++++ syslinux-3.63+dfsg/gfxboot.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -0,0 +1,1357 @@
++		section .text
++
++load_gfx_msg	db 'Loading...', 0
++no_msg		db 0
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++; do a reboot
++;
++do_reboot:
++		call gfx_done
++		mov word [472h],1234h
++		push word 0ffffh
++		push word 0
++		retf
++		int 19h
++		jmp $
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; wait for 'enter' key pressed
++;
++wait_for_key:
++		pusha
++wait_for_key_10:
++		mov ah,0
++		int 16h
++		cmp al,13
++		jnz wait_for_key_10
++		popa
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++; read gfx data
++get_gfx_file:
++		push si
++		mov si,load_gfx_msg
++		call cwritestr
++		pop si
++		mov word [gfx_mem_start_seg],first_free_seg
++		push ds
++		push 40h
++		pop ds
++		mov bx,[13h]			; mem size in kb
++		pop ds
++		shl bx,6
++		mov word [gfx_mem_end_seg],bx
++
++		call gfx_init			; Load and display file
++		cmp byte [gfx_ok],0
++		jz .done
++		mov si,crlf_msg
++		call cwritestr
++.done:
++		ret
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++; read from disk, ask for disk change, if necessary
++
++;       EAX - Linear sector number
++;       ES:BX   - Target buffer
++;       BP      - Sector count
++;
++;       (es:)bx gets updated
++
++%if IS_SYSLINUX
++
++; %define DEBUG_XXX
++
++getlinsec3:
++%ifdef DEBUG_XXX
++		mov si,txt0
++		call dump_params
++		call crlf
++%endif
++		mov cx,[DiskSize]
++		or cx,cx
++		jz getlinsec3_70		; unlimited
++
++		xor dx,dx
++		div cx
++		xchg ax,dx
++		movzx eax,ax
++
++		mov si,ax
++		add si,bp
++		sub si,cx
++		jbe getlinsec3_40
++		; split
++
++		sub bp,si
++		movzx ebp,bp
++		push ebp
++		push eax
++		push si
++		push dx
++		call getlinsec3_40
++		pop dx
++		pop bp
++		pop eax
++		pop esi
++		add eax,esi
++		movzx ebp,bp
++		inc dl
++
++getlinsec3_40:
++		push es
++		pushad
++		call disk_change
++		popad
++		pop es
++		jc kaboom
++getlinsec3_70:
++%ifdef DEBUG_XXX
++		mov si,txt1
++		call dump_params
++		mov si,txt3
++		call cwritestr
++		push ax
++		mov al,[CurrentDisk]
++		call writehex2
++		pop ax
++		call crlf
++		pushad
++		call getchar
++		popad
++%endif
++		xor edx,edx
++		call getlinsec.jmp
++		ret
++
++%ifdef DEBUG_XXX
++dump_params:
++		push eax
++		call cwritestr
++		mov ax,es
++		call writehex4
++		mov si,txt2
++		call cwritestr
++		mov ax,bx
++		call writehex4
++		mov si,txt3
++		call cwritestr
++		pop eax
++		push eax
++		call writehex8
++		mov si,txt3
++		call cwritestr
++		mov ax,bp
++		call writehex4
++		pop eax
++		ret
++
++txt0		db 'linsec3: ', 0
++txt1		db 'linsec:  ', 0
++txt2		db ':', 0
++txt3		db ', ', 0
++
++%include "writehex.inc"
++
++%endif
++
++
++; dl: new disk
++; return: CF = 1 -> error
++disk_change:
++		cmp dl,[CurrentDisk]
++		jz disk_change_90
++
++		mov [CurrentDisk],dl
++		movzx eax,dl
++		mov [gfx_user_info_0],eax
++		add dl,'1'
++		mov [boot_disk_msg0],dl
++		mov [boot_ndisk_msg0],dl
++
++disk_change_20:
++		cmp byte [gfx_ok],0
++		jz disk_change_40
++		mov al,3
++		xor di,di
++		xor si,si
++		call gfx_infobox
++
++		jmp disk_change_50
++disk_change_40:
++		mov si,clrln_msg
++		call cwritestr
++		mov si,boot_disk_msg
++		call cwritestr
++		call wait_for_key
++		mov si,clrln_msg
++		call cwritestr
++disk_change_50:
++		xor eax,eax
++		mov bp,1
++		push bx
++		xor edx,edx
++		call getlinsec.jmp
++		pop bx
++		mov eax,[es:bx+27h]
++		sub eax,[bsVolumeID]
++		movzx edx,byte [CurrentDisk]
++		cmp eax,edx
++		jz disk_change_90
++		mov [gfx_user_info_1],eax
++
++		cmp byte [gfx_ok],0
++		jz disk_change_70
++		mov al,4
++		xor di,di
++		xor si,si
++		call gfx_infobox
++
++		jmp disk_change_50
++disk_change_70:
++		mov si,clrln_msg
++		call cwritestr
++		mov si,boot_ndisk_msg
++		call cwritestr
++;		mov eax,[es:bx+27h]
++;		call writehex8
++		call wait_for_key
++		mov si,clrln_msg
++		call cwritestr
++
++		jmp disk_change_20
++disk_change_90:
++		ret
++
++
++bsVolumeID	equ bsHugeSectors+7
++
++boot_disk_msg	db 'Please insert boot disk '
++boot_disk_msg0	db '0; then press ENTER to continue.', 0
++boot_ndisk_msg	db 'This is not boot disk '
++boot_ndisk_msg0	db '0. Press ENTER to continue.', 0
++
++DiskSize	dw 0			; unlimited
++CurrentDisk	db 0			; current disk
++
++clrln_msg	db 0dh, '                                                            ', 0dh, 0
++
++
++cache_metadata:
++		cmp word [DiskSize],0
++		jz cache_md_90
++
++		mov eax,[FAT]
++		mov ecx,[bxFATsecs]
++cache_md_20:
++		push eax
++		push cx
++		call getcachesector
++		pop cx
++		pop eax
++		inc eax
++		loop cache_md_20
++
++		mov eax,[RootDir]
++cache_md_40:
++		push eax
++		call getcachesector
++		pop eax
++		call nextsector
++		jnc cache_md_40
++		
++cache_md_90:
++		ret
++
++
++%endif
++
++
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; gfx stuff
++;
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++
++; != 0 -> graphics active
++gfx_ok			db 0
++gfx_cwritestr_old	db 0c3h		; 'ret'
++gfx_cpio_swab		db 0
++gfx_cd_changed		db 0
++
++gfx_mem_start_seg	dw 0
++gfx_mem_end_seg		dw 0
++
++			align 4, db 0
++; the memory area we are working with
++gfx_mem			dd 0		; linear address
++
++gfx_save_area1		dd 0		; 64k
++gfx_save_area1_used	db 0		; != 0 if area1 is in use
++
++; interface to loadable gfx extension (seg:ofs values)
++gfx_bc_jt		dd 0
++
++gfx_bc_init		dd 0
++gfx_bc_done		dd 0
++gfx_bc_input		dd 0
++gfx_bc_menu_init	dd 0
++gfx_bc_infobox_init	dd 0
++gfx_bc_infobox_done	dd 0
++gfx_bc_progress_init	dd 0
++gfx_bc_progress_done	dd 0
++gfx_bc_progress_update	dd 0
++gfx_bc_progress_limit	dd 0
++gfx_bc_password_init	dd 0
++gfx_bc_password_done	dd 0
++
++; menu entry descriptor
++menu_entries		equ 0
++menu_default		equ 2		; seg:ofs
++menu_ent_list		equ 6		; seg:ofs
++menu_ent_size		equ 10
++menu_arg_list		equ 12		; seg:ofs
++menu_arg_size		equ 16
++sizeof_menu_desc	equ 18
++
++menu_desc		zb sizeof_menu_desc
++
++; system config data (52 bytes)
++gfx_sysconfig		equ $
++gfx_bootloader		db 1			;  0: boot loader type (0: lilo, 1: syslinux, 2: grub)
++gfx_sector_shift	db SECTOR_SHIFT		;  1: sector shift
++gfx_media_type		db 0			;  2: media type (0: disk, 1: floppy, 2: cdrom)
++gfx_failsafe		db 0			;  3: turn on failsafe mode (bitmask)
++						;     0: SHIFT pressed
++						;     1: skip gfxboot
++						;     2: skip monitor detection
++gfx_sysconfig_size	db gfx_sysconfig_end-gfx_sysconfig	;  4: size of sysconfig data
++gfx_boot_drive		db 0			;  5: BIOS boot drive
++gfx_callback		dw gfx_cb		;  6: offset to callback handler
++gfx_bootloader_seg	dw 0			;  8: code/data segment used by bootloader; must follow gfx_callback
++gfx_reserved_1		dw 0			; 10
++gfx_user_info_0		dd 0			; 12: data for info box
++gfx_user_info_1		dd 0			; 16: data for info box
++gfx_bios_mem_size	dd 0			; 20: BIOS memory size (in bytes)
++gfx_xmem_0		dw 0			; 24: extended mem area 0 (start:size in MB; 12:4 bits)
++gfx_xmem_1		dw 0			; 26: extended mem area 1
++gfx_xmem_2		dw 0			; 28: extended mem area 2
++gfx_xmem_3		dw 0			; 20: extended mem area 3
++gfx_file		dd 0			; 32: start of gfx file
++gfx_archive_start	dd 0			; 36: start of cpio archive
++gfx_archive_end		dd 0			; 40: end of cpio archive
++gfx_mem0_start		dd 0			; 44: low free memory start
++gfx_mem0_end		dd 0			; 48: low free memory end
++gfx_sysconfig_end	equ $
++
++gfx_slash		db '/', 0
++
++%macro		lin2segofs 3
++		push %1
++		call gfx_l2so
++		pop %3
++		pop %2
++%endmacro
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++; must not change registers!
++;
++gfx_get_sysconfig:
++		push ax
++		mov al,[DriveNumber]
++		mov [gfx_boot_drive],al
++
++%if IS_ISOLINUX
++		mov ah,2
++%else
++		mov ah,0
++%endif
++		cmp al,80h	; floppy ?
++		jae gfx_get_sysconfig_20
++		mov ah,1
++gfx_get_sysconfig_20:
++
++		mov [gfx_media_type],ah
++
++		mov [gfx_bootloader_seg],cs
++
++		pop ax
++		ret
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; Initialize graphics code. Load and display graphics data.
++;
++;  dx:ax	file length
++;  si		start cluster
++;
++;  return:	[gfx_ok] = 0/1
++;
++gfx_init:
++		push es
++
++		test byte [KbdFlags],3
++		jz gfx_init_10
++		mov byte [gfx_failsafe],1
++		call ask_user
++gfx_init_10:
++
++		test byte [gfx_failsafe],2
++		jnz gfx_init_80
++
++		call highmemsize
++
++		; setup extended memory areas
++		pusha
++		mov eax,[HighMemSize]
++		mov [gfx_bios_mem_size],eax
++		mov eax,[VKernelEnd]
++		shr eax,20
++		cmp ax,16
++		jb gfx_init_40			; at least 16MB
++		mov word [gfx_xmem_0], 81h	; 1MB at 8MB
++		mov word [gfx_xmem_1],0a1h	; 1MB at 10MB
++		mov word [gfx_xmem_2],0c1h	; 1MB at 12MB
++		mov word [gfx_xmem_3],0e1h	; 1MB at 14MB
++
++		mov dword [gfx_save_area1],7f0000h	; 8MB-64k
++gfx_init_40:
++		popa
++
++		cld
++
++		movzx ebx,word [gfx_mem_start_seg]
++		shl ebx,4
++		jz gfx_init_80
++
++		movzx ecx,word [gfx_mem_end_seg]
++		shl ecx,4
++		jz gfx_init_80
++
++		cmp ecx,ebx
++		jbe gfx_init_80
++
++		; define our memory area
++		; gfx_mem _must_ be 16-byte aligned
++		mov dword [gfx_mem],ebx
++		mov dword [gfx_mem0_start],ebx
++		mov dword [gfx_mem0_end],ecx
++
++		call gfx_read_file
++		cmp byte [gfx_ok],0
++		jz near gfx_init_90
++
++		call gfx_get_sysconfig
++
++		; align 4
++		mov eax,[gfx_mem0_start]
++		add eax,3
++		and eax,~3
++		mov [gfx_mem0_start],eax
++
++		; setup jump table
++		les bx,[gfx_bc_jt]
++
++		mov ax,[es:bx]
++		mov [gfx_bc_init],ax
++		mov [gfx_bc_init+2],es
++
++		mov ax,[es:bx+2]
++		mov [gfx_bc_done],ax
++		mov [gfx_bc_done+2],es
++
++		mov ax,[es:bx+4]
++		mov [gfx_bc_input],ax
++		mov [gfx_bc_input+2],es
++
++		mov ax,[es:bx+6]
++		mov [gfx_bc_menu_init],ax
++		mov [gfx_bc_menu_init+2],es
++
++		mov ax,[es:bx+8]
++		mov [gfx_bc_infobox_init],ax
++		mov [gfx_bc_infobox_init+2],es
++
++		mov ax,[es:bx+10]
++		mov [gfx_bc_infobox_done],ax
++		mov [gfx_bc_infobox_done+2],es
++
++		mov ax,[es:bx+12]
++		mov [gfx_bc_progress_init],ax
++		mov [gfx_bc_progress_init+2],es
++
++		mov ax,[es:bx+14]
++		mov [gfx_bc_progress_done],ax
++		mov [gfx_bc_progress_done+2],es
++
++		mov ax,[es:bx+16]
++		mov [gfx_bc_progress_update],ax
++		mov [gfx_bc_progress_update+2],es
++
++		mov ax,[es:bx+18]
++		mov [gfx_bc_progress_limit],ax
++		mov [gfx_bc_progress_limit+2],es
++
++		mov ax,[es:bx+20]
++		mov [gfx_bc_password_init],ax
++		mov [gfx_bc_password_init+2],es
++
++		mov ax,[es:bx+22]
++		mov [gfx_bc_password_done],ax
++		mov [gfx_bc_password_done+2],es
++
++		mov esi,cs
++		shl esi,4
++		add esi,gfx_sysconfig
++		call far [gfx_bc_init]
++		jc gfx_init_80
++
++		mov byte [gfx_ok],1
++
++		; turn off 'cwritestr'
++		mov al,[cwritestr]
++		cmp al,0c3h
++		jz gfx_init_90
++		mov [gfx_cwritestr_old],al
++		mov byte [cwritestr],0c3h
++
++		jmp gfx_init_90
++
++gfx_init_80:
++		mov byte [gfx_ok],0
++gfx_init_90:
++		pop es
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; Back to text mode.
++;
++;  return:	[gfx_ok] = 0
++;
++gfx_done:
++		push ax
++		cmp byte [gfx_ok],0
++		jz gfx_done_90
++		call far [gfx_bc_done]
++		mov byte [gfx_ok],0
++
++		; reactivate 'cwritestr'
++		mov al,[gfx_cwritestr_old]
++		cmp al,0c3h
++		jz gfx_done_90
++		mov [cwritestr],al
++gfx_done_90:
++		pop ax
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_input:
++		cmp byte [gfx_ok],0
++		jz gfx_input_90
++		cmp byte [gfx_save_area1_used],0
++		jz gfx_input_10
++		; recover saved menu layout, gfxboot has references into it
++		pushad
++		mov esi,[gfx_save_area1]
++		mov edi,gfx_menu_seg << 4
++		mov ecx,10000h
++		call bcopy
++		popad
++gfx_input_10:
++		call far [gfx_bc_input]
++		jnc gfx_input_50
++		mov ax,1
++gfx_input_50:
++		cmp ax,1
++		jnz gfx_input_90
++		push ax
++		call gfx_done
++		pop ax
++gfx_input_90:
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; es:di		string
++; return:
++;  cx		length
++gfx_strlen:
++		mov cx,-1
++		mov al,0
++		repnz scasb
++		not cx
++		dec cx
++		ret
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_setup_menu:
++		push es
++		cmp byte [gfx_ok],0
++		jz gfx_setup_menu_90
++
++		mov dword [menu_desc+menu_default],gfx_menu_seg << 16
++
++		push ds
++		pop es
++		mov si,default_cmd
++		mov di,trackbuf
++		call mangle_name
++		mov si,trackbuf
++		les di,[menu_desc+menu_default]
++		call unmangle_name
++		inc di
++
++		mov [menu_desc+menu_ent_list],di
++		mov [menu_desc+menu_ent_list+2],es
++		mov [menu_desc+menu_arg_list],di
++		mov [menu_desc+menu_arg_list+2],es
++
++		; first, count entries and find max kernel and append length
++
++		push ds
++		pop es
++
++		mov esi,[HighMemSize]
++		jmp gfx_setup_menu_20
++gfx_setup_menu_10:
++		mov di,VKernelBuf
++		call rllunpack
++
++		; count only non empty entries
++		cmp byte [VKernelBuf],0
++		jz gfx_setup_menu_20
++
++		inc word [menu_desc+menu_entries]
++
++		push esi
++		mov si,VKernelBuf
++		mov di,KernelCName
++		push di
++		call unmangle_name
++		pop di
++		pop esi
++
++		call gfx_strlen
++
++		cmp cx,[menu_desc+menu_ent_size]
++		jbe gfx_setup_menu_15
++		mov [menu_desc+menu_ent_size],cx
++gfx_setup_menu_15:
++		mov ax,[VKernelBuf+vk_appendlen]
++		cmp ax,[menu_desc+menu_arg_size]
++		jbe gfx_setup_menu_20
++		mov [menu_desc+menu_arg_size],ax
++
++gfx_setup_menu_20:
++		cmp esi,[VKernelEnd]
++		ja gfx_setup_menu_10
++
++		inc word [menu_desc+menu_ent_size]
++		mov ax,[menu_desc+menu_ent_size]
++		inc ax
++		add [menu_desc+menu_arg_size],ax
++
++		; ...and again, but this time copy entries
++
++		mov word [menu_desc+menu_entries],0
++
++		mov esi,[HighMemSize]
++		jmp gfx_setup_menu_60
++gfx_setup_menu_30:
++		mov di,VKernelBuf
++		call rllunpack
++
++		; count only non empty entries
++		cmp byte [VKernelBuf],0
++		jz gfx_setup_menu_60
++
++		mov di,[menu_desc+menu_arg_list]
++		add di,[menu_desc+menu_arg_size]
++		jc gfx_setup_menu_60
++
++		inc word [menu_desc+menu_entries]
++
++		push esi
++
++		mov si,VKernelBuf
++		mov di,KernelCName
++		push di
++		call unmangle_name
++		pop si
++		mov cx,[menu_desc+menu_ent_size]
++		les di,[menu_desc+menu_arg_list]
++
++		rep movsb
++
++		mov cx,[VKernelBuf+vk_appendlen]
++		mov si,VKernelBuf+vk_append
++		rep movsb
++		mov byte [es:di],0
++
++		pop esi
++
++		push ds
++		pop es
++
++		mov ax,[menu_desc+menu_arg_size]
++		add [menu_desc+menu_arg_list],ax
++
++gfx_setup_menu_60:
++		cmp esi,[VKernelEnd]
++		ja gfx_setup_menu_30
++
++		mov ax,[menu_desc+menu_ent_size]
++		mov bx,[menu_desc+menu_arg_size]
++		mov [menu_desc+menu_ent_size],bx
++		add ax,[menu_desc+menu_ent_list]
++		mov [menu_desc+menu_arg_list],ax
++
++		mov esi,ds
++		shl esi,4
++		add esi,menu_desc
++
++		call far [gfx_bc_menu_init]
++
++		; save menu structure, gfxboot uses references into it
++		mov edi,[gfx_save_area1]
++		or edi,edi
++		jz gfx_setup_menu_90
++		mov esi,gfx_menu_seg << 4
++		mov ecx,10000h
++		call bcopy
++		mov byte [gfx_save_area1_used],1
++
++gfx_setup_menu_90:
++		pop es
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_infobox:
++		pushad
++		cmp byte [gfx_ok],0
++		jz gfx_infobox_90
++		mov ecx,ds
++		shl ecx,4
++		movzx esi,si
++		movzx edi,di
++		or si,si
++		jz gfx_infobox_20
++		add esi,ecx
++gfx_infobox_20:
++		or di,di
++		jz gfx_infobox_30
++		add edi,ecx
++gfx_infobox_30:
++		call far [gfx_bc_infobox_init]
++		xor edi,edi
++		xor eax,eax
++		call far [gfx_bc_input]
++		call far [gfx_bc_infobox_done]
++gfx_infobox_90:
++		popad
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_progress_init:
++		pushad
++		cmp byte [gfx_ok],0
++		jz gfx_progress_init_90
++		call far [gfx_bc_progress_init]
++gfx_progress_init_90:
++		popad
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_progress_done:
++		pushad
++		cmp byte [gfx_ok],0
++		jz gfx_progress_done_90
++		call far [gfx_bc_progress_done]
++gfx_progress_done_90:
++		popad
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_progress_update:
++		pushad
++		cmp byte [gfx_ok],0
++		jz gfx_progress_update_90
++		movzx eax,cx
++		call far [gfx_bc_progress_update]
++gfx_progress_update_90:
++		popad
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_progress_limit:
++		pushad
++		cmp byte [gfx_ok],0
++		jz gfx_progress_limit_90
++		movzx eax,ax
++		movzx edx,dx
++		call far [gfx_bc_progress_limit]
++gfx_progress_limit_90:
++		popad
++		ret
++
++
++%if 0
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++gfx_password:
++		pushad
++		cmp byte [gfx_ok],0
++		stc
++		jz gfx_password_90
++		call far [gfx_bc_password_init]
++		mov edi,ds
++		shl edi,4
++		add edi,gfx_password_buf
++		mov ecx,32
++		xor eax,eax
++		call far [gfx_bc_input]
++		mov esi,ds
++		shl esi,4
++		add esi,gfx_password_buf
++		call far [gfx_bc_password_done]
++		jnc gfx_password_90
++		mov esi,ds
++		shl esi,4
++		add esi,gfx_msg_wrong_password
++		xor edi,edi
++		mov al,0
++		call far [gfx_bc_infobox_init]
++		xor edi,edi
++		xor eax,eax
++		call far [gfx_bc_input]
++		call far [gfx_bc_infobox_done]
++		stc
++gfx_password_90:
++                popad
++                ret
++%endif
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; Read graphics data and store them at [gfx_mem].
++;
++;  dx:ax	file length
++;  si		start cluster
++;
++;  return:	[gfx_ok] = 0/1
++;
++gfx_read_file:
++		push es
++		mov byte [gfx_ok],0
++		mov edi,[gfx_mem]
++		push dx                         ; DX:AX = length of file
++                push ax
++		pop edx
++		mov [gfx_archive_end],edx
++		mov eax,[gfx_mem0_start]
++		lea eax,[eax+edx+0fh]		; add space for alignment
++		cmp eax,[gfx_mem0_end]		; max. length
++		ja near gfx_read_file_90
++		mov [gfx_mem0_start],eax
++
++gfx_read_file_10:
++		mov bx,trackbuf
++		mov cx,[BufSafe]
++		push edi
++		push edx
++		call getfssec
++		pop edx
++		pop edi
++		movzx ecx,word [BufSafeBytes]
++		cmp edx,ecx
++		jae gfx_read_file_20
++		mov ecx,edx
++gfx_read_file_20:
++		push ecx
++		push edi
++		push si				; Save current cluster
++		push es
++		mov si,trackbuf
++		push edi
++		call gfx_l2so
++		pop di
++		pop es
++		rep movsb
++		pop es
++		pop si
++		pop edi
++		pop ecx
++		add edi,ecx
++		sub edx,ecx
++		ja gfx_read_file_10
++
++		call find_file
++		or eax,eax
++		jz gfx_read_file_90
++		push edi
++		push eax
++		add eax,edi
++		call align_it
++		pop eax
++		pop edi
++		sub edi,[gfx_mem]
++		mov ecx,[gfx_archive_start]
++		add edi,ecx
++		mov [gfx_file],edi
++		add [gfx_archive_end],ecx
++		add eax,edi
++		shr eax,4
++		mov [gfx_bc_jt+2],ax
++
++		mov byte [gfx_ok],1
++
++gfx_read_file_90:
++		pop es
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; locate graphics file
++;
++; return:	eax: code offset (0 -> no file found)
++; 		edi: gfx file start
++;
++find_file:
++		mov edi,[gfx_mem]
++		lin2segofs edi,es,bx
++		call magic_ok
++		or eax,eax
++		jnz find_file_90
++
++		; ok, maybe it's a cpio archive
++
++		; note: edi must be properly aligned (2)!
++
++find_file_20:
++		mov ecx,[gfx_mem0_start]
++		sub ecx,26 + 12			; min cpio header + gfx header
++		cmp edi,ecx
++		jae find_file_90
++
++		lin2segofs edi,es,bx
++		cmp word [es:bx],71c7h
++		jz find_file_30			; normal cpio record
++		cmp word [es:bx],0c771h		; maybe byte-swapped?
++		jnz find_file_90		; no cpio record
++		mov byte [gfx_cpio_swab],1
++
++find_file_30:
++		mov ax,[es:bx+20]		; file name size
++		call cpio_swab
++		movzx esi,ax
++
++		inc si
++		and si,~1			; align
++
++		mov eax,[es:bx+22]		; data size
++		call cpio_swab
++		rol eax,16			; get word order right
++		call cpio_swab
++		mov ecx,eax
++
++		inc ecx
++		and ecx,byte ~1			; align
++
++		add si,26			; skip header
++
++		add edi,esi
++		add bx,si
++		call magic_ok
++		or eax,eax
++		jnz find_file_90
++
++		add edi,ecx
++		jmp find_file_20
++
++find_file_90:
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; byte-swap cpio data if appropriate
++;
++; ax:		word to swap
++;
++; return:	ax: swapped if [gfx_cpio_swab], otherwise same as input
++;
++cpio_swab:
++		cmp byte [gfx_cpio_swab],0
++		jz cpio_swab_90
++		xchg ah,al
++
++cpio_swab_90:
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++;  es:bx	file start
++;
++;  return:	eax:	offset to code entry
++;
++; Notes:
++;  - changes no regs except eax
++;
++magic_ok:
++		xor eax,eax
++		cmp dword [es:bx],0b2d97f00h	; header.magic_id
++		jnz magic_ok_90
++		cmp byte [es:bx+4],8		; header.version
++		jnz magic_ok_90
++		mov eax,[es:bx+8]
++magic_ok_90:
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++;  eax		address to be aligned
++;
++align_it:
++		push dword [gfx_mem]
++		pop dword [gfx_archive_start]
++		neg al
++		and eax,byte 0fh
++		jz align_it_90
++		add [gfx_archive_start],eax
++		mov esi,[gfx_mem]
++		mov ebx,[gfx_mem0_start]
++		sub ebx,esi
++		sub ebx,byte 0fh
++		add esi,ebx
++		dec esi
++
++		std
++
++align_it_30:
++		or ebx,ebx
++		jz align_it_60
++		mov ecx,ebx
++		cmp ebx,8000h
++		jb align_it_40
++		mov ecx,8000h
++align_it_40:
++		push esi
++		sub ebx,ecx
++		sub [esp],ecx
++		push esi
++		call gfx_l2so
++		pop si
++		add si,8000h
++		sub word [esp],(8000h >> 4)
++		pop es
++		mov di,si
++		add di,ax
++		es rep movsb
++		pop esi
++		jmp align_it_30
++align_it_60:
++
++		cld
++
++align_it_90:
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; Ask user whether to continue.
++;
++; don't change regs
++;
++ask_user:
++		pushad
++
++		mov si,failsafe_msg_0
++		call cwritestr
++
++		mov dx,2
++		mov si,failsafe_msg_1
++		call ask_question
++
++		test byte [gfx_failsafe],2
++		jnz ask_user_90
++
++		mov dx,4
++		mov si,failsafe_msg_2
++		call ask_question
++
++ask_user_90:
++
++		popad
++		ret
++
++
++; si: text
++; dh: 'yes'-mask
++; dl: 'no'-mask
++ask_question:
++		push dx
++		call cwritestr
++		mov si,failsafe_msg_q
++		call cwritestr
++		pop dx
++
++ask_question_20:
++		push dx
++		mov ah,0
++		int 16h
++		pop dx
++
++		cmp al,13
++		jnz ask_question_30
++		mov al,'y'
++ask_question_30:
++		or al,20h		; force lower case
++
++		cmp al,'y'
++		jz ask_question_40
++		cmp al,'n'
++		jnz ask_question_20
++		or byte [gfx_failsafe],dl
++		jmp ask_question_50
++ask_question_40:
++		or byte [gfx_failsafe],dh
++ask_question_50:
++
++		mov si,failsafe_key
++		mov [si],al
++		call cwritestr
++
++		ret
++
++failsafe_msg_q	db ' (y/n)? y', 8, 0
++
++failsafe_msg_0	db 13, 10, 10, 10, 0
++failsafe_msg_1	db 'Load boot graphics', 0
++failsafe_msg_2	db 'Detect display size', 0
++
++failsafe_key	db 0, 13, 10, 0
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++; Convert 32bit linear address to seg:ofs.
++;
++;  dword [esp + 2]:	linear address
++;
++; return:
++;  dword [esp + 2]:	seg:ofs
++;
++; Notes:
++;  - changes no regs
++;
++gfx_l2so:
++		push eax
++		mov eax,[esp + 6]
++		shr eax,4
++		mov [esp + 8],ax
++		and word [esp + 6],byte 0fh
++		pop eax
++		ret
++
++
++; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
++;
++cb_table	dw cb_status
++		dw cb_fopen
++		dw cb_fread
++		dw cb_getcwd
++		dw cb_chdir
++		dw cb_readsector
++cb_len		equ ($-cb_table)/2
++
++f_handle	dw 0
++f_size		dd 0
++fname_buf	times 64 db 0
++fname_buf_len	equ $ - fname_buf
++
++
++gfx_cb:
++		push cs
++		pop ds
++
++		cmp al,cb_len
++		jae gfx_cb_80
++
++		movzx bx,al
++		add bx,bx
++		call word [bx+cb_table]
++		jmp gfx_cb_90
++
++gfx_cb_80:
++		mov al,0ffh
++gfx_cb_90:
++		retf
++
++
++; Return status info.
++;
++; return:
++;  edx		filename buffer (64 bytes)
++;
++cb_status:
++		mov edx,cs
++		shl edx,4
++		add edx,fname_buf
++
++		xor al,al
++		ret
++
++; Open file.
++;
++; return:
++;    al		0: ok, 1: file not found
++;   ecx		file length (al = 0)
++;
++cb_fopen:
++		mov si,fname_buf
++		mov di,VGAFileMBuf	; we just need some space
++		push ds
++		pop es
++		push di
++		call mangle_name
++		pop di
++		call searchdir
++		xchg ax,bx
++		mov al,1
++		jz cb_fopen_90
++		mov [f_handle],si
++		mov cx,dx
++		shl ecx,16
++		mov cx,bx
++		mov [f_size],ecx
++cb_fopen_80:
++		xor al,al
++cb_fopen_90:
++		ret
++
++
++; Read next chunk.
++;
++; return:
++;   edx		buffer address (linear)
++;   ecx		data length (< 64k)
++;
++cb_fread:
++		cmp dword [f_size],0
++		jz cb_fread_80
++		push cs
++		pop es
++		mov bx,trackbuf
++		mov cx,[BufSafe]
++		mov si,[f_handle]
++		call getfssec
++		mov [f_handle],si
++		mov ecx,[f_size]
++		movzx edx,word [BufSafeBytes]
++		cmp ecx,edx
++		jbe cb_fread_50
++		mov ecx,edx
++cb_fread_50:
++		sub [f_size],ecx
++		mov edx,cs
++		shl edx,4
++		add edx,trackbuf
++
++cb_fread_80:
++		xor al,al
++cb_fread_90:
++		ret
++
++
++; Return current working directory.
++;
++; return:
++;  edx		filename
++;
++cb_getcwd:
++		mov edx,cs
++		shl edx,4
++%if IS_ISOLINUX
++		add edx,isolinux_dir
++%else
++		add edx,gfx_slash
++%endif
++		xor al,al
++		ret
++
++
++; Set current working directory.
++;
++cb_chdir:
++%if IS_ISOLINUX
++
++		push cs
++		pop es
++		mov si,fname_buf
++		mov di,isolinux_dir
++cb_chdir_20:
++		lodsb
++		stosb
++		or al,al
++		jz cb_chdir_60
++		cmp di,config_name - 1
++		jb cb_chdir_20
++		xor al,al
++		stosb
++cb_chdir_60:
++		call get_fs_structures
++
++%endif
++		xor al,al
++		ret
++
++
++; read sector
++;
++;  edx		sector
++;
++; return:
++;  edx		buffer (linear address)
++;
++;  Note: does not return on error!
++;
++cb_readsector:
++		mov eax,edx
++		push ds
++		pop es
++		mov bx,trackbuf
++		call getonesec
++		mov edx,ds
++		shl edx,4
++		add edx,trackbuf
++		xor al,al
++		ret
++
+diff -urNad syslinux-3.63+dfsg~/isolinux.asm syslinux-3.63+dfsg/isolinux.asm
+--- syslinux-3.63+dfsg~/isolinux.asm	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/isolinux.asm	2008-06-13 15:08:24.000000000 +0100
+@@ -19,6 +19,10 @@
+ ; ****************************************************************************
+ 
+ %define IS_ISOLINUX 1
++
++%define WITH_GFX 1
++; %define DEBUG_DISKIO
++
+ %include "head.inc"
+ 
+ ;
+@@ -70,6 +74,8 @@
+ real_mode_seg	equ 2000h
+ xfer_buf_seg	equ 1000h		; Bounce buffer for I/O to high mem
+ comboot_seg	equ real_mode_seg	; COMBOOT image loading zone
++gfx_menu_seg	equ 3000h		; temporary storage to setup menu
++first_free_seg	equ 4000h		; end of isolinux used memory
+ 
+ ;
+ ; File structure.  This holds the information for each currently open file.
+@@ -259,6 +265,21 @@
+ 		mov [FirstSecSum],edi
+ 
+ 		mov [DriveNumber],dl
++
++		; check whether the BIOS did load us correctly
++		cmp dl,80h			; some BIOSes try to do floppy emulation...
++		jb bios_err
++		cmp dword [FirstSecSum], byte 0
++		jz bios_ok
++bios_err:
++		mov si,broken_bios_msg
++		call writemsg
++		jmp short $
++broken_bios_msg	db 13, 10, 'Cannot boot from this CD. Please try a BIOS update.', 13, 10, 0
++		align 4
++csum_value	dd 0
++bios_ok:
++
+ %ifdef DEBUG_MESSAGES
+ 		mov si,startup_msg
+ 		call writemsg
+@@ -283,6 +304,9 @@
+ 		; Other nonzero fields
+ 		inc word [dsp_sectors]
+ 
++%if 0
++		; Some BIOSes don't like that call.
++
+ 		; Now figure out what we're actually doing
+ 		; Note: use passed-in DL value rather than 7Fh because
+ 		; at least some BIOSes will get the wrong value otherwise
+@@ -303,6 +327,8 @@
+ 		call crlf
+ %endif
+ 
++%endif
++
+ found_drive:
+ 		; Alright, we have found the drive.  Now, try to find the
+ 		; boot file itself.  If we have a boot info table, life is
+@@ -427,6 +453,9 @@
+ %endif
+ 		jmp all_read			; Jump to main code
+ 
++%if 0
++		; doesn't work anyway, see above
++
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; Start of BrokenAwardHack --- 10-nov-2002           Knut_Petersen@t-online.de
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+@@ -618,6 +647,7 @@
+ 		mov si,trysbm_msg
+ 		call writemsg
+ 		jmp .found_drive		; Pray that this works...
++%endif
+ 
+ fatal_error:
+ 		mov si,nothing_msg
+@@ -694,10 +724,17 @@
+ ;
+ getlinsec:
+ 		mov si,dapa			; Load up the DAPA
+-		mov [si+4],bx
+-		mov bx,es
+-		mov [si+6],bx
+ 		mov [si+8],eax
++		; seems that some BIOSes have problems if the target
++		; segment is 0 (don't ask); to avoid this, we normalize
++		; the buffer address here
++		; -> seen on Acer TravelMate C102Ti
++		mov [si+4],bx
++		and word [si+4],0fh
++		mov ax,es
++		shr bx,4
++		add ax,bx
++		mov [si+6],ax
+ .loop:
+ 		push bp				; Sectors left
+ 		cmp bp,[MaxTransfer]
+@@ -724,15 +761,78 @@
+ 		; INT 13h with retry
+ xint13:		mov byte [RetryCount],retry_count
+ .try:		pushad
++%ifdef DEBUG_DISKIO
++		pushad
++		mov cx,16
++.zap:
++		lodsb
++		call writehex2
++		mov al,' '
++		call writechr
++		loop .zap
++		mov ah,0
++		int 16h
++		popad
++%endif
++		; seen buggy bios that overwrites buffer address on error...
++		push dword [dapa + 4]
+ 		call int13
++		pop dword [dapa + 4]
++%ifdef DEBUG_DISKIO   
++		pushad
++		pushf
++		push ax
++		mov al,':'
++		call writechr
++		mov al,' '
++		call writechr
++		pop ax
++		sbb al,al
++		call writehex4
++		call crlf
++		mov ah,0
++		int 16h
++		popf
++		popad
++%endif
+ 		jc .error
++.noerror:
+ 		add sp,byte 8*4			; Clean up stack
+ 		ret
+ .error:
++		or ah,ah
++		jz .noerror
+ 		mov [DiskError],ah		; Save error code
+ 		popad
+ 		mov [DiskSys],ax		; Save system call number
+-		dec byte [RetryCount]
++
++%if 0
++		; eject currently not supported - doesn't work anyway with
++		; most BIOSes
++
++		test byte [gfx_user_note],1
++		jz .noeject
++		cmp byte [RetryCount],4
++		ja .noeject
++		cmp byte [DiskError],0aah	; drive not ready
++		jnz .noeject
++		; might have been cdrom eject, wait a bit
++		cmp byte [gfx_ok],0
++		jz .noeject
++		push si
++		push di
++		push ax
++		mov si,err_not_ready
++		xor di,di
++		mov al,0
++		call gfx_infobox
++		pop ax
++		pop di
++		pop si
++%endif
++.noeject:
++
++ 		dec byte [RetryCount]
+ 		jz .real_error
+ 		push ax
+ 		mov al,[RetryCount]
+@@ -774,6 +874,17 @@
+ ;
+ kaboom:
+ 		RESET_STACK_AND_SEGS AX
++
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		mov si,err_failed_gfx
++		xor di,di
++		mov al,1
++		call gfx_infobox
++		call gfx_done
++		call do_reboot
++.nogfx:
++
+ 		mov si,err_bootfailed
+ 		call cwritestr
+ 		call getchar
+@@ -825,6 +936,9 @@
+ crlf_msg	db CR, LF
+ null_msg	db 0
+ 
++err_failed_gfx	db 'Error reading boot CD.', 0
++err_not_ready	db 'CDROM drive not ready.', 0
++
+ 		alignb 4, db 0
+ MaxTransfer	dw 32				; Max sectors per transfer
+ 
+@@ -882,6 +996,9 @@
+ ; (which will be at 16 only for a single-session disk!); from the PVD
+ ; we should be able to find the rest of what we need to know.
+ ;
++		call get_fs_structures
++		jmp get_fs_struct_done
++
+ get_fs_structures:
+ 		mov eax,[bi_pvd]
+ 		mov bx,trackbuf
+@@ -907,10 +1024,15 @@
+ 		; Look for an isolinux directory, and if found,
+ 		; make it the current directory instead of the root
+ 		; directory.
++
++		cmp byte [gfx_ok],0		; don't look at both
++		jnz .gfx
++
+ 		mov di,boot_dir			; Search for /boot/isolinux
+ 		mov al,02h
+ 		call searchdir_iso
+ 		jnz .found_dir
++.gfx:
+ 		mov di,isolinux_dir
+ 		mov al,02h			; Search for /isolinux
+ 		call searchdir_iso
+@@ -931,6 +1053,9 @@
+ 		call crlf
+ %endif
+ .no_isolinux_dir:
++		ret
++
++get_fs_struct_done:
+ 
+ ;
+ ; Locate the configuration file
+@@ -1096,6 +1221,9 @@
+ ; 0xFFFF in case we should execute INT 18h ("next device.")
+ ;
+ local_boot:
++%ifdef WITH_GFX
++		call gfx_done
++%endif
+ 		call vgaclearmode
+ 		lss sp,[cs:Stack]		; Restore stack pointer
+ 		xor dx,dx
+@@ -1113,7 +1241,7 @@
+ 		xor dh,dh
+ 		push dx
+ 		xor ax,ax			; Reset drive
+-		call xint13
++		int 13h				; we don't care about errors here...
+ 		mov ax,0201h			; Read one sector
+ 		mov cx,0001h			; C/H/S = 0/0/1 (first sector)
+ 		mov bx,trackbuf
+@@ -1488,6 +1616,9 @@
+ %include "rawcon.inc"		; Console I/O w/o using the console functions
+ %include "adv.inc"		; Auxillary Data Vector
+ 
++%include "gfxboot.inc"		; add gfx things
++
++
+ ; -----------------------------------------------------------------------------
+ ;  Begin data section
+ ; -----------------------------------------------------------------------------
+@@ -1499,6 +1630,7 @@
+ default_len	equ ($-default_str)
+ boot_dir	db '/boot'			; /boot/isolinux
+ isolinux_dir	db '/isolinux', 0
++zb 64
+ config_name	db 'isolinux.cfg', 0
+ err_disk_image	db 'Cannot load disk image (invalid file)?', CR, LF, 0
+ 
+diff -urNad syslinux-3.63+dfsg~/keywords syslinux-3.63+dfsg/keywords
+--- syslinux-3.63+dfsg~/keywords	2008-06-13 15:07:39.000000000 +0100
++++ syslinux-3.63+dfsg/keywords	2008-06-13 15:08:24.000000000 +0100
+@@ -43,3 +43,5 @@
+ f10
+ f11
+ f12
++gfxboot
++disksize
+diff -urNad syslinux-3.63+dfsg~/keywords.inc syslinux-3.63+dfsg/keywords.inc
+--- syslinux-3.63+dfsg~/keywords.inc	2008-06-13 15:07:39.000000000 +0100
++++ syslinux-3.63+dfsg/keywords.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -91,8 +91,15 @@
+ %if IS_PXELINUX
+ 		keyword ipappend,	pc_ipappend
+ %endif
+-%if IS_PXELINUX || IS_ISOLINUX
++%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
+ 		keyword localboot,	pc_localboot
+ %endif
+ 
++%ifdef WITH_GFX
++		keyword gfxboot,   pc_filecmd,  get_gfx_file
++%if IS_SYSLINUX
++		keyword disksize,  pc_disksize, DiskSize
++%endif
++%endif
++
+ keywd_count	equ ($-keywd_table)/keywd_size
+diff -urNad syslinux-3.63+dfsg~/layout.inc syslinux-3.63+dfsg/layout.inc
+--- syslinux-3.63+dfsg~/layout.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/layout.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -88,7 +88,11 @@
+ 		section .uibss		nobits align=16 follows=.adv
+ 
+ 		; Normal bss...
++%if IS_ISOLINUX
++		section .bss1		nobits align=16 follows=.bss2
++%else
+ 		section .bss1		nobits align=16 follows=.uibss
++%endif
+ 
+ 		; Reserve space for stack
+ 		section .stack		nobits align=16 start=STACK_START
+diff -urNad syslinux-3.63+dfsg~/ldlinux.asm syslinux-3.63+dfsg/ldlinux.asm
+--- syslinux-3.63+dfsg~/ldlinux.asm	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/ldlinux.asm	2008-06-13 15:08:24.000000000 +0100
+@@ -24,6 +24,9 @@
+ %ifndef IS_MDSLINUX
+ %define IS_SYSLINUX 1
+ %endif
++
++%define WITH_GFX 1
++
+ %include "head.inc"
+ 
+ ;
+@@ -82,6 +85,8 @@
+ cache_seg	equ 2000h		; 64K area for metadata cache
+ xfer_buf_seg	equ 1000h		; Bounce buffer for I/O to high mem
+ comboot_seg	equ real_mode_seg	; COMBOOT image loading zone
++gfx_menu_seg	equ 4000h		; temporary storage to setup menu
++first_free_seg	equ 5000h		; end of syslinux used memory
+ 
+ ;
+ ; File structure.  This holds the information for each currently open file.
+@@ -357,6 +362,8 @@
+ 		add eax,[bsHidden]		; Add partition offset
+ 		xor edx,edx			; Zero-extend LBA (eventually allow 64 bits)
+ 
++.patch:		jmp strict near .jmp
++
+ .jmp:		jmp strict short getlinsec_cbios
+ 
+ ;
+@@ -906,6 +913,48 @@
+ ;
+ %include "ui.inc"
+ 
++; Boot a specified local disk.  AX specifies the BIOS disk number; or
++; 0xFFFF in case we should execute INT 18h ("next device.")
++;
++local_boot:
++%ifdef WITH_GFX
++               call gfx_done
++%endif
++               call vgaclearmode
++               lss sp,[cs:Stack]               ; Restore stack pointer
++               xor dx,dx
++               mov ds,dx
++               mov es,dx
++               mov fs,dx
++               mov gs,dx
++               mov si,localboot_msg
++               call cwritestr
++               cmp ax,-1
++               je .int18
++
++               ; Load boot sector from the specified BIOS device and jump to it.
++               mov dl,al
++               xor dh,dh
++               push dx
++               xor ax,ax                       ; Reset drive
++               int 13h
++               mov ax,0201h                    ; Read one sector
++               mov cx,0001h                    ; C/H/S = 0/0/1 (first sector)
++               mov bx,trackbuf
++               int 13h
++               pop dx
++               cli                             ; Abandon hope, ye who enter here
++               mov si,trackbuf
++               mov di,07C00h
++               mov cx,512                      ; Probably overkill, but should be safe
++               rep movsd
++               mov ss,cx
++               mov sp,7c00h
++               jmp 0:07C00h                    ; Jump to new boot sector
++.int18:
++               int 18h                         ; Hope this does the right thing...
++               jmp kaboom                      ; If we returned, oh boy...
++
+ ;
+ ; allocate_file: Allocate a file structure
+ ;
+@@ -1126,6 +1175,15 @@
+ ;	   starting with "kaboom.patch" with this part
+ 
+ kaboom2:
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		mov si,err_failed_gfx
++		xor di,di
++		mov al,1
++		call gfx_infobox
++		call gfx_done
++		call do_reboot
++.nogfx:
+ 		mov si,err_bootfailed
+ 		call cwritestr
+ 		cmp byte [kaboom.again+1],18h	; INT 18h version?
+@@ -1530,6 +1588,8 @@
+ %include "cache.inc"		; Metadata disk cache
+ %include "adv.inc"		; Auxillary Data Vector
+ 
++%include "gfxboot.inc"		; add gfx things
++
+ ; -----------------------------------------------------------------------------
+ ;  Begin data section
+ ; -----------------------------------------------------------------------------
+@@ -1539,6 +1599,8 @@
+ 		db CR, LF, 0
+ err_bootfailed	db CR, LF, 'Boot failed: please change disks and press '
+ 		db 'a key to continue.', CR, LF, 0
++err_failed_gfx	db 'Error reading from disk.', 0
++localboot_msg	db 'Booting from local disk...', CR, LF, 0
+ syslinux_cfg1	db '/boot'			; /boot/syslinux/syslinux.cfg
+ syslinux_cfg2	db '/syslinux'			; /syslinux/syslinux.cfg
+ syslinux_cfg3	db '/'				; /syslinux.cfg
+diff -urNad syslinux-3.63+dfsg~/loadhigh.inc syslinux-3.63+dfsg/loadhigh.inc
+--- syslinux-3.63+dfsg~/loadhigh.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/loadhigh.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -47,7 +47,12 @@
+ .read_loop:
+ 		and si,si			; If SI == 0 then we have end of file
+ 		jz .eof
++%ifdef WITH_GFX
++		cmp byte [gfx_ok],0
++		jnz .no_message
++%endif
+ 		call bx
++.no_message:
+ 		push bx				; <AA> Pausebird function
+ 
+ 		push eax			; <A> Total bytes to transfer
+@@ -63,7 +68,15 @@
+ 		push edi			; <C> Target buffer
+ 		mov cx,ax
+ 		xor bx,bx			; ES:0
++
++%ifdef WITH_GFX
++		call gfx_progress_update
++%endif
++
++		push dx
+ 		call getfssec			; Load the data into xfer_buf_seg
++						; getfssec destroys dx!
++		pop dx
+ 		pop edi				; <C> Target buffer
+ 		pop ecx				; <B> Byte count this round
+ 		push ecx			; <B> Byte count this round
+diff -urNad syslinux-3.63+dfsg~/parsecmd.inc syslinux-3.63+dfsg/parsecmd.inc
+--- syslinux-3.63+dfsg~/parsecmd.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/parsecmd.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -107,6 +107,14 @@
+ FKeyName	resb MAX_FKEYS*FILENAME_MAX	; File names for F-key help
+ KernelCNameLen	resw 1			; Length of unmangled kernel name
+ InitRDCNameLen	resw 1			; Length of unmangled initrd name
++
++%if IS_ISOLINUX
++%ifdef DEBUG_MESSAGES
++; we need to rearrange memory a bit to make isolinux-debug.bin fit
++		section .bss
++%endif
++%endif
++
+ %if IS_SYSLINUX
+ KernelName      resb FILENAME_MAX+1	; Mangled name for kernel
+ KernelCName     resb FILENAME_MAX+2	; Unmangled kernel name
+diff -urNad syslinux-3.63+dfsg~/parseconfig.inc syslinux-3.63+dfsg/parseconfig.inc
+--- syslinux-3.63+dfsg~/parseconfig.inc	2008-06-13 15:07:39.000000000 +0100
++++ syslinux-3.63+dfsg/parseconfig.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -94,7 +94,7 @@
+ ;
+ ; "localboot" command (PXELINUX, ISOLINUX)
+ ;
+-%if IS_PXELINUX || IS_ISOLINUX
++%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
+ pc_localboot:	call getint
+ 		cmp byte [VKernel],0		; ("label" section only)
+ 		je .err
+@@ -299,6 +299,25 @@
+ 		mov [SerialPort], word 0
+ 		ret
+ 
++%ifdef WITH_GFX
++%if IS_SYSLINUX
++;
++; like pc_setint16, but patch sector read funtion, too
++;
++pc_disksize:
++		push ax
++		call getint
++		pop si
++		jc .err
++		mov [si],bx
++		mov word [getlinsec.patch+1], getlinsec3 - getlinsec.patch - 3
++		or bx,bx
++		jz .err
++		call cache_metadata
++.err:		ret
++%endif
++%endif
++
+ ;
+ ; "F"-key command
+ ;
+diff -urNad syslinux-3.63+dfsg~/pxelinux.asm syslinux-3.63+dfsg/pxelinux.asm
+--- syslinux-3.63+dfsg~/pxelinux.asm	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/pxelinux.asm	2008-06-13 15:08:24.000000000 +0100
+@@ -846,6 +846,9 @@
+ ; AX contains the appropriate return code.
+ ;
+ local_boot:
++%ifdef WITH_GFX
++		call gfx_done
++%endif
+ 		push cs
+ 		pop ds
+ 		mov [LocalBootType],ax
+diff -urNad syslinux-3.63+dfsg~/runkernel.inc syslinux-3.63+dfsg/runkernel.inc
+--- syslinux-3.63+dfsg~/runkernel.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/runkernel.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -206,6 +206,15 @@
+                 pop ds
+ 		sub si,cmd_line_here
+ 		mov [CmdLineLen],si		; Length including final null
++
++%ifdef WITH_GFX
++		mov eax,[KernelSects]
++		mov esi,ds
++		shl esi,4
++		add esi,KernelCName
++		call gfx_progress_init
++%endif
++
+ ;
+ ; Now check if we have a large kernel, which needs to be loaded high
+ ;
+@@ -312,6 +321,19 @@
+                 jz nk_noinitrd
+ 		call parse_load_initrd
+ nk_noinitrd:
++
++%ifdef WITH_GFX
++		call gfx_progress_done
++
++		cmp byte [gfx_cd_changed],0
++		jz .no_cd_change
++		mov al,6
++		xor si,si
++		xor di,di
++		call gfx_infobox
++.no_cd_change:
++%endif 
++
+ ;
+ ; Abandon hope, ye that enter here!  We do no longer permit aborts.
+ ;
+@@ -320,6 +342,10 @@
+ 		mov si,ready_msg
+ 		call cwritestr
+ 
++%ifdef WITH_GFX
++		call gfx_done
++%endif
++
+ 		call vgaclearmode		; We can't trust ourselves after this
+ 
+ 		UNLOAD_PREP			; Module-specific hook
+@@ -552,6 +578,34 @@
+ 
+ .got_start:
+ 		push si
++
++%ifdef WITH_GFX
++		cmp byte [si],'+'
++		jnz .got_start_10
++		mov byte [cs:gfx_cd_changed],1
++		inc si
++		push es
++		push ds
++		push si
++		push cs
++		pop es
++		mov cx,100h
++		mov di,trackbuf
++		push di
++		rep movsb
++		mov byte [es:di],0
++		pop si
++		xor di,di
++		mov al,5		; ask for cd change
++		push cs
++		pop ds
++		call gfx_infobox
++		pop si
++		pop ds
++		pop es
++.got_start_10:
++%endif
++
+ 		mov di,InitRD		; Target buffer for mangled name
+ 		call mangle_name
+ 		call loadinitrd
+@@ -645,6 +699,20 @@
+ 		ret
+ 
+ .notthere:
++
++%ifdef WITH_GFX
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		mov si,InitRDCName
++		xor di,di
++		mov al,2
++		call gfx_infobox
++		call gfx_progress_done
++		mov si,no_msg
++		jmp abort_load
++.nogfx:
++%endif
++
+                 mov si,err_noinitrd
+                 call cwritestr
+                 mov si,InitRDCName
+@@ -653,7 +721,21 @@
+                 jmp abort_load
+ 
+ no_high_mem:					; Error routine
++
++%ifdef WITH_GFX
++		cmp byte [gfx_ok],0
++		jz .nogfx
+ 		mov si,err_nohighmem
++		xor di,di
++		mov al,0 
++		call gfx_infobox
++		call gfx_progress_done
++		mov si,no_msg
++		jmp abort_load
++.nogfx:
++%endif
++
++ 		mov si,err_nohighmem
+                 jmp abort_load
+ 
+                 ret
+@@ -666,7 +748,8 @@
+ ready_msg	db 'ready.', CR, LF, 0
+ err_oldkernel   db 'Cannot load a ramdisk with an old kernel image.'
+                 db CR, LF, 0
+-err_noinitrd    db CR, LF, 'Could not find ramdisk image: ', 0
++err_noinitrd    db CR, LF
++err_noinitrda	db 'Could not find ramdisk image: ', 0
+ err_nohighmem   db 'Not enough memory to load specified kernel.', CR, LF, 0
+ 
+ boot_image      db 'BOOT_IMAGE='
+diff -urNad syslinux-3.63+dfsg~/ui.inc syslinux-3.63+dfsg/ui.inc
+--- syslinux-3.63+dfsg~/ui.inc	2008-04-10 18:30:35.000000000 +0100
++++ syslinux-3.63+dfsg/ui.inc	2008-06-13 15:08:24.000000000 +0100
+@@ -44,6 +44,11 @@
+ 
+ .no_bootonce:
+ 
++%ifdef WITH_GFX
++		; build gfx menu
++		call gfx_setup_menu
++%endif
++
+ ;
+ ; Check whether or not we are supposed to display the boot prompt.
+ ;
+@@ -57,6 +62,21 @@
+ 		cmp word [NoEscape],0		; If NOESCAPE, no prompt,
+ 		jne auto_boot			; always run default cmd
+ 
++%ifdef WITH_GFX
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		mov edi,ds
++		shl edi,4
++		add edi,command_line
++		mov ecx,max_cmd_len
++		xor eax,eax
++		xchg eax,[KbdTimeout]		; only the first time
++		call gfx_input
++		cmp ax,1
++		jnz load_kernel
++.nogfx:
++%endif
++
+ 		mov si,boot_prompt
+ 		call cwritestr
+ 
+@@ -323,9 +343,21 @@
+ 		push word real_mode_seg
+ 		pop es
+ 		mov di,cmd_line_here
++
++%ifdef WITH_GFX
++		; gfx code includes them
++		cmp byte [gfx_ok],0
++		jnz .isgfx
++%endif
++
+ 		mov si,VKernelBuf+vk_append
+ 		mov cx,[VKernelBuf+vk_appendlen]
+ 		rep movsb
++
++%ifdef WITH_GFX
++.isgfx:
++%endif
++
+ 		mov [CmdLinePtr],di		; Where to add rest of cmd
+ 		pop es
+ 		mov di,KernelName
+@@ -343,7 +375,7 @@
+ 		mov al, [VKernelBuf+vk_type]
+ 		mov [KernelType], al
+ 
+-%if IS_PXELINUX || IS_ISOLINUX
++%if IS_PXELINUX || IS_ISOLINUX || IS_SYSLINUX
+ 		; Is this a "localboot" pseudo-kernel?
+ %if IS_PXELINUX
+ 		cmp byte [VKernelBuf+vk_rname+4], 0
+@@ -421,6 +453,19 @@
+ 		push di
+                 call unmangle_name              ; Get human form
+ 		mov si,err_notfound		; Complain about missing kernel
++
++%ifdef WITH_GFX
++		cmp byte [gfx_ok],0
++		jz .nogfx
++		pop si
++		xor di,di
++		mov al,2
++		call gfx_infobox
++		mov si,no_msg
++		jmp abort_load
++.nogfx:
++%endif
++
+ 		call cwritestr
+ 		pop si				; KernelCName
+                 call cwritestr
--- syslinux-3.63+dfsg.orig/debian/patches/13-ubuntu_com32_gfxboot.dpatch
+++ syslinux-3.63+dfsg/debian/patches/13-ubuntu_com32_gfxboot.dpatch
@@ -0,0 +1,56 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 13-ubuntu_com32_gfxboot.dpatch by Colin Watson <cjwatson@ubuntu.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Turn progress operations into no-ops unless gfx_progress_init has
+## DP: been called. Fixes a crash when both com32 and gfxboot are used,
+## DP: since loading a com32 object calls load_high which calls
+## DP: gfx_progress_update.
+
+@DPATCH@
+diff -urNad syslinux-3.63+dfsg~/gfxboot.inc syslinux-3.63+dfsg/gfxboot.inc
+--- syslinux-3.63+dfsg~/gfxboot.inc	2008-06-19 02:16:18.000000000 +0100
++++ syslinux-3.63+dfsg/gfxboot.inc	2008-06-19 02:20:01.000000000 +0100
+@@ -296,6 +296,7 @@
+ 
+ gfx_save_area1		dd 0		; 64k
+ gfx_save_area1_used	db 0		; != 0 if area1 is in use
++gfx_progress_inited	db 0		; != 0 if gfx_progress_init called
+ 
+ ; interface to loadable gfx extension (seg:ofs values)
+ gfx_bc_jt		dd 0
+@@ -786,6 +787,7 @@
+ 		cmp byte [gfx_ok],0
+ 		jz gfx_progress_init_90
+ 		call far [gfx_bc_progress_init]
++		mov byte [gfx_progress_inited],1
+ gfx_progress_init_90:
+ 		popad
+ 		ret
+@@ -797,6 +799,8 @@
+ 		pushad
+ 		cmp byte [gfx_ok],0
+ 		jz gfx_progress_done_90
++		cmp byte [gfx_progress_inited],0
++		jz gfx_progress_done_90
+ 		call far [gfx_bc_progress_done]
+ gfx_progress_done_90:
+ 		popad
+@@ -809,6 +813,8 @@
+ 		pushad
+ 		cmp byte [gfx_ok],0
+ 		jz gfx_progress_update_90
++		cmp byte [gfx_progress_inited],0
++		jz gfx_progress_update_90
+ 		movzx eax,cx
+ 		call far [gfx_bc_progress_update]
+ gfx_progress_update_90:
+@@ -822,6 +828,8 @@
+ 		pushad
+ 		cmp byte [gfx_ok],0
+ 		jz gfx_progress_limit_90
++		cmp byte [gfx_progress_inited],0
++		jz gfx_progress_limit_90
+ 		movzx eax,ax
+ 		movzx edx,dx
+ 		call far [gfx_bc_progress_limit]
