platform/upstream/syslinux.git
12 years agoMerge branch 'master' into elflink
Matt Fleming [Thu, 19 Jul 2012 15:03:19 +0000 (16:03 +0100)]
Merge branch 'master' into elflink

The reason for this merge is that we need the fix to core/fs/cache.c
without which we can potentially dereference an invalid pointer.

The below conflict is a result of the new setup_data blob code being
merged from the master branch.

Conflicts:
com32/lib/Makefile

12 years agoldlinux: Return immediately after we execute() a command
Matt Fleming [Fri, 6 Jul 2012 14:36:56 +0000 (15:36 +0100)]
ldlinux: Return immediately after we execute() a command

If we successfully lookup the filetype of a command we need to return
once we've called execute(), otherwise we'll also end up calling
new_linux_kernel().

Reported-by: Sebastian Herbszt <herbszt@gmx.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoCorrect initialization of the cache doubly-linked list syslinux-4.06-pre11
H. Peter Anvin [Thu, 19 Jul 2012 14:29:55 +0000 (07:29 -0700)]
Correct initialization of the cache doubly-linked list

The initialization of the cache doubly-linked list had
head->next->prev instead of head->prev->next; this entry is supposed
to initialize the ->next entry of the last entry in the list (which
points back to the head node.)

For clarity, consistently use "head" to refer to the head node; the
mixing of "head" and "dev->cache_head" needlessly obfuscated the code.

The wild pointer reference caused crashes on some systems.

Reported-by: Jan Safrata <jsafrata@centrum.cz>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agocore: Makefile: Do not enable debug by default
Paulo Alcantara [Thu, 5 Jul 2012 06:54:19 +0000 (03:54 -0300)]
core: Makefile: Do not enable debug by default

The commit 72842b6 has set "DDEBUG=1" as it shouldn't, so the whole core
was being compiled always with debug enabled.

This patch removes the "DDEBUG=1" from CFLAGS in Makefile, since Syslinux
is never compiled with debug enabled by default.

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agovdprintf: Remove unused variable
Paulo Alcantara [Thu, 5 Jul 2012 06:39:58 +0000 (03:39 -0300)]
vdprintf: Remove unused variable

This patch removes an unused variable and fixes the following warning:

vdprintf.c: In function ‘vdprintf’:
vdprintf.c:48:13: warning: variable ‘_rv’ set but not used
   [-Wunused-but-set-variable]

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agoelf_module: Remove unused variable
Paulo Alcantara [Thu, 5 Jul 2012 06:36:04 +0000 (03:36 -0300)]
elf_module: Remove unused variable

This patch removes an unused variable and fixes the following warning:

sys/module/elf_module.c: In function ‘module_load’:
sys/module/elf_module.c:512:16: warning: variable ‘j’ set but not used
[-Wunused-but-set-variable]

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agoFix Makefile install targets
Matt Fleming [Wed, 4 Jul 2012 10:09:54 +0000 (11:09 +0100)]
Fix Makefile install targets

Some Makefiles were still referring to libutil_com.a, even though we
stopped producing that file with commit 74518b8b691c ("elflink: Make
ELF the default object format"). Delete all references to avoid the
following install error,

install: cannot stat `libutil_com.a': No such file or directory

Remove the install target from com32/elflink as we no longer build any
of the test modules, and so don't need to install them.

Also, we need to add ldlinux.c32 to the list of modules that *must* be
installed for all targets, since it is required for Syslinux to
function correctly.

Reported-by: Dag Wieers <dag@wieers.com>
Reported-by: Michael D. Setzer II <mikes@kuentos.guam.net>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agomenu: Supply the command type to execute()
Matt Fleming [Tue, 3 Jul 2012 08:34:03 +0000 (09:34 +0100)]
menu: Supply the command type to execute()

The old execute() was much more forgiving when passing a COM32 module
as KT_NONE, as the old code for loading a kernel could also handle
COM32 modules. This isn't the case with new_linux_kernel(), and COM32
modules really need to take the create_args_and_load() path in
execute().

Without this change loading .c32 files from vesamenu.c32/menu.c32
fails.

Reported-by: Helmut Hullen <Hullen@t-online.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agodprintf: Always include the dprintf implementation in libcom32core.a
Matt Fleming [Mon, 2 Jul 2012 13:02:35 +0000 (14:02 +0100)]
dprintf: Always include the dprintf implementation in libcom32core.a

Whether or not we compile the com32/ code with DEBUG=1 we need to
provide the dprintf() implementation. This was highlighted by commit
72842b681e7b ("SEG(): make SEG() puke on bad pointers if DEBUG is
defined")

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agolinux.c32: add missing break; syslinux-4.06-pre10
H. Peter Anvin [Fri, 29 Jun 2012 23:23:36 +0000 (16:23 -0700)]
linux.c32: add missing break;

Add missing break; for ENOMEM.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agolinux.c32: allow loading arbitrary setup_data blobs
H. Peter Anvin [Fri, 29 Jun 2012 23:21:13 +0000 (16:21 -0700)]
linux.c32: allow loading arbitrary setup_data blobs

Allow loading arbitrary setup_data blobs via the syntax
blob.NN=filename where NN is a decimal number.

This also allows loading multiple device tree blobs.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agosetup_data: if nothing to load and version < 2.09, no harm no foul
H. Peter Anvin [Fri, 29 Jun 2012 22:46:27 +0000 (15:46 -0700)]
setup_data: if nothing to load and version < 2.09, no harm no foul

If the setup_data is empty, it is okay if the version is < 2.09.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agosetup_data: check to make sure kernel version >= 0x0209
H. Peter Anvin [Fri, 29 Jun 2012 22:43:20 +0000 (15:43 -0700)]
setup_data: check to make sure kernel version >= 0x0209

Versions before 2.09 had no setup_data support.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agolinux.c32: add support for a device tree blob (dtb)
H. Peter Anvin [Fri, 29 Jun 2012 22:24:02 +0000 (15:24 -0700)]
linux.c32: add support for a device tree blob (dtb)

Based on a patch by Thierry Reding, add support for loading a device
tree blob using the generic setup_data framework.

I used the name dtb= instead of fdt= since it looks like dtb= is the
common acronym for the filenames and what is used in the kernel.

Originally-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years ago<syslinux/linux.h>: add missing setup_data_init() definition
H. Peter Anvin [Fri, 29 Jun 2012 22:23:19 +0000 (15:23 -0700)]
<syslinux/linux.h>: add missing setup_data_init() definition

Missing prototype.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoChange fdt-specific loader into a generic setup_data loader
H. Peter Anvin [Fri, 29 Jun 2012 22:16:03 +0000 (15:16 -0700)]
Change fdt-specific loader into a generic setup_data loader

Make it a generic setup_data loader keyed by type.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
12 years agocom32: Add device tree support
Thierry Reding [Thu, 31 May 2012 15:41:35 +0000 (17:41 +0200)]
com32: Add device tree support

This commit adds support for passing a Flattened Device Tree (FDT) blob
to the Linux kernel.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agofat: Make mangle behavior similar to the standard one
H. Peter Anvin [Fri, 29 Jun 2012 20:57:42 +0000 (13:57 -0700)]
fat: Make mangle behavior similar to the standard one

Handle mangle in FAT the same as in the generic version, except for \
-> / conversion.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agowin: Use lower-case private definition of STORAGE_DEVICE_NUMBER
H. Peter Anvin [Fri, 29 Jun 2012 20:18:55 +0000 (13:18 -0700)]
win: Use lower-case private definition of STORAGE_DEVICE_NUMBER

Since we can't know if <winioctl.h> actually defines
STORAGE_DEVICE_NUMBER, just use a private definition of the structure
but with a lower-case name.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoSEG(): centralize the bad bailout
H. Peter Anvin [Fri, 29 Jun 2012 16:50:00 +0000 (09:50 -0700)]
SEG(): centralize the bad bailout

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agocom32: mark the invalid SEG() as __unlikely()
H. Peter Anvin [Fri, 29 Jun 2012 16:45:22 +0000 (09:45 -0700)]
com32: mark the invalid SEG() as __unlikely()

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoSEG(): make SEG() puke on bad pointers if DEBUG is defined
H. Peter Anvin [Fri, 29 Jun 2012 16:40:48 +0000 (09:40 -0700)]
SEG(): make SEG() puke on bad pointers if DEBUG is defined

SEG() and OFFS() should only be passed on lowmem pointers.  When DEBUG
is defined, make SEG() abort if we pass it a non-lowmem pointer.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoelflink: fix dependency problem in cmenu/Makefile syslinux-5.00-pre6
H. Peter Anvin [Fri, 29 Jun 2012 14:38:33 +0000 (07:38 -0700)]
elflink: fix dependency problem in cmenu/Makefile

Instead of adding library dependencies implicitly, make them explicit
and use --as-needed to avoid bogus DT_NEEDED entries from being
generated.

The other Makefiles should be adjusted accordingly as well.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Matt Fleming <matt.fleming@intel.com>
12 years agoelflink: Use ConfigName directly, the comboot API doesn't work syslinux-5.00-pre5
H. Peter Anvin [Fri, 29 Jun 2012 04:36:59 +0000 (21:36 -0700)]
elflink: Use ConfigName directly, the comboot API doesn't work

Use the ConfigName buffer directly.  Since this buffer doesn't
necessarily live in lowmem anymore, the comboot API is useless.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMerge remote-tracking branch 'origin/master' into elflink
H. Peter Anvin [Fri, 29 Jun 2012 04:34:28 +0000 (21:34 -0700)]
Merge remote-tracking branch 'origin/master' into elflink

Conflicts:
core/fs/lib/searchconfig.c

Get the reverse pathname lookup fixes from the master branch.

12 years agoActually keep track of the pathnames for all elements syslinux-4.06-pre9
H. Peter Anvin [Fri, 29 Jun 2012 02:33:16 +0000 (19:33 -0700)]
Actually keep track of the pathnames for all elements

Actually keep track of the pathnames for all elements for on-disk
filesystems.  This makes sure we can always reconstruct the correct
path.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agochdir: collapse /./ and /../ in path for conventional filesystems syslinux-4.06-pre8
H. Peter Anvin [Fri, 29 Jun 2012 00:26:19 +0000 (17:26 -0700)]
chdir: collapse /./ and /../ in path for conventional filesystems

For conventional filesystems (i.e. not PXE), collapse /./ and /../ in
the path when doing chdir.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMakefile: fix misplaced dot
H. Peter Anvin [Wed, 27 Jun 2012 18:03:51 +0000 (11:03 -0700)]
Makefile: fix misplaced dot

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMerge remote-tracking branch 'origin/master' into elflink
H. Peter Anvin [Wed, 27 Jun 2012 15:03:55 +0000 (08:03 -0700)]
Merge remote-tracking branch 'origin/master' into elflink

12 years agowin32: assume STORAGE_DEVICE_NUMBER is defined
H. Peter Anvin [Wed, 27 Jun 2012 15:01:47 +0000 (08:01 -0700)]
win32: assume STORAGE_DEVICE_NUMBER is defined

If using mingw-w64 to build for win32, this will be defined.  This is
confusing, especially since mingw-w64 defined __MINGW32__ but nothing
else... thus hide this definition for now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMerge branch 'elflink' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into...
H. Peter Anvin [Wed, 27 Jun 2012 14:57:21 +0000 (07:57 -0700)]
Merge branch 'elflink' of ssh://terminus.zytor.com/pub/git/syslinux/syslinux into elflink

12 years agoMerge remote-tracking branch 'origin/master' into elflink syslinux-5.00-pre4
H. Peter Anvin [Fri, 22 Jun 2012 16:06:36 +0000 (09:06 -0700)]
Merge remote-tracking branch 'origin/master' into elflink

12 years agosyslxopt: fix syntax errors syslinux-4.06-pre7
H. Peter Anvin [Wed, 20 Jun 2012 23:12:29 +0000 (16:12 -0700)]
syslxopt: fix syntax errors

Oops :)

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoNEWS: document extlinux --device
H. Peter Anvin [Wed, 20 Jun 2012 23:11:07 +0000 (16:11 -0700)]
NEWS: document extlinux --device

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoextlinux: add --device option to override device detect
H. Peter Anvin [Wed, 20 Jun 2012 23:08:53 +0000 (16:08 -0700)]
extlinux: add --device option to override device detect

Add a --device option for scripts and expert users to override the
device detection.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoextlinux: centralize and reuse btrfs validation
H. Peter Anvin [Wed, 20 Jun 2012 23:01:43 +0000 (16:01 -0700)]
extlinux: centralize and reuse btrfs validation

We can re-use btrfs device validation now.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agomodule: Make list of DT_NEEDED entries per-module
Matt Fleming [Wed, 20 Jun 2012 15:17:23 +0000 (16:17 +0100)]
module: Make list of DT_NEEDED entries per-module

We can't store the DT_NEEDED entries in the bss because 'needed[]'
will be overwritten with recursive calls to module_load(). Make the
list part of struct elf_module instead.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoldlinux: Don't lfree() 'kernel' twice
Matt Fleming [Wed, 13 Jun 2012 14:34:14 +0000 (15:34 +0100)]
ldlinux: Don't lfree() 'kernel' twice

This lead to serious problems where duplicate free blocks would appear
next to each other on the free list, which created an infinite loop in
the following code,

for ( fp = head->next_free ; fp != head ; fp = fp->next_free ) {
    if ( ARENA_SIZE_GET(fp->a.attrs) >= size ) {
/* Found fit -- allocate out of this block */
p = __malloc_from_block(fp, size, tag);
break;
    }
}

because fp == fp->next_free, resulting in modules hanging forever at
malloc() call sites.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoRevert "pxe: resolve names via DNS from protected-mode code"
Matt Fleming [Wed, 13 Jun 2012 10:17:29 +0000 (11:17 +0100)]
Revert "pxe: resolve names via DNS from protected-mode code"

This reverts commit 6aba981cd9310bae94587d3e51106261bf0e27b9.

dns_resolv() is only implemented for PXELINUX, meaning that if we try
to execute any module that references it under SYSLINUX, EXTLINUX or
ISOLINUX it fails to run because it cannot resolve the symbol.

We need a way to implement DNS resolution so that it works for
PXELINUX but returns an error for SYSLINUX/EXTLINUX or ISOLINUX,
without introducing undefined symbols. The old COMBOOT API method
worked splendidly for this, so revert until someone provides a better
solution.

Conflicts:

com32/lib/Makefile
com32/modules/host.c
mk/elf.mk

Cc: Paulo Alcantara <pcacjr@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agocom32: Per-object file LDFLAGS
Matt Fleming [Wed, 13 Jun 2012 08:23:13 +0000 (09:23 +0100)]
com32: Per-object file LDFLAGS

Some object files need to link against the ELF libraries. Allow them
to be specified with the following syntax in the Makefiles,

     LDFLAGS_$(object_file) = $(LIBS)

By adding libraries in this way DT_NEEDED entries are created in the
ELF modules and the required library dependencies are automatically
loaded before running the module.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agofs: Add .copy_super to struct fs_ops
Matt Fleming [Tue, 12 Jun 2012 10:24:04 +0000 (11:24 +0100)]
fs: Add .copy_super to struct fs_ops

commit c0d18deeee2 ("elflink: Fix boot sector booting") makes
reference to vfat_copy_superblock() which is only implemented for
SYSLINUX, resulting in an undefined symbol when booting ISOLINUX or
PXELINUX. Move the superblock copy operation to struct fs_ops so that
we don't need to add a stub implementation of vfat_copy_superblock()
to ISOLINUX and PXELINUX.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoextlinux: better methods for finding device matches
H. Peter Anvin [Wed, 20 Jun 2012 00:41:15 +0000 (17:41 -0700)]
extlinux: better methods for finding device matches

1. Support parsing /proc/self/mountinfo for devices;
2. For btrfs, query the device names from btrfs itself.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoMerge remote-tracking branch 'origin/master' into elflink syslinux-5.00-pre3
H. Peter Anvin [Wed, 13 Jun 2012 02:49:19 +0000 (19:49 -0700)]
Merge remote-tracking branch 'origin/master' into elflink

12 years agoelflink: Fix compiler warning
Matt Fleming [Fri, 8 Jun 2012 10:25:42 +0000 (11:25 +0100)]
elflink: Fix compiler warning

Apply the correct cast to fix the following warning,

chainboot.c: In function ‘chainboot_file’:
chainboot.c:88:7: warning: passing argument 3 of ‘syslinux_add_movelist’ makes integer from pointer without a cast
../../../com32/include/syslinux/movebits.h:57:5: note: expected ‘addr_t’ but argument is of type ‘const void * const’

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoMerge remote-tracking branch 'genec/linux-com32-error-message-for-hpa' syslinux-4.06-pre6
H. Peter Anvin [Tue, 12 Jun 2012 02:58:32 +0000 (19:58 -0700)]
Merge remote-tracking branch 'genec/linux-com32-error-message-for-hpa'

12 years agoisohybrid: Fix building with --as-needed
Micah Gersten [Mon, 11 Jun 2012 22:38:20 +0000 (15:38 -0700)]
isohybrid: Fix building with --as-needed

The library link order was wrong.

This patch was picked from Ubuntu.

Reported-and-tested-by: Tim Fletcher <tim@night-shade.org.uk>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agolinux.c32: Make errors clearer for users
Gene Cumm [Sat, 9 Jun 2012 21:58:20 +0000 (17:58 -0400)]
linux.c32: Make errors clearer for users

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
12 years agocom32: Add missing DHCP pack/unpack files
Matt Fleming [Sat, 9 Jun 2012 18:01:54 +0000 (19:01 +0100)]
com32: Add missing DHCP pack/unpack files

These files were left out of the recent merge from master.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agopxechn: Fix merge botch s/pxe_dns/pxe_dns_resolv/
Matt Fleming [Fri, 8 Jun 2012 13:58:23 +0000 (14:58 +0100)]
pxechn: Fix merge botch s/pxe_dns/pxe_dns_resolv/

pxe_dns() was deleted in commit 6aba981cd93 ("pxe: resolve names via
DNS from protected-mode code"), so when pxechn was merged from
'master' we should really have updated pxechn.c to use
pxe_dns_resolv().

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoDelete all references to __com32.cs_bounce
Matt Fleming [Fri, 8 Jun 2012 13:07:37 +0000 (14:07 +0100)]
Delete all references to __com32.cs_bounce

The COM32 cs_bounce buffer is not usable with ELF modules, as we're
trying to move to an environment where memory is dynamically
allocated. All users of __com32.cs_bounce have been converted to using
lmalloc() to allocate low memory.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agomodule: Actually use last component of DT_NEEDED pathname
Matt Fleming [Fri, 1 Jun 2012 12:24:51 +0000 (13:24 +0100)]
module: Actually use last component of DT_NEEDED pathname

The comment in module_load() claims that we strip everything from the
DT_NEEDED pathnames but the last component. That's not true as we
leave the initial '/', which works fine if the module is in the root
directory, but not so well if we're in a sub-directory. Worse still,
if the DT_NEEDED entry pathname doesn't include a '/' the module is
skipped entirely.

We should also be loading dependencies in reverse order, as modules
loaded because of DT_NEEDED entries may also have dependencies and
their dependencies should be loaded first.

Also, now we need the strrchr() implementation in the core, so move
strrchr.o into $CORELIBOBJS.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoldlinux: fixes bug that happens when using fullpath for a COM32 module
Andre Ericson [Mon, 28 May 2012 09:54:15 +0000 (06:54 -0300)]
ldlinux: fixes bug that happens when using fullpath for a COM32 module

When using full path for a com32 module, for example,
/boot/syslinux/ls.c32 it fails without any error message. This patch
fixes it by looking first if the argv[0] is the path to a module before
looking for it at PATH.

Since we're using fopen to open module files (which works for both
absolute paths and paths relative to the current working directory) we
no longer need to include "." in PATH and neither the code to handle it.

Signed-off-by: Andre Ericson <de.ericson@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agoMerge remote-tracking branch 'mfleming/merge/elflink/master' into elflink
H. Peter Anvin [Thu, 7 Jun 2012 22:54:09 +0000 (15:54 -0700)]
Merge remote-tracking branch 'mfleming/merge/elflink/master' into elflink

12 years agochainboot: clean up old assemblyisms
H. Peter Anvin [Thu, 7 Jun 2012 22:52:57 +0000 (15:52 -0700)]
chainboot: clean up old assemblyisms

Delete a bunch of stuff related to the old assembly implementation of
chainloading.  There are still a few, like the use of pm_load_high()
that should be cleaned up.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoexecute(): move chainbooting code to its own file
H. Peter Anvin [Thu, 7 Jun 2012 22:23:46 +0000 (15:23 -0700)]
execute(): move chainbooting code to its own file

To improve readability, move chainbooting to its own source file.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMerge remote-tracking branch 'mfleming/elflink-dot-zero' into elflink
H. Peter Anvin [Thu, 7 Jun 2012 22:12:07 +0000 (15:12 -0700)]
Merge remote-tracking branch 'mfleming/elflink-dot-zero' into elflink

Resolved Conflicts:
com32/elflink/ldlinux/execute.c

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoelflink: Fix boot sector booting
Matt Fleming [Tue, 1 May 2012 07:55:45 +0000 (08:55 +0100)]
elflink: Fix boot sector booting

This adds missing support for booting from a boot sector file such as
.bs, .bss or .0, by re-implementing the old asm bootsec code from
core/bootsect.inc in C.

This has resulted in some external changes. We've had to make StackBuf
a global symbol because we access it directly from execute.c. Also, we
need to move dsinfo.c into MINLIBOBJS because ldlinux now needs to
reference __syslinux_derivative_info.

Signed-off-by: Matt Fleming <matt.fleming@intel.com>
12 years agobtrfs: Fix booting off a btrfs subvolume.
Alexander E. Patrakov [Mon, 4 Jun 2012 17:59:55 +0000 (23:59 +0600)]
btrfs: Fix booting off a btrfs subvolume.

The subvolume name in path.data is not NUL-terminated, so don't use
strcmp on it.

Before this patch, it would accumulate the following (given
subvolumes with names "ext2_saved", "home", "gentoo" and "boot"):

ext2_saved
home_saved
gentooaved
bootooaved

Signed-off-by: Alexander E. Patrakov <patrakov@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoMerge remote-tracking branch 'zytor/master' into merge/elflink/master
Matt Fleming [Thu, 31 May 2012 11:16:22 +0000 (12:16 +0100)]
Merge remote-tracking branch 'zytor/master' into merge/elflink/master

A lot of development has gone on in the 'master' branch since the last
time we merged; new features, bug fixes, etc, etc.

Conflicts:
Makefile
com32/Makefile
com32/lib/Makefile
com32/lib/syslinux/load_linux.c
com32/modules/Makefile
com32/modules/chain.c
core/bootsect.inc
core/init.inc
version

12 years agocore: remove unused variable in scan_highmem_area()
H. Peter Anvin [Tue, 29 May 2012 21:53:52 +0000 (14:53 -0700)]
core: remove unused variable in scan_highmem_area()

Remove a completely unused variable giving a "set but not used"
warning.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agoMerge commit 'd76af0754db7ddd4c06215d922d213c93178c0af' into elflink
H. Peter Anvin [Tue, 29 May 2012 21:53:07 +0000 (14:53 -0700)]
Merge commit 'd76af0754db7ddd4c06215d922d213c93178c0af' into elflink

12 years agorelocs: Move stop to the end
H. Peter Anvin [Tue, 29 May 2012 21:08:11 +0000 (14:08 -0700)]
relocs: Move stop to the end

The Linux kernel puts the stop word at the beginning of the relocation
list (the list is processed backwards); Syslinux puts the stop word at
the beginning of the relocation list (the list is processed forwards.)

Missed that change when syncing with the kernel version.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agopxe: move hardwired DHCP options into high memory
H. Peter Anvin [Tue, 29 May 2012 19:22:32 +0000 (12:22 -0700)]
pxe: move hardwired DHCP options into high memory

If we have hardwired DHCP options, move them into high memory instead
of into the trackbuf.  This eliminates yet another trackbuf user.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agopxe: remove remaining stray trackbuf reference
H. Peter Anvin [Tue, 29 May 2012 19:01:25 +0000 (12:01 -0700)]
pxe: remove remaining stray trackbuf reference

We aren't using trackbuf, stop referring to it...

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agopxe: stop using trackbuf for DHCP packets
H. Peter Anvin [Tue, 29 May 2012 18:56:05 +0000 (11:56 -0700)]
pxe: stop using trackbuf for DHCP packets

Get rid of yet another trackbuf usage.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agocore/font.c: remove another reference to trackbuf
H. Peter Anvin [Tue, 29 May 2012 18:46:41 +0000 (11:46 -0700)]
core/font.c: remove another reference to trackbuf

Remove a dead reference to trackbuf.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agocore/font: clean up and remove trackbuf usage
H. Peter Anvin [Tue, 29 May 2012 18:41:51 +0000 (11:41 -0700)]
core/font: clean up and remove trackbuf usage

This code was pretty messed up; it used the trackbuf for simple file
I/O, but didn't use lowmem for the actual font buffer, which is
touched by BIOS.

This also removes yet another user of trackbuf.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
12 years agorelocs: sync with the Linux kernel
H. Peter Anvin [Tue, 29 May 2012 08:02:54 +0000 (01:02 -0700)]
relocs: sync with the Linux kernel

Sync the relocs tool with the Linux kernel.  The new version of this
tool correctly verifies that any absolute symbol is either listed as
allowed absolute or is listed as relative.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agocore: add support for .init/fini_table
H. Peter Anvin [Tue, 29 May 2012 04:39:40 +0000 (21:39 -0700)]
core: add support for .init/fini_table

We don't actually have any constructors/destructors in the core at
this time, but handle .init/fini_table in case that happens...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agocom32.ld: handle .init_array and .fini_array syslinux-4.06-pre5
H. Peter Anvin [Tue, 29 May 2012 04:28:52 +0000 (21:28 -0700)]
com32.ld: handle .init_array and .fini_array

Handle constructors/destructors via .init_array and .fini_array, as
generated by newer gccs.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agocom32: fix warning in host module
Paulo Alcantara [Mon, 28 May 2012 04:04:00 +0000 (01:04 -0300)]
com32: fix warning in host module

host.c: In function ‘main’:
host.c:56:9: warning: implicit declaration of function ‘exit’
                            [-Wimplicit-function-declaration]
host.c:56:9: warning: incompatible implicit declaration of built-in
                                function ‘exit’ [enabled by default]

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agocom32: fix warning in elf_module
Paulo Alcantara [Mon, 28 May 2012 03:52:03 +0000 (00:52 -0300)]
com32: fix warning in elf_module

sys/module/elf_module.c: In function ‘module_load’:
sys/module/elf_module.c:454:8: warning: ‘ctors’ may be used
                    uninitialized in this function [-Wuninitialized]
sys/module/elf_module.c:404:17: note: ‘ctors’ was declared here

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agolocalboot: remove unnecessary real-mode call
Paulo Alcantara [Mon, 28 May 2012 03:31:59 +0000 (00:31 -0300)]
localboot: remove unnecessary real-mode call

syslinux_local_boot() used to call local_boot() from INT 0x22
(AX=0x0014) as it should just call local_boot() function.

The local_boot() function is now exported by core/include/localboot.h to
be used in COM32 library space so that syslinux_local_boot() can use it.

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agoMerge remote-tracking branch 'hdt/master' syslinux-4.06-pre4
H. Peter Anvin [Sun, 27 May 2012 19:57:21 +0000 (12:57 -0700)]
Merge remote-tracking branch 'hdt/master'

12 years agoMerge remote-tracking branch 'genec/diag-mbr-fix-for-hpa'
H. Peter Anvin [Sun, 27 May 2012 19:57:01 +0000 (12:57 -0700)]
Merge remote-tracking branch 'genec/diag-mbr-fix-for-hpa'

12 years agodiag/mbr: Clarify README
Gene Cumm [Sun, 27 May 2012 18:13:05 +0000 (14:13 -0400)]
diag/mbr: Clarify README

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
12 years agoUpdate diag/mbr instruction to match the current filename.
Jean-Christian de Rivaz [Sat, 26 May 2012 22:26:42 +0000 (00:26 +0200)]
Update diag/mbr instruction to match the current filename.

I suspect that some instructions about how to use the diag/mbr was not
updated when the source file was renamed to handoff.S. Here is a simple
proposition to fix that only into the handoff.S file.

Jean-Christian de Rivaz

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
12 years agopxechn.c32: PXE NBP chainloader
Gene Cumm [Sun, 27 May 2012 13:23:07 +0000 (09:23 -0400)]
pxechn.c32: PXE NBP chainloader

Designed as a more versatile COM32-based alternative to pxechain.com.
It can use the PXE RESTART or chain to the new NBP without the PXE
stack.  It also enables a user to boot Microsoft Windows Server 2008R2
Windows Deployment Services's wdsnbp.com from PXELINUX.

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
12 years agoCOM32: add DHCP pack/unpack functions
H. Peter Anvin [Tue, 14 Jun 2011 01:16:46 +0000 (21:16 -0400)]
COM32: add DHCP pack/unpack functions

Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
12 years agohdt: 0.5.2-pre2 release
Erwan Velu [Sun, 27 May 2012 09:59:25 +0000 (11:59 +0200)]
hdt: 0.5.2-pre2 release

12 years agohdt: Adding say & postexec demo
Erwan Velu [Sun, 27 May 2012 09:58:19 +0000 (11:58 +0200)]
hdt: Adding say & postexec demo

When building official hdt image, let's add a say & postexec example.

12 years agohdt: Adding say command
Erwan Velu [Sun, 27 May 2012 09:46:54 +0000 (11:46 +0200)]
hdt: Adding say command

This command is just for displaing a message to the cli during a defined
period of time.

Syntax is like the following : say `my message`%<number_of_seconds>
An example :

say `This is my text message to display during 5 seconds`%5

12 years agohdt: Adding nomodule support in cli
Erwan Velu [Sun, 27 May 2012 09:41:39 +0000 (11:41 +0200)]
hdt: Adding nomodule support in cli

Some new commands might need being able to manage the argv directly
instead of the much more oriented scheme we had until now.

This commit add a .nomodule option to cli object to explically tell they
don't have a module as parameter but only arguments.

This will be needed for the 'say' command.

12 years agohdt: Fixing argument mgmt in cli
Erwan Velu [Sun, 27 May 2012 09:20:01 +0000 (11:20 +0200)]
hdt: Fixing argument mgmt in cli

Sizeof(char *) is definetly wrong for getting the length of a string.

12 years agohdt: Adding more debug traces in cli
Erwan Velu [Sun, 27 May 2012 06:27:49 +0000 (08:27 +0200)]
hdt: Adding more debug traces in cli

Adding more debug traces in the cli management to ease debugging &
feature adding.

12 years agohdt: Fixing chain32 target in makefile
Erwan Velu [Fri, 25 May 2012 21:31:42 +0000 (23:31 +0200)]
hdt: Fixing chain32 target in makefile

chain32 moved, let's adjust the "release" target.

12 years agoMerge remote-tracking branch 'hpa/master'
Erwan Velu [Fri, 25 May 2012 21:08:35 +0000 (23:08 +0200)]
Merge remote-tracking branch 'hpa/master'

12 years agographics: make use of syslinux_force_text_mode()
Paulo Alcantara [Sat, 19 May 2012 04:58:03 +0000 (01:58 -0300)]
graphics: make use of syslinux_force_text_mode()

The syslinux_force_text_mode() function used in library
space made unnecessary INT 0x22 call that could be simply
used with vgaclearmode() function.

This patche renames vgaclearmode() to
syslinux_force_text_mode() as this naming is generally more
carefully considered and gets rid of "forcetext.c" source
file.

Also all the VGA-related functions and variables that were
exported in core/include/bios.h have been moved out to
core/include/graphics.h which makes more sense actually.

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
12 years agoCLI: don't highlight the prompt syslinux-5.00-pre2
H. Peter Anvin [Fri, 18 May 2012 23:29:42 +0000 (16:29 -0700)]
CLI: don't highlight the prompt

Don't gratuitously highlight the prompt; it is just annoying.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agosyslinux_boot_linux(): revert to text mode unless vga=current
H. Peter Anvin [Fri, 18 May 2012 23:26:53 +0000 (16:26 -0700)]
syslinux_boot_linux(): revert to text mode unless vga=current

When loading a Linux kernel, revert to text mode before invoking
unless vga=current.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agocom32: make syslinux_dump_*() pure debugging functions
H. Peter Anvin [Tue, 28 Jun 2011 02:06:43 +0000 (19:06 -0700)]
com32: make syslinux_dump_*() pure debugging functions

Make the syslinux_dump_*() functions pure debugging functions; that is
the way that they are used anyway, and this way they log to the same
place as dprintf.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoUse <dprintf.h> instead of an ad hoc definition
H. Peter Anvin [Tue, 28 Jun 2011 01:51:11 +0000 (18:51 -0700)]
Use <dprintf.h> instead of an ad hoc definition

Instead of using ad hoc definitions of dprintf, dprintf2, vdprintf and
vdprintf2, use <dprintf.h> everywhere possible.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodprintf: always define dprintf2/vdprintf2
H. Peter Anvin [Tue, 21 Jun 2011 04:33:38 +0000 (21:33 -0700)]
dprintf: always define dprintf2/vdprintf2

Always define dprintf2/vdprintf2 even with no debugging at all
enabled.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agolib/shuffle: use <dprintf.h>
H. Peter Anvin [Tue, 21 Jun 2011 04:19:46 +0000 (21:19 -0700)]
lib/shuffle: use <dprintf.h>

Another straggler not yet using <dprintf.h> for debugging.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agodprintf: add the ability to log to stdio
H. Peter Anvin [Tue, 21 Jun 2011 04:19:17 +0000 (21:19 -0700)]
dprintf: add the ability to log to stdio

Add the ability to redirect dprintf to stdio when there is no other
choice.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Resolved Conflicts:

com32/lib/dprintf.c
com32/lib/vdprintf.c

12 years agovdprintf.c: undo double-printing
H. Peter Anvin [Fri, 18 May 2012 23:01:25 +0000 (16:01 -0700)]
vdprintf.c: undo double-printing

Undo double-printing change so we can sync with master.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoCLI: Stick to the classic "boot: " prompt rather than "syslinux$"
H. Peter Anvin [Fri, 18 May 2012 22:42:38 +0000 (15:42 -0700)]
CLI: Stick to the classic "boot: " prompt rather than "syslinux$"

Just for familiarity...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agofs.h: A slighly more useful default PATH
H. Peter Anvin [Fri, 18 May 2012 22:38:08 +0000 (15:38 -0700)]
fs.h: A slighly more useful default PATH

/bin is clearly insane...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoMakefile: install library modules, too
H. Peter Anvin [Fri, 18 May 2012 22:37:32 +0000 (15:37 -0700)]
Makefile: install library modules, too

We need the library modules to be added to MODULES.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
12 years agoelflink: Make sure to install ldlinux.c32 at install time
H. Peter Anvin [Fri, 18 May 2012 22:00:04 +0000 (15:00 -0700)]
elflink: Make sure to install ldlinux.c32 at install time

We need to reach ldlinux.c32 during early boot...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>