summaryrefslogtreecommitdiff
path: root/com32/lua
Commit message (Collapse)AuthorAgeFilesLines
* In the current Lua.c32 DMI implementation, it is a flat table with dotted ↵Hung-chi Lihn2012-09-222-208/+420
| | | | | | | | | names in table entries. It also misses a number DMI sub-tables. This patch, cleans up the DMI table structure using Lua's nested table structure and adds all missing DMI sub-tables. If a DMI sub-table is not supported by the hardware (not filled), then the corresponding sub-table will not be generated. This helps to make the table structure cleaner and reflects the actual DMI information. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
* Added the native syslinux functions config_file(), ipappend_strs(), and ↵Hung-chi Lihn2012-09-221-0/+33
| | | | | | | | | | | | reboot() to Lua.c32. This allows the Lua script to query the config file name and the ipappend strings (pxelinux only), as well as to perform reboot (warm and cold) to the system. In Lua.c32, the extension will be used as the following: 1. syslinux.config_file() will return the config file string. 2. syslinux.ipappend_strs() will return a table of IPAPPEND strings with numerical indices. 3. syslinux.reboot() will perform cold reboot, while syslinux.reboot(1) will perform warm reboot. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
* The current Lua.c32 does not enable io.read() due to some missing library ↵Hung-chi Lihn2012-09-221-11/+29
| | | | | | | | | | | | functions. However, this strongly limits the Lua script from getting user inputs and reading files (even in pxelinux via TFTP). This patch enables io.read() in Lua.c32 with some restrictions: 1. the io.read("*line") is fully supported. 2. the io.read("*number") is not supported due to the missing buffering in underlying file I/Os. However, the user can read a line using io.read() and convert the string to numbers using the built in pattern matching and number conversion features. 3. io.read(bytes) is supported. However, io.read(0) will not be a valid test for EOF due to the missing I/O buffering. io.read() will return nil if EOF is encountered. This offers an alternative way to handle EOF. Signed-off-by: Hung-chi Lihn <hlihn@google.com> Signed-off-by: Erwan Velu <erwanaliasr1@gmail.com>
* com32: Add device tree supportThierry Reding2012-06-291-2/+2
| | | | | | | | This commit adds support for passing a Flattened Device Tree (FDT) blob to the Linux kernel. Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* lua: Adding dhcp supportTimm Gleason2012-01-075-0/+412
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds DHCPINFO functionality to the lua.c32 binary gettable() returns a table of the BOOTP message fields returned by the DHCP server for use in a Lua pxeboot script See http://tools.ietf.org/html/rfc1542 lua key value RFC key ----------------------------------------------------------------------- opcode op message opcode hardware.type htype Hardware address type hardware.length hlen Hardware address length hops hops Used by relay agents transaction.id xid transaction id elapsed.seconds secs Secs elapsed since client boot flags flags DHCP Flags field client.ip.addr ciaddr client IP addr your.ip.addr yiaddr 'Your' IP addr. (from server) server.ip.addr siaddr Boot server IP addr gateway.ip.addr giaddr Relay agent IP addr client.mac chaddr Client hardware addr server.hostname sname Optl. boot server hostname boot.file file boot file name (ascii path) magic.cookie cookie Magic cookie getoptions() returns a table of the DHCP Options field of the BOOTP message returned by the DHCP server for use in a Lua pxeboot script. Many of the options are reurned formatted in as strings in a standard, recognizable format, such as IP addresses. 1, 2, and 4 byte numerical options are returned as integers. Other Options with non-standard formats are returned as strings of the raw binary number that was returned by the DHCP server and must be decoded in a Lua script The Options table returns the Option code as the key except where there are multiple values returned. In those cases, an extra key increment number is added to allow individual access to each Option value. lua key value value Name ----------------------------------------------------------------------- 1 Subnet Mask 6.1 DNS Server [element 1] 6.2 DNS Server [element 2] 6.3 DNS Server [element 3] 209 PXE Configuration File 21.1 Policy Filter [element 1] 21.2 Policy Filter [element 2] Options that can have a list of values, but contain only one (like Option 6) will not return with .sub key values. Usage: t = dhcp.gettable() for k,v in pairs(t) do print(k.." : "..v) end
* lua: Delete superfluous $(LIBS) prerequisiteMatt Fleming2011-04-161-2/+1
| | | | | | | com32.mk already includes the necessary library in $(C_LIBS), we don't need to list them again in $(LIBS). Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* Makefile: Move Makefile fragments into mk/Matt Fleming2011-04-071-1/+2
| | | | | | | | | | | | | | | | | | 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/lua/src/vesa.c: remove variables set but not usedH. Peter Anvin2011-03-161-4/+1
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32/lua/src/syslinux.c: remove variables set but not usedH. Peter Anvin2011-03-161-6/+7
| | | | | | gcc 4.6 warns on variables set but not used, so remove them. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* lua: Adding CPU moduleErwan Velu2011-02-085-1/+182
|
* com32: single instance of skipspace()Erwan Velu2011-02-071-18/+10
| | | | no need to keep several versions of it.
* lua: Adding PCI initErwan Velu2011-02-071-0/+1
| | | | | This removable was introduced by commit bfcd7b7305c5465eb33acca86109ca96cb37403a
* lua: Updating to 5.1.4.2Erwan Velu2011-02-077-20/+37
| | | | Taken from http://www.lua.org/ftp/patch-lua-5.1.4-2
* lua: Updating to 5.1.4Erwan Velu2011-02-0721-215/+308
| | | | | | Updating base code to 5.1.4 Adding -DSYSLINUX build flag Moving #if 0 to ifndef SYSLINUX
* lua: removing duplicated code from vesa.cErwan Velu2011-02-061-22/+0
| | | | | This code was static and unused. At least, if we need it let's reuse the code from the vesa lib.
* lua: Preventing gcc warning on vesa.cErwan Velu2011-02-061-0/+2
|
* lua: Making lua building with no gcc errorErwan Velu2011-02-062-12/+15
| | | | Simple patch to make gcc happy during build in -Wall -Werror
* DMI: Adjusting structures size / Adding cpu coreLaurent Licour2011-01-301-0/+12
| | | | | This patch adds some correction of the dmi structures but also add the support of the cpu cores/threads.
* lua: remove obsolete FIXME commentGeert Stappers2010-07-201-2/+0
| | | | | Remove an obsolete FIXME comment; the problem was caused by a stale library.
* lua: Add .syslinux.derivative() and .syslinux.version()Gert Hulselmans2010-07-073-1/+86
| | | | | | | Add .syslinux.derivative() and .syslinux.version(). Add an example script which shows how you can use .syslinux.derivative(). Signed-off-by: Gert Hulselmans <gerth@zytor.com>
* lua: remove obsolete header used for old sleep functionGert Hulselmans2010-07-061-1/+0
| | | | | | Remove obsolete header used for old sleep function. Signed-off-by: Gert Hulselmans <gerth@zytor.com>
* lua: change syslinux.sleep() to seconds, syslinux.msleep() to msH. Peter Anvin2010-07-053-11/+24
| | | | | | | For consistency with just about everything else, make syslinux.sleep() count seconds, and syslinux.msleep() count milliseconds. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* com32: add proper sleep()/msleep() functions and make Lua use themH. Peter Anvin2010-07-052-5/+4
| | | | | | | 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>
* Merge remote branch 'marcel/luaext'H. Peter Anvin2010-07-059-11/+1116
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merge Marcel Ritter's work on the lua branch: The last time he wrote about the state of his lua branch: http://syslinux.zytor.com/archives/2009-October/013383.html The current state is: - VESA: - switching to vesa mode works - loading/displaying images works - display text works (s. com32/lua/test/vesa.lua) - PCI: - list PC devices + ID - get human-readable device name for device (s. com32/lua/test/pci.lua) - DMI: - get DMI info (BIOS, Hardware, etc). (s. com32/lua/test/dmi.lua) - syslinux: - loading files, kernel, initrd - start kernel, initrd, local boot ... just working on this, so no example lua file right now Most of the actual merging work was done by Gert Hulselmans <gerth@zytor.com>. Resolved Conflicts: com32/lib/sys/vesa/initvesa.c com32/lua/src/Makefile Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * Added PCI descMarcel Ritter2009-10-201-1/+43
| |
| * Added invocationMarcel Ritter2009-10-201-0/+15
| |
| * NewMarcel Ritter2009-10-201-0/+216
| |
| * Loading of kernel and ramdisk worksMarcel Ritter2009-10-161-0/+120
| |
| * More debugging removedMarcel Ritter2009-10-151-0/+2
| |
| * Disabled debug outputMarcel Ritter2009-10-151-3/+4
| |
| * UpdatedMarcel Ritter2009-10-121-0/+44
| |
| * Fixed vesa stuffMarcel Ritter2009-10-102-1/+22
| |
| * Added sleep()Marcel Ritter2009-10-092-39/+92
| | | | | | | | | | Added some comments Fixed cmdline parsing
| * Prepare for arg parsing supportMarcel Ritter2009-10-091-1/+229
| |
| * COM32: lua - add vesa functions (only mode listing right now)Marcel Ritter2008-12-155-0/+144
| |
| * COM32: lua - basic pci functions implementedMarcel Ritter2008-12-155-1/+224
| |
* | lua: quiet warnings about unused variables and functionssyslinux-4.01H. Peter Anvin2010-07-023-2/+5
| | | | | | | | | | | | | | Quiet gcc warnings about unused variables and functions -- things that are not used in the Syslinux environment at this time. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | lua: add parents to luaconf.h to quiet a gcc warningH. Peter Anvin2010-07-021-2/+2
| | | | | | | | | | | | | | | | gcc warns about suspicious-looking code with a comparison inside ==. The code is correct, but add parens so that gcc know we know it is correct. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | lua: add missing <syslinux/boot.h> to syslinux.cH. Peter Anvin2010-07-021-0/+1
| | | | | | | | | | | | Need header files for functions we invoke. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | lua: Modernize the MakefileH. Peter Anvin2010-07-021-73/+27
| | | | | | | | | | | | | | | | | | | | | | Modernize the Makefile for lua to match the current style, in particular to have it pick up its configuration and rules from the central MCONFIG file. This also fixes the incorrect use of "clean" vs. "spotless" which was picked up from the Makefile style in use at that time. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | lua: update for Syslinux 4Geert Stappers2010-07-012-6/+16
|/ | | | Update the lua code to work with Syslinux 4.
* COM32: lua - added dmi functionsMarcel Ritter2008-12-155-1/+324
|
* COM32: lua - added simple syslinux_run_command functionMarcel Ritter2008-12-155-0/+35
|
* COM32: lua - (re-)enable liolib to get printf like functionMarcel Ritter2008-12-153-9/+17
|
* Err.Alexey Zaytsev2008-07-181-1/+1
| | | | Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* Final touhes.Alexey Zaytsev2008-07-183-2/+9
| | | | Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* Don't load the io and os libs, we cant compile them right now.Alexey Zaytsev2008-07-181-2/+2
| | | | Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* Can't load precompiled binaries because if missing ungetcAlexey Zaytsev2008-07-181-0/+2
| | | | Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* Add some more lua libs to be compiled.Alexey Zaytsev2008-07-181-2/+5
| | | | Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>
* Applyed the Go Long Lua! patchAlexey Zaytsev2008-07-186-6/+89
| | | | | | from http://lua-users.org/wiki/LuaPowerPatches Signed-off-by: Alexey Zaytsev <zaytsev.a@protei.ru>