aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-01-24efi: Add Intel copyright noticesfirmwareMatt Fleming8-0/+32
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2014-01-17Merge branch 'elflink' into firmwareH. Peter Anvin3-8/+34
Resolved Conflict: diag/geodsp/Makefile Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-01-17Merge branch 'master' into elflinkelflinkH. Peter Anvin4-11/+37
Resolved Conflicts: NEWS core/fs/fs.c version Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-01-16.gitignore: Ignore the bios, efi32, efi64 object directoriesH. Peter Anvin1-0/+3
They are object output only. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-01-16dos: We cannot use memset() for a far object, introduce memset_sl()H. Peter Anvin3-1/+20
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>
2014-01-08diag/geodsp: README fixesGene Cumm1-7/+25
Should clarify the situation; also word-wrap & save example Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-08diag/geodsp: fix MakefileGene Cumm1-3/+3
Results in null image Reported-By: ioannis Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-08core/legacynet: Enable dot quad resolutionGene Cumm1-0/+35
in dnsresolv.c:dns_resolv() Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-08efi: Make the gnu-efi build scripts more portableMatt Fleming3-17/+16
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>
2014-01-02isolinux: Shorten a few of the debug messagesH. Peter Anvin1-2/+2
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>
2013-12-30Remove some whitespaceRuben Kerkhof1-1/+1
Signed-off-by: Ruben Kerkhof <ruben at rubenkerkhof.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-12-11isolinux: Clear upper half of EDX before usingH. Peter Anvin1-1/+1
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>
2013-12-11Merge remote-tracking branch 'origin/elflink' into firmwareH. Peter Anvin1-35/+11
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-12-11pxe, efi: Bad read of file size over TFTP on EFI64Celelibi1-35/+11
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>
2013-12-11version: Bump versionsyslinux-6.03-pre1Matt Fleming1-1/+1
We've now entered the 6.03 development cycle. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-12-11Merge branch 'efi-date-for-mfleming' of git://github.com/geneC/syslinux into ↵Matt Fleming2-2/+14
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
2013-12-11ansi: switch cindex type to attr_tJames Buren1-1/+2
To fully support color tables with more than 256 entries Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-12-11ldlinux: Fix recent pxe symbol regressionMatt Fleming1-1/+1
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>
2013-12-11efi: Don't rebuild gnu-efi every timeMatt Fleming1-1/+1
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>
2013-12-11efi: Check the gnu-efi build succeededMatt Fleming1-1/+5
Guard against future changes by requiring that the gnu-efi build scripts exit with success. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-12-11efi: Make gnu-efi build scripts more robustMatt Fleming3-5/+52
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>
2013-12-10efi: Add build scripts for gnu-efiMatt Fleming4-58/+35
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>
2013-12-10gnu-efi: Add gnu-efi as a submoduleMatt Fleming2-0/+3
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>
2013-12-06pxe: Make the SENDCOOKIES feature for HTTP worked againRussel Santillanes2-2/+2
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>
2013-12-04load_linux: Don't use size heuristic for non-relocatable kernelsH. Peter Anvin1-33/+40
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>
2013-11-26Merge remote-tracking branch 'origin/elflink' into firmwareH. Peter Anvin1-1/+1
Resolved Conflicts: com32/lib/syslinux/disk.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-11-26isolinux: Clear upper half of EDX before usingH. Peter Anvin1-1/+1
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>
2013-10-31efi/: Fix displayed version; add DATEGene Cumm2-2/+14
Version string appeared to be a temporary generic string; complete out in the standard fashion Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-10-17core: don't leak the __lowmem and __bss16 macros to modulesH. Peter Anvin2-3/+5
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>
2013-10-17chain: Fix chainloading on 6.02Raphael S. Carvalho1-8/+14
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>
2013-10-13NEWS: Add recent development newssyslinux-6.02Matt Fleming1-0/+4
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-09-30com32: Fix a bug on history of commands.Raphael S.Carvalho1-5/+8
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>
2013-09-30com32: Fix bugs on cmd_reverse_search (Triple fault dimension)Raphael S.Carvalho1-2/+9
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>
2013-09-30com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2-83/+97
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>
2013-09-30com32: Fix a bug on history of commands.Raphael S.Carvalho1-5/+8
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>
2013-09-30com32: Fix bugs on cmd_reverse_search (Triple fault dimension)Raphael S.Carvalho1-2/+9
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>
2013-09-30com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2-83/+97
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>
2013-09-30Merge branch 'elflink-pxe-fixes-for-mfleming-2' of ↵Matt Fleming18-69/+292
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
2013-09-30PXE ISR: Force polling on select hardware WORKAROUNDGene Cumm1-1/+21
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>
2013-09-23PXE ISR: Force polling on select hardware WORKAROUNDGene Cumm1-0/+20
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>
2013-09-23core/lwip: Fix NULL pointer checkGene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23PXE: use ddprintf macroGene Cumm3-26/+26
Messages are needed before ldlinux.c32 is loaded Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23com32: Define ddprintf() macroGene Cumm1-0/+3
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>
2013-09-23PXELINUX: specify PXE/lwIPGene Cumm2-2/+8
Styled after SYSLINUX Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23undiif: show thread of execution on UNDIIF_ID_DEBUGGene Cumm1-3/+7
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23core: dprintf() the banner.Gene Cumm1-0/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23PXELINUX: Use sendto() instead of connect()/send()/disconnect()Gene Cumm4-8/+94
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>
2013-08-31pxe, ftp: Don't convert an IP address to host byte orderH. Peter Anvin1-1/+1
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>
2013-08-03core: make mbox_post()/__sem_down_slow() check if validGene Cumm2-2/+2
If the mailbox/semaphore is invalid, disallow additions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-08-03core: mbox/semaphore NULL checksGene Cumm5-24/+41
Also set mbox invalid and mbox pointer NULL when free()d Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-08-03core/lwip/undi: Improve UNDIIF_ID_DEBUG messagesGene Cumm1-8/+9
Remove extra space; add TCP flags Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-08-02efi: implement LOCALBOOTsyslinux-6.02-pre16Matt Fleming1-1/+10
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>
2013-07-29cmenu: Add libmenu.c32 to $(C_LIBS)syslinux-6.02-pre15Matt Fleming2-1/+3
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>
2013-07-29cmenu: the order of entries in $(LIBMENU) is vitalMatt Fleming4-6/+18
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>
2013-07-26module: convert to dprintf() to aid debuggingsyslinux-6.02-pre14Matt Fleming3-16/+23
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>
2013-07-26Merge branch 'elflink-undi-debug-for-mfleming' of ↵syslinux-6.02-pre13Matt Fleming5-44/+300
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
2013-07-26tests: unit test bios_boot_linux()Matt Fleming7-1/+206
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>
2013-07-26video.h: we need one syslinux_force_text_mode() prototypeMatt Fleming10-3/+9
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>
2013-07-26tests: syslinux_memmap_highest() unit testsMatt Fleming1-0/+66
Exercise the new syslinux_memmap_highest() function. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-25load_linux: dynamically calculate the cmdline regionsyslinux-6.02-pre12Matt Fleming3-4/+74
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>
2013-07-25tests: verify kernel cmdline parameterMatt Fleming3-2/+14
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>
2013-07-25load_linux: extract the logic for cmdline_offsetMatt Fleming1-4/+10
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>
2013-07-25pxe: use bios_fbm() and real_base_mem to calculate free spaceMatt Fleming1-47/+7
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>
2013-07-25NEWS: document changes in 4.07syslinux-4.07Matt Fleming1-0/+8
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-24pxe: mark all PXE regions as SMT_TERMINALsyslinux-6.02-pre11Matt Fleming1-17/+49
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>
2013-07-24tests: delete test executables after each runMatt Fleming1-3/+1
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>
2013-07-24tests: unit tests for core/memMatt Fleming6-1/+142
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>
2013-07-24tests: make mmap_entry globally available to unit testsMatt Fleming7-25/+26
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>
2013-07-24mem: explicitly include dprintf.hMatt Fleming1-0/+1
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>
2013-07-23mem: fix regression in recent memscan changessyslinux-6.02-pre10Matt Fleming1-1/+1
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>
2013-07-23tests: delete tests before making releaseMatt Fleming1-0/+5
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>
2013-07-23tests: Syslinux unit testsMatt Fleming18-2/+549
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>
2013-07-23tests: Regression testsuiteMatt Fleming19-2/+409
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>
2013-07-22derivative_info: be sure not to dereference pointerssyslinux-6.02-pre9Matt Fleming3-15/+15
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>
2013-07-20Allow for UNDIIF_ID_DEBUG in 1 mk linesyslinux-5.11-pre9Gene Cumm2-1/+5
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>
2013-07-20core/lwip/undiif: dprint MAC/ARP/IP/ICMP/TCP/UDP headers; poll debugGene Cumm2-1/+220
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>
2013-07-19Revert "Makefile.private: only delete mk/devel.mk for production releases"syslinux-6.02-pre8Matt Fleming1-4/+3
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>
2013-07-19Merge branch 'pxe-dns-dotquad-for-mfleming' of ↵syslinux-6.02-pre7Matt Fleming1-0/+35
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
2013-07-18core/legacynet: Enable dot quad resolutionGene Cumm1-0/+35
in dnsresolv.c:dns_resolv() Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-18movebits: Handle arbitrary combinations of SMT_FREE and SMT_TERMINALsyslinux-6.02-pre6H. Peter Anvin1-29/+13
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>
2013-07-17zonelist: allow syslinux_memmap_type() to demote SMT_FREE to SMT_TERMINALH. Peter Anvin1-5/+16
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>
2013-07-17movebits: add an inline to test for SMT_FREE || SMT_TERMINALH. Peter Anvin1-0/+5
Introduce a predicate inline to test for a valid terminal address. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2013-07-17movebits: allow allocation across region boundaryMatt Fleming1-1/+16
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>
2013-07-17PXELINUX: Add bios memscan functionMatt Fleming1-0/+35
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>
2013-07-17memscan: build a linked list of memory scannersMatt Fleming5-129/+171
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>
2013-07-17movebits: Add SMT_TERMINAL - a last resort region typeMatt Fleming3-2/+3
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>
2013-07-17memscan: pass enum syslinux_memmap_types aroundMatt Fleming4-14/+18
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>
2013-07-17movebits: Add syslinux_memmap_find()Matt Fleming3-74/+84
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>
2013-07-17zonelist: rename syslinux_memmap_find()...Matt Fleming5-10/+10
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>
2013-07-13lwip/undiif: split arphdr._hwlen_protolenGene Cumm1-5/+7
lwIP already split this in etharp.h Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12lwip: Allow LWIP_PLATFORM_* output to use dprintfGene Cumm1-2/+12
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12lwip: undiif: Fix debug options to unique *_DEBUG macrosGene Cumm2-35/+56
Don't reuse *_DEBUG macros intended for other source files. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12Merge branch 'firmware' of git://daniel-baumann.ch/git/upstream/syslinux ↵Matt Fleming1-1/+1
into firmware Pull Makefile patch from Daniel Baumann, * 'firmware' of git://daniel-baumann.ch/git/upstream/syslinux: Excluding git metadata files in release tarballs.
2013-07-12efi, udp: implement receive timeoutsyslinux-6.02-pre5Matt Fleming1-1/+16
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>
2013-07-12Excluding git metadata files in release tarballs.Daniel Baumann1-1/+1
2013-07-12Makefile.private: only delete mk/devel.mk for production releasessyslinux-6.02-pre4Matt Fleming1-3/+4
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>
2013-07-12NEWS: Mention fixing of make targetsMatt Fleming1-0/+3
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-12cmenu: only the spotless target should delete *.c32Matt Fleming1-3/+3
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>
2013-07-12Makefile: add netinstall target for efiMatt Fleming1-2/+10
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-12version: bump version and datesyslinux-4.07-pre1Matt Fleming1-1/+1
Welcome to the 4.07 release cycle Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-11Makefile: explicitly reference ldlinux.*Matt Fleming1-1/+1
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>
2013-07-11efi: 'install' target shouldn't depend on 'all'Matt Fleming1-1/+1
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>
2013-07-09efi: restore console before invoking handover_boot()syslinux-6.02-pre3Matt Fleming1-0/+1
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>
2013-07-09efi: setup ramdisk before invoking handover protocolMatt Fleming1-3/+3
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>
2013-07-09efi: Convert printf() to Print()Matt Fleming1-1/+1
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>
2013-07-08NEWS: Catch up with recent changes in 6.02syslinux-6.02-pre2Matt Fleming1-0/+5
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08Merge branch 'kernel-loader' into for-hpa/elflink/firmwareMatt Fleming7-234/+476
Conflicts: efi/efi.h
2013-07-08efi, console: save/restore attributes before exitingMatt Fleming3-1/+32
The Linux kernel doesn't use ANSI attributes when writing to the serial console, so make sure we restore the default attributes that were set when we were initially executed by the firmware. Failure to do so can result in 'invisible' characters being written to the console. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08Merge tag 'syslinux-5.11-pre8' into firmwaresyslinux-6.02-pre1Matt Fleming19-112/+227
syslinux-5.11-pre8 Conflicts: NEWS com32/lib/Makefile core/conio.c mk/devel.mk mk/elf.mk
2013-07-08version: bump versionMatt Fleming1-1/+1
Welcome to the 6.02 release cycle. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: move all screen twiddling to setup_screen()Matt Fleming2-6/+4
We can defer all modifications of ->screen_info to setup_screen(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: only want one linux_header variableMatt Fleming1-17/+23
There have been various bugs as a result of having multiple variables for the linux_header struct. Move the header validation to another function so that we don't have to keep track of two copies. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: update the correct linux_header pointer for cmdlineMatt Fleming1-1/+1
We're updating the cmd_line_ptr field of the wrong linux_header, so the command line isn't being passed to the kernel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: get rid of _bp variableMatt Fleming1-24/+23
It's super confusing having 'bp' and '_bp'. Move the allocation of our boot_params much earlier so that we only need one variable to track a boot params structure. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: refactor into smaller functionsMatt Fleming1-170/+225
efi_main() is pretty large and could definitely be made clearer by moving various chunks into their own functions. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: implement Linux kernel handover protocol supportMatt Fleming5-6/+150
The handover protocol is the preferred method of booting kernels on EFI because it allows workarounds for various firmware bugs to be contained in one place and applied irrespective of the chosen bootloader. Use it if available, but ensure that we fallback to the legacy boot method. Also, update the linux_header structure with recent changes made in the kernel source. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-08efi: try harder to boot non-relocatable kernelsMatt Fleming1-8/+8
We don't absolutely need a kernel to be built with CONFIG_RELOCATABLE=y in order to boot it. We can try and place the kernel image as its preferred address, and if that fails and the image isn't relocatable, then we can bail. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-05Merge branch 'dynamic-debug' into elflinksyslinux-5.11-pre8Matt Fleming10-6/+182
2013-07-05mk: enable dynamic debug supportMatt Fleming1-0/+1
This will probably be disabled for releases, but it's definitely worthwhile having enabled for all prereleases. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-05debug.c32: Dynamically enable/disable debug code at runtimeMatt Fleming7-3/+178
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>
2013-07-05mk: include $(GCCWARN) when building ELF objectsMatt Fleming2-3/+3
It's currently impossible to turn on dprintf() statements in com32/modules because $(GCCWARN) isn't used as part of $(CFLAGS). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-04NEWS: Add entries for 6.01syslinux-6.01Matt Fleming1-0/+15
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-04Merge tag 'syslinux-5.11-pre4' into firmwareMatt Fleming1-4/+3
syslinux-5.11-pre4
2013-07-04efi: use unsigned long to represent addressesMatt Fleming1-2/+2
This fixes a valid compiler warning on 64-bit about "cast from pointer to integer of different size". Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-04efi: workaround upstream gnu-efi compiler warningsMatt Fleming1-0/+3
/usr/local/include/efi/efiapi.h:663:5: warning: function declaration isn’t a prototype [-Wstrict-prototypes] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-04firmware: s/set_mode/text_mode/Matt Fleming4-6/+6
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>
2013-07-03Merge branch 'idle' into elflinksyslinux-5.11-pre7Matt Fleming6-79/+6
2013-07-03idle: Consolidate idle implementationsMatt Fleming6-79/+5
Duplicate code is bad. Move all the idle code to C and delete the old assembly stuff. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-03idle: enable interrupts before idlingMatt Fleming1-0/+1
Users are *still* reporting executing __idle() with interrupts disabled, which ultimately leads to a hang. Just enable them explicitly before idling. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-03Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflinksyslinux-5.11-pre6Matt Fleming2-5/+6
Pull doc/ and txt/ spelling corrections from Gene Cumm, * 'doc-for-mfleming' of git://github.com/geneC/syslinux: doc/ & txt/: Spelling fix
2013-07-03efi: only read ADV when booting from disksyslinux-6.01-pre6Matt Fleming2-85/+17
We aren't expecting to be able to access ldlinux.sys when booting over PXE. Follow the pre-5.00 behaviour and simply initialise the ADV buffer without even attempting to open the file. Also, delete all references to EXTLINUX, we do not support it under EFI. Without this patch we hang in efi_open() when booting PXELINUX because no root volume is set as we're not booting from disk. This regression was caused by commit a17fdfb8 ("com32: Catch up with GCC changes to ctor/dtor funcs") because now constructors are actually being invoked on EFI and efi_adv_init() is called by __syslinux_init(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-03efi: update derivative info on bootMatt Fleming3-9/+14
Various bits of Syslinux use the filesystem type of the derivative info structure to figure out how we were booted. Update this for SYSLINUX and PXELINUX. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-02core: we only need one reset_idle()Matt Fleming3-9/+3
We don't need both an assembly version of reset_idle and an implementation in C. Having these two functions has led to a bug where we may idle with interrupts disabled because an 'sti' is only performed in the assembly version. This lead to a hang waiting for user input. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-01doc/ & txt/: Spelling fixGene Cumm2-5/+6
Also add octal note. Reported-By: Ady <ady-sf@hotmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-01load_linux: validate sanity of 'initrd_addr_max'syslinux-5.11-pre5Matt Fleming1-1/+1
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>
2013-07-01load_linux: Add dprintf statements to aid debuggingMatt Fleming1-12/+29
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>
2013-07-01conio: Fix pollchar() for serial consolesyslinux-5.11-pre4Matt Fleming1-4/+3
The check of the LSR value was inverted. This resulted in pollchar() always claiming that there was data to be read from the serial console. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-28Merge tag 'syslinux-5.11-pre3' into firmwaresyslinux-6.01-pre5Matt Fleming17-106/+927
syslinux-5.11-pre3 Conflicts: core/Makefile
2013-06-28com32: Catch up with GCC changes to ctor/dtor funcsMatt Fleming3-193/+8
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>
2013-06-27Makefile: make gpxe/ depend on core/Gene Cumm1-0/+1
Paralleling sometimes fails depending on pxelinux.0 Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-27ldlinux: fix INCLUDE regressionsyslinux-5.11-pre3Matt Fleming1-22/+70
We don't want to overwrite 'ConfigName' when parsing a config file via the INCLUDE directive, which commit 5447ef821 ("ldlinux: Always update ConfigName when opening a config file") failed to take into account. In the INCLUDE case we're only parsing config fragments, and not a main config file. Rename parse_one_config() to parse_main_config() to more accurately reflect when it should be invoked (i.e. not for INCLUDE). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-27bios, font: zero input registers to get fontsyslinux-6.01-pre4Matt Fleming1-0/+2
Users are reporting font issues under VirtualBox. Try this as a speculative fix since the old 5.x behaviour was to pass in a partially zero'd register set. Incidentally, the input regs are also used for output, so at least we now avoid potentially constructing a pointer to the font buffer using garbage register values. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-26PXELINUX: implement our own version of local_boot16Matt Fleming3-6/+66
We need to do different things for PXE, such as reset the PXE environment when booting from the local disk from PXELINUX. This fixes a localboot regression. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-26Merge branch 'ipappend-fix-for-mfleming' of git://github.com/geneC/syslinux ↵Matt Fleming4-4/+7
into elflink Pull patches to standardize and document IPAPPEND/SYSAPPEND from Gene Cumm, * 'ipappend-fix-for-mfleming' of git://github.com/geneC/syslinux: doc/ & txt/: Document IPAPPEND/SYSAPPEND format core & menu: fix IPAPPEND/SYSAPPEND conversion
2013-06-26doc/ & txt/: Document IPAPPEND/SYSAPPEND formatGene Cumm2-2/+5
Previously the maximum value was 7 which didn't require differentiation between decimal and hexadecimal.
2013-06-26core & menu: fix IPAPPEND/SYSAPPEND conversionGene Cumm2-2/+2
Make both use the same functions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-26efi, tcp: fill out the IP TTL fieldMatt Fleming1-0/+2
Since the UEFI specification doesn't state that the firmware is responsible for filling out this field if it's unset (though some will set a default value) we need to do it ourselves. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-26efi, udp: fill out the IP TTL fieldsyslinux-6.01-pre3Matt Fleming1-0/+1
Some firmware implementations fill out a default value for the Time To Live field when none is set, others do not. Since the UEFI specification doesn't mandate that the firmware set this field, we need to do it ourselves. Pick the recommended value of 64. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-26efi, udp: use single local port for each connectionsyslinux-6.01-pre2Matt Fleming2-22/+55
The TFTP protocol uses the local port as an idenitifer during a transfer (TID), which means that once we've established a TFTP connection, we must ensure we reuse the same local port number in each packet. Failure to do so is an error, which causes the TFTP server to send an error packet. From RFC 1350 - THE TFTP PROTOCOL (REVISION 2), Section 4, In the next step, and in all succeeding steps, the hosts should make sure that the source TID matches the value that was agreed on in steps 1 and 2. If a source TID does not match, the packet should be discarded as erroneously sent from somewhere else. An error packet should be sent to the source of the incorrect packet, while not disturbing the transfer. Once the UDPv4 protocol driver has been assigned a local port number (which happens on the first core_udp_connect()) reuse that number until core_udp_close() time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-25efi: Support booting 32-bit kernels from 64-bit EFIMatt Fleming4-65/+74
The default scheme for booting Linux kernels should be to switch to 32-bit protected mode and jump to the start of the kernel image. The kernel has always had the know-how to switch 64-bit capable CPUs into 64-bit mode if necessary. By using this scheme, we can transparently boot either 32-bit or 64-bit kernels. This change necessitated moving kernel_jump() to a .S file for both i386 and x86-64. Writing inline assembly is fun for about 5 minutes, but then becomes monstrously tedious. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-24core: remove unused header file vkernel.incH. Peter Anvin2-36/+0
vkernel.inc is related to the old assembly-based config file parser; it is no longer relevant. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-06-24Merge branch 'menu-ipappend-1-for-mfleming' of ↵Matt Fleming1-3/+5
git://github.com/geneC/syslinux into elflink Pull a fix for the SYSAPPEND directive from Gene Cumm, * 'menu-ipappend-1-for-mfleming' of git://github.com/geneC/syslinux: menu.c32: Fix SYSAPPEND
2013-06-24efi: there are no EFI installer componentsMatt Fleming2-3/+1
Users are reporting hitting the following error when typing 'make installer', make[3]: *** No rule to make target `efi32/core/codepage.o', needed by `syslinux.so'. Stop. But there's no actual need to build any installers for EFI (none exist), especially not since the stuff in utils/ is already built for BIOS and doesn't need building again. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-24Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflinkMatt Fleming8-36/+779
Pull txt/ and doc/ updates from Gene Cumm, * 'doc-for-mfleming' of git://github.com/geneC/syslinux: txt/syslinux.txt: rewrap long command txt/Makefile: add isolinux.txt, pxelinux.txt txt/: Add isolinux.txt, pxelinux.txt txt/syslinux-cli.txt: Version on Ctrl-N txt/Makefile: order-only prerequisite txt/: Add common file for derivatives txt/syslinux.cfg.txt: Updates txt/syslinux.txt: synopsis, extlinux.sys, wrap long command txt/syslinux-cli.txt: Path rules txt/syslinux.cfg.txt: Add SENDCOOKIES, example config txt/syslinux.cfg.txt: Add SYSAPPEND doc/syslinux.txt: grammar Fix SERIAL directive in docs
2013-06-24version: bump versionsyslinux-6.01-pre1Matt Fleming1-1/+1
Welcome to the 6.01 release cycle. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-24load_linux: fallback to the BIOS linux loaderMatt Fleming1-6/+5
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>
2013-06-23menu.c32: Fix SYSAPPENDGene Cumm1-3/+5
Using the SYSAPPEND directive would examine "D" instead of the value after the directive. Also allows a 1-step switch to strtol() Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/syslinux.txt: rewrap long commandGene Cumm1-2/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/Makefile: add isolinux.txt, pxelinux.txtGene Cumm1-2/+4
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/: Add isolinux.txt, pxelinux.txtGene Cumm2-0/+577
Reformatted from previous in doc/. Reflow to try to be more manpage-like and put more commonly used information on the top. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/syslinux-cli.txt: Version on Ctrl-NGene Cumm1-1/+1
Only on some versions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-21efi: Tag symbols with __exportMatt Fleming2-2/+2
I missed some symbols previously that are required to be exported when loading vesamenu.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-21efi: Export __bcopyxx_lenMatt Fleming2-1/+2
We need to provide a __bcopyxx_len symbol for EFI because it's referenced in generic code in libcom32.c32. Without this change, libcom32.c32 will fail to load under EFI. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: delete unused varaiblessyslinux-6.00Matt Fleming1-2/+0
efi/main.c: In function ‘find_addr’: efi/main.c:527:9: warning: unused variable ‘addr’ [-Wunused-variable] efi/main.c:524:13: warning: unused variable ‘status’ [-Wunused-variable] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20mk: stop complaining about unused parametersMatt Fleming1-1/+2
Now that we've got the firmware abstraction, many backend functions don't use all of their parameters, and it isn't necessarily something we want to warn about all the time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: return a value from sem_down()Matt Fleming1-0/+1
GCC is rightly complaining that we aren't returning a value from sem_down() like we should be, efi/main.c: In function ‘sem_down’: efi/main.c:174:1: warning: control reaches end of non-void function [-Wreturn-type] It doesn't really matter what value we return because the return value is only used in core/thread which EFI doesn't need. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: provide prototype for load_env32()Matt Fleming2-1/+3
To get rid of the following GCC warning, efi/main.c:1237:2: warning: implicit declaration of function ‘load_env32’ [-Wimplicit-function-declaration] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: fix a bunch of casting to different size warnings,Matt Fleming1-4/+9
e.g. efi/main.c:997:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] efi/main.c:999:30: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: fix comparison between signed and unsigned typesMatt Fleming1-8/+4
GCC is complaining, efi/main.c:534:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-20efi: fix prototype of efi_erase()Matt Fleming1-2/+1
and address the following compiler warning, efi/main.c:263:2: warning: initialization from incompatible pointer type [enabled by default] efi/main.c:263:2: warning: (near initialization for ‘efi_ops.erase’) [enabled by default] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: forward declare 'struct semaphore'Matt Fleming1-0/+1
We don't need to include thread.h because struct semaphore is never actually used in the EFI code. Fixes, efi/main.c:171:26: warning: ‘struct semaphore’ declared inside parameter list [enabled by default] efi/main.c:171:26: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: cast third argument to HandleProtocol()Matt Fleming1-4/+6
and fix a bunch of compiler warnings along the lines of, efi/console.c:86:3: warning: passing argument 3 of ‘BS->HandleProtocol’ from incompatible pointer type [enabled by default] efi/console.c:86:3: note: expected ‘void **’ but argument is of type ‘struct EFI_GRAPHICS_OUTPUT_PROTOCOL **’ Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: don't compare integers of different signsMatt Fleming1-4/+4
Appease gcc and fix the following warning, efi/console.c: In function ‘setup_gop’: efi/console.c:81:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: cast to avoid compiler warningMatt Fleming1-1/+1
efi/tcp.c: In function ‘core_tcp_fill_buffer’: efi/tcp.c:210:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: include <string.h> for memcpy()/memset()Matt Fleming1-0/+1
and fix these warnings, efi/adv.c: In function ‘cleanup_adv’: efi/adv.c:48:5: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration] efi/adv.c: In function ‘syslinux_reset_adv’: efi/adv.c:54:5: warning: implicit declaration of function ‘memset’ [-Wimplicit-function-declaration] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: include <string.h> for memcpy()Matt Fleming1-0/+1
to fix this warning, efi/mem.c: In function ‘efi_realloc’: efi/mem.c:14:2: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19ldlinux: fix definition of 'Hidden'Matt Fleming1-1/+1
and fix this compiler warning, core/ldlinux-c.c: In function ‘get_derivative_info’: core/ldlinux-c.c:18:22: warning: assignment makes pointer from integer without a cast [enabled by default] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19isolinux: fix type declarationsMatt Fleming1-2/+2
and fix the following compiler warnings, core/isolinux-c.c:19:22: warning: assignment makes pointer from integer without a cast [enabled by default] core/isolinux-c.c:21:21: warning: assignment makes pointer from integer without a cast [enabled by default] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19isolinux: use parenthesis to clarify operator precedenceMatt Fleming1-1/+1
and fix the following compiler warning, core/isolinux-c.c: In function ‘get_derivative_info’: core/isolinux-c.c:17:2: warning: suggest parentheses around ‘-’ inside ‘>>’ [-Wparentheses] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19bios: fix definition of 'bios_free_mem'Matt Fleming1-1/+1
and fix the following compiler warning, core/bios.c: In function ‘bios_init’: core/bios.c:515:16: warning: assignment makes integer from pointer without a cast [enabled by default] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19ipappend: delete .ipappend_strings()Matt Fleming3-35/+0
It's no longer referenced anywhere as everything has now moved to *sysappend*. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19firmware: correct the get_cursor() argument typesMatt Fleming3-3/+3
We only ever pass uint8_t * to get_cursor(), so update the prototypes and fix the following compiler warnings, In function ‘__ansicon_open’: com32/lib/sys/ansicon_write.c:93:6: warning: passing argument 1 of ‘firmware->o_ops->get_cursor’ from incompatible pointer type [enabled by default] com32/lib/sys/ansicon_write.c:93:6: note: expected ‘int *’ but argument is of type ‘uint8_t *’ com32/lib/sys/ansicon_write.c:93:6: warning: passing argument 2 of ‘firmware->o_ops->get_cursor’ from incompatible pointer type [enabled by default] com32/lib/sys/ansicon_write.c:93:6: note: expected ‘int *’ but argument is of type ‘uint8_t *’ Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19com32: add prototype for get_derivative_info()Matt Fleming1-0/+2
and fix the following compiler warning, In function ‘__syslinux_get_derivative_info’: com32/lib/syslinux/dsinfo.c:37:5: warning: implicit declaration of function ‘get_derivative_info’ [-Wimplicit-function-declaration] Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19load_linux: return a non-void value to fix compiler warningMatt Fleming1-2/+2
->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>
2013-06-19NEWS: Add entry for EFI network supportMatt Fleming1-0/+2
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19version: We're now in 2013Matt Fleming1-1/+1
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19ansi: partially revert 937f816addb214ca4c8c1ce977e0357eafa8c617Matt Fleming1-5/+1
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>
2013-06-19efi: Turn on symbol export whitelistMatt Fleming8-12/+13
Reduce the default visibility of objects in efi/ as was done for BIOS in commit e4b3ce2dd82c ("Symbol export whitelist"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19efi: Mark global BIOS-only symbols as __weakMatt Fleming2-8/+10
Unfortunately, there are still some references in generic code to symbols that only make sense under BIOS. Use the __weak tag to allow building for EFI without having to declare these symbols. Accessing these __weak symbols under EFI will generate an error at runtime, indicating to the user that they're executing a BIOS code path. The long-term solution is to move these BIOS-specific symbols into core/bios.c or somewhere equally BIOS-centric so that these symbols are no longer global. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-19mk: reinstate -mregparm for BIOSMatt Fleming4-0/+17
There's still a bunch of assembly code that assumes we're building our C objects with -mregparm=3. For example, the code to transition from 16-bit real-mode mode to 32-bit protected mode assumes this. Violating this assumption leads to various hangs, caused by garbage function arguments. Put back -mregparm into CFLAGS that was removed in commit 8789d2689564 ("mk/embedded.mk: Don't use -mregparm in core"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-17Merge tag 'syslinux-5.11-pre2' into firmwareMatt Fleming12-117/+187
syslinux-5.11-pre2 Conflicts: core/elflink/load_env32.c version
2013-06-17txt: always rebuild necessary directoriesMatt Fleming1-1/+4
Even if they're found in VPATH. This change ensures that txt/html is ignored in the source directory and that $(OBJ)/txt/html is always created in the output directory, avoiding the following error, asciidoc: FAILED: syslinux.txt: line 8: unexpected error: asciidoc: ------------------------------------------------------------ Traceback (most recent call last): File "/usr/bin/asciidoc", line 6016, in asciidoc writer.open(outfile, reader.bom) File "/usr/bin/asciidoc", line 4430, in open self.f = open(fname,'wb+') IOError: [Errno 2] No such file or directory: '/syslinux.git/efi64/txt/html/syslinux.html' Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-14cli: don't disable linewrap when redrawing the cmdlinesyslinux-5.11-pre2Matt Fleming1-1/+1
It messes things up when we want to use printf(), for example when printing labels after the user has hit the TAB key. This fixes a bug where labels would be printed on a single line on the screen (with some being displayed off screen) when they should have been printed across multiple lines. I can't think of a reason to disable linerap when redrawing the command line - so let's not. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-13ldlinux: fix loading of kbdmap filesMatt Fleming1-9/+2
Use the canonical code sequence for opening the kbdmap file instead of referencing KernelName, which presumably is a remanent of the old assembly code. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-13txt/Makefile: order-only prerequisiteGene Cumm1-3/+3
No need to rebuild when the directory's timestamp is updated. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-13PATH: use a linked list internallysyslinux-5.11-pre1Matt Fleming6-67/+109
In retrospect, choosing the colon character as the entry separator for the PATH directive was not a smart move, as that character is also used in TFTP-style paths. This conflict manifests as PXELINUX being unable to find and load files. An example dnsmasq log looks like, dnsmasq-tftp: sent /arch/boot/syslinux/lpxelinux.0 to 192.168.0.90 dnsmasq-tftp: file /arch/ldlinux.c32 not found dnsmasq-tftp: file /arch//ldlinux.c32 not found dnsmasq-tftp: file /arch//boot/isolinux/ldlinux.c32 not found dnsmasq-tftp: file /arch//isolinux/ldlinux.c32 not found dnsmasq-tftp: file /arch//boot/syslinuxldlinux.c32 not found dnsmasq-tftp: sent /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90 dnsmasq-tftp: error 0 No error, file close received from 192.168.0.90 dnsmasq-tftp: failed sending /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90 dnsmasq-tftp: sent /arch/boot/syslinux/archiso.cfg to 192.168.0.90 dnsmasq-tftp: sent /arch/boot/syslinux/whichsys.c32 to 192.168.0.90 dnsmasq-tftp: file /arch/libcom32.c32 not found dnsmasq-tftp: file /arch//libcom32.c32 not found dnsmasq-tftp: file /arch/libcom32.c32 not found dnsmasq-tftp: file /arch//arch//boot/syslinux/libcom32.c32 not found The last line of the log is the indication that there's a problem. Internally, Syslinux adds the location of ldlinux.c32 to PATH by querying the current working directory once ldlinux.c32 is successfully loaded. Under PXELINUX that means the initial PATH string will be, "::/arch/boot/syslinux/" The PATH parsing code doesn't know how to correctly parse the "::" string and hence, the file is searched for relative to the 210 dhcp option directory - /arch/. Implement PATH with a linked list which *greatly* simplifies the path code, and means we no longer have to parse strings backwards and forwards. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-12txt/: Add common file for derivativesGene Cumm1-0/+11
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-12txt/syslinux.cfg.txt: UpdatesGene Cumm1-26/+39
DEFAULT often references a LABEL; TIMEOUT action affected by UI. IPAPPEND/SYSAPPEND: wrap SYSAPPEND; notes on mask values 2,1. TIMEOUT-related clarifications SERIAL is sticky PATH updated for 5.10-next with notes Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-12txt/syslinux.txt: synopsis, extlinux.sys, wrap long commandGene Cumm1-6/+8
Add -v/--version to synopsis; add note on extlinux.sys from old versions; Wrap altmbr command for cleaner manpage Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-12txt/syslinux-cli.txt: Path rulesGene Cumm1-0/+28
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>