aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/ldlinux
Commit message (Collapse)AuthorAgeFilesLines
...
| * 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>
| * Reduce the number of global variablesMatt Fleming2012-12-051-1/+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>
| * 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>
| * 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>
| * 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>
| * ldlinux: Complain to user on failure to perform file operationsMatt Fleming2012-11-292-2/+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>
| * 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-271-3/+1
| |\
| | * 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>
| * | 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>
| * | 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>
| * | 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-262-23/+29
| |/ | | | | | | | | | | | | | | | | 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>
* | Merge tag 'syslinux-5.00-pre10' into for-hpa/elflink/firmwareMatt Fleming2012-11-148-68/+88
|\| | | | | | | | | | | | | | | | | | | | | Pull in the latest prerelease that includes some bug fixes for ldlinux and a realloc() bug in core/. Conflicts: com32/cmenu/Makefile com32/elflink/ldlinux/Makefile com32/lib/Makefile core/pxelinux.asm
| * 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>
| * CLI: Add Ctrl + V support for printing the Syslinux versionMatt Fleming2012-11-021-0/+10
| | | | | | | | | | | | | | The cli code is missing support for printing the version string that is available in Syslinux 4.06 and earlier. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * CLI: Fix command history traversalMatt Fleming2012-11-021-4/+18
| | | | | | | | | | | | | | | | The up/down keys were broken with respect to traversing through the command history because it was dereferencing a NULL pointer on the first iteration. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: get_key() requires raw access to user inputMatt Fleming2012-11-022-2/+22
| | | | | | | | | | | | | | | | | | commit 4503e6260c0 ("ldlinux: Use stdcon instead of rawcon for the console") broke get_key() because it was no longer possible to read raw data from stdin. Provide a new function raw_read() that will return user input a character at a time. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: Fix logic if no DEFAULT or UI directive is foundMatt Fleming2012-11-023-30/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Somewhere along the way the code that prints, No DEFAULT or UI configuration directive found! was broken, and now no longer prints at all. While we're fixing this it's a good opportunity to rework the logic to be clearer. Now we only print the message if a config file was found, since these directives are obviously missing if there is no config file (a warning will be printed about the lack of config file anyway). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: Print a warning if no config file is foundMatt Fleming2012-11-011-1/+4
| | | | | | | | | | | | | | | | This behaviour is taken from 4.06, where an error message is printed if no config file is found. A warning is a more user-friendly choice since Syslinux will still function without a config file. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge tag 'syslinux-5.00-pre9' into for-hpa/elflink/firmwareMatt Fleming2012-11-051-1/+1
|\| | | | | | | | | | | | | | | | | | | | | This merge also includes the Syslinux-4.06 release. Conflicts: Makefile com32/hdt/Makefile com32/modules/Makefile com32/samples/hello.c mtools/Makefile
| * ldlinux: Use stdcon instead of rawcon for the consoleMatt Fleming2012-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Switch to the stdcon input device so things like fgets() work correctly when reading from stdin. I noticed this was broken when running dmitest.c32. fgets() was returning NULL because there was no pending user input instead of waiting for/buffering the input. Modules are expecting stdin to be a line-oriented device, not a raw one where each module has to implement its own line support. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Add per-firmware object directory supportMatt Fleming2012-10-161-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have multiple firmware backends it no longer makes sense to write object files to the same directory as their source. A better solution is to write the object files to a per-firmware directory under a top-level object directory. The top-level object directory can be specified on the command-line with the O= variable, e.g. make O=/tmp/obj. If no top-level object directory is specified an 'obj' directory is created in the top-level of the Syslinux source repository. All the existing make targets continue to work as before, however now they apply to all firmware backends, e.g. 'make installer' will build the BIOS, 32-bit EFI and 64-bit EFI installers and place them under $(OBJ)/bios, $(OBJ)/efi32 and $(OBJ)/efi64 respectively. Note unlike every other bit of Syslinux, the gpxe objects are still kept in the src directory, e.g. gpxe/src, since gpxe is only required by the BIOS backend. It is possible to specify a make target for a specific firmware or list of firmware with the following syntax, make [firmware[,firmware]] [target[,target]] To clean the object directory for just the BIOS firmware type, 'make bios clean' To build both the 32-bit and 64-bit EFI installers type, 'make efi32 efi64 installer' Since the Syslinux make infrastructure is now more complex a new file doc/building.txt has been created to explain how to build Syslinux. The top-level Makefile now exports some make variables for use in module Makefiles, - topdir - the top-level source directory of the Syslinux repository, e.g. /usr/src/syslinux - objdir - the top-level object directory for the firmware backend currently being built, e.g. /obj/syslinux/bios - SRC - the source directory in the Syslinux repository for the module currently being built, e.g. /usr/src/syslinux/com32/libupload - OBJ - the object directory for the module currently being built, e.g. /obj/syslinux/bios/com32/libupload Since we're rewriting the Makefile infrastructure anyway it seemed like a good idea to add parallel support. By writing subdirectories as prequisites for make targets the objects in those subdirectories can be built in parallel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge branch 'elflink' into for-hpa/elflink/firmwareMatt Fleming2012-09-051-0/+12
|\| | | | | | | | | | | | | | | | | | | We need to pick up a couple of bug fixes, one of which causes some machines to hang because we're walking out of the bounds of an ELF symbol table. Conflicts: com32/lib/Makefile core/init.c
| * console: Close stdin, stdout, stderr on ldlinux.c32 unloadMatt Fleming2012-09-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The location of __file_info[] and ansicon_counter are split between the core and ldlinux.c32. We can end up calling __ansicon_close (from fp->oop->close) in the process of reloading ldlinux.c32, and while ansicon_counter is set to its initialised data value of 0 when reloading ldlinux.c32, the core is never reloaded, and so __file_info[] retains its pointers. What this amounts to is that when ldlinux.c32 tries to call openconsole() after being reloaded, the core tries to close the ansicon device (the core still has pointers to __ansicon_close) despite the ansicon code having no knowledge of ever being opened (because ansicon_counter was reinitialised). The most logical way to deal with this is to close stdin, stdout and stderr when unloading ldlinux.c32. It also turns out that sys/openconsole.o was present in two Makefile variables which lead to duplication of code, data, etc. We only need it present in libcom32min.a and not in the core since the core never handles opening consoles, at least not now that we've deleted printf_init() which is safe because we always open a console in ldlinux.c32 anyway. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmwareMatt Fleming2012-08-133-33/+49
|\| | | | | | | | | Conflicts: com32/lib/sys/module/common.c
| * ldlinux: Use findpath() to lookup filenamessyslinux-5.00-pre7Matt Fleming2012-08-071-4/+5
| | | | | | | | | | | | | | We should use the same method of opening files as the module code when searching for extensions. In particular, we should search all of PATH. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: Return to command prompt after loading COM32Matt Fleming2012-08-023-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | The old COM32 loading code would drop the user at a command prompt once execution returned from the COM32 amodule. We need to replicate this because most callers of execute() don't expect it to return. This bug was noticed when loading a COM32 module from vesamenu.c32. Once execution returned from the COM32 module the display became garbled because no code exists to reinitialise the screen for VGA. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmwareMatt Fleming2012-07-3013-262/+627
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile com32/elflink/ldlinux/adv.c com32/elflink/ldlinux/kernel.c com32/elflink/ldlinux/ldlinux.c com32/include/bitsize/stddef.h com32/include/bitsize/stdint.h com32/include/stdint.h com32/include/sys/module.h com32/include/sys/x86_64/bitops.h com32/include/syslinux/linux.h com32/lib/Makefile com32/lib/sys/ansicon_write.c com32/lib/sys/module/elfutils.h com32/lib/sys/vesa/efi/fill.h com32/lib/syslinux/load_linux.c com32/lib/syslinux/serial.c com32/lib/syslinux/shuffle.c core/conio.c core/elflink/config.c core/elflink/load_env32.c core/graphics.c core/include/graphics.h core/init.c core/pxelinux.asm mk/elf.mk mk/lib.mk
| * elflink: Replace __intcall() with direct function callsMatt Fleming2012-07-201-1/+1
| | | | | | | | | | | | | | | | There's no reason to use the COMBOOT API at all now that we can have any undefined symbols resolved at runtime - we can just access functions directly. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: Stop using the internal KT_* image typesMatt Fleming2012-07-204-50/+64
| | | | | | | | | | | | | | The KT_* image types were never meant to be used outside of com32/menu, so use the external image types from syslinux/boot.h Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * Merge branch 'master' into elflinkMatt Fleming2012-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | The reason for this merge is that we need the fix to core/fs/cache.c without which we can potentially dereference an invalid pointer. The below conflict is a result of the new setup_data blob code being merged from the master branch. Conflicts: com32/lib/Makefile
| * ldlinux: Return immediately after we execute() a commandMatt Fleming2012-07-191-0/+1
| | | | | | | | | | | | | | | | | | If we successfully lookup the filetype of a command we need to return once we've called execute(), otherwise we'll also end up calling new_linux_kernel(). Reported-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * menu: Supply the command type to execute()Matt Fleming2012-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The old execute() was much more forgiving when passing a COM32 module as KT_NONE, as the old code for loading a kernel could also handle COM32 modules. This isn't the case with new_linux_kernel(), and COM32 modules really need to take the create_args_and_load() path in execute(). Without this change loading .c32 files from vesamenu.c32/menu.c32 fails. Reported-by: Helmut Hullen <Hullen@t-online.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * ldlinux: Don't lfree() 'kernel' twiceMatt Fleming2012-06-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This lead to serious problems where duplicate free blocks would appear next to each other on the free list, which created an infinite loop in the following code, for ( fp = head->next_free ; fp != head ; fp = fp->next_free ) { if ( ARENA_SIZE_GET(fp->a.attrs) >= size ) { /* Found fit -- allocate out of this block */ p = __malloc_from_block(fp, size, tag); break; } } because fp == fp->next_free, resulting in modules hanging forever at malloc() call sites. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * fs: Add .copy_super to struct fs_opsMatt Fleming2012-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | commit c0d18deeee2 ("elflink: Fix boot sector booting") makes reference to vfat_copy_superblock() which is only implemented for SYSLINUX, resulting in an undefined symbol when booting ISOLINUX or PXELINUX. Move the superblock copy operation to struct fs_ops so that we don't need to add a stub implementation of vfat_copy_superblock() to ISOLINUX and PXELINUX. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * elflink: Fix compiler warningMatt Fleming2012-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | Apply the correct cast to fix the following warning, chainboot.c: In function ‘chainboot_file’: chainboot.c:88:7: warning: passing argument 3 of ‘syslinux_add_movelist’ makes integer from pointer without a cast ../../../com32/include/syslinux/movebits.h:57:5: note: expected ‘addr_t’ but argument is of type ‘const void * const’ Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * chainboot: clean up old assemblyismsH. Peter Anvin2012-06-071-57/+38
| | | | | | | | | | | | | | | | Delete a bunch of stuff related to the old assembly implementation of chainloading. There are still a few, like the use of pm_load_high() that should be cleaned up. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * execute(): move chainbooting code to its own fileH. Peter Anvin2012-06-073-137/+177
| | | | | | | | | | | | To improve readability, move chainbooting to its own source file. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Merge remote-tracking branch 'mfleming/elflink-dot-zero' into elflinkH. Peter Anvin2012-06-074-1/+258
| |\ | | | | | | | | | | | | | | | | | | Resolved Conflicts: com32/elflink/ldlinux/execute.c Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| | * elflink: Fix boot sector bootingMatt Fleming2012-06-074-1/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds missing support for booting from a boot sector file such as .bs, .bss or .0, by re-implementing the old asm bootsec code from core/bootsect.inc in C. This has resulted in some external changes. We've had to make StackBuf a global symbol because we access it directly from execute.c. Also, we need to move dsinfo.c into MINLIBOBJS because ldlinux now needs to reference __syslinux_derivative_info. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | localboot: remove unnecessary real-mode callPaulo Alcantara2012-05-281-4/+2
| |/ | | | | | | | | | | | | | | | | | | syslinux_local_boot() used to call local_boot() from INT 0x22 (AX=0x0014) as it should just call local_boot() function. The local_boot() function is now exported by core/include/localboot.h to be used in COM32 library space so that syslinux_local_boot() can use it. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * CLI: don't highlight the promptsyslinux-5.00-pre2H. Peter Anvin2012-05-182-2/+2
| | | | | | | | | | | | Don't gratuitously highlight the prompt; it is just annoying. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * CLI: Stick to the classic "boot: " prompt rather than "syslinux$"H. Peter Anvin2012-05-181-1/+1
| | | | | | | | | | | | Just for familiarity... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Merge remote-tracking branch 'mfleming/elflink' into elflinkH. Peter Anvin2012-05-044-50/+57
| |\