aboutsummaryrefslogtreecommitdiffstats
path: root/com32
Commit message (Collapse)AuthorAgeFilesLines
* Revert "vesa: Correct screencpy() prototype"Matt Fleming2013-01-112-3/+3
| | | | | | | | | | | | | | This reverts commit 15a67011987c341814533ac4d8e23c9a72dc7605, because as Peter points out, The objects are uint32_t and so the prototype is correct. It should not "leak" outside the screencpy function that we play ugly tricks with these pointers; that is better handled by an internal cast. So do the necessary casting inside bios_vesacon_screencpy(). Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Greatly simplify the EFI Scan Code handlingMatt Fleming2013-01-091-0/+25
| | | | | | | | | | | | | | | | By adding the EFI Scan Codes to 'keycodes' in get_key.c, prefixed with the escape sequence '\0' to avoid clashes with ASCII characters, we can have all the input key decoding done in one place, allowing us to delete efi/keymap.h. Luckily there are no conflicts with the combined BIOS codes already present in 'keycodes', though if we were to add the EFI scan code for the pause key (0x48) that would conflict with the existing BIOS code for KEY_UP. Still, it shouldn't be necessary to add any more scan codes because it doesn't make sense for things like the mute key to be handled by Syslinux. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'elflink' into firmwareMatt Fleming2013-01-085-27/+55
|\ | | | | | | | | | | | | | | | | | | | | Merge the changes since Syslinux-5.00. The main reason behind this merge is to pull in the following bug fix, commit 90b5864fc793 ("core/kaboom.c: Export __bad_SEG()"), which allows us to turn on debugging in mk/devel.mk without ldlinux.c32 failing to load. Conflicts: com32/elflink/ldlinux/Makefile version
| * 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.
* | vesa: Make __vesacon_i915resolution() a stub under EFIMatt Fleming2013-01-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | We can't use the code in __vesacon_i915resolution() under EFI, it leads to hangs. Provide a stub implementation in efi/vesa.c that just returns an error. We don't use the usual idiom of moving the function into the 'firmware' structure because that would require the i915 code to move into the core/. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | vesa: Correct screencpy() prototypeMatt Fleming2013-01-071-1/+1
| | | | | | | | | | | | | | The 'src' argument should actually be const char * because the BIOS code performs pointer arithmetic on it. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | sys/vesa: Include screencpy.o in $LIBVESA_OBJSMatt Fleming2013-01-021-1/+1
| | | | | | | | | | | | | | | | | | commit 4b0851493dce ("sys/vesa: Modularise common vesa code") accidentally removed screencpy.o from $LIBVESA_OBJS, which results in an undefined reference to __vesacon_copy_to_screen when loading vesamenu.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | com32: Fix merge botchMatt Fleming2013-01-021-0/+1
| | | | | | | | | | | | | | | | Somehow to the printf() statement that warns about undefined symbols when loading modules was deleted when syslinux-5.00 was merged, so restore it. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3Matt Fleming2012-12-0739-641/+444
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile com32/elflink/ldlinux/Makefile com32/lib/sys/module/elf_module.c core/cleanup.c core/comboot.inc core/conio.c core/fs/fs.c core/init.c core/mem/free.c core/mem/malloc.c core/timer.inc diag/geodsp/Makefile extlinux/main.c mk/embedded.mk modules/Makefile Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * 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>
* | firmware: Make disk->private an opaque typeMatt Fleming2012-11-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've currently got both the BIOS and EFI versions of struct disk_private in core/include/disk.h, which isn't ideal because this file shouldn't need to know about the inner-workings of the firmware's private disk info. Move the implementation of 'struct disk_private' into more suitable locations and use a void * for the 'private' member of struct disk. This change allows us to once and for all delete the gnu-efi header files from core/include/core.h and the gnu-efi include paths from mk/lib.mk. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | firmware: Move memory operations into firmwareMatt Fleming2012-11-152-2/+10
| | | | | | | | | | | | | | | | Instead of littering core/mem with #ifdef SYSLINUX_EFI move memory operations into the 'firmware' structure so that they can be implemented differently for BIOS and EFI. Signed-off-by: Matt Fleming <matt.fleming@intel.com>