aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert "vesa: Correct screencpy() prototype"Matt Fleming2013-01-114-7/+8
| | | | | | | | | | | | | | 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-093-114/+31
| | | | | | | | | | | | | | | | 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>
* efi: Lookup the Unicode encoding when writing charactersMatt Fleming2013-01-091-1/+4
| | | | | | | | | We should be using the system's codepage to lookup the correct Unicode character when writing characters to the output. This allows us to seemlessly print the correct Unicode character given an extended ASCII character, e.g. when drawing boxes in the menu code. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Set display attributes before writing outputMatt Fleming2013-01-091-0/+2
| | | | | | | | Set the foreground and background attributes before writing any characters to the output. Without this change, the text-based menu doesn't highlight entries. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Enable/disable cursor like the BIOS codeMatt Fleming2013-01-091-1/+2
| | | | Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Fix handling of "extended" keysMatt Fleming2013-01-091-3/+4
| | | | | | | | | | If we're using the scancode we need to put it in 'hi', which isn't subject to processing the same way that the return value of efi_getchar() is. This mimics the way that the BIOS version works. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* efi: Fix screen clearing and cursor positionMatt Fleming2013-01-091-3/+4
| | | | | | | | | | | The logic to figure out when to clear the screen was broken, leading to the screen sometimes containing garbage. x0,y0 are the coordinates of the upper left part of the screen, and x1,y1 the lower right. x1,y1 will be the position of our cursor, which we can ignore, but we must use x0,y0 to figure out when to clear the screen and not simply set the cursor position. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'elflink' into firmwareMatt Fleming2013-01-086-28/+56
|\ | | | | | | | | | | | | | | | | | | | | 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
| * core/kaboom.c: Export __bad_SEG()Matt Fleming2013-01-081-1/+1
| | | | | | | | | | | | | | | | | | We need to add __bad_SEG() to the symbol export whitelist, otherwise ldlinux.c32 will fail to load if compiled with -DDEBUG=1 due to not being able to resolve __bad_SEG(). Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * version: Bump minor number and yearsyslinux-5.01-pre1Matt Fleming2013-01-081-1/+1
| | | | | | | | | | | | Welcome to the 5.01 development cycle and 2013. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * 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-082-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | mk/embedded.mk: Don't use -mregparm in coreMatt Fleming2013-01-084-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately commit 4eb06d95d882 ("mk: Add -fPIC for x86_64 to embedded.mk") left -mregparm enabled when compiling objects in core/, which means that when compiling for i386 those objects are compiled with a different ABI compared with everything else, leading to hangs when booting under 32-bit EFI. We should only enable -mregparm for code that absolutely requires it, such as dos/crt0.S which would need to be re-written to use another ABI. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | efi: Delete EFI handover protocol checkMatt Fleming2013-01-071-4/+0
| | | | | | | | | | | | | | | | | | We don't need to bail if the kernel we're trying to boot supports the handover protocol even though we don't know how use it. We can simply boot the kernel the old fashioned way until we grow the necessary support. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | vesa: Correct screencpy() prototypeMatt Fleming2013-01-072-2/+2
| | | | | | | | | | | | | | 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-07118-4172/+5826
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0620-2443/+23
| | | | | | | | | | | | | | | | | | | | | | 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-0544-92/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-053-5/+3
| | | | | | | | | | | | 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-0516-270/+28
| | | | | | | | | | | | | | | | | | | | 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>
| * comboot: Mark API functions obsoleteMatt Fleming2012-12-051-349/+37
| | | | | | | | | | | | | | | | | | Starting with Syslinux 5.00 the COMBOOT API is obsolete and should not be used by any modules. It is still used internally for some things, such as the ADV code in ldlinux.c32, but that will change in the future. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * doc: Further explanation for the PATH directive and lookup rulesMatt Fleming2012-12-041-1/+29
| | | | | | | | | | | | | | | | The PATH directive can be quite confusing when coupled with the fact that the current working directory is always searched first when opening files. 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-033-340/+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>
| * Merge branch 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux ↵Matt Fleming2012-11-301-108/+155
| |\ | | | | | | | | | | | | | | | | | | | | | | | | into elflink-searchdir-leak Pull a change that fixes a resource leak from Shao Miller, * 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux: fs: Fix searchdir resource leak
| | * fs: Fix searchdir resource leakShao Miller2012-11-291-108/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant rewrite of the generic lookup logic inside core/fs/fs.c's searchdir function. Previously, there was a memory leak if a path involved multiple directories. After a sufficiently large number of invocations, this could be observed. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Shao Miller <sha0.miller@gmail.com>
| * | PATH: Use installation directory for 'PATH'Matt Fleming2012-11-302-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Files in the installation directory should be able to be executed (along with their dependencies) from any directory in the file hierarchy. Using the installation directory as the default value for 'PATH' is the most sensible way to do this. The PATH config directive still allows other directories to be appended to the 'PATH' variable, which is useful when there are other directories containing modules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | ldlinux: Don't try reloading ldlinux.c32 unless it's likely to succeedMatt Fleming2012-11-302-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | 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-2710-25/+32
| |\
| | * core/elflink: Fix off-by-one errorMatt Fleming2012-11-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | We need to remember to allocate space for the terminating NULL in create_args_and_load() otherwise we will write a NUL-byte past the bounds of 'argv[]' to some random part of the stack. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| | * 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>
| | * pxe: Don't leak inode on timeoutMatt Fleming2012-11-271-1/+3
| | | | | | | | | | | | 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>