Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
By copying two short functions from the cpu module.
They do not warrant a separate module.
Also make those functions static in both modules.
|
|
And document the change in usage.
|
|
|
|
Under Lua 5.2 modules are not expected to set global variables
to reduce namespace pollution. Explicit require() is preferred.
|
|
|
|
|
|
|
|
This makes the module_* functions accessible to COM32 modules.
MODULE_INIT and MODULE_EXIT are not used anymore.
|
|
Nor the concept of text vs. binary open mode, so it does not matter.
|
|
|
|
|
|
Which always returns NULL, representing an empty environment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Start with the src/Makefile in Syslinux before importing Lua 5.2.2.
Refresh the core Lua object list based on the original Makefile.
Add the new builtin library objects.
Temporarily remove the Syslinux extension library objects, as they
need adjustments for the new API.
|
|
Source downloaded from http://www.lua.org/ftp/lua-5.2.2.tar.gz.
The com32/lua directory now matches exactly the source distribution,
plus the various Syslinux extension modules and their documentation.
|
|
Putting the __syslinux_shuffler_size in a C file by itself caused it
to not get included in the core, causing failures. Put it in assembly
to make sure it really gets included there.
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>
|
|
Export the firmware type as a cpp variable so we can #ifdef.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
DL register is not set to drive number when detecting EDD for drive,
so detection may fail.
Signed-off-by: Andy Alex <andy at r-tt.com>
|
|
Resolved Conflicts:
core/init.c
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
We can't truncate the memory size needed to 16 bits *before* we
convert it to kilobytes...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
The lowmem check was backwards and would report error when there
wasn't any. This was missed because the Ctrl key check was *also*
backwards and so the check would only be done when Ctrl was held down.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
This eliminates the forking and pushes the build under the efi32/ and
efi64/ object directories eliminating a build race and preventing the
build from breaking as gnu-efi takes a few seconds to complete.
Depends on gnu-efi commit 52d88dd
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
This allows gnu-efi to be built outside the source tree properly.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
The other cleaning targets might still have issues...
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
We need to specify -m32/-m64 even when we are processing assembly.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Disable the stack protector if on by default.
Copied from https://bugs.gentoo.org/show_bug.cgi?id=495146.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
There is no need to have a relocation section that nothing points at.
The image is still seen as relocatable as long as the Characteristics of
the FileHeader do not say otherwise.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
PE headers code_sz and image_sz indicate more or less, the size of the
file and the size of the in-memory image. They are now given the right
value.
In the ELF format, only the program headers are reliable to determine
the actually needed part of the file and the in-memory size.
The .bss section should always be marked as NOLOAD for ld since its
content shouldn't be included into the binary file.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
OVMF and probably other UEFI implementation refuse a file with a
relocation entry inside the headers. And since the dummy relocation
wasn't used at all, better remove it.
Moreover, the field base_relocation_table wasn't initialized properly,
leading to unpredictable bugs.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
In the generated PE file, the section header for the .text section used
to address more than the whole file. Starting at offset 0 (before the
end of the headers) is illegal and is rejected by OVMF. Giving a size
greater than the actual file size is also illegal and rejected.
Moreover, the body of the PE file have to be aligned to at least 512
bytes. Hence, .text need to be aligned as well.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
The value of the field rva_and_sizes_nr is used by OVMF to check the
consistency of the PE file with respect to the field optional_hdr_sz. It
now have the right value.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
We need biosboot.o for shuffle and boot now.
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>
|
|
The only comapi calls left are the ones related to the ADV and to
shuffle and boot. Remove the ADV-related ones as part of getting rid
of the comapi framework completely.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Export the initial stack and PXE(NV) structure pointers properly, even
for users which need seg:offs. Use this in pxechn.c rather than the
already-removed INT 22h AX=000Ah call.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Cc: Gene Cumm <gene.cumm@gmail.com>
|
|
It could happen on 32 bits architecture that the memory size really allocated
could be less than required. On 64 bits, allocate_pages may be called
more times than needed.
This closes bug #39.
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Resolved Conflicts:
com32/include/byteswap.h
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
&>foo is a bashism, use >foo 2>&1 instead.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
If a dependency is added to the newer rules, make will choose the easier
rules instead of the preferred rules.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
There is no need to memset the buffer since the strncat will end the
string with a \0. The memset was also almost wrong as doing a sizeof()
on a char * could return 1 if buff was malloc'ed.
We had chance as all the current calls are done with static buffers.
Removing this memset call will make things clearer but also will prevent
compilation warnings like :
com32/gpllib/acpi/acpi.c:38:29: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the
destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
memset(buffer, 0, sizeof(buffer));
|
|
The dynamically alloc'd string to protect from strtok modification
has not been free'd on start_auto_mode() function.
This patch insure the free is done properly.
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
This should help hardware that doesn't return EFI_SUCCESS immediately.
Reported-by: Jason Matthews <jason.david.matthews@gmail.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
udata.AcceptAnyPort caused the udata.StationPort to return as 0.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
We don't need to re-inform EFI what IPv4 address and subnet mask to use.
This change should help to re-use the exising routes.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
core_udp_open() obtained a port allocation. Continue using it.
Author: Celelibi <celelibi@gmail.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
core_udp_open() should obtain a UDP port allocation and save it for
core_udp_connect() and core_udp_sendto() to reuse.
Author: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Some functions are ignoring the const qualifier.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Recommended-By: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Wrong prototype; use GCC unused
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
On some code, the intcall 0x15 was missing when playing with 0x8800
making code useless.
That's not a big deal since e820 or e801 shall be provided by host but
anyway, let's fix it ;)
|
|
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
|
|
|
|
Using a register image on the stack without initializing it is not a
good idea.
Reported-by: Erwan Velu <erwanaliasr1@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Resolved Conflicts:
version
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Resolved Conflicts:
version
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Since checkin:
bd09a6d828fa Major Makefile cleanups; gcc 4.3.0 compatiblity
... we include *.tmp into the Makefiles as well as .*.d. This seems
to have been a mistake in made when adding *.tmp to cleanup rules,
probably using a sed script.
This causes problems, because *.tmp files are generated by the gcc_ok
macro and do not contain Makefile rules at all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
The access functions for architectures which need bytewise access had
type problems.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Accomodates the per-firmware object directory support
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Correct merge f88b4f47
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
The definition for data_segment() was exactly the same as ds().
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Add sparse address space annotation to the actual DOS installer code.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
0 used as NULL triggers a warning.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Add sparse address space annotations for the syslinux boot image, to
make it easier to catch errors that break the DOS installer build
again. Use "make CC=cgcc" to run sparse.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Resolved Conflict:
diag/geodsp/Makefile
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
Resolved Conflicts:
NEWS
core/fs/fs.c
version
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
They are object output only.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
We started using memset() on the extents buffer in ldlinux.sys, which
doesn't reside in the main segment, which worked on all the installer
platforms except DOS. Fix DOS by introducing memset_sl() for this
case.
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Should clarify the situation; also word-wrap & save example
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Results in null image
Reported-By: ioannis
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
in dnsresolv.c:dns_resolv()
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Not all distributions point /bin/sh at /bin/bash, so remove some
bashisms (pushd/popd) and require that build-gnu-efi.sh be run from the
Syslinux object directory.
Also, swap realpath(1) for readlink(1) because the former isn't
available on Debian.
Reported-by: Ferenc Wagner <wferi@niif.hu>
Reported-by: Celelibi <celelibi@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Apparently with some toolchains, isolinux-debug runs out of space by a
few bytes. Shorted a few messages slightly to make up for that.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Signed-off-by: Ruben Kerkhof <ruben at rubenkerkhof.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
In checkin:
cb015497a4e4 isolinux: Update LBA in getlinsec loop
... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized. If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.
At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.
Reported-by: Carl Duff <cdrw2400@gmail.com>
Reported-by: Philip Müller <philm@manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
A fancy pointers logic has been replaced with a plain old if / else
branches. It was assigning only half of a 64 bits integer which is then
assigned to a size_t. Thus leading to a bug on platform where size_t is
64 bits.
Resolves bug #26
Signed-off-by: Celelibi <celelibi@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
We've now entered the 6.03 development cycle.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
firmware
Pull date fix for EFI from Gene Cumm,
* 'efi-date-for-mfleming' of git://github.com/geneC/syslinux:
efi/: Fix displayed version; add DATE
|
|
To fully support color tables with more than 256 entries
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
commit 60dabb5b1d6d ("pxe: Make the SENDCOOKIES feature for HTTP worked
again") introduced a regression for ldlinux because it references the
'SendCookies' symbol, which is only provided by PXELINUX.
The regression was caused because the '__weak' tag was dropped from the
declaration of SendCookies.
Tested-by: "Santillanes, Russel" <Russel.Santillanes@gs.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
There is a typo in the path used to decide whether to build gnu-efi.
Since the condition "does a nonexistent file exist?" will never evaluate
true, we're currently building gnu-efi unnecessarily.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Guard against future changes by requiring that the gnu-efi build scripts
exit with success.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Modify the scripts to check that they're called with the correct number
of arguments and error out otherwise after printing some helpful info.
This change also stops relying on passing arguments through environment
variables and instead passes them explicitly to the scripts, which is
definitely more robust, and handles the case where the scripts are
invoked directly.
Of course, now that the scripts can be invoked directly we need to
regard any input as hostile and exit immediately on error.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Now that we have a gnu-efi git submodule we need some scripts to build
and install it into architecture-specific build directories.
This actually simplifies things a bit because we no longer need to
account for the variations in distribution installation paths - we now
control the paths.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Tracking the gnu-efi dependency has tripped up some users. We can make
things easier when building Syslinux by including a copy of the gnu-efi
source and building it for efi32 and efi64.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Code refactoring had caused the http_bake_cookies() function to become
inaccessible and the SendCookies variable to be duplicated, causing
the sendcookies feature to not work.
Signed-off-by: H. Peter Anvin <hpa@linux.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>
|
|
Resolved Conflicts:
com32/lib/syslinux/disk.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
In checkin:
cb015497a4e4 isolinux: Update LBA in getlinsec loop
... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized. If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.
At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.
Reported-by: Carl Duff <cdrw2400@gmail.com>
Reported-by: Philip Müller <philm@manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
Version string appeared to be a temporary generic string; complete out in the
standard fashion
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
The __lowmem and __bss16 macros are only useful in the core itself.
Hide them from modules so people don't use them by mistake.
extern declarations don't need them (and are safe in modules), they
are only necessary at the point of definition (which must be in the
core.)
Signed-off-by: H. Peter Anvin <hpa@linux.intel.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>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Previously, even zero-length commands would be added to the history when
they shoudn't, e.g: just typing enter.
For example, if you type: FOO -> (ENTER) -> (ENTER),
then to get FOO from the history you would have to press the UP key
twice. It also saves a bit of memory.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
cmd_reverse_search has a bug that the variable cursor is updated even if a command
wasn't found. If this happens, and the next key falls into the default case,
memmove's size parameter would be a negative number.
This bug can be reproduced by doing the following:
On cmd_reverse_search (ctrl-r), type multiple keys at the same time.
'Enjoy' the triple fault and a screen of random colors.
There is also a small bug that turns the task of using (ctrl-r) on the first command
impossible. Previously, this command was discarded.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@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>
|
|
Previously, even zero-length commands would be added to the history when
they shoudn't, e.g: just typing enter.
For example, if you type: FOO -> (ENTER) -> (ENTER),
then to get FOO from the history you would have to press the UP key
twice. It also saves a bit of memory.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
cmd_reverse_search has a bug that the variable cursor is updated even if a command
wasn't found. If this happens, and the next key falls into the default case,
memmove's size parameter would be a negative number.
This bug can be reproduced by doing the following:
On cmd_reverse_search (ctrl-r), type multiple keys at the same time.
'Enjoy' the triple fault and a screen of random colors.
There is also a small bug that turns the task of using (ctrl-r) on the first command
impossible. Previously, this command was discarded.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@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>
|
|
git://github.com/geneC/syslinux into firmware
Pull various network stack fixes from Gene Cumm and adapt to the 6.xx
core_udp_* API,
* 'elflink-pxe-fixes-for-mfleming-2' of git://github.com/geneC/syslinux:
PXE ISR: Force polling on select hardware WORKAROUND
core/lwip: Fix NULL pointer check
PXE: use ddprintf macro
com32: Define ddprintf() macro
PXELINUX: specify PXE/lwIP
undiif: show thread of execution on UNDIIF_ID_DEBUG
core: dprintf() the banner.
PXELINUX: Use sendto() instead of connect()/send()/disconnect()
core: make mbox_post()/__sem_down_slow() check if valid
core: mbox/semaphore NULL checks
core/lwip/undi: Improve UNDIIF_ID_DEBUG messages
Conflicts:
core/fs/pxe/pxe.c
core/fs/pxe/tftp.c
core/init.c
|
|
By OUI == 00:23:ae and flags == 0xdc1b, detect select hardware.
On select platforms (Dell OptiPlex 760, Dell OptiPlex 960; perhaps
more), the interrupt appears to go "deaf" after a few seconds. By
matching MAC OUI and flags value, force polling on these select
platforms. I'm not sure if there's any better data available that
shallow in the core. I believe PCI IDs can be fetched with functions
from other libraries and the UUID and DMI data (the most likely to be
useful is SYSPRODUCT) is available in ldlinux.c32.
Commit message expanded with Matt Fleming's assistance
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
By OUI == 00:23:ae and flags == 0xdc1b, detect select hardware.
On select platforms (Dell OptiPlex 760, Dell OptiPlex 960; perhaps
more), the interrupt appears to go "deaf" after a few seconds. By
matching MAC OUI and flags value, force polling on these select
platforms. I'm not sure if there's any better data available that
shallow in the core. I believe PCI IDs can be fetched with functions
from other libraries and the UUID and DMI data (the most likely to be
useful is SYSPRODUCT) is available in ldlinux.c32.
Commit message expanded with Matt Fleming's assistance
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Messages are needed before ldlinux.c32 is loaded
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Duplicating Debug Printf; Certain warning/error printf()
statements are not visible if they occur before ldlinux.c32
is loaded
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Styled after SYSLINUX
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
This commit prevents a race-condition on systems that have functional
interrupts (observed with iPXE and select other Dell systems). Without
this, the reply packet could be received by the core prior to the
disconnect() call, see that it doesn't have a matching PCB (protocol
control block, iirc) since the reply has a different far-end UDP port
than the original request, and lwIP will discard the packet before
PXELINUX can see it.
net_core_sendto() instead of
net_core_connect() net_core_send() net_core_disconnect()
Commit message expanded with Matt Fleming's assistance
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
FTP passes an IP address and port number as decimal string encoded
comma-separated octets. The first four are the IP number and the
second two the port. We consider port numbers as ordinary integers
and they should be in host byte order when passed into
core_tcp_connect(), but IP addresses are simply kept in network byte
order at all times and thus should not be converted.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
|
If the mailbox/semaphore is invalid, disallow additions.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Also set mbox invalid and mbox pointer NULL when free()d
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Remove extra space; add TCP flags
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Booting the next device is in fact fairly trivial under EFI. We simply
need to return control to the firmware with an error code that indicates
we couldn't execute our OS loader properly.
Unlike under BIOS, we don't take any notice of any integer arguments
passed to LOCALBOOT for EFI, since there is no variation for "boot next
entry".
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
The menu modules, display, text, etc, require libmenu.c32 to be listed
as a dependency. Append to $(C_LIBS) in mk/elf.mk so that module
Makefiles can make use of the suffix rules.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Unresolved symbols in an object file cannot be resolved from shared
libraries that are listed earlier in $(LIBMENU). We need to put the
shared libraries at the end of $(LIBMENU).
commit 1408e6ca ("Add per-firmware object directory support") appears to
have broken this rule, which resulted in hdt.c32 (among other modules)
failing to load with,
"Undef symbol FAIL: symbol console_ansi_raw"
Add a simple regression test that loads hdt.c32.
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>
|
|
git://github.com/geneC/syslinux into firmware
Pull UNDIIF packet header debug patch series from Gene Cumm,
* 'elflink-undi-debug-for-mfleming' of git://github.com/geneC/syslinux:
Allow for UNDIIF_ID_DEBUG in 1 mk line
core/lwip/undiif: dprint MAC/ARP/IP/ICMP/TCP/UDP headers; poll debug
lwip/undiif: split arphdr._hwlen_protolen
lwip: Allow LWIP_PLATFORM_* output to use dprintf
lwip: undiif: Fix debug options to unique *_DEBUG macros
Conflicts:
core/kaboom.c
|
|
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>
|
|
Add a new test that verifies the kernel cmdline arguments we setup in
our config file are passed to the kernel correctly.
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>
|
|
We don't need to individually add the PXE regions, we already have two
symbols that denote the memory region that will be freed when calling
unload_pxe().
This essentially reverts commit 03dda0f1 ("pxe: mark all PXE regions as
SMT_TERMINAL").
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
There are more than just the UNDI code and data regions. Mark all of the
regions as SMT_TERMINAL if the start address and size are non-zero.
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>
|
|
We can exercise the memory subsystem through unit tests with a little
bit of coaxing. We need to create a number of fake data objects in order
to get it to build. This is less than ideal, but once we've got good
test coverage and confidence in our tests we can begin refactoring.
Had this unit test already been in place, commit 33c4ab1b ("mem: fix
regression in recent memscan changes") would have never been required
because buggy commit a1331f8d ("memscan: pass enum syslinux_memmap_types
around") would have broke the unit test. Ordinarily, this unit test
would have been part of the bugfix commit 33c4ab1b, but the bugfix needs
to be backported to 5.xx on its own.
test_mem_init_reserved() tests whether SMT_RESERVED regions are
incorrectly added to the memory subsystems's freelist.
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>
|
|
It is good practice to explicitly include required header files as it
clearly highlights dependencies.
This practice also makes it easier to write unit tests since we
explicitly include dummy header files from unittest/include.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
A thinko in commit a1331f8d ("memscan: pass enum syslinux_memmap_types
around") causes many machines not to boot because the expression
"!SMT_FREE" always evaluates to "false", regardless of the value of
'type', which means that mem_init() may use reserved memory regions for
general allocation.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Binary files exist in tests/ which can dramatically increase the size of
the release tarballs. Delete both regression and unit tests when
building any kind of a release.
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>
|
|
A number of Syslinux releases have contained regressions when compared
with previous versions. Now that the size of the derivative grid has
exploded (PXELINUX, SYSLINUX,.... bios, efi32, efi64) we need to have
some means of ensuring we don't introduce regressions so easily.
Start building a suite of regression tests. Regression tests should test
end-to-end functionality, e.g. loading a Linux kernel. If a test fails,
that failure represents a regression in some behaviour, e.g. Syslinux
behaves differently than it previously did.
The idea is that when bugs are reported in Syslinux, we can create new
tests that reproduce the buggy behaviour. Once a fix has been committed
the new test should pass. From that point forward, the test provides a
means of ensuring we never reintroduce that bug.
The collection of tests illustrates the agreed upon behaviour of
Syslinux.
To execute the regression testsuite type,
make regression
Sample output might look like,
Executing regression tests for SYSLINUX
Running Linux kernel regression tests...
[+] empty passed
[+] kernelhello passed
Running COM32 module regression tests...
[+] chaindisk passed
Executing regression tests for PXELINUX
Running Linux kernel regression tests...
[!] empty failed
[+] kernelhello passed
[+] pxetest passed
Qemu is used to execute the regression tests in a virtual environment.
Because it takes time to load Qemu, we can forgive the regression
testsuite for not executing instantaneously. However, developers should
keep in mind the idea of "failing fast" in their regression tests to
minimize execution time - that is, if a test is going to fail, make it
fail as quickly as possible to reduce the testrun time.
It's possible to have derivative-specific tests, where the test only
runs for a specific Syslinux boot loader. For an example see pxetest in
tests/linux/Makefile.
Currently the regression testsuite requires root privileges to execute
and makes several calls to sudo(8). In future it would be nice to get
rid of this requirement.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
All the BIOS get_derivative_info() implementations are incorrect. They
all dereference pointers to various deriviative-specific data objects
instead of using the address of the objects.
This broke chain loading on SYSLINUX because the ->partoffset field
contained the dereferenced value of 'Hidden' rather than the address.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Add comments and 1 line to mk/devel.mk to debug headers of all
packets sent/recieved through undiif.c.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Encapsulate in #ifdef; use snprintf and 1 dprintf-like statement.
Print debug message that polling has been forced
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
This reverts commit 8dc346bfdc871329624378d4b48db94b40d0b2a4.
Users are reporting a regression caused by this commit, as unlikely as
it seems. Revert in the hope that things will begin working for them
again.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
git://github.com/geneC/syslinux into firmware
Pull PXE legacynet DNS dotquad fix from Gene Cumm,
* 'pxe-dns-dotquad-for-mfleming' of git://github.com/geneC/syslinux:
core/legacynet: Enable dot quad resolution
|
|
in dnsresolv.c:dns_resolv()
Signed-off-by: Gene Cumm <gene.cumm@gmail.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>
|
|
Introduce a predicate inline to test for a valid terminal address.
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>
|
|
We can mark the memory region occupied by the PXE stack as SMT_TERMINAL
provided that KeepPXE isn't set. Historically some very old
non-relocatable kernel images (memtest86+) have a load address that
falls within the PXE stack region, so we need to attempt to load into
that region if at all possible.
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>
|
|
lwIP already split this in etharp.h
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
Don't reuse *_DEBUG macros intended for other source files.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
|
|
into firmware
Pull Makefile patch from Daniel Baumann,
* 'firmware' of git://daniel-baumann.ch/git/upstream/syslinux:
Excluding git metadata files in release tarballs.
|
|
We currently wait indefinitely in core_udp_recv() when reading packets.
Implement a timeout, which is what all the other network stacks do. By
timing out we are now able to handle packet loss on the network, e.g.
we'll now re-send TFTP requests instead of waiting for ACK packets that
will never come.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
|
|
Since we've now got support for dynamic debug, include mk/devel.mk in
prerelease tarballs so that users can enable that feature when building
from source.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
If distribution package maintainers follow the advice in
doc/distrib.txt for rebuilding the installers, they'll currently hit the
following error when executing 'make install'
install: cannot stat ‘com32/cmenu/libmenu/*.c32’: No such file or directory
Follow what every other module does and only delete .c32 files for the
spotless target.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Welcome to the 4.07 release cycle
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Avoid warnings about not being able to find any *.c32 files in
{efi32,efi64}/com32/elflink/ldlinux/ by explicitly referencing
$(LDLINUX).
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Typing 'make efi64 install' from a release tarball results in the
following make error,
make[3]: *** No rule to make target `/syslinux-6.02-pre3/efi64/efi/../core//writestr.o', needed by `syslinux.so'. Stop.
because make tries to build syslinux.so as it is missing from the
tarball.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
Otherwise the kernel may print "invisible" characters on the serial
console, because it doesn't reset the output device's character
attributes.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
The EFI handover protocol expects us to have setup the following fields,
o hdr.code32_start
o hdr.cmd_line_ptr
o hdr.ramdisk_image (if applicable)
o hdr.ramdisk_size (if applicable)
Which means we need to call handle_ramdisks() before handover_boot().
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|
|
We haven't loaded ldlinux.* at this point so we can't rely on the
console code being in a useful state. Use the EFI-specific Print()
instead.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
|