aboutsummaryrefslogtreecommitdiffstats
path: root/com32
Commit message (Collapse)AuthorAgeFilesLines
...
* | lua: explicitly put the console in standard modeFerenc Wágner2014-03-011-0/+4
| |
* | lua: the COM32 API does not provide signal.hFerenc Wágner2014-03-011-0/+6
| |
* | dev.h: get size_t definitionFerenc Wágner2014-03-011-0/+1
| |
* | lua: replace src/Makefile to build Lua as a Syslinux COM32 moduleFerenc Wágner2014-03-011-172/+49
| | | | | | | | | | | | | | | | 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.
* | lua: import Lua 5.2.2Ferenc Wágner2014-03-01115-10901/+14357
| | | | | | | | | | | | 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.
* | 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>
* pxe: Export the initial stack and PXE(NV) structure, fix pxechnH. Peter Anvin2014-02-132-17/+19
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/rockridge'H. Peter Anvin2014-02-122-16/+138
|\ | | | | | | | | | | | | Resolved Conflicts: com32/include/byteswap.h Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Generic facilities for byteswapping and unaligned referencesH. Peter Anvin2013-04-022-11/+141
| | | | | | | | | | | | | | For future portability, add functions to access both littleendian and bigendian numbers, and to perform unaligned memory references. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge remote-tracking branch 'erwan-github/hdt-memleak' into masterGene Cumm2014-01-312-1/+2
|\ \ | | | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | acpi: Removing memset of bufferErwan Velu2014-01-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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));
| * | hdt: Fixing memory leak in cliFelipe Pena2014-01-291-0/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* | | Add const qualifiersGene Cumm2014-01-252-2/+2
| | | | | | | | | | | | | | | | | | Some functions are ignoring the const qualifier. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | | com32: fix __bswap_64_macroGene Cumm2014-01-251-1/+1
| | | | | | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | | Merge branch 'syslinux-5.xx' into master; fixes loadkeysGene Cumm2014-01-252-4/+3
|\ \ \ | |/ / |/| | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | com32/moduless/poweroff.c: use __unused attribute insteadGene Cumm2014-01-251-1/+1
| | | | | | | | | | | | | | | Recommended-By: Matt Fleming <matt@console-pimps.org> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | com32/modules/poweroff.c: fix main()Gene Cumm2014-01-251-1/+1
| | | | | | | | | | | | | | | | | | Wrong prototype; use GCC unused Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | ldlinux/readconfig.c: remove bail: from do_include()Gene Cumm2014-01-251-1/+0
| | | | | | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | Add const qualifiers to loadleysGene Cumm2014-01-251-2/+2
| | | | | | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * | com32: Fix a bug on history of commands.Raphael S.Carvalho2013-09-301-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>
| * | com32: Fix bugs on cmd_reverse_search (Triple fault dimension)Raphael S.Carvalho2013-09-301-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>
| * | com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2013-09-302-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>
* | | mem: Calling int15 for 0x8800Erwan Velu2014-01-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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 ;)
* | | com32sys_t inreg shall be zeroified prior intcallErwan Velu2014-01-2215-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | com32: Add missing dependencies to MakefileGene Cumm2014-01-181-3/+3
| | | | | | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | | 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>
* | | ldlinux: Fix recent pxe symbol regressionMatt Fleming2013-12-111-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>
* | | pxe: Make the SENDCOOKIES feature for HTTP worked againRussel Santillanes2013-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | 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: Fix a bug on history of commands.Raphael S.Carvalho2013-09-301-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>
* | | com32: Fix bugs on cmd_reverse_search (Triple fault dimension)Raphael S.Carvalho2013-09-301-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>
* | | com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2013-09-302-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>
* | | Merge branch 'elflink-pxe-fixes-for-mfleming-2' of ↵Matt Fleming2013-09-301-0/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | com32: Define ddprintf() macroGene Cumm2013-09-231-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>
* | | cmenu: Add libmenu.c32 to $(C_LIBS)syslinux-6.02-pre15Matt Fleming2013-07-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | cmenu: the order of entries in $(LIBMENU) is vitalMatt Fleming2013-07-291-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | 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-263-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-253-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>
* | | 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: add an inline to test for SMT_FREE || SMT_TERMINALH. Peter Anvin2013-07-171-0/+5
| | | | | | | | | | | | | | | | | | Introduce a predicate inline to test for a valid terminal address. 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>