aboutsummaryrefslogtreecommitdiffstats
path: root/com32
Commit message (Collapse)AuthorAgeFilesLines
* ldlinux: Dynamically alloc memory for kernel and initrd filenamesMatt Fleming2013-01-041-19/+45
| | | | | | | | | | | | Absolutely no bounds checking is performed when copying filenames to 'cmdline_buf' and 'initrd_name' which means that sufficiently long strings will scribble over the stack. At best, the files will simply fail to load because the name is garbled. Allocate space for the cmdline at runtime to avoid these overflow problems. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Don't delete ldlinux.c32 with 'make clean'Matt Fleming2013-01-041-4/+6
| | | | | | | | | | | | | | | | | | | | | The documented command sequence for distributions wishing to package a Syslinux release is, make clean make installer Unfortunately, becaues ldlinux.c32 is deleted by 'make clean' the installer target fails like so, make[1]: *** No rule to make target `../com32/elflink/ldlinux/ldlinux.c32', needed by `ldlinuxc32_bin.c'. Stop. make: *** [installer] Error 2 Follow the example set by core/Makefile for ldlinux.sys, etc and add any build files that are required by the installers to $(BTARGET). $(BTARGET) only gets deleted when running 'make spotless'. Reported-by: László Házy <hazy_l@yahoo.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: set the sonames of shared librariesH. Peter Anvin2013-01-034-4/+4
| | | | | Set the sonames of shared libraries to the filename, so we don't end up with full pathnames embedded in the files.
* Delete 16-bit COMBOOT supportsyslinux-5.00Matt Fleming2012-12-065-6/+1
| | | | | | | | | | | 16-bit COMBOOT files are no longer supported by Syslinux in 5.00 so delete all references and change any 32-bit COMBOOT image references to mention ELF instead. Some of the COMBOOT stuff is still used internally so we can't nuke core/comboot.inc yet, but that will disappear in a future release. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Symbol export whitelistMatt Fleming2012-12-0510-13/+17
| | | | | | | | | | | | | | | | Before modules were dynamically loaded the boundary between GPL and non-GPL code was implicit because of the separate link domains for each module. With dynamic modules we need an explicit whitelist of core symbols that non-GPL code can link against at runtime without needing to be re-licensed under the GPL. Mark such symbols with __export, so that it is explicitly clear which symbols in the core can be linked against by non-GPL code. Reduce the visibility of symbols in both the core and ldlinux.c32 with -fvisibility=hidden. __export changes the visibility to 'default'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* core: Fix 'NoHalt'Matt Fleming2012-12-051-2/+2
| | | | | | Use the same variable in idle.c and ldlinux.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* com32: Delete unused malloc.c and friendsMatt Fleming2012-12-054-383/+0
| | | | | | | | The memory alloc files haven't been referenced since commit 880f67714ec0 ("elflink: remove the malloc.c/free.c/realloc.c/zalloc.c from com32"). They live in the core now. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Reduce the number of global variablesMatt Fleming2012-12-052-49/+1
| | | | | | | | | | In preparation for strictly limiting the list of variables that are exported (global) in the core, delete any unused variables, rewrite variable declarations in C that are not referenced by asm and delete files that are no longer included in other asm files. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Revert "menu: Inherit parent menu title"Matt Fleming2012-12-041-3/+0
| | | | | | | | | | | | This reverts commit 6387f043f7f870e4f0b402dae0b921d99eb82c39. We got reports of this change causing regressions. The reverted commit only goes half way to providing proper parent menu title inheritance, and breaks other configs where the menu label or submenu tagname are used for the title. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Use get_msg_file() for F-keysMatt Fleming2012-12-041-17/+2
| | | | | | | | | The file that we display with the F-keys may contain background or foreground color codes and so needs to be interpreted by get_msg_file() instead of just printing the color codes as ascii to the screen with cat_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Remove default bold attribute typoMatt Fleming2012-12-041-1/+1
| | | | | | | | | commit 82cbb1bd4133 ("ldlinux: Move DISPLAY file handling out of the core") introduced a typo where the foreground color was always bold when displaying a DISPLAY file. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* CLI: Don't always start the CLI at column 0Matt Fleming2012-12-041-3/+9
| | | | | | | | | | | If we print files with no newline then it looks better if the CLI prompt is printed immediately after the file content, rather than erasing the line and printing prompt at column 0. This mainly affects files with one line of text and no newline character. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Move DISPLAY file handling out of the coresyslinux-5.00-pre13Matt Fleming2012-12-032-1/+215
| | | | | | | | | | | | | | The code that handles the DISPLAY directive was writing directly to the BIOS VGA page with __intcall(0x10). This caused corruption problems on the screen because the ansi library code was also writing to the screen. The correct way to fix this is to always use the ansi library code (via printf()) instead of going behind its back and using separate code paths to write to the screen. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* stdio: Fix unhexchar() for hex digits > 9Matt Fleming2012-12-031-3/+3
| | | | | | | | | | There was a typographical error in commit 9f51b69d7c050 ("core: Reimplement lots asm code in C") which re-wrote the asm implementation of unhexchar() in C. We should be adding 10, not subtracting to get the equivalent decimal integer. Also be explicit about the sign of 'data' and 'num'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Don't try reloading ldlinux.c32 unless it's likely to succeedMatt Fleming2012-11-301-1/+3
| | | | | | | | If we can't access ldlinux.c32 with findpath(), reloading it isn't going to work so don't unload it or any of the other modules. Instead return control to the caller. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* module: Fix incorrect list_entry() useMatt Fleming2012-11-301-1/+1
| | | | | | | | Correct the bogus use of list_entry() that was introduced in commit 8f1c64acf9c6 ("module: Stop silently failing to load dependency modules"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* CLI: Delete 'temp_cmdline' and put 'cmdline' on the stackMatt Fleming2012-11-291-17/+6
| | | | | | | | | | | | We don't need to preserve the contents of 'cmdline' across calls to edit_cmdline(). In fact, doing so causes things like the TAB key to not function properly because the previous command is used as a prefix to print_labels(), as though the user had typed it explicitly before hitting TAB. Delete 'temp_cmdline' because it no longer serves a purpose. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* module: Stop silently failing to load dependency modulessyslinux-5.00-pre12Matt Fleming2012-11-291-1/+11
| | | | | | | | | | | | | We should be checking the return value of spawn_load() when loading a module's dependencies and printing some kind of an error message if they fail to load (for instance if the file is missing) and returning an error to the caller. Track the most recently loaded module in 'head' before we begin loading dependencies. That way we can unload any dependencies in the error path that were successfully loaded. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Complain to user on failure to perform file operationsMatt Fleming2012-11-293-4/+4
| | | | | | | | | | | | | | | If we fail to chdir or to execute a COM32 file we should inform the user so that they can debug the problem. We don't currently print anything if the user tries to execute a regular file, such as a config file, as an COM32 image. We also shouldn't be returning the exit value of the module from spawn_load(), because we have no way of doing anything useful with it, and just because a main() function returns -1 doesn't mean it failed to run. Modules need to take care of printing any error messages themselves. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* module: Append '/' to PATH strings if missingMatt Fleming2012-11-291-0/+4
| | | | | | | | We shouldn't be appending a filename to any path string that isn't terminated by a '/', otherwise we end up searching for files like '/isolinuxpwd.c32' Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Only append missing filename extensionsMatt Fleming2012-11-291-3/+6
| | | | | | | | | | | | Don't append an extension like ".c32" if the command already has one! This bug lead to "config.c32" being executed as "config.c32.c32" with the below config snippet, LABEL config COM32 config.c32 /configs/isolinux.cfg Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'coverity' into elflinksyslinux-5.00-pre11Matt Fleming2012-11-278-22/+26
|\
| * module: Fix off-by-one error in findpath()Matt Fleming2012-11-271-2/+2
| | | | | | | | | | | | | | | | We need to make sure that 'path' still has enough space to write the trailing NUL-byte. Without this patch it's possible to write a NUL-byte past the end of the on-stack buffer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * module: Fix memory leak in spawn_load()Matt Fleming2012-11-271-10/+12
| | | | | | | | | | | | | | If for some reason we fail to load a module then we need to free the memory allocated to that module. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * screensize: Dereference pointers when checking cols/rowsMatt Fleming2012-11-271-1/+1
| | | | | | | | | | | | | | | | Dereference 'rows' and 'cols' to check whether the data they point to is zero, which would indicate the screen size is bogus, instead of checking if they point to NULL. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * hdt-cli: Correct malloc() size argumentMatt Fleming2012-11-271-1/+1
| | | | | | | | | | | | | | | | We need to be allocating sizeof(char *) (4) not sizeof(char) (1) for 'new_argv'. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * chainboot: Delete extraneous free() in chainboot_file()Matt Fleming2012-11-151-3/+1
| | | | | | | | | | | | | | We don't need to call free(buf) if we're jumping to the 'bail' label because 'buf' is always free'd there. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * vesa: Fix double close() bug in vesacon_load_background()Matt Fleming2012-11-151-1/+0
| | | | | | | | | | | | | | We always call fclose() on 'fp' if fopen() was successful, so delete the extraneous fclose() call in read_jpeg_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * asprintf: Ensure we always call va_end(ap)Matt Fleming2012-11-151-2/+3
| | | | | | | | | | | | | | | | There's currently the potential for us to exit early from asprintf() without calling va_end(ap). Rearrange things so that we always make the call. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * bufprintf: Add va_end() for our va_copy()Matt Fleming2012-11-151-2/+6
| | | | | | | | | | | | | | | | According to the stdarg(3) man page each invocation of va_copy() should be paired with an invocation of va_end(). Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Reset the console whenever we execute a moduleMatt Fleming2012-11-273-1/+17
| | | | | | | | | | | | | | | | Each module expects the console to start in text mode and will make explicit calls to openconsole() when another console is required, e.g. in vesamenu.c32. This mimics the behaviour found in 4.0x. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Revert "menu: Make "menu clear" the default"Matt Fleming2012-11-272-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6ab02b6682c0b693b3e4f9afcc2ab8775f804f0a. People are reporting that the above commit causes a regression in behaviour between 4.0x and 5.0x. It also makes the MENU CLEAR directive obsolete and requires that users change their existing config files to restore the old behaviour. The commit was intended to solve the same bug that commit 87320b8de8f3 ("ldlinux: Disable VGA graphics when loading a kernel") addresses but without breaking vesacon, see, commit e04ee714164d ('Revert "ldlinux: Disable VGA graphics when loading a kernel"') for more details. Reported-by: Ady <ady-sf@hotmail.com> Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | gpllib: Distribute libcom32gpl.c32 in releasesMatt Fleming2012-11-271-1/+1
| | | | | | | | | | | | | | | | | | | | This is a partial revert of commit b26d1c8642a8 ("Clean up $(GPLLIB) leak"). While we do need to use $(C_LIBS) and respect $(NOGPL), we should also be distributing libcom32gpl.c32. Now that we have ELF modules, such as hdt.c32, that need to have some of their symbols dynamically resolved at runtime we need to distribute libcom32gpl.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | module: Correct the size of the module symbol tableMatt Fleming2012-11-271-7/+21
| | | | | | | | | | | | | | | | | | | | | | | | We were incorrectly grovelling around in the GNU hash table for the size of the symbol table. Instead we need to map the section headers and search for the SHT_DYNSYM entry. This bug caused hdt.c32 to refuse to load as some symbols were never resolved because not all of the SHT_UNDEF symbols in hdt.c32 were processed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | cmenu: Delete __intcall()sMatt Fleming2012-11-271-45/+7
| | | | | | | | | | | | | | | | We can dynamically resolve our symbols and so we don't need to jump through __intcall(), which is deprecated anyway in favour of dynamic resolution. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Fix OnError behaviourMatt Fleming2012-11-261-2/+8
| | | | | | | | | | | | | | If the ONERROR directive references a label we need to lookup the label's command line and type. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Automatically apply ".c32" extension for COM32 filesMatt Fleming2012-11-263-2/+13
| | | | | | | | | | | | | | | | | | | | | | If a type-specifier is used on the command line, e.g. .com32 pwd we should apply the ".c32" filename extension automatically as this works elsewhere and this behaviour was present in 4.0x. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | runimage.c: Actually pass arguments to execute()Matt Fleming2012-11-261-15/+11
| | | | | | | | | | | | | | | | | | | | | | Fix the breakage from commit 8486142cf304 ("elflink: Replace __intcall() with direct function calls"), where we stopped passing 'cmdline' to execute(). This bug resulted in things like config.c32 not respecting the <directory> argument. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Don't return NULL on KEY_ESC.Matt Fleming2012-11-261-6/+0
| | | | | | | | | | | | | | | | | | The old command line code in 4.06 ignores KEY_ESC and KEY_CTRL('C') so we should do the same. What currently happens if a user hits ESC is that we return from edit_cmdline() as though we'd timed out waiting for user input. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Never exit from ldlinux.c32Matt Fleming2012-11-263-24/+30
|/ | | | | | | | | If there's no DEFAULT directive in the config file and the user hits the ENTER key enough times, or we timeout waiting for input, ldlinux.c32 will exit. This should never be allowed to happen, and we need to keep doing the ldlinux_auto_boot()/boot prompt dance. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Delete dead code and useless printfsyslinux-5.00-pre10Matt Fleming2012-11-131-28/+0
| | | | | | | | Seeing the cmdline re-printed every time the user presses enter is very annoying, so delete the offending printf(). Also delete some code that has been commented out for ages. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Delete inaccurate 'insufficient memory' messageMatt Fleming2012-11-131-3/+4
| | | | | | | Instead, use strerror() to print a more useful message if we fail to load a kernel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* mk: Add Makefile variable for pythonMatt Fleming2012-11-121-1/+1
| | | | | | | | | | | | | | Instead of hard-coding the python executable name use a make variable like we do for all other executables used during the build. This has the added bonus of allowing $(PYTHON) to be overridden on the command line, e.g. make PYTHON=python2 which is particularly useful for distributions where /usr/bin/python is actually python3. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* menu: Inherit parent menu titleMatt Fleming2012-11-121-0/+3
| | | | | | | | | The documentation for the menu system clearly states that all properties of the parent are inherited in the submenu. Unfortunately there's a bug that means this isn't true for the parent's menu title, so fix that. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'strerror-for-mfleming' of git://github.com/geneC/syslinux into ↵Matt Fleming2012-11-073-12/+121
|\ | | | | | | | | | | | | | | | | | | | | | | | | elflink Pull klibc strerror() patches from Gene Cumm, Update strerror() to give english messages * 'strerror-for-mfleming' of git://github.com/geneC/syslinux: com32 strerror(): Remove macro WITH_ERRLIST use com32 strerror: add errlist.o to Make strerror: Use klibc version
| * com32 strerror(): Remove macro WITH_ERRLIST useGene Cumm2012-11-061-2/+0
| | | | | | | | Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * com32 strerror: add errlist.o to MakeGene Cumm2012-11-061-2/+5
| | | | | | | | | | | | Exclude in .gitignore Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
| * strerror: Use klibc versionGene Cumm2012-11-062-10/+118
| | | | | | | | | | | | Remove old in favor of current klibc version Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | Merge branch 'hexdump' of git://git.zytor.com/users/sha0/syslinux into elflinkMatt Fleming2012-11-062-1/+247
|\ \ | |/ |/| | | | | | | | | Pull new hexdump.c32 module from Shao Miller, * 'hexdump' of git://git.zytor.com/users/sha0/syslinux: hexdump.c32: Simple file hex-dumper
| * hexdump.c32: Simple file hex-dumperShao Miller2012-11-042-1/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: %s [<option> [...]] <filename> [<option> [...]] Options: -p --page . . . . . . . Pause output every 24 lines --no-buffer . . . . Load the entire file before dumping --extended-ascii . . Use extended ASCII chars in dump -? -h --help . . . . . . Display this help Signed-off-by: Shao Miller <sha0.miller@gmail.com>