Chandramouli Narayanan [Wed, 5 Sep 2012 06:49:49 +0000 (07:49 +0100)]
module: Fixed the upper limit in symbol table walk through
Number of entries in symbol table should be sized by the table entry
size. Without this, the loading of modules takes forever due to
walking all over the memory.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan@intel.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 3 Sep 2012 13:35:14 +0000 (14:35 +0100)]
console: Close stdin, stdout, stderr on ldlinux.c32 unload
The location of __file_info[] and ansicon_counter are split between
the core and ldlinux.c32. We can end up calling __ansicon_close (from
fp->oop->close) in the process of reloading ldlinux.c32, and while
ansicon_counter is set to its initialised data value of 0 when
reloading ldlinux.c32, the core is never reloaded, and so
__file_info[] retains its pointers.
What this amounts to is that when ldlinux.c32 tries to call
openconsole() after being reloaded, the core tries to close the
ansicon device (the core still has pointers to __ansicon_close)
despite the ansicon code having no knowledge of ever being opened
(because ansicon_counter was reinitialised).
The most logical way to deal with this is to close stdin, stdout and
stderr when unloading ldlinux.c32.
It also turns out that sys/openconsole.o was present in two Makefile
variables which lead to duplication of code, data, etc. We only need
it present in libcom32min.a and not in the core since the core never
handles opening consoles, at least not now that we've deleted
printf_init() which is safe because we always open a console in
ldlinux.c32 anyway.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 7 Aug 2012 09:40:12 +0000 (10:40 +0100)]
ldlinux: Use findpath() to lookup filenames
We should use the same method of opening files as the module code when
searching for extensions. In particular, we should search all of PATH.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 2 Aug 2012 09:34:17 +0000 (10:34 +0100)]
rawcon_read: Fix reading high part of input keys
commit
8486142cf304 ("elflink: Replace __intcall() with direct
function calls") made the mistake of zero'ing the high part of the
input key on every invocation of __rawcon_read() instead of preserving
it across calls like the old code, which lead to function keys such as
KEY_UP, KEY_DOWN, etc not working.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 2 Aug 2012 08:26:54 +0000 (09:26 +0100)]
ldlinux: Return to command prompt after loading COM32
The old COM32 loading code would drop the user at a command prompt
once execution returned from the COM32 amodule. We need to replicate
this because most callers of execute() don't expect it to return.
This bug was noticed when loading a COM32 module from
vesamenu.c32. Once execution returned from the COM32 module the
display became garbled because no code exists to reinitialise the
screen for VGA.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 12 Jul 2012 19:35:14 +0000 (20:35 +0100)]
com32: Use --as-needed for LDFLAGS
This extends commit
4678fd92a21e ("elflink: fix dependency problem in
cmenu/Makefile") and basically reverts commit
fb543aa635ff ("com32:
Per-object file LDFLAGS"). By using the --as-needed ld argument we can
specify all the required shared libraries for a directory, even if not
all of the libraries are needed by every .c32 file. --as-needed takes
care of only creating DT_NEEDED entries for the shared libraries that
are actually required to resolve undefined symbols in a given module.
Furthermore, by using $(LIBS) we create a dependency between .c32
files and their shared libraries, which allows multiple make jobs to
run in parallel.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 12 Jul 2012 12:34:06 +0000 (13:34 +0100)]
Use pxe_call() instead of COMBOOT API
This involved some other changes, such as passing flags to
unload_pxe() now that we only call it from C code, and hence don't
need to update KeepPXE.
We also needed to move some of the pxe function prototypes to
com32/include/syslinux/pxe_api.h because they are now referenced
outside of the core.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 3 Jul 2012 07:50:13 +0000 (08:50 +0100)]
elflink: Replace __intcall() with direct function calls
There's no reason to use the COMBOOT API at all now that we can have
any undefined symbols resolved at runtime - we can just access
functions directly.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 12 Jul 2012 16:39:53 +0000 (17:39 +0100)]
lib/sys/module: Add support for weak symbols
We need a means of allowing Syslinux derivative-specific functions to
remain unresolved when there is no implementation for them. For
example, unload_pxe() is referenced by common code in com32/lib, but
is only implemented for PXELINUX. By marking unload_pxe() as __weak we
can substitute references with the undefined_symbol() function for
SYSLINUX, EXTLINUX and ISOLINUX. Provided that those references are
never executed everything works fine. However, if code calls actually
calls unload_pxe() from SYSLINUX, EXTLINUX or ISOLINUX an error
message is displayed and execution is halted.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 11 Jul 2012 12:12:33 +0000 (13:12 +0100)]
ldlinux: Stop using the internal KT_* image types
The KT_* image types were never meant to be used outside of
com32/menu, so use the external image types from syslinux/boot.h
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 11 Jul 2012 09:17:49 +0000 (10:17 +0100)]
core/elflink: Delete ADV code that's already in ldlinux
The exact same ADV code is in both com32/elflink/ldlinux and
core/elflink. Since there's no need to have the same code in two place
at once delete the copy from the core since there are no users in
core/.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
H. Peter Anvin [Thu, 19 Jul 2012 15:42:32 +0000 (08:42 -0700)]
Only compile dprintf/vdprintf if DEBUG_PORT is defined
We really, really don't want to accidentally spew output to a debug
port in production, so make it obligatory to define DEBUG_PORT or
DEBUG_STDIO in order for the debugging code to be compiled in. Since
DEBUG_STDIO just turns the debugging code into stdio references, we
only need to compile the code for the DEBUG_PORT case.
Add a commented-out line to mk/devel.mk to make it easier for users.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Cc: Matt Fleming <matt.fleming@intel.com>
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
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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.
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>
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>
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>
H. Peter Anvin [Wed, 27 Jun 2012 15:03:55 +0000 (08:03 -0700)]
Merge remote-tracking branch 'origin/master' into elflink
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>
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
H. Peter Anvin [Fri, 22 Jun 2012 16:06:36 +0000 (09:06 -0700)]
Merge remote-tracking branch 'origin/master' into elflink
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
H. Peter Anvin [Wed, 13 Jun 2012 02:49:19 +0000 (19:49 -0700)]
Merge remote-tracking branch 'origin/master' into elflink
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>
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'
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>
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>
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>
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>
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>
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>
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>
H. Peter Anvin [Thu, 7 Jun 2012 22:54:09 +0000 (15:54 -0700)]
Merge remote-tracking branch 'mfleming/merge/elflink/master' into elflink
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>
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>
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>
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>
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>
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
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>
H. Peter Anvin [Tue, 29 May 2012 21:53:07 +0000 (14:53 -0700)]
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
H. Peter Anvin [Sun, 27 May 2012 19:57:21 +0000 (12:57 -0700)]
Merge remote-tracking branch 'hdt/master'
H. Peter Anvin [Sun, 27 May 2012 19:57:01 +0000 (12:57 -0700)]
Merge remote-tracking branch 'genec/diag-mbr-fix-for-hpa'
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>
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>
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>
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>
Erwan Velu [Sun, 27 May 2012 09:59:25 +0000 (11:59 +0200)]
hdt: 0.5.2-pre2 release
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.
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
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.
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.
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.
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.
Erwan Velu [Fri, 25 May 2012 21:08:35 +0000 (23:08 +0200)]
Merge remote-tracking branch 'hpa/master'
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>