| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
We used to need a wrapper around the core function dns_resolv() to
implement pxe_dns(), because the former function required its argument
to live in low memory. This is no longer the case and hasn't been for
a while, so remove this unnecessary level of indirection.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
| |
Clean up the handling of firmware selection inside the Makefiles.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
| |
When parsing the modules.alias, we shall report it as broken if we
cannot find any valid line in it.
This patch simply count the number of valid lines and report a missing
modules.alias if no valid lines are found.
|
|
|
|
|
|
|
| |
Check if the first character matches the character to replace, rather
than skipping it and starting with the second.
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
|
|
|
|
|
|
| |
Originally-By: Patrick Masotta <masottaus@yahoo.com>
[Use (void(0)) instead of a dummy function - gene.cumm@gmail.com]
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
| |
Fixes the warning: format '%x' expects argument of type 'unsigned int', but
argument 2 has type 'size_t'
Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
|
|
|
|
| |
Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the kernel is relocatable and the protected mode code will not fit
in the initially determined location, that code will be moved to the
next available location. However, beginning with commit 8f470e7b, the
code is moved to the initially determined location instead of the next
available location because prot_mode_base is no longer updated to the
correct location. Since whdr->code32_start is updated, it is pointing
to the wrong execution start location, random code is executed and
the machine is rebooted.
Restore the old behavior by assigning prot_mode_base the value of
base. Tested on a machine that exposed this behavior.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
|
| |
Correct base's type to match its initialization from prot_mode_base and
passage to syslinux_memmap_find(). Tested with extlinux.
Signed-off-by: Scot Doyle <lkml14@scotdoyle.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
|
|
| |
Use the z size specifier to printf-ing size_t variables to get rid of gcc
warning format ‘%08x’ expects type ‘unsigned int’, but argument 2 has
type ‘long unsigned int’
Author: Martin Str|mberg <ams@ludd.ltu.se>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get rid of printf format warning format ‘%llx’ expects type
‘long long unsigned int’, but argument 2 has type ‘uint64_t’
Use <inttypes.h> PRIx64 instead of llx to get rid of gcc warning
format ‘%llx’ expects type ‘long long unsigned int’, but argument 2
has type ‘uint64_t’
Author: Martin Str|mberg <ams@ludd.ltu.se>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
| |
This makes symbols defined in com32.ld and syslinux.ld HIDDEN, to
avoid collisions. Additional linker scripts should have this done, too.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
This file causes dynamic link failures on EFI, and of course has
no use in the EFI environment.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the last bits of the comapi interfaces completely. This does
not install stub handlers for the INT 20-3Fh handlers, as we don't
support loading old COMBOOT/COM32/COM32R images anymore.
We could put those back if we really need them.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the shuffle and boot comapi call. This is the last of the
comapi calls left; we should now be able to completely remove the
comapi support.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|/
|
|
|
|
|
|
|
| |
Actually get the shuffler size sanely. At least for now, we are BIOS
only, so stub out the functions on EFI (they shouldn't even be
compiled for EFI; this stuff should be moved into some kind of
BIOS-only directory.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
| |
Some functions are ignoring the const qualifier.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
| |
As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters
of intcall() shall be zeroified.
Having unclean inreg could trigger bad behaviors on some hosts.
This patch is about adding memset() calls prior any intcall() :
- some intcall didn't had any memset at all
- some successive intcall() calls didn't memset inreg in between calls
|
|
|
|
|
|
| |
To fully support color tables with more than 256 entries
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For non-relocatable kernels, it really makes no sense to estimate how
much space the kernel is going to need, as if we fail, there is really
nothing we can do about it. Furthermore, it is actively wrong for
zImage kernels (which aren't decompressed in place) and for non-Linux
kernels.
Additionally, tweak the code for assigning an address to the command
line to handle a few more corner cases correctly, be simpler, and not
need to build the memory map again since we already are doing that
elsewhere.
Reported-and-tested-by: Christian Hesse <list@eworm.de>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
My commit 09f4ac33 broke 'com32/lib/syslinux/disk.c'
__lowmem doesn't work for declarations outside the core.
Using __lowmem outside the core wouldn't have the desired effect, then lmalloc
must be used instead to store dapa into the correct section (".lowmem").
Reported-by: Dark Raven <drdarkraven@gmail.com>
Signed-off-by: Raphael S. Carvalho <raphael.scarv@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
|
|
|
|
|
|
| |
Pulled common code out of these functions into new ones.
The functions chs_setup and ebios_setup were created for this purpose.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
| |
dprintf() is much more useful than DBG_PRINT() when trying to figure out
where a module is failing to load because we can enable the debug
statements at runtime.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The constraints for allocating the kernel cmdline buffer under bios are
pretty involved and filled with historic rules. Unit test the bios linux
loader to ensure we never violate any of them, while at the same time
making sure we actually find a usable chunk of memory.
This commit is designed to test the changes in commit 77cadda8
("load_linux: dynamically calculate the cmdline region").
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
| |
Use the one from syslinux/video.h. This makes it easier to write unit
tests for syslinux/load_linux.c without pulling in loads of core
definitions from core/include/graphics.h. It can also be argued that
syslinux_* symbols should have prototypes in syslinux/*.h files.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
| |
Exercise the new syslinux_memmap_highest() function.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Users are hitting issues where the offset calculated by,
(0x9ff0 - cmdline_size) & ~15;
is not useable memory, e.g. it is SMT_RESERVED. Instead we should be
trying to find the highest lowmem address.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
| |
There's bits of historical baggage surrounding these values. Pull the
calculation out into a separate function for clarity.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
The unit tests are designed to be small and should build very quickly,
so there should be no downside to rebuilding them for every run. The
upside is that we don't litter our build trees with target executables
and we don't need to explicitly list dependencies in Makefiles to ensure
our tests get rebuilt whenever a dependency changes.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
There's a bunch of places that need to deal with mmap_entry entries when
doing tests, so make the structure readily available. Since we're going
to get a collection of header files that could be considered the
"unit test infrastructure" we might as well create a new directory for
them.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve our faith in the validity of the Syslinux code by writing unit
tests where possible. These should be used in addition to the regression
tests - unit tests are a means of doing very fine-grained testing of
code, whereas the regression tests are end-to-end tests that exercise
abstract functionality.
Unit tests run on your development machine and above all else, their
execution time should be kept to a minimum to encourage repeated runs of
the unit testsuite.
The Syslinux header hierarchy has been reconstructed under
tests/unittest/include. This allows us to reuse header files where
appropriate by simply creating a file with the same name and including
the original, e.g.
tests/unittest/include/com32.h:
#include <../../../com32/include/com32.h>
Places where we need to override definitions (so that the tests build in
a dev environment) obviously won't include the original header file, but
such scenarios should be kept to a minimum, since you're not really
testing any Syslinux code that way.
To execute the collection of unit tests type,
make unittest
Sample output might look like,
Executing unit tests
Running library unit tests...
[+] zonelist passed
[+] movebits passed
[+] memscan passed
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
| |
In theory we may have multiple subregions with SMT_FREE and
SMT_TERMINAL. This can be fairly easily integrated into a small loop.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
Allow syslinux_memmap_type() to report any combination of SMT_FREE and
SMT_TERMINAL as SMT_TERMINAL.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
| |
It's OK to allocate across some region boundaries, provided that the
region types are compatible.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
|
|
| |
By registering memory scanners at runtime we can support multiple memory
scanner functions, which helps us to isolate them and keep things
modular, only registering them for specific platform/derivative
combinations. This is preparation for adding a memory scanner that is
specific to PXELINUX on bios and understands when the memory region
occupied by the PXE stack can be reused.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
|
| |
Some memory regions are usable, but only as a last resort just before we
hand over control to a kernel image. Add the necessary movebits
infrastructure to use these regions when all other options have been
exhausted.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
| |
The memscan interface should be using SMT_* to describe the types of
memory regions as SMT_* are platform agnostic values. This will allow us
to be much more descriptive about the type of memory regions in future.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
|
| |
Refactor the code for finding a suitable location for kernel
protected-mode and real-mode data. It's complicated enough that it
deserves to be separated into its own function.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
|
|
|
| |
to syslinux_memmap_find_type(), which more accurately reflects its
function and frees up the old name for another use.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
syslinux-5.11-pre8
Conflicts:
NEWS
com32/lib/Makefile
core/conio.c
mk/devel.mk
mk/elf.mk
|
| |\ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's useful to be able to enable (and disable) debug code at runtime,
particularly for allowing users that are unable to build their own
Syslinux releases the chance to provide useful debugging output.
For example, say a user reports trouble with their PXE stack but doesn't
have a development environment setup to turn on the debug code
themselves. With this change you can simply request that they do,
debug.c32 -e pxe_call unload_pxe open_file
to enable the debug in those functions. By only turning on code in
specific functions we reduce the chance of disrupting the buggy
behaviour and improve the signal to noise ratio for print statements.
To disable debug code use the -d flag,
debug.c32 -d pxe_call
To use this new feature simply do,
if (syslinux_debug_enabled) {
debug1();
debug2();
....
}
from within the function you wish to add debug code. Note that this
feature is not limited to print statements - you can put any code within
the conditional, such as verifying a checksum or checking for memory
leaks.
The plan is to leave the dynamic debug code built in for all prereleases
and to turn it off for final releases.
People may still want to build with all dprintf() statements enabled,
and so a new symbol, DYNAMIC_DEBUG, was introduced rather than
repurposing the old DEBUG, DEBUG_STDIO and DEBUG_PORT symbols.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Some kernel headers have bogus 'initrd_addr_max' fields. This field
should never be zero. Set it to the old upper limit if unspecified.
Failure to set a non-zero value for the field results in a bogus
'memlimit' value, thereby unnecessarily reserving part of the memmap.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |/
| |
| |
| |
| |
| |
| | |
It's useful to know why a kernel is failing to load. Sprinkle some
dprintf() statements with informative messages.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| | |
We only ever use ->set_mode() to transition into text mode, so rename it
to something more suitable and drop the unused 'mode' argument.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Cherry-pick commit e55d4988 ("com32: Include .init_array section in
.ctors in linker script") from the elflink branch.
People were seeing this bug manifest as an error when using the CONFIG
directive. Loading a new main configuration file causes ldlinux.* to be
reloaded and relies on its destructor functions being executed.
This change was missed during merging because com32/lib/elf32.ld should
have been deleted when we added per-architecture linker scripts. Had we
done that, we'd have seen a merge conflict. Because the unused file was
left around, things merged silently.
Delete the unused file with extreme prejudice.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The BIOS firmware backend is missing a .load_linux pointer, and so
anyone trying to boot a Linux kernel under BIOS is hitting the following
error message,
"No linux boot function registered for firmware"
The usual way to handle this kind of abstraction would be to move
bios_load_linux() to core/bios.c and assign it to .load_linux, but that
would necessitate pulling the movebits and shuffler code into the core.
For now, leave the BIOS loader where it is and use it as the default. In
future we will want to move this to BIOS-specific code (though not
necessarily in the core) because, by having it in the generic loader
code, it is currently being built for the EFI backends even though it is
never used.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
->boot_linux() actually returns an error value, so return it to the
caller of syslinux_boot_linux() and fix the following compiler warning,
com32/lib/syslinux/load_linux.c: In function ‘syslinux_boot_linux’:
com32/lib/syslinux/load_linux.c:527:1: warning: control reaches end of non-void function [-Wreturn-type]
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Commit ("ansi: Improve EFI console support") broke writing to the
display under BIOS in an attempt to get things working under EFI. Since
the 'cols' and 'rows' arguments aren't used by the EFI console code,
revert that chunk of the commit to restore the BIOS functionality.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|