Gene Cumm [Sat, 25 Jan 2014 00:44:51 +0000 (19:44 -0500)]
ldlinux/readconfig.c: remove bail: from do_include()
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 25 Jan 2014 12:37:24 +0000 (07:37 -0500)]
Add const qualifiers to loadleys
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
H. Peter Anvin [Tue, 21 Jan 2014 15:15:52 +0000 (07:15 -0800)]
localboot: Clear register image before using
Using a register image on the stack without initializing it is not a
good idea.
Reported-by: Erwan Velu <erwanaliasr1@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Sun, 19 Jan 2014 00:11:39 +0000 (16:11 -0800)]
Merge remote-tracking branch 'origin/syslinux-4.xx' into syslinux-5.xx
Resolved Conflicts:
version
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Sun, 19 Jan 2014 00:09:19 +0000 (16:09 -0800)]
Makefiles: don't include *.tmp
Since checkin:
bd09a6d828fa Major Makefile cleanups; gcc 4.3.0 compatiblity
... we include *.tmp into the Makefiles as well as .*.d. This seems
to have been a mistake in made when adding *.tmp to cleanup rules,
probably using a sed script.
This causes problems, because *.tmp files are generated by the gcc_ok
macro and do not contain Makefile rules at all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
H. Peter Anvin [Fri, 17 Jan 2014 22:26:28 +0000 (14:26 -0800)]
version: Update year to 2014
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Fri, 17 Jan 2014 22:25:34 +0000 (14:25 -0800)]
version: Update to 4.08, update year to 2014
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Fri, 17 Jan 2014 22:21:44 +0000 (14:21 -0800)]
Merge branch 'master' into elflink
Resolved Conflicts:
NEWS
core/fs/fs.c
version
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Gene Cumm [Mon, 9 Sep 2013 03:22:22 +0000 (23:22 -0400)]
diag/geodsp: README fixes
Should clarify the situation; also word-wrap & save example
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 8 Sep 2013 23:05:30 +0000 (19:05 -0400)]
diag/geodsp: fix Makefile
Results in null image
Reported-By: ioannis
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Thu, 18 Jul 2013 15:20:49 +0000 (11:20 -0400)]
core/legacynet: Enable dot quad resolution
in dnsresolv.c:dns_resolv()
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Ruben Kerkhof [Mon, 30 Dec 2013 21:53:35 +0000 (16:53 -0500)]
Remove some whitespace
Signed-off-by: Ruben Kerkhof <ruben at rubenkerkhof.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
H. Peter Anvin [Tue, 26 Nov 2013 17:58:17 +0000 (09:58 -0800)]
isolinux: Clear upper half of EDX before using
In checkin:
cb015497a4e4 isolinux: Update LBA in getlinsec loop
... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized. If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.
At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.
Reported-by: Carl Duff <cdrw2400@gmail.com>
Reported-by: Philip Müller <philm@manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Celelibi [Sun, 1 Dec 2013 21:06:24 +0000 (22:06 +0100)]
pxe, efi: Bad read of file size over TFTP on EFI64
A fancy pointers logic has been replaced with a plain old if / else
branches. It was assigning only half of a 64 bits integer which is then
assigned to a size_t. Thus leading to a bug on platform where size_t is
64 bits.
Resolves bug #26
Signed-off-by: Celelibi <celelibi@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Tue, 26 Nov 2013 17:58:17 +0000 (09:58 -0800)]
isolinux: Clear upper half of EDX before using
In checkin:
cb015497a4e4 isolinux: Update LBA in getlinsec loop
... we use EDX as a sector count, but the sector count is actually in
DX, and the upper half of EDX is uninitialized. If the BIOS enters
with a nonzero value in the upper half of EDX, this breaks horribly.
At least one set of BIOSes has been identified where if the LBA > 64K
then the upper half of EDX will be nonzero.
Reported-by: Carl Duff <cdrw2400@gmail.com>
Reported-by: Philip Müller <philm@manjaro.org>
Tested-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Raphael S.Carvalho [Tue, 17 Sep 2013 19:52:10 +0000 (16:52 -0300)]
com32: Fix a bug on history of commands.
Previously, even zero-length commands would be added to the history when
they shoudn't, e.g: just typing enter.
For example, if you type: FOO -> (ENTER) -> (ENTER),
then to get FOO from the history you would have to press the UP key
twice. It also saves a bit of memory.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Raphael S.Carvalho [Tue, 17 Sep 2013 19:48:58 +0000 (16:48 -0300)]
com32: Fix bugs on cmd_reverse_search (Triple fault dimension)
cmd_reverse_search has a bug that the variable cursor is updated even if a command
wasn't found. If this happens, and the next key falls into the default case,
memmove's size parameter would be a negative number.
This bug can be reproduced by doing the following:
On cmd_reverse_search (ctrl-r), type multiple keys at the same time.
'Enjoy' the triple fault and a screen of random colors.
There is also a small bug that turns the task of using (ctrl-r) on the first command
impossible. Previously, this command was discarded.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Raphael S.Carvalho [Tue, 17 Sep 2013 19:45:34 +0000 (16:45 -0300)]
com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.
Pulled common code out of these functions into new ones.
The functions chs_setup and ebios_setup were created for this purpose.
Signed-off-by: Raphael S.Carvalho <raphael.scarv@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Mon, 23 Sep 2013 21:28:26 +0000 (17:28 -0400)]
PXE ISR: Force polling on select hardware WORKAROUND
By OUI == 00:23:ae and flags == 0xdc1b, detect select hardware.
On select platforms (Dell OptiPlex 760, Dell OptiPlex 960; perhaps
more), the interrupt appears to go "deaf" after a few seconds. By
matching MAC OUI and flags value, force polling on these select
platforms. I'm not sure if there's any better data available that
shallow in the core. I believe PCI IDs can be fetched with functions
from other libraries and the UUID and DMI data (the most likely to be
useful is SYSPRODUCT) is available in ldlinux.c32.
Commit message expanded with Matt Fleming's assistance
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Thu, 22 Aug 2013 02:21:27 +0000 (22:21 -0400)]
core/lwip: Fix NULL pointer check
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 16 Aug 2013 16:55:53 +0000 (12:55 -0400)]
PXE: use ddprintf macro
Messages are needed before ldlinux.c32 is loaded
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 16 Aug 2013 16:54:39 +0000 (12:54 -0400)]
com32: Define ddprintf() macro
Duplicating Debug Printf; Certain warning/error printf()
statements are not visible if they occur before ldlinux.c32
is loaded
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 16 Aug 2013 16:52:58 +0000 (12:52 -0400)]
PXELINUX: specify PXE/lwIP
Styled after SYSLINUX
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 16 Aug 2013 16:38:28 +0000 (12:38 -0400)]
undiif: show thread of execution on UNDIIF_ID_DEBUG
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 16 Aug 2013 02:28:27 +0000 (22:28 -0400)]
core: dprintf() the banner.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Mon, 23 Sep 2013 21:13:53 +0000 (17:13 -0400)]
PXELINUX: Use sendto() instead of connect()/send()/disconnect()
This commit prevents a race-condition on systems that have functional
interrupts (observed with iPXE and select other Dell systems). Without
this, the reply packet could be received by the core prior to the
disconnect() call, see that it doesn't have a matching PCB (protocol
control block, iirc) since the reply has a different far-end UDP port
than the original request, and lwIP will discard the packet before
PXELINUX can see it.
net_core_sendto() instead of
net_core_connect() net_core_send() net_core_disconnect()
Commit message expanded with Matt Fleming's assistance
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 3 Aug 2013 20:01:28 +0000 (16:01 -0400)]
core: make mbox_post()/__sem_down_slow() check if valid
If the mailbox/semaphore is invalid, disallow additions.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 3 Aug 2013 19:59:26 +0000 (15:59 -0400)]
core: mbox/semaphore NULL checks
Also set mbox invalid and mbox pointer NULL when free()d
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 3 Aug 2013 19:55:54 +0000 (15:55 -0400)]
core/lwip/undi: Improve UNDIIF_ID_DEBUG messages
Remove extra space; add TCP flags
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Thu, 25 Jul 2013 09:28:59 +0000 (10:28 +0100)]
NEWS: document changes in 4.07
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Sat, 20 Jul 2013 13:25:23 +0000 (09:25 -0400)]
Allow for UNDIIF_ID_DEBUG in 1 mk line
Add comments and 1 line to mk/devel.mk to debug headers of all
packets sent/recieved through undiif.c.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 20 Jul 2013 13:23:06 +0000 (09:23 -0400)]
core/lwip/undiif: dprint MAC/ARP/IP/ICMP/TCP/UDP headers; poll debug
Encapsulate in #ifdef; use snprintf and 1 dprintf-like statement.
Print debug message that polling has been forced
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sat, 13 Jul 2013 12:16:14 +0000 (08:16 -0400)]
lwip/undiif: split arphdr._hwlen_protolen
lwIP already split this in etharp.h
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 2 Oct 2011 16:55:20 +0000 (12:55 -0400)]
lwip: Allow LWIP_PLATFORM_* output to use dprintf
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Fri, 12 Jul 2013 18:28:41 +0000 (14:28 -0400)]
lwip: undiif: Fix debug options to unique *_DEBUG macros
Don't reuse *_DEBUG macros intended for other source files.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Fri, 12 Jul 2013 06:33:21 +0000 (07:33 +0100)]
version: bump version and date
Welcome to the 4.07 release cycle
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Fri, 5 Jul 2013 12:50:34 +0000 (13:50 +0100)]
Merge branch 'dynamic-debug' into elflink
Matt Fleming [Fri, 5 Jul 2013 11:14:11 +0000 (12:14 +0100)]
mk: enable dynamic debug support
This will probably be disabled for releases, but it's definitely
worthwhile having enabled for all prereleases.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Fri, 28 Jun 2013 19:53:30 +0000 (20:53 +0100)]
debug.c32: Dynamically enable/disable debug code at runtime
It's useful to be able to enable (and disable) debug code at runtime,
particularly for allowing users that are unable to build their own
Syslinux releases the chance to provide useful debugging output.
For example, say a user reports trouble with their PXE stack but doesn't
have a development environment setup to turn on the debug code
themselves. With this change you can simply request that they do,
debug.c32 -e pxe_call unload_pxe open_file
to enable the debug in those functions. By only turning on code in
specific functions we reduce the chance of disrupting the buggy
behaviour and improve the signal to noise ratio for print statements.
To disable debug code use the -d flag,
debug.c32 -d pxe_call
To use this new feature simply do,
if (syslinux_debug_enabled) {
debug1();
debug2();
....
}
from within the function you wish to add debug code. Note that this
feature is not limited to print statements - you can put any code within
the conditional, such as verifying a checksum or checking for memory
leaks.
The plan is to leave the dynamic debug code built in for all prereleases
and to turn it off for final releases.
People may still want to build with all dprintf() statements enabled,
and so a new symbol, DYNAMIC_DEBUG, was introduced rather than
repurposing the old DEBUG, DEBUG_STDIO and DEBUG_PORT symbols.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Fri, 5 Jul 2013 10:33:26 +0000 (11:33 +0100)]
mk: include $(GCCWARN) when building ELF objects
It's currently impossible to turn on dprintf() statements in
com32/modules because $(GCCWARN) isn't used as part of $(CFLAGS).
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 3 Jul 2013 21:28:43 +0000 (22:28 +0100)]
Merge branch 'idle' into elflink
Matt Fleming [Tue, 2 Jul 2013 13:51:26 +0000 (14:51 +0100)]
idle: Consolidate idle implementations
Duplicate code is bad. Move all the idle code to C and delete the old
assembly stuff.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 3 Jul 2013 21:09:15 +0000 (22:09 +0100)]
idle: enable interrupts before idling
Users are *still* reporting executing __idle() with interrupts disabled,
which ultimately leads to a hang. Just enable them explicitly before
idling.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 3 Jul 2013 11:40:12 +0000 (12:40 +0100)]
Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflink
Pull doc/ and txt/ spelling corrections from Gene Cumm,
* 'doc-for-mfleming' of git://github.com/geneC/syslinux:
doc/ & txt/: Spelling fix
Matt Fleming [Tue, 2 Jul 2013 11:50:54 +0000 (12:50 +0100)]
core: we only need one reset_idle()
We don't need both an assembly version of reset_idle and an
implementation in C. Having these two functions has led to a bug where
we may idle with interrupts disabled because an 'sti' is only performed
in the assembly version. This lead to a hang waiting for user input.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Sun, 30 Jun 2013 17:59:47 +0000 (13:59 -0400)]
doc/ & txt/: Spelling fix
Also add octal note.
Reported-By: Ady <ady-sf@hotmail.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Mon, 1 Jul 2013 15:55:20 +0000 (16:55 +0100)]
load_linux: validate sanity of 'initrd_addr_max'
Some kernel headers have bogus 'initrd_addr_max' fields. This field
should never be zero. Set it to the old upper limit if unspecified.
Failure to set a non-zero value for the field results in a bogus
'memlimit' value, thereby unnecessarily reserving part of the memmap.
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 1 Jul 2013 11:54:06 +0000 (12:54 +0100)]
load_linux: Add dprintf statements to aid debugging
It's useful to know why a kernel is failing to load. Sprinkle some
dprintf() statements with informative messages.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 1 Jul 2013 09:28:15 +0000 (10:28 +0100)]
conio: Fix pollchar() for serial console
The check of the LSR value was inverted. This resulted in pollchar()
always claiming that there was data to be read from the serial console.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 27 Jun 2013 11:54:15 +0000 (12:54 +0100)]
ldlinux: fix INCLUDE regression
We don't want to overwrite 'ConfigName' when parsing a config file via
the INCLUDE directive, which commit
5447ef821 ("ldlinux: Always update
ConfigName when opening a config file") failed to take into account. In
the INCLUDE case we're only parsing config fragments, and not a main
config file.
Rename parse_one_config() to parse_main_config() to more accurately
reflect when it should be invoked (i.e. not for INCLUDE).
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 26 Jun 2013 19:35:32 +0000 (20:35 +0100)]
PXELINUX: implement our own version of local_boot16
We need to do different things for PXE, such as reset the PXE
environment when booting from the local disk from PXELINUX.
This fixes a localboot regression.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 26 Jun 2013 19:56:09 +0000 (20:56 +0100)]
Merge branch 'ipappend-fix-for-mfleming' of git://github.com/geneC/syslinux into elflink
Pull patches to standardize and document IPAPPEND/SYSAPPEND from Gene Cumm,
* 'ipappend-fix-for-mfleming' of git://github.com/geneC/syslinux:
doc/ & txt/: Document IPAPPEND/SYSAPPEND format
core & menu: fix IPAPPEND/SYSAPPEND conversion
Gene Cumm [Wed, 26 Jun 2013 16:01:56 +0000 (12:01 -0400)]
doc/ & txt/: Document IPAPPEND/SYSAPPEND format
Previously the maximum value was 7 which didn't require
differentiation between decimal and hexadecimal.
Gene Cumm [Wed, 26 Jun 2013 15:55:24 +0000 (11:55 -0400)]
core & menu: fix IPAPPEND/SYSAPPEND conversion
Make both use the same functions.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
H. Peter Anvin [Mon, 10 Jun 2013 21:09:24 +0000 (14:09 -0700)]
core: remove unused header file vkernel.inc
vkernel.inc is related to the old assembly-based config file parser;
it is no longer relevant.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Matt Fleming [Mon, 24 Jun 2013 11:03:05 +0000 (12:03 +0100)]
Merge branch 'menu-ipappend-1-for-mfleming' of git://github.com/geneC/syslinux into elflink
Pull a fix for the SYSAPPEND directive from Gene Cumm,
* 'menu-ipappend-1-for-mfleming' of git://github.com/geneC/syslinux:
menu.c32: Fix SYSAPPEND
Matt Fleming [Mon, 24 Jun 2013 09:28:58 +0000 (10:28 +0100)]
Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflink
Pull txt/ and doc/ updates from Gene Cumm,
* 'doc-for-mfleming' of git://github.com/geneC/syslinux:
txt/syslinux.txt: rewrap long command
txt/Makefile: add isolinux.txt, pxelinux.txt
txt/: Add isolinux.txt, pxelinux.txt
txt/syslinux-cli.txt: Version on Ctrl-N
txt/Makefile: order-only prerequisite
txt/: Add common file for derivatives
txt/syslinux.cfg.txt: Updates
txt/syslinux.txt: synopsis, extlinux.sys, wrap long command
txt/syslinux-cli.txt: Path rules
txt/syslinux.cfg.txt: Add SENDCOOKIES, example config
txt/syslinux.cfg.txt: Add SYSAPPEND
doc/syslinux.txt: grammar
Fix SERIAL directive in docs
Gene Cumm [Mon, 24 Jun 2013 03:30:51 +0000 (23:30 -0400)]
menu.c32: Fix SYSAPPEND
Using the SYSAPPEND directive would examine "D" instead of the
value after the directive. Also allows a 1-step switch to strtol()
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 23 Jun 2013 16:19:08 +0000 (12:19 -0400)]
txt/syslinux.txt: rewrap long command
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 23 Jun 2013 12:41:32 +0000 (08:41 -0400)]
txt/Makefile: add isolinux.txt, pxelinux.txt
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 23 Jun 2013 12:41:09 +0000 (08:41 -0400)]
txt/: Add isolinux.txt, pxelinux.txt
Reformatted from previous in doc/. Reflow to try to be more
manpage-like and put more commonly used information on the top.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Sun, 23 Jun 2013 12:39:25 +0000 (08:39 -0400)]
txt/syslinux-cli.txt: Version on Ctrl-N
Only on some versions.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Fri, 14 Jun 2013 07:48:11 +0000 (08:48 +0100)]
cli: don't disable linewrap when redrawing the cmdline
It messes things up when we want to use printf(), for example when
printing labels after the user has hit the TAB key.
This fixes a bug where labels would be printed on a single line on the
screen (with some being displayed off screen) when they should have been
printed across multiple lines.
I can't think of a reason to disable linerap when redrawing the command
line - so let's not.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 13 Jun 2013 13:22:26 +0000 (14:22 +0100)]
ldlinux: fix loading of kbdmap files
Use the canonical code sequence for opening the kbdmap file instead of
referencing KernelName, which presumably is a remanent of the old
assembly code.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Thu, 13 Jun 2013 11:19:47 +0000 (07:19 -0400)]
txt/Makefile: order-only prerequisite
No need to rebuild when the directory's timestamp is updated.
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Thu, 13 Jun 2013 10:46:40 +0000 (11:46 +0100)]
PATH: use a linked list internally
In retrospect, choosing the colon character as the entry separator for
the PATH directive was not a smart move, as that character is also used
in TFTP-style paths. This conflict manifests as PXELINUX being unable to
find and load files.
An example dnsmasq log looks like,
dnsmasq-tftp: sent /arch/boot/syslinux/lpxelinux.0 to 192.168.0.90
dnsmasq-tftp: file /arch/ldlinux.c32 not found
dnsmasq-tftp: file /arch//ldlinux.c32 not found
dnsmasq-tftp: file /arch//boot/isolinux/ldlinux.c32 not found
dnsmasq-tftp: file /arch//isolinux/ldlinux.c32 not found
dnsmasq-tftp: file /arch//boot/syslinuxldlinux.c32 not found
dnsmasq-tftp: sent /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90
dnsmasq-tftp: error 0 No error, file close received from 192.168.0.90
dnsmasq-tftp: failed sending /arch//boot/syslinux/ldlinux.c32 to 192.168.0.90
dnsmasq-tftp: sent /arch/boot/syslinux/archiso.cfg to 192.168.0.90
dnsmasq-tftp: sent /arch/boot/syslinux/whichsys.c32 to 192.168.0.90
dnsmasq-tftp: file /arch/libcom32.c32 not found
dnsmasq-tftp: file /arch//libcom32.c32 not found
dnsmasq-tftp: file /arch/libcom32.c32 not found
dnsmasq-tftp: file /arch//arch//boot/syslinux/libcom32.c32 not found
The last line of the log is the indication that there's a problem.
Internally, Syslinux adds the location of ldlinux.c32 to PATH by
querying the current working directory once ldlinux.c32 is successfully
loaded. Under PXELINUX that means the initial PATH string will be,
"::/arch/boot/syslinux/"
The PATH parsing code doesn't know how to correctly parse the "::"
string and hence, the file is searched for relative to the 210 dhcp
option directory - /arch/.
Implement PATH with a linked list which *greatly* simplifies the path
code, and means we no longer have to parse strings backwards and
forwards.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Thu, 13 Jun 2013 03:59:09 +0000 (23:59 -0400)]
txt/: Add common file for derivatives
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Thu, 13 Jun 2013 03:56:49 +0000 (23:56 -0400)]
txt/syslinux.cfg.txt: Updates
DEFAULT often references a LABEL; TIMEOUT action affected by UI.
IPAPPEND/SYSAPPEND: wrap SYSAPPEND; notes on mask values 2,1.
TIMEOUT-related clarifications
SERIAL is sticky
PATH updated for 5.10-next with notes
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Thu, 13 Jun 2013 02:56:36 +0000 (22:56 -0400)]
txt/syslinux.txt: synopsis, extlinux.sys, wrap long command
Add -v/--version to synopsis; add note on extlinux.sys from old
versions; Wrap altmbr command for cleaner manpage
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Thu, 13 Jun 2013 02:53:30 +0000 (22:53 -0400)]
txt/syslinux-cli.txt: Path rules
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Wed, 12 Jun 2013 07:25:14 +0000 (08:25 +0100)]
version: Welcome to the 5.11 release cycle
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 12 Jun 2013 06:52:29 +0000 (07:52 +0100)]
ldlinux: fix serial port handling regression
commit
c4fa33189f1d ("serial: Clean up and abstract handling of serial
ports") removed an assignment to 'port' in the config parsing code which
is used to setup the serial ports. Restore the assignment.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Gene Cumm [Mon, 10 Jun 2013 19:55:47 +0000 (15:55 -0400)]
txt/syslinux.cfg.txt: Add SENDCOOKIES, example config
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Mon, 10 Jun 2013 19:43:35 +0000 (15:43 -0400)]
txt/syslinux.cfg.txt: Add SYSAPPEND
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Mon, 10 Jun 2013 19:32:58 +0000 (15:32 -0400)]
doc/syslinux.txt: grammar
Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Gene Cumm [Mon, 10 Jun 2013 14:59:38 +0000 (10:59 -0400)]
Fix SERIAL directive in docs
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
Matt Fleming [Tue, 4 Jun 2013 12:56:05 +0000 (13:56 +0100)]
NEWS: Mention noteworthy changes in 5.10
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 4 Jun 2013 11:11:26 +0000 (12:11 +0100)]
NEWS: Clarify network stack files
Point users in the right direction when looking for the new and legacy
network stacks.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 4 Jun 2013 10:50:17 +0000 (11:50 +0100)]
font: write to 'fontbuf', not random memory
commit
be5a345d385d ("font: load data as a single block") cleaned up the
loop for reading into the font buffer but made the mistake of dropping
the assignment to 'p', which means that the _fread() call is writing
through a garbage pointer. Since 'p' was only used to keep track while
writing into the font buffer in a loop, we can now delete it and
reference 'fontbuf' directly.
Also delete the unused variable 'i'.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
H. Peter Anvin [Fri, 31 May 2013 15:05:57 +0000 (08:05 -0700)]
serial: Clean up and abstract handling of serial ports
The special handling of serial ports 0-3 meaning "look in a BIOS
table" is at least officially BIOS-specific, so create an inline
function and move it to bios.h.
While we are at it, make the function look slightly less like
converted assembly.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
H. Peter Anvin [Fri, 31 May 2013 14:52:55 +0000 (07:52 -0700)]
font: load data as a single block
The only reason for a loop is to interleave data, which we don't need
anymore; instead the data is stored in packed form.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Matt Fleming [Wed, 29 May 2013 14:01:12 +0000 (15:01 +0100)]
serial: fix SERIAL directive for ports > 0
There is a bug in the SERIAL directive parsing code that means that
using a port other than the first (SERIAL 0) results in a non-working
serial console. We need to use the serial port number from the config
file to offset the BIOS I/O port base address, otherwise we always
lookup the I/O port address for the first serial port instead of the one
the user specified.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 29 May 2013 12:56:02 +0000 (13:56 +0100)]
font: increment pointer to fontbuf by font height
Instead of always assuming that the font height is 32 bytes, use
hdr.height to increment our fontbuf pointer. hdr.height is the size of
the chunks we read from the .psf file.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 25 Apr 2013 14:14:18 +0000 (15:14 +0100)]
linux: Clear up error message
Passing opt.device to perror() in do_open_file() results in confusing
error messages, as Jack reports,
Last night, I was trying to install syslinux (5.01) to a SD card of
mine, writing to a subdirectory to keep the layout neat:
syslinux-5.01/linux# ./syslinux -i -d /boot /dev/mmcblk0p1
/dev/mmcblk0p1: No such file or directory
The message is coming from do_open_file() in syslinux.c: the call to
open() fails because the containing directory isn't present, and then it
calls perror(opt.device).
We should instead be passing 'name' to perror() so that we know _which_
file doesn't exist.
Reported-by: Jack Kelly <jack@jackkelly.name>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 25 Apr 2013 12:17:06 +0000 (13:17 +0100)]
load_linux: update errno before returning
syslinux_boot_linux() only returns control to the caller when something
has gone wrong, under normal circumstances a kernel is booted.
Update errno accordingly in the error paths, so the user no longer sees
inaccurate errno values which result in the following kinds of messages,
"Booting kernel failed: Bad file descriptor"
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Josh Triplett [Wed, 27 Mar 2013 21:50:37 +0000 (14:50 -0700)]
Fix support for Linux kernel images with no protected mode code
Some kernel images use the Linux kernel boot protocol and header
structure, but do not actually have any protected-mode code. For
instance, grub's 1024-byte lnxboot.img consists of 1024 real-mode bytes
and 0 protected-mode bytes; you can concatenate it with a full grub
core.img to produce a self-contained bootable kernel, but you can also
use it standalone as the kernel with the core.img loaded as an initrd.
syslinux 4 supports this, but it no longer works with syslinux 5: the
memmap functions do not correctly handle a request to work with a 0-byte
region. With lnxboot.img, this would cause syslinux to bail because it
thinks it has no space at the 1M load location but cannot relocate
lnxboot.img. (In bailing, it gives the confusing error message "Bad
file descriptor", not because that error actually occurred when
attempting to boot the kernel, but because errno has that value on entry
to syslinux_boot_linux and nothing clears or sets it.)
Fix the regression by handling the corner case of no protected-mode code
explicitly.
Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Burt Triplett <burt@pbjtriplett.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
H. Peter Anvin [Thu, 28 Mar 2013 21:14:20 +0000 (14:14 -0700)]
pxe: disentangle the legacy and lwip stacks without #ifdef
Disentangle the dependencies via the legacy and the lwip stacks. Now
there are no more #ifdefs (except for a single one in pxelinux.asm)
and the only difference between the pxelinux and lpxelinux archives
are which files are included.
To make this happen:
1. Replace the private part of the socket structure with a union.
2. Move the list of URL methods into a stack-dependent file.
Reported-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Matt Fleming [Wed, 20 Mar 2013 15:22:40 +0000 (15:22 +0000)]
pxe: Fix compiler warnings and real bug
commit
00a6f13139 ("Partially revert "pxe: Pass absolute path to
pxe_chdir()"") introduced a bug by comparing the function 'url_type'
with URL_SUFFIX. This resulted in the following warning,
fs/pxe/pxe.c: In function ‘pxe_chdir’:
fs/pxe/pxe.c:460:18: warning: comparison between pointer and integer [enabled by default]
fs/pxe/pxe.c:458:19: warning: unused variable ‘path_type’ [-Wunused-variable]
fs/pxe/pxe.c: In function ‘pxe_chdir’:
fs/pxe/pxe.c:460:18: warning: comparison between pointer and integer [enabled by default]
fs/pxe/pxe.c:458:19: warning: unused variable ‘path_type’ [-Wunused-variable]
which unfortunately went unnoticed.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Fri, 15 Mar 2013 16:32:52 +0000 (16:32 +0000)]
ldlinux: Fixup lwip merge botch
The lwip merge changed the code for copying cmdline arguments from,
strcpy(q, p);
to this,
do {
*q++ = ch = *p++;
} while (ch);
which means 'p' no longer points at 'args'. Use 'args' explicitly for
the case where we need to apply a filename extension, otherwise users
end up seeing errors like,
Failed to load COM32 file .c32
Reported-by: Mattias Schlenker <ms@mattiasschlenker.de>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 11 Mar 2013 13:57:56 +0000 (13:57 +0000)]
Partially revert "pxe: Pass absolute path to pxe_chdir()"
This partially reverts commit
b208ba467f678ed8e73f8d11fc0609634120cb83.
It isn't correct to always pass URL_OLD_TFTP to chdir(), since the
path prefix option may contain a full url, e.g. http://
Specialise the one case where we need to build a ::-style TFTP path
inside of get_prefix() to maintain backwards compatability, since from
Syslinux 5.00 onwards we may move out of the root directory ("::")
while searching for ldlinux.c32.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 28 Feb 2013 15:07:19 +0000 (15:07 +0000)]
readconfig: Don't display "(null)" labels when hitting TAB
It is entirely legitimate for a menu entry to have a NULL label or
displayname. Since these entries are not used for execution, skip
displaying them in print_labels() when hitting the TAB key.
Reported-by: Bernd Blaauw <bblaauw@home.nl>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Thu, 28 Feb 2013 17:44:54 +0000 (17:44 +0000)]
ldlinux: Always update ConfigName when opening a config file
With the introduction of commit
aa7dd29db684 ("ldlinux: Pass config
filename as argv[1] to ldlinux.c32") we stopped using ConfigName to
store the filename of the config file we intend to open in execute()
since it interfered with the filesystem-specific open_config()
implementations. But a side-effect of this change is that
syslinux_config_file() no longer works if we explicitly pass a
filename to parse_config_file().
The logical place to keep ConfigName in sync is in parse_config_file()
since it's expected that all the filesystem-specific open_config()
functions will fill out ConfigName for us. In the case where the
filename is supplied by the caller, we need to fill it out ourselves.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Wed, 6 Mar 2013 17:10:32 +0000 (17:10 +0000)]
Merge branch 'lwip-merge' into elflink
Matt Fleming [Tue, 26 Feb 2013 16:24:56 +0000 (16:24 +0000)]
net: Return of the legacy network stack
While it's nice having the shiny new lwIP stack, there is definitely
merit in being able to choose between two different network stacks. We
want to keep the legacy network stack around as it is known to handle
funky BIOS implementations and provides a good reference point when
bugs are suspected in the lwIP code.
Users now have a choice of .0 files. pxelinux.0 uses the legacy
network stack, while lpxelinux.0 uses lwIP.
Note that not every protocol is converted to using this new API. The
http, ftp and tcp code is still inherently tied to the netconn API,
and is only available with lpxelinux.0 and the lwIP stack. It's
unlikely that this code will ever be fixed up to work with the legacy
network stack.
Network stack operations are abstracted behind the net_core_*
interface, and each network stack has private data fields contained
within a struct net_private.
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Paulo Alcantara [Sun, 6 Jan 2013 20:36:17 +0000 (18:36 -0200)]
menugen: Make it compatible with Py3k
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 26 Feb 2013 14:25:00 +0000 (14:25 +0000)]
shuffle: syslinux_dump_movelist() only takes 1 argument
Fix up the following compiler error that is triggered with -DDEBUG=2,
syslinux/shuffle.c:135:2: error: too many arguments to function ‘syslinux_dump_movelist’
In file included from syslinux/shuffle.c:44:0:
../include/syslinux/movebits.h:87:6: note: declared here
syslinux/shuffle.c:155:5: warning: passing argument 1 of ‘syslinux_dump_movelist’ from incompatible pointer type [enabled by default]
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Tue, 19 Feb 2013 12:18:19 +0000 (12:18 +0000)]
lwip: Fix use-after-free memory corruption
Set *sem to NULL after free() otherwise calling sys_sem_set_invalid()
will cause us to write into a memory location that has potentially
either been reused for another allocation or contains freelist
metadata.
This manifested as malloc() corruption, because we
sys_sem_set_invalid() was overwriting malloc metadata used for
maintaining the freelist.
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Cc: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 18 Feb 2013 20:25:27 +0000 (20:25 +0000)]
pxe: Handle closing file with NULL ->inode
It's possible that pxe_close_file() will be called with a NULL
file->inode from searchdir() if pxe_searchdir() fails to lookup a
file.
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Matt Fleming [Mon, 25 Feb 2013 15:25:16 +0000 (15:25 +0000)]
Merge branch 'lwip' into elflink
Welcome to Syslinux 5.10.
Conflicts:
NEWS
com32/lib/Makefile
com32/lib/sys/open.c
com32/lib/syslinux/ipappend.c
com32/modules/Makefile
com32/modules/prdhcp.c
core/Makefile
core/cmdline.inc
core/com32.inc
core/comboot.inc
core/configinit.inc
core/fs/chdir.c
core/fs/fs.c
core/fs/pxe/dnsresolv.c
core/fs/pxe/pxe.c
core/fs/pxe/pxe.h
core/idle.c
core/include/ctype.h
core/init.inc
core/mem/init.c
core/parseconfig.inc
core/runkernel.inc
core/syslinux.ld
core/ui.inc
doc/comboot.txt
version
Matt Fleming [Fri, 22 Feb 2013 15:13:38 +0000 (15:13 +0000)]
com32: Add com32_cmdline() which returns argv[1..argc-1]
cmd.c32 needs an equivalent of __com32.cs_cmdline now that the COMBOOT
code is dead. Introducing com32_cmdline(), which returns a string
consisting of module arguments from argv[1] to argv[argc-1], separated
by spaces.
Reported-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>