aboutsummaryrefslogtreecommitdiffstats
path: root/com32/lib
Commit message (Collapse)AuthorAgeFilesLines
* com32: fix a ffile descriptor leak on open() of a nonexistent fileH. Peter Anvin2010-12-061-2/+4
| | | | | | | | If we try to open a nonexistent file, free the resulting file descriptor. Reported-by: Antonio Carlini <arcarlini@iee.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* com32: add a centralized bitops headerH. Peter Anvin2010-11-141-18/+7
| | | | | | | | | Add a centralized bitops header <sys/bitops.h> which uses x86 bitops instructions. This is necessary to keep gcc 4.5 from aborting compilation due to the inlined code being larger than the non-inlined version, and well, we should really use the bitops. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge remote branch 'liu/master'H. Peter Anvin2010-10-151-18/+27
|\
| * lib: Update memmem functionLiu Aleaxander2010-10-091-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | The current memem implementation can not handle the case that the length of the third parameter(needle) is equal *ONE*. So that the current strstr implemention doesn't work when the lenght of substring is ONE. For example, strstr("linux", "l") it will return NULL instead of "linux", which is not right. This code is stolen from klibc ;) Signed-off-by: Liu Aleaxander <Aleaxander@gmail.com>
* | strspn.c: drop "inline"H. Peter Anvin2010-10-121-2/+2
|/ | | | | | | | | Drop "inline" from bit operations. These should be recoded to use x86 bts/bt instructions, but for now just drop the "inline" which causes failures on gcc 4.5 due to inlining failures. Reported-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* zlib: rename DEBUG to DEBUG_ZLIB againH. Peter Anvin2010-07-065-26/+26
| | | | | | We don't want to use the global DEBUG for zlib... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* com32: add proper sleep()/msleep() functions and make Lua use themH. Peter Anvin2010-07-052-1/+23
| | | | | | | Add proper sleep() and msleep() functions, which among other things call syslinux_idle(), and make Lua use them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: change clock_t to 32 bits, and in millisecondsH. Peter Anvin2010-07-051-5/+3
| | | | | | | Previously, clock_t was 16 bits and counted timer ticks, now make it 32 bits and count milliseconds. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* zlib: update to zlib 1.2.5H. Peter Anvin2010-07-0520-727/+1665
| | | | | | Update zlib to zlib 1.2.5. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* libpng: upgrade to version 1.2.44H. Peter Anvin2010-07-0430-17538/+8664
| | | | | | Upgrade libpng from 1.2.8 to 1.2.44. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: update getopt() to the current version from klibcH. Peter Anvin2010-07-021-46/+71
| | | | | | Update getopt() to the current klibc version. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: add getopt_long() to the libraryH. Peter Anvin2010-07-022-1/+154
| | | | | | | Add getopt_long() to the library. This is code lifted straight out of klibc. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* zlib: change DEBUG to DEBUG_ZLIBH. Peter Anvin2010-07-015-25/+25
| | | | | | | zlib uses DEBUG for something slightly different than the Syslinux main code, so change the name of the symbol. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* dprintf: allow overriding the serial port addressH. Peter Anvin2010-07-011-1/+6
| | | | | | | Allow overriding the serial port address, e.g. for systems which only have PCI serial ports. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* PM getcwd(); Fix COM32 getcwdGene Cumm2010-06-261-21/+2
| | | | | | | | | Implement getcwd() in the core; Fix COM32 getcwd() to use the new function. This resolves the previous comment about COM32 getcwd() not working by not using INT 22h AX=001Fh. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Fix COM32 chdir()Gene Cumm2010-06-261-6/+4
| | | | | | | | Fix COM32 chdir() since it's implemented in the core. Forgot the core changes needed for this before. Signed-off-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Replacing strncpy by strlcpyErwan Velu2010-06-221-4/+4
| | | | | As reported by hpa, strlcpy is safer and could prevent some bugs. So I replaced all strncpy by strlcpy calls.
* com32: make __farcall() IF-preservingH. Peter Anvin2010-06-211-1/+14
| | | | | | | Make __farcall preserve the current value of IF. If we need to we can create a __raw_farcall() operation which does not. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Unify instances of integer log2H. Peter Anvin2010-06-092-8/+3
| | | | | | Unify multiple open-coded instances of integer binary logarithm. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* runimage.c: remove unused variableH. Peter Anvin2010-05-121-1/+0
| | | | | | -Werror cleanup: remove unused variable. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* Merge branch 'master' into pathbasedH. Peter Anvin2010-05-121-1/+1
|\
| * com32: Fixing cast in argv to avoid warningErwan Velu2010-05-121-1/+1
| | | | | | | | | | const char * confuse the *argv++ assignation Casting to char * removes this warning
* | core: move idle handling into protected modeH. Peter Anvin2010-03-301-17/+7
| | | | | | | | | | | | | | | | Do the actual idling in protected mode. This both allows PM code a more efficient interface, but also handles bugs in HVM implementations which don't handle HLT in real mode. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | Merge branch 'master' into pathbasedH. Peter Anvin2010-03-292-3/+4
|\| | | | | | | | | | | | | | | | | | | | | | | Resolved Conflicts: MCONFIG.embedded com32/MCONFIG com32/include/com32.h core/com32.inc core/pxelinux.asm doc/comboot.txt Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * com32: export the filename of a com32 module to the module itselfH. Peter Anvin2010-03-292-3/+4
| | | | | | | | | | | | | | Export the filename of the com32 module to the module itself, setting argv[0]. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | stdcon: make the screen size availableH. Peter Anvin2010-03-061-1/+18
| | | | | | | | | | | | Make the screen size available when using stdcon, not just ansicon. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | qsort: handle the case of zero entriesH. Peter Anvin2010-03-061-0/+4
| | | | | | | | | | | | Avoid bugs when the qsorted array is empty. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Add 32-bit versions of open file/close fileH. Peter Anvin2010-03-067-51/+21
| | | | | | | | | | | | Add 32-bit API calls for open file and close file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | lmalloc: add <string.h> for lzallocH. Peter Anvin2010-03-051-0/+1
| | | | | | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | readdir: replace opendir/readdir/closedir API with a 32-bit APIH. Peter Anvin2010-03-045-99/+31
| | | | | | | | | | | | | | | | The 16-bit API to opendir/readdir/closedir was confused, had a memory leak, and was incompatible with Syslinux 3.x anyway. Replace it with a pure 32-bit API. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | dprintf: make usable on hardwareH. Peter Anvin2010-02-281-6/+71
| | | | | | | | | | | | | | Actually configure the serial port used for dprintf, so we can actually use it on real hardware. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | com32/lib: remove unused definitionsH. Peter Anvin2010-02-282-4/+0
| | | | | | | | Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | com32: replace hard-coded bounce buffer use in com32/libH. Peter Anvin2010-02-2410-73/+148
| | | | | | | | | | | | Replace hard-coded bounce buffer uses in com32/lib with lmalloc/lfree. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | com32: add lzalloc()H. Peter Anvin2010-02-241-0/+11
| | | | | | | | | | | | Add lzalloc(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | lmalloc: set errno on failureH. Peter Anvin2010-02-241-1/+6
| | | | | | | | | | | | | | The core function can't set the com32 errno, so we need to do it in the wrapper. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | com32: wrapper functions for lowmem allocationsH. Peter Anvin2010-02-243-0/+60
| | | | | | | | | | | | lmalloc(), lfree(), lstrdup() Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | core: use better malloc; add low memory malloc; fix com32 exitH. Peter Anvin2010-02-231-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | Use a better malloc for the core. In particular, use the same core that we should eventually be able to use for the entire system in Syslinux 5 -- with module awareness, etc. This code can also accommodate multiple heaps. Set up a separate heap for lowmem; the intent is to use explicit lowmem allocations instead of the static bounce buffer. The lowmem allocation is also exported via the pmapi mechanism, so modules can safely allocate lowmem. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | core: add a direct 32-bit APIH. Peter Anvin2010-02-232-23/+28
| | | | | | | | | | | | Add a direct 32-bit API to some functions; initially read file only. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | Merge remote branch 'origin/master' into pathbasedH. Peter Anvin2010-02-209-27/+818
|\|
| * libpci: merge BIOS read and BIOS writeH. Peter Anvin2010-02-206-25/+13
| | | | | | | | | | | | | | Save a few bytes by merging the very similar BIOS read and BIOS write functions. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * i915resolution: use libpci to access PCI config spaceH. Peter Anvin2010-02-161-19/+11
| | | | | | | | | | | | | | | | Use libpci to access PCI config space. This *hopefully* will make it less likely that some old machine hangs when failing to set the requested video mode. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Merge branch 'master' into i915resH. Peter Anvin2010-02-083-9/+108
| |\
| * \ Merge branch 'master' into i915resH. Peter Anvin2010-01-221-0/+3
| |\ \
| * | | vesa: allow arbitrary resolutions on some Intel chipsetsH. Peter Anvin2010-01-224-2/+813
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some code from the tool "915resolution" to allow arbitrary resolutions to be set on some Intel chipsets. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | | memmove: don't reverse copy if there is no overlapH. Peter Anvin2010-02-151-12/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't do reverse copies if there is no overlap. Current x86 CPUs optimize forward copies, but some of them don't optimize reverse copies. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | | Merge branch 'master' into pathbasedH. Peter Anvin2010-02-143-9/+108
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved Conflicts: com32/Makefile com32/include/syslinux/pxe.h core/pxelinux.asm core/syslinux.ld Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | | vesa: for jpg or png images, tile the image across the screenH. Peter Anvin2010-02-081-9/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we specify a smaller image than the screen size, tile it across the screen rather than leaving a big black box. This may have to be made configurable. Also note that Syslinux currently does not handle the case of an image bleeding off the end of the screen. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * | | com32: add library function for DNS lookupH. Peter Anvin2010-02-062-0/+71
| | |/ | |/| | | | | | | | | | | | | Add a library function for DNS lookup Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | openmem: fix openmem()H. Peter Anvin2010-01-251-1/+2
| | | | | | | | | | | | | | | | | | Correct the implementation of openmem(). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | | Merge commit 'origin/master' into fscH. Peter Anvin2010-01-241-0/+3
|\| |