summaryrefslogtreecommitdiff
path: root/com32/cmenu
Commit message (Collapse)AuthorAgeFilesLines
* com32sys_t inreg shall be zeroified prior intcallErwan Velu2014-01-221-0/+6
| | | | | | | | | | | As per commit f775e740a3a817a4ff5ba26bea99dbfd735456b3, inreg parameters of intcall() shall be zeroified. Having unclean inreg could trigger bad behaviors on some hosts. This patch is about adding memset() calls prior any intcall() : - some intcall didn't had any memset at all - some successive intcall() calls didn't memset inreg in between calls
* cmenu: Add libmenu.c32 to $(C_LIBS)syslinux-6.02-pre15Matt Fleming2013-07-291-0/+2
| | | | | | | | The menu modules, display, text, etc, require libmenu.c32 to be listed as a dependency. Append to $(C_LIBS) in mk/elf.mk so that module Makefiles can make use of the suffix rules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* cmenu: the order of entries in $(LIBMENU) is vitalMatt Fleming2013-07-291-4/+3
| | | | | | | | | | | | | | | | Unresolved symbols in an object file cannot be resolved from shared libraries that are listed earlier in $(LIBMENU). We need to put the shared libraries at the end of $(LIBMENU). commit 1408e6ca ("Add per-firmware object directory support") appears to have broken this rule, which resulted in hdt.c32 (among other modules) failing to load with, "Undef symbol FAIL: symbol console_ansi_raw" Add a simple regression test that loads hdt.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* video.h: we need one syslinux_force_text_mode() prototypeMatt Fleming2013-07-261-0/+1
| | | | | | | | | Use the one from syslinux/video.h. This makes it easier to write unit tests for syslinux/load_linux.c without pulling in loads of core definitions from core/include/graphics.h. It can also be argued that syslinux_* symbols should have prototypes in syslinux/*.h files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* cmenu: only the spotless target should delete *.c32Matt Fleming2013-07-121-3/+3
| | | | | | | | | | | | | If distribution package maintainers follow the advice in doc/distrib.txt for rebuilding the installers, they'll currently hit the following error when executing 'make install' install: cannot stat ‘com32/cmenu/libmenu/*.c32’: No such file or directory Follow what every other module does and only delete .c32 files for the spotless target. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge tag 'syslinux-5.01' into firmwaresyslinux-6.00-pre4Matt Fleming2013-01-292-34/+35
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile NEWS com32/cmenu/Makefile com32/elflink/ldlinux/Makefile com32/gfxboot/Makefile com32/gpllib/Makefile com32/include/sys/module.h com32/lib/Makefile com32/lib/sys/module/elf_module.c com32/menu/Makefile com32/rosh/Makefile com32/samples/Makefile core/init.c mk/elf.mk Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * Rename libutil_com.c32 to libutil.c32H. Peter Anvin2013-01-171-2/+2
| | | | | | | | | | | | Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * Always strip all the modulesH. Peter Anvin2013-01-171-4/+5
| | | | | | | | | | | | | | | | Always strip the modules; they are too big unstripped. Specifically, we generate unstripped *.elf files, and then convert them to stripped *.c32 files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * menugen: Make it compatible with Py3kPaulo Alcantara2013-01-091-28/+28
| | | | | | | | | | Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3Matt Fleming2012-12-071-45/+7
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * 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>
* | Merge tag 'syslinux-5.00-pre10' into for-hpa/elflink/firmwareMatt Fleming2012-11-141-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | 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
| * 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>
* | Add per-firmware object directory supportMatt Fleming2012-10-161-13/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* com32: Use --as-needed for LDFLAGSMatt Fleming2012-07-201-4/+4
| | | | | | | | | | | | | | | | This extends commit 4678fd92a21e ("elflink: fix dependency problem in cmenu/Makefile") and basically reverts commit fb543aa635ff ("com32: Per-object file LDFLAGS"). By using the --as-needed ld argument we can specify all the required shared libraries for a directory, even if not all of the libraries are needed by every .c32 file. --as-needed takes care of only creating DT_NEEDED entries for the shared libraries that are actually required to resolve undefined symbols in a given module. Furthermore, by using $(LIBS) we create a dependency between .c32 files and their shared libraries, which allows multiple make jobs to run in parallel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: Replace __intcall() with direct function callsMatt Fleming2012-07-201-13/+9
| | | | | | | | 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>
* elflink: fix dependency problem in cmenu/Makefilesyslinux-5.00-pre6H. Peter Anvin2012-06-291-15/+4
| | | | | | | | | | | Instead of adding library dependencies implicitly, make them explicit and use --as-needed to avoid bogus DT_NEEDED entries from being generated. The other Makefiles should be adjusted accordingly as well. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Cc: Matt Fleming <matt.fleming@intel.com>
* com32: Per-object file LDFLAGSMatt Fleming2012-06-201-2/+15
| | | | | | | | | | | | | Some object files need to link against the ELF libraries. Allow them to be specified with the following syntax in the Makefiles, LDFLAGS_$(object_file) = $(LIBS) By adding libraries in this way DT_NEEDED entries are created in the ELF modules and the required library dependencies are automatically loaded before running the module. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Delete all references to __com32.cs_bounceMatt Fleming2012-06-081-7/+18
| | | | | | | | | The COM32 cs_bounce buffer is not usable with ELF modules, as we're trying to move to an environment where memory is dynamically allocated. All users of __com32.cs_bounce have been converted to using lmalloc() to allocate low memory. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: Make ELF the default object formatMatt Fleming2011-04-261-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | com32/elflink/modules was originally created to house ELF modules and keep them separate from the COM32 modules as the elflink branch was being developed. However, this has inadvertently created a maintenance nightmare because code was copied from elsewhere in the tree into com32/elflink/modules, resulting in duplication. Bug fixes have been going into the original code but have not been merged onto the elflink branch, leaving the duplicate code in com32/elflink/modules buggy. So let's delete this directory. There really is no reason to keep ELF and COM32 modules separate because there's no reason to need both COM32 and ELF modules to coexist. ELF is a far superior object file format and all modules are not emitted as ELF objects. Now that we're outputting ELF modules we can use dynamic memory instead of the cs_bounce bounce buffer. This commit requires a certain amount of shuffling for some files. quicksort.c isn't a module and belongs as part of the util library. cli.h belongs in com32/include so that other modules can make use of the cli code in ldlinux.c32. All libraries are now ELF shared libraries which are only loaded to fixup unresolved symbols for executable modules and renamed from *.a to *.c32. This reduces the runtime memory footprint because libraries are only loaded when needed and because every executable no longer gets its own copy of code/data (as it would if linking with a static library). Also, remove MINLIBOBJS from libcom32.c32 because it is already part of libcom32min.a and we don't want to have any duplicate symbols between the core (which links with libcom32min.a) and libcom32.c32. Welcome to the New World Order of ELF modules! Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* cmenu: Rename menu.h to cmenu.hMatt Fleming2011-04-267-6/+6
| | | | | | | | | In preparation for moving com32/menu/menu.h to com32/include/ let's rename com32/cmenu/menu.h. This stops us having two header files named menu.h which would mean that we'd have to be super careful with our include paths to ensure we included the correct header. Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* Makefile: Move Makefile fragments into mk/Matt Fleming2011-04-071-2/+3
| | | | | | | | | | | | | | | | | | Move the MCONFIG files into a mk/ directory and give them more descriptive names. This is purely a cosmetic change to make the 'include' directives a bit more coherent by making it obvious exactly which MCONFIG file we're including. For example, in com32/lua/src/Makefile we exchange the line, include ../../MCONFIG for the much more comprehensible, include $(MAKEDIR)/com32.mk Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* com32/cmenu/adv_menu.tpl: Use the proper value for ipappendH. Peter Anvin2011-03-161-1/+1
| | | | | | | | If x is NULL, we're supposed to pass 0 for ipappend; this was incorrect in the template and the gcc 4.6 unused variable warning caught it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32/cmenu/libmenu/help.c: remove variables set but not usedH. Peter Anvin2011-03-161-4/+3
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* libmenu: Fix cursor on exit from showmenus()Gene Cumm2010-07-261-1/+1
| | | | | | | | | | This fixes the issue in hdt.c32 that Kent Robotti noticed where exiting directly from Menu Mode caused the cursor to not be displayed. This same issue also affects com32/cmenu/simple.c32 and probably others using showmenus(). Signed-off-by: Gene Cumm <gene.cumm@gmail.com> 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-13/+0
| | | | | | | 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>
* cmenu: remove obsolete Makefile rulessyslinux-4.00-pre42H. Peter Anvin2010-05-121-15/+0
| | | | | | | Remove Makefile rules which were both redundant (../MCONFIG contains the rules in a central manner) and just plain wrong. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* adv_menu.tpl: fix type of login_handler()H. Peter Anvin2010-05-121-1/+3
| | | | | | Fix the type of the login_handler() function. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* complex.c: fix warningsH. Peter Anvin2010-05-121-0/+4
| | | | | | Clean up warnings, even though this is sample code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libmenu/des.c: fix signedness errorH. Peter Anvin2010-05-121-4/+3
| | | | | | | Fix a signedness error, which in turn was caused by needlessly complicated code. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libmenu/passwords.h: function declaration isn't a prototypeH. Peter Anvin2010-05-121-1/+1
| | | | | | Make it a prototype Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* libmenu/syslnx.c: mark ipappend usedH. Peter Anvin2010-05-121-0/+2
| | | | | | Is this really correct?! Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* CMENU: Fixing login_handler prototypeErwan Velu2010-05-121-1/+1
| | | | | login_handler have to follow the (t_menusystem * ms, t_menuitem * mi) prototype defined by t_handler_return
* cmenu: clean up some () that should be (void)H. Peter Anvin2010-01-103-4/+4
| | | | | | | () is not a prototype, and means (...) not (void) in C. Replace with (void). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Change () prototypes to (void)H. Peter Anvin2010-01-063-10/+10
| | | | | | | | () means the same as (...) in C, not the same as (void) as it does in C++. It is generally misused to mean (void), though. Actually write what we mean... this is C, after all. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* cmenu: Increasing limitsErwan Velu2009-11-081-2/+2
| | | | | | | Impact: avoid memory corruption with hdt Some users reported systems with 89 pci devices. This case requires to increase theses values
* cmenu: reset the cursor position on shutdownPierre-Alexandre Meyer2009-11-011-0/+1
| | | | | | | | | | Reset the cursor at the top left corner of the screen when exiting the menu. This fixes odd behaviors when switching back and forth between CLI and menu in HDT. Closes: #14 Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use ASCII characters for scrollbarsPierre-Alexandre Meyer2009-09-072-4/+3
| | | | | | | | | | Use ^ and v as hints for scrolling. Use \141 from the Special Characters and Line Drawing Character Set as the scrollbox. Note: printf "\016\141\017" doesn't seem to work well on xterm, although it does work on the vga console. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: do not invoke help if helpid is 0xFFFF (complex.c)Pierre-Alexandre Meyer2009-09-071-1/+1
| | | | | | 0xFFFF is invalid (no help) Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: redraw the current menu after exiting the keys_handlerPierre-Alexandre Meyer2009-09-071-0/+6
| | | | | | | | | | | | | | | After exiting the keys_handler, reset_ui() is not enough since it only resets the status line and title. The current menu needs to be redrawn. Note: only a submenu will be redrawn, not its parents. This means that not all the UI will be displayed after exiting the handler if invoked from whithin a submenu. We have already this problem nowadays when exiting a submenu of a submenu. The root parent is not redrawn, leading to some ugly states (the background color overrides part of the root menu). This will be fixed when we implement a real hierarchy (each submenu having access to its parents). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: optimize redraw to be fasterPierre-Alexandre Meyer2009-09-071-63/+118
| | | | | | | | | | cmenu currently redraws everything after each key press. This doesn't scale well, especially over serial. Instead, redraw only the previous/current selected entries. A full redraw is still needed when scrolling though. Misc.: add CTRL-L combo to force a redraw of the current menu. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: force refresh after checkbox_handler in complex.cPierre-Alexandre Meyer2009-09-071-1/+6
| | | | | | | | complex.c has a special checkbox_handler that disables mutual exclusive entries. This works today because each key press triggers a redraw of the whole menu. We can't rely on this if we want to optimize the redraw. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: redraw menu when exiting keys_handlerPierre-Alexandre Meyer2009-09-071-12/+22
| | | | | | | The keys_handler can change the UI (e.g. the help system draws a black background by default). We need to redraw the background and title on exit. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: pad help filename with 0 instead of spacesPierre-Alexandre Meyer2009-09-071-1/+1
| | | | | | | | | | The manual states that the help filename format is hlp<NNNNN>.txt where <NNNNN> is the helpid. If the helpid contains less than 5 digits, pad with zero, not spaces, i.e. look for hlp00023.txt, not hlp 23.txt. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove obsolete com32io codePierre-Alexandre Meyer2009-09-062-14/+0
| | | | | | Remove legacy scrollupwindow definition and checkkbdbuf declaration. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: make the help menu actually workPierre-Alexandre Meyer2009-09-062-22/+39
| | | | | | | With the recent changes in cmenu, the help feature was completely broken. Fix it. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: fix handlers signature in the examplesPierre-Alexandre Meyer2009-09-052-3/+3
| | | | | | | | | The keys handler accepts three arguments: the current menu system, the current menu entry and the key pressed. Misc: fix timeout in complex.c to actually be 10 seconds. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: use get_key library for keyboard functionsPierre-Alexandre Meyer2009-09-0510-211/+99
| | | | | | | Syslinux already uses a get_key library to handle stdin. Let's leverage it. cmenu now works over serial completely. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: fill backgorund with printable characterPierre-Alexandre Meyer2009-09-052-5/+5
| | | | | | | To have a blue background on the console (serial), we need to fill the screen with a printable character (e.g. space). Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
* cmenu: remove legacy CHABSATTR/CHRELATTR codePierre-Alexandre Meyer2009-09-051-3/+0
| | | | | | CHABSATTR and CHRELATTR have been replaced by SO/SI. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>