aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix all warnings, and better separate code that should not be mixedsyslinux-6.04-pre3H. Peter Anvin (Intel)2019-02-0710-78/+71
| | | | | | | | | Clean up a number of warnings in the tree. Refactor especially the core code so we don't end up building a bunch of BIOS-specific code for EFI, and general build cleanups. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* install: don't install obsolete file com32.ldH. Peter Anvin (Intel)2019-02-061-1/+0
| | | | | | | | com32.ld has been obsolete for a long time, and has been removed now; don't install it either. Reported-by: Joakim Tjernlund <Joakim.Tjernlund@infinera.com> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
* libpng: update to 1.6.36H. Peter Anvin2019-02-0426-16533/+30588
| | | | | | Update libpng to version 1.6.36 due to errata in earlier versions. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Reorganize and clean up a bunch of the x86 codeH. Peter Anvin2019-02-0410-200/+72
| | | | | | | We were doing a bunch of i386-specific things even on x86-64. Fix this, and merge x86 definitions where possible. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: remove setjmp.S stub fileH. Peter Anvin2019-02-041-8/+0
| | | | | | Compile setjmp.S directly out of the $(ARCH) directory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* libcc: move libgcc files into arch-specific directoriesH. Peter Anvin2019-02-0410-0/+0
| | | | | | | | We would compile these for for x86-64 even though they are i386-specific; the resulting code was meaningless but nevertheless included in the output. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32/lib: clean up unused filesH. Peter Anvin2019-02-046-613/+2
| | | | | | Clean up obsolete unused files; simplify setjmp.S stub Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* zlib: update to version 1.2.11H. Peter Anvin2019-01-2819-989/+1394
| | | | | | Update zlib to version 1.2.11 due to errata in previous versions. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* pxe: Fix recognition of keeppxe optionAdam Goldman2017-03-051-1/+11
| | | | | | | | | | | | | | | The preprocessor directive IS_PXELINUX is no longer valid. Submitted-by: Adam Goldman <adamg@pobox.com> Move "keeppxe" processing from com32/elflink/ldlinux/kernel.c:new_linux_kernel() to com32/lib/syslinux/load_linux.c:bios_boot_linux() using strstr() (not find_argument in original patch). Should also be processed by firmware->boot_linux() if not yet done. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* pxe_dns: remove obsolete pxe_dns.c wrapperH. Peter Anvin2016-04-062-68/+0
| | | | | | | | | We used to need a wrapper around the core function dns_resolv() to implement pxe_dns(), because the former function required its argument to live in low memory. This is no longer the case and hasn't been for a while, so remove this unnecessary level of indirection. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Makefile: make the handling of firmware selection a little sanerH. Peter Anvin2016-02-091-1/+1
| | | | | | Clean up the handling of firmware selection inside the Makefiles. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: Handle broken modules.aliasErwan Velu2015-12-061-0/+8
| | | | | | | | When parsing the modules.alias, we shall report it as broken if we cannot find any valid line in it. This patch simply count the number of valid lines and report a missing modules.alias if no valid lines are found.
* chrreplace: Don't skip the first characterJosh Triplett2015-09-281-1/+1
| | | | | | | Check if the first character matches the character to replace, rather than skipping it and starting with the second. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
* zlib: use (void(0)) instead of empty #definesPatrick Masotta2015-09-131-6/+6
| | | | | | Originally-By: Patrick Masotta <masottaus@yahoo.com> [Use (void(0)) instead of a dummy function - gene.cumm@gmail.com] Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* Use z width specifier when printing size_t variableJonathan Boeing2015-05-031-1/+1
| | | | | | | Fixes the warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'size_t' Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
* add missing '\n' to dprintfJonathan Boeing2015-05-031-2/+2
| | | | Signed-off-by: Jonathan Boeing <jonathan.n.boeing@gmail.com>
* com32/lib/syslinux/load_linux.c: update prot_mode_baseScot Doyle2015-04-181-0/+1
| | | | | | | | | | | | | | | | | If the kernel is relocatable and the protected mode code will not fit in the initially determined location, that code will be moved to the next available location. However, beginning with commit 8f470e7b, the code is moved to the initially determined location instead of the next available location because prot_mode_base is no longer updated to the correct location. Since whdr->code32_start is updated, it is pointing to the wrong execution start location, random code is executed and the machine is rebooted. Restore the old behavior by assigning prot_mode_base the value of base. Tested on a machine that exposed this behavior. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* load_linux: correct a typeScot Doyle2015-02-141-2/+2
| | | | | | | | Correct base's type to match its initialization from prot_mode_base and passage to syslinux_memmap_find(). Tested with extlinux. Signed-off-by: Scot Doyle <lkml14@scotdoyle.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* com32: Use z size specifier for printf-ing size_t variableMartin Str|mberg2015-01-051-1/+1
| | | | | | | | | Use the z size specifier to printf-ing size_t variables to get rid of gcc warning format ‘%08x’ expects type ‘unsigned int’, but argument 2 has type ‘long unsigned int’ Author: Martin Str|mberg <ams@ludd.ltu.se> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* com32: change '%llx' to use PRIx64Martin Str|mberg2015-01-051-8/+8
| | | | | | | | | | | | Get rid of printf format warning format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ Use <inttypes.h> PRIx64 instead of llx to get rid of gcc warning format ‘%llx’ expects type ‘long long unsigned int’, but argument 2 has type ‘uint64_t’ Author: Martin Str|mberg <ams@ludd.ltu.se> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* Make symbols defined in linker script HIDDENH. Peter Anvin2014-06-101-15/+15
| | | | | | | This makes symbols defined in com32.ld and syslinux.ld HIDDEN, to avoid collisions. Additional linker scripts should have this done, too. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* biosboot: This file is not for EFInocomapiH. Peter Anvin2014-03-131-0/+4
| | | | | | | 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>
* Merge branch 'nocomapi'syslinux-6.03-pre7H. Peter Anvin2014-03-032-8/+42
|\
| * comapi: Remove the comapi interfaces completelyH. Peter Anvin2014-02-131-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
| * bios: Remove shuffle and boot comapi callH. Peter Anvin2014-02-132-8/+42
| | | | | | | | | | | | | | | | 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>
* | shuffler: Actually get the shuffler size sanelysyslinux-6.03-pre4H. Peter Anvin2014-02-272-13/+8
|/ | | | | | | | | 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>
* Add const qualifiersGene Cumm2014-01-251-1/+1
| | | | | | Some functions are ignoring the const qualifier. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* com32sys_t inreg shall be zeroified prior intcallErwan Velu2014-01-221-0/+1
| | | | | | | | | | | 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
* ansi: switch cindex type to attr_tJames Buren2013-12-111-1/+2
| | | | | | To fully support color tables with more than 256 entries Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* load_linux: Don't use size heuristic for non-relocatable kernelsH. Peter Anvin2013-12-041-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>
* chain: Fix chainloading on 6.02Raphael S. Carvalho2013-10-171-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>
* com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2013-09-301-83/+90
| | | | | | | | 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>
* module: convert to dprintf() to aid debuggingsyslinux-6.02-pre14Matt Fleming2013-07-263-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>
* tests: unit test bios_boot_linux()Matt Fleming2013-07-262-1/+201
| | | | | | | | | | | | 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>
* video.h: we need one syslinux_force_text_mode() prototypeMatt Fleming2013-07-261-1/+1
| | | | | | | | | 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>
* tests: syslinux_memmap_highest() unit testsMatt Fleming2013-07-261-0/+66
| | | | | | Exercise the new syslinux_memmap_highest() function. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* load_linux: dynamically calculate the cmdline regionsyslinux-6.02-pre12Matt Fleming2013-07-252-4/+70
| | | | | | | | | | | | 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>
* load_linux: extract the logic for cmdline_offsetMatt Fleming2013-07-251-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>
* tests: delete test executables after each runMatt Fleming2013-07-241-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>
* tests: make mmap_entry globally available to unit testsMatt Fleming2013-07-245-25/+9
| | | | | | | | | | 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>
* tests: Syslinux unit testsMatt Fleming2013-07-236-0/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* movebits: Handle arbitrary combinations of SMT_FREE and SMT_TERMINALsyslinux-6.02-pre6H. Peter Anvin2013-07-181-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>
* zonelist: allow syslinux_memmap_type() to demote SMT_FREE to SMT_TERMINALH. Peter Anvin2013-07-171-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>
* movebits: allow allocation across region boundaryMatt Fleming2013-07-171-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>
* memscan: build a linked list of memory scannersMatt Fleming2013-07-171-119/+27
| | | | | | | | | | | 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>
* movebits: Add SMT_TERMINAL - a last resort region typeMatt Fleming2013-07-172-2/+2
| | | | | | | | | 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>
* memscan: pass enum syslinux_memmap_types aroundMatt Fleming2013-07-172-10/+12
| | | | | | | | 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>
* movebits: Add syslinux_memmap_find()Matt Fleming2013-07-172-74/+78
| | | | | | | | 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>
* zonelist: rename syslinux_memmap_find()...Matt Fleming2013-07-173-6/+6
| | | | | | | 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>
* Merge tag 'syslinux-5.11-pre8' into firmwaresyslinux-6.02-pre1Matt Fleming2013-07-082-13/+125
|\ | | | | | | | | | | | | | | | | | | | | syslinux-5.11-pre8 Conflicts: NEWS com32/lib/Makefile core/conio.c mk/devel.mk mk/elf.mk