aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-02-26bios: Don't truncate memory size needed to 16 bitssyslinux-5.xxH. Peter Anvin1-1/+1
We can't truncate the memory size needed to 16 bits *before* we convert it to kilobytes... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-26bios: Fix lowmem checkH. Peter Anvin1-2/+2
The lowmem check was backwards and would report error when there wasn't any. This was missed because the Ctrl key check was *also* backwards and so the check would only be done when Ctrl was held down. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-02-01Merge branch 'syslinux-4.xx' into syslinux-5.xxGene Cumm3-2/+76
2014-02-01isohybrid: Improve help/manGene Cumm2-7/+10
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-02-01Add manpages for isohybrid, memdiskfindPeter Jones2-0/+71
Signed-off-by: Peter Jones <pjones@redhat.com>
2014-01-25com32/moduless/poweroff.c: use __unused attribute insteadGene Cumm1-1/+1
Recommended-By: Matt Fleming <matt@console-pimps.org> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-25com32/modules/poweroff.c: fix main()Gene Cumm1-1/+1
Wrong prototype; use GCC unused Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-25ldlinux/readconfig.c: remove bail: from do_include()Gene Cumm1-1/+0
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-25Add const qualifiers to loadleysGene Cumm2-3/+3
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-21localboot: Clear register image before usingH. Peter Anvin1-0/+1
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>
2014-01-18Merge remote-tracking branch 'origin/syslinux-4.xx' into syslinux-5.xxH. Peter Anvin9-9/+9
Resolved Conflicts: version Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-01-18Makefiles: don't include *.tmpH. Peter Anvin9-9/+9
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>
2014-01-17version: Update year to 2014H. Peter Anvin1-1/+1
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-01-17version: Update to 4.08, update year to 2014H. Peter Anvin1-1/+1
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-01-17Merge branch 'master' into elflinkelflinkH. Peter Anvin4-11/+37
Resolved Conflicts: NEWS core/fs/fs.c version Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2014-01-08diag/geodsp: README fixesGene Cumm1-7/+25
Should clarify the situation; also word-wrap & save example Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-08diag/geodsp: fix MakefileGene Cumm1-3/+3
Results in null image Reported-By: ioannis Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2014-01-08core/legacynet: Enable dot quad resolutionGene Cumm1-0/+35
in dnsresolv.c:dns_resolv() Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-12-30Remove some whitespaceRuben Kerkhof1-1/+1
Signed-off-by: Ruben Kerkhof <ruben at rubenkerkhof.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-12-11isolinux: Clear upper half of EDX before usingH. Peter Anvin1-1/+1
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>
2013-12-11pxe, efi: Bad read of file size over TFTP on EFI64Celelibi1-35/+11
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>
2013-11-26isolinux: Clear upper half of EDX before usingH. Peter Anvin1-1/+1
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>
2013-09-30com32: Fix a bug on history of commands.Raphael S.Carvalho1-5/+8
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>
2013-09-30com32: Fix bugs on cmd_reverse_search (Triple fault dimension)Raphael S.Carvalho1-2/+9
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>
2013-09-30com32/disk: Code cleanup at disk_write_sectors and disk_read_sectors.Raphael S.Carvalho2-83/+97
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>
2013-09-30PXE ISR: Force polling on select hardware WORKAROUNDGene Cumm1-1/+21
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>
2013-09-23core/lwip: Fix NULL pointer checkGene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23PXE: use ddprintf macroGene Cumm3-26/+26
Messages are needed before ldlinux.c32 is loaded Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23com32: Define ddprintf() macroGene Cumm1-0/+3
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>
2013-09-23PXELINUX: specify PXE/lwIPGene Cumm2-2/+8
Styled after SYSLINUX Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23undiif: show thread of execution on UNDIIF_ID_DEBUGGene Cumm1-3/+7
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23core: dprintf() the banner.Gene Cumm1-0/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-09-23PXELINUX: Use sendto() instead of connect()/send()/disconnect()Gene Cumm4-8/+94
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>
2013-08-03core: make mbox_post()/__sem_down_slow() check if validGene Cumm2-2/+2
If the mailbox/semaphore is invalid, disallow additions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-08-03core: mbox/semaphore NULL checksGene Cumm5-24/+41
Also set mbox invalid and mbox pointer NULL when free()d Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-08-03core/lwip/undi: Improve UNDIIF_ID_DEBUG messagesGene Cumm1-8/+9
Remove extra space; add TCP flags Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-25NEWS: document changes in 4.07syslinux-4.07Matt Fleming1-0/+8
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-20Allow for UNDIIF_ID_DEBUG in 1 mk linesyslinux-5.11-pre9Gene Cumm2-1/+5
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>
2013-07-20core/lwip/undiif: dprint MAC/ARP/IP/ICMP/TCP/UDP headers; poll debugGene Cumm2-1/+220
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>
2013-07-13lwip/undiif: split arphdr._hwlen_protolenGene Cumm1-5/+7
lwIP already split this in etharp.h Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12lwip: Allow LWIP_PLATFORM_* output to use dprintfGene Cumm1-2/+12
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12lwip: undiif: Fix debug options to unique *_DEBUG macrosGene Cumm2-35/+56
Don't reuse *_DEBUG macros intended for other source files. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-12version: bump version and datesyslinux-4.07-pre1Matt Fleming1-1/+1
Welcome to the 4.07 release cycle Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-07-05Merge branch 'dynamic-debug' into elflinksyslinux-5.11-pre8Matt Fleming10-6/+182
2013-07-05mk: enable dynamic debug supportMatt Fleming1-0/+1
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>
2013-07-05debug.c32: Dynamically enable/disable debug code at runtimeMatt Fleming7-3/+178
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>
2013-07-05mk: include $(GCCWARN) when building ELF objectsMatt Fleming2-3/+3
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>
2013-07-03Merge branch 'idle' into elflinksyslinux-5.11-pre7Matt Fleming6-79/+6
2013-07-03idle: Consolidate idle implementationsMatt Fleming6-79/+5
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>
2013-07-03idle: enable interrupts before idlingMatt Fleming1-0/+1
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>
2013-07-03Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflinksyslinux-5.11-pre6Matt Fleming2-5/+6
Pull doc/ and txt/ spelling corrections from Gene Cumm, * 'doc-for-mfleming' of git://github.com/geneC/syslinux: doc/ & txt/: Spelling fix
2013-07-02core: we only need one reset_idle()Matt Fleming3-9/+3
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>
2013-07-01doc/ & txt/: Spelling fixGene Cumm2-5/+6
Also add octal note. Reported-By: Ady <ady-sf@hotmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-07-01load_linux: validate sanity of 'initrd_addr_max'syslinux-5.11-pre5Matt Fleming1-1/+1
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>
2013-07-01load_linux: Add dprintf statements to aid debuggingMatt Fleming1-12/+29
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>
2013-07-01conio: Fix pollchar() for serial consolesyslinux-5.11-pre4Matt Fleming1-4/+3
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>
2013-06-27ldlinux: fix INCLUDE regressionsyslinux-5.11-pre3Matt Fleming1-22/+70
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>
2013-06-26PXELINUX: implement our own version of local_boot16Matt Fleming3-6/+66
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>
2013-06-26Merge branch 'ipappend-fix-for-mfleming' of git://github.com/geneC/syslinux ↵Matt Fleming4-4/+7
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
2013-06-26doc/ & txt/: Document IPAPPEND/SYSAPPEND formatGene Cumm2-2/+5
Previously the maximum value was 7 which didn't require differentiation between decimal and hexadecimal.
2013-06-26core & menu: fix IPAPPEND/SYSAPPEND conversionGene Cumm2-2/+2
Make both use the same functions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-24core: remove unused header file vkernel.incH. Peter Anvin2-36/+0
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>
2013-06-24Merge branch 'menu-ipappend-1-for-mfleming' of ↵Matt Fleming1-3/+5
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
2013-06-24Merge branch 'doc-for-mfleming' of git://github.com/geneC/syslinux into elflinkMatt Fleming8-36/+779
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
2013-06-23menu.c32: Fix SYSAPPENDGene Cumm1-3/+5
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>
2013-06-23txt/syslinux.txt: rewrap long commandGene Cumm1-2/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/Makefile: add isolinux.txt, pxelinux.txtGene Cumm1-2/+4
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-23txt/: Add isolinux.txt, pxelinux.txtGene Cumm2-0/+577
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>
2013-06-23txt/syslinux-cli.txt: Version on Ctrl-NGene Cumm1-1/+1
Only on some versions. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-14cli: don't disable linewrap when redrawing the cmdlinesyslinux-5.11-pre2Matt Fleming1-1/+1
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>
2013-06-13ldlinux: fix loading of kbdmap filesMatt Fleming1-9/+2
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>
2013-06-13txt/Makefile: order-only prerequisiteGene Cumm1-3/+3
No need to rebuild when the directory's timestamp is updated. Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-13PATH: use a linked list internallysyslinux-5.11-pre1Matt Fleming6-67/+109
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>
2013-06-12txt/: Add common file for derivativesGene Cumm1-0/+11
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-12txt/syslinux.cfg.txt: UpdatesGene Cumm1-26/+39
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>
2013-06-12txt/syslinux.txt: synopsis, extlinux.sys, wrap long commandGene Cumm1-6/+8
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>
2013-06-12txt/syslinux-cli.txt: Path rulesGene Cumm1-0/+28
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-12version: Welcome to the 5.11 release cycleMatt Fleming1-1/+1
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-12ldlinux: fix serial port handling regressionMatt Fleming1-1/+3
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>
2013-06-10txt/syslinux.cfg.txt: Add SENDCOOKIES, example configGene Cumm1-0/+36
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-10txt/syslinux.cfg.txt: Add SYSAPPENDGene Cumm1-3/+77
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-10doc/syslinux.txt: grammarGene Cumm1-1/+1
Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-10Fix SERIAL directive in docsGene Cumm2-2/+2
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-06-04NEWS: Mention noteworthy changes in 5.10syslinux-5.10Matt Fleming1-0/+9
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-04NEWS: Clarify network stack filesMatt Fleming1-1/+3
Point users in the right direction when looking for the new and legacy network stacks. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-06-04font: write to 'fontbuf', not random memoryMatt Fleming1-3/+1
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>
2013-05-31serial: Clean up and abstract handling of serial portsH. Peter Anvin2-15/+18
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>
2013-05-31font: load data as a single blockH. Peter Anvin1-11/+7
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>
2013-05-29serial: fix SERIAL directive for ports > 0Matt Fleming1-1/+1
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>
2013-05-29font: increment pointer to fontbuf by font heightMatt Fleming1-1/+1
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>
2013-04-25linux: Clear up error messageMatt Fleming1-1/+1
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>
2013-04-25load_linux: update errno before returningMatt Fleming1-12/+37
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>
2013-04-08Fix support for Linux kernel images with no protected mode codeJosh Triplett1-7/+11
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>
2013-03-28pxe: disentangle the legacy and lwip stacks without #ifdefH. Peter Anvin8-81/+88
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>
2013-03-20pxe: Fix compiler warnings and real bugsyslinux-5.10-pre2Matt Fleming1-1/+1
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>
2013-03-15ldlinux: Fixup lwip merge botchMatt Fleming1-0/+1
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>
2013-03-11Partially revert "pxe: Pass absolute path to pxe_chdir()"Matt Fleming1-16/+27
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>
2013-03-07readconfig: Don't display "(null)" labels when hitting TABMatt Fleming1-0/+3
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>
2013-03-07ldlinux: Always update ConfigName when opening a config fileMatt Fleming1-0/+9
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>
2013-03-06Merge branch 'lwip-merge' into elflinksyslinux-5.10-pre1Matt Fleming233-1591/+69694
2013-03-06net: Return of the legacy network stackMatt Fleming15-178/+1129
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>
2013-02-27menugen: Make it compatible with Py3kPaulo Alcantara1-28/+28
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-26shuffle: syslinux_dump_movelist() only takes 1 argumentMatt Fleming1-2/+2
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>
2013-02-26lwip: Fix use-after-free memory corruptionMatt Fleming1-0/+1
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>
2013-02-26pxe: Handle closing file with NULL ->inodeMatt Fleming1-0/+3
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>
2013-02-26Merge branch 'lwip' into elflinkMatt Fleming227-1653/+68801
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
2013-02-23com32: Add com32_cmdline() which returns argv[1..argc-1]syslinux-5.02-pre3Matt Fleming3-1/+15
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>
2013-02-21ldlinux: Don't discard cmdline arguments when executing labelsMatt Fleming1-2/+22
Don't throw away additional cmdline arguments when executing a label. Append them instead. Gene Cumm reports, When using the CLI and calling a LABEL "mylabel", specifying "mylabel options" does not pass "options" through to the kernel's command line. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-21mem: Add magic field to detect memory corruptionMatt Fleming6-6/+38
Very little checking is performed on the validity of freelist metadata. Add a magic field to struct arena_header which can be used to detect memory corruption or whether a user tries to free something that isn't a malloc pointer. This feature can be enabled with -DDEBUG_MALLOC. Turn it on for development in mk/devel.mk. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-20pxe: Pass absolute path to pxe_chdir()Matt Fleming1-6/+16
We may have moved out of the root directory when calling get_prefix() and so need a way to create an absolute path. Historically, in versions prior to 5.xx we would call pxe_open_config() while we were still in the root directory ("::"), and so, we could construct a relative path to the config file. However, because we need to load ldlinux.c32 before opening the config file, which may involve us changing directory, we need a way of constructing an absolute path to the config file in get_prefix(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-20ldlinux: Pass config filename as argv[1] to ldlinux.c32Matt Fleming4-14/+17
Instead of hijacking ConfigName use a more standard method of passing a config name to ldlinux.c32's main() function, via argc and argv. This allows us to actually call open_config() the first time ldlinux.c32 is executed even if the file system has already modified ConfigName. For example, pxelinux_configfile() parses the DHCP 209 option and fills out ConfigName before ldlinux.c32 is launched, but because the PXE code needs to do things with the path to the config file (such as parsing the DHCP 210 option), we need to leave the config mangling to open_config() and not try and lookup ConfigName from ldlinux. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-14com32/chain: fix potential problem with 'fs' optionMichal Soltys1-2/+2
It's possible, that fs_lba available through syslinux_derivative_info() could be 0. So match the candidates including disk, instead of only partitions. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: sizeof style change (trivial)Michal Soltys4-20/+20
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: (utility) use enum for BPB typesMichal Soltys1-9/+2
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: (partiter) add cebr_siz for completnessMichal Soltys2-0/+2
Might be useful at some and/or when partiter becomes a non-chain specific code. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: (partiter) dos_next_ebr() fixupMichal Soltys1-1/+1
Make sure that *lba is set to 0, if start_lba in the record is 0. Not an issue in any of the code using partiter currently, as that implies either broken layout or a hole. Still useful for consistency with index == -1 or when relax flag is set. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: use single value for partiter related options (flags)Michal Soltys5-16/+13
Also use enum instead of #defines for flags. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: partiter: rename start_lbaMichal Soltys4-23/+23
disk.c also uses start_lba and it can mean few different things depending on context (disk relative, BEBR relative, current EBR relative). partiter's main offset is always a disk relative value. To make it more distinct and avoid suggestion the value is simply a copy of the one from disk_dos_part_entry, we rename it to more fitting abs_lba. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: manglepe_fixchs() correctionMichal Soltys1-10/+38
We have to be more careful, when in-entry start/length values are 0 (one or both). Firstly they are relative to the disk or the [B]EBR (while CHS are absolute). Secondly, length 0 would imply the end CHS being lower than the start CHS. Under normal circumstances, partiter would complain about corrupt layout (unless relax flag is set) and value 0 in any of those fields generally imply a hole, so the adjustments were harmless - nontheless they made everything look silly and not really correct. Adjusted approach is: - for start entry - if the os entry is 0 /and/ the beginning is 0 - reset to 0, otherwise calculate chs - for end entry - as above /or/ length is 0 - reset to 0, otherwise calculate chs Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: index -1 partiter adjustmentMichal Soltys3-14/+12
Currently, the only situation when index could be set to -1 was empty logical partition (with stepall flag active). To keep things consistent (and with index0 already providing "full" info), adjust the partiter to also set -1 on empty main partition. This change also allows simple index check to see whether we're are at the empty partition or not, without digging into disk_dos_part_entry data and retesting ostype field. We rely on it now in manglepe_hide(). Also some retab! changes in partiter.h and one variable rename. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: rely more on addr_t, replace ADDR*Michal Soltys4-22/+32
Whenever the computation imply use of that type, even if it's just uint32_t. Add dosmax (using 40:13) and dosmin (0x500) instead of separate ADDR* and dosmem (in do_boot()). Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: remove common.hMichal Soltys6-43/+3
Only 2 defines there related to preliminary options.c's and chain.c's hecks (real checks come later during mapping to real memory). So move them to options.h and remove common.h. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: recognize exFATMichal Soltys3-4/+19
The usual stuff - hidden sectors (now 64bit at different offset), drive offest, "BPB" type. Formally (?) region from 0x0B to 0x3F should be 0, but ... it's tempting to fill "old" values there. Might be worth adding a switch to handle such behavior. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: implement handling of non-standard hybrid GPT+MBR layoutsMichal Soltys7-18/+34
We also take a bit relaxed approach - so we check for presence of 0xEE at any place, then attempt to read GPT header only if prefmbr is not set. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: implement relax flagMichal Soltys7-11/+42
This flag tones down sanity checks during partition iteration. This is useful in situations such as: - inconsistent layouts, but with some partition still in sane bootable state - usb sticks/disks moved between different PCs might return different size, which might cause problems if the partitions span the whole disk Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: warning/error/help/doc tidyingMichal Soltys6-149/+166
Trivial change that tidies a bit warning / error reporting through fatal()/error()/warn(). Also small doc/help updates. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: use disk_guid for part_guid for 0th partitionMichal Soltys2-7/+4
Initial position of each itarator is whole disk, so this actually matches. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: cleaner variable namesMichal Soltys2-16/+14
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: mangle and related updatesMichal Soltys5-43/+49
Comments, output and minor adjustments. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: add pi_errored() in partiterMichal Soltys2-2/+7
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: remove unused ebr_startMichal Soltys2-4/+0
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: partiter - more precise comments / outputMichal Soltys2-19/+23
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: remove redundant rawindexMichal Soltys3-7/+4
'index0' provides the same "raw" info, complementing standard 'index'. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: partiter - simplifications and updatesMichal Soltys4-279/+119
The code uses more abstractions than it's really worth or necessary, so these patches simplify the code a bit. Partially suggested by Shao as well. Additionally, there're some added comments and more consistent naming used. Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: shuffle code before partiter simplificationsMichal Soltys1-62/+62
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: change stepall into flagsMichal Soltys3-14/+18
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: use anonymous and unnamed aggregatesMichal Soltys4-58/+58
Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: comments, minor adjustmentMichal Soltys7-81/+87
- add some comments to clarify c{nul,add,max} modes - use enums instead of defines - remove unnecessary integer casts - avoid casts and uninline guid_is0() - minor handover comment/flow changes - clean up some old comment-outs - add -fno-strict-aliasing as it's not picked anymore by default for elf.mk Signed-off-by: Michal Soltys <soltys@ziu.info>
2013-02-14com32/chain: update licenses and #ifndef stanzasMichal Soltys12-19/+248
Licenses: chain.[ch] Makefile: GPLv2+ the rest: MIT Defines: Avoid prefixing with _ Signed-off-by: Michal Soltys <soltys@ziu.info> Acked-by: H. Peter Anvin <hpa@linux.intel.com> Acked-by: Shao Miller <sha0.miller@gmail.com>
2013-02-13pxe: chdir to Path Prefix (DHCP Option 210) to open configsyslinux-5.02-pre2Matt Fleming1-0/+1
This is an addition to commit 282fe9da42e ("elflink: Use CurrentDirName for initial PATH if valid") which tried to fix the case when booting PXELINUX with DHCP options 209 and 210. Unfortunately, it's not useful to play games with PATH and we really do need to chdir to the Path Prefix before opening the config file because the config file may be specified with a path relative to the Path Prefix. Just do the chdir() and be done with it. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-11poweroff COM32 moduleSebastian Herbszt2-1/+89
This module is able to power off a system via APM. It replaces the poweroff COMBOOT module. Signed-off-by: Sebastian Herbszt <herbszt@gmx.de> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-114k_sector: Support sectors >512Frediano Ziglio1-14/+27
If EBIOS is detected for this drive it tries to read sector size and use it. If error or no EBIOS 512 is assumed. Buffer to read sector size is always allocated into the stack. CHS informations are not readed as not needed and save space not restoring %dl for drive number. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-114k_sector: Reduce size reducing a messageFrediano Ziglio1-1/+1
Easy way to reduce code but actually I found the message is readable at the same way as previous. Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-114k_sector: Save some bytes adding a function to set bx before read_sectorFrediano Ziglio1-6/+7
Mostly of the time bx was set as phdr before calling read_sector so add a specific function to set %bx and call read_sector gaining 2 bytes Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-114k_sector: Recover 3 bytes avoid a callFrediano Ziglio1-9/+10
after read_sector %edx:%eax are unused or incremented so increment always at end gaining 3 bytes Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-07version: Welcome to the 5.02 release cyclesyslinux-5.02-pre1Matt Fleming1-1/+1
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-07elflink: Use CurrentDirName for initial PATH if validMatt Fleming2-12/+23
commit c250a42263c8 ("elflink: Set PATH to the directory containing ldlinux.c32") made the mistake of thinking that CurrentDirName doesn't contain useful data for PXELINUX, it may do. If a user specifies a Path Prefix (DHCP option 210) we enter load_env32() with that path as the current working directory. If that path is thrown away instead of being used for PATH we may fail to load a config file as specified with Configuration File Option (DHCP option 209). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-07run_command: Use load_kernel() which understands labelsMatt Fleming1-1/+1
load_kernel() understands how to handle labels from config files whereas create_args_and_load() assumes that the cmdline is a COM32 file. Callers of syslinux_run_command() may want to pass labels, so use a function that allows that. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-07ldlinux: Append BOOT_IMAGE= to kernel cmdlineMatt Fleming2-13/+6
Some users rely on the syntax of the kernel cmdline from 4.xx and this is currently different in 5.xx. Fix things to match the 4.xx syntax. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-02-04load_linux: bail if no place for the real mode portion is foundH. Peter Anvin1-0/+3
Bail in the case of no space for the real mode code. This can happen mostly for zImage kernels when the conventional memory ceiling is too low. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-02-04load_linux: additional cleanups and corner case fixingH. Peter Anvin1-15/+14
Handle the case with a zero-length passed in initramfs for ancient protocols, since we bothered handling it correctly for newer protocols. Move the setting of the command line pointer to the place where the command line is actually placed, for clarity. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-02-04load_linux: the command line pointer depends on real_mode_baseH. Peter Anvin1-12/+12
The command line pointer depends on real_mode_base, so we can't set it up until we know where the real mode code will actually land. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-02-04load_linux: boot protocol < 2.00 could still have a command lineH. Peter Anvin1-6/+10
The command line existed before the 2.00 boot protocol, it was the initrd which was the new addition to that version. Therefore, allow the command line to be set even for the ancient kernels. This is necessary to specify a command line for memtest86+. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-25ldlinux: Correct the attribute bit for foreground brightsyslinux-5.01Matt Fleming1-1/+1
The foreground bright bit number is bit 3. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-25ldlinux: Convert all UsingVGA uses with display_mask_vga()Matt Fleming1-24/+35
Introduce display_mask_vga() which does the necessary converting of UsingVGA into a mask to be AND'd with DisplayMask. Also, apply TextAttribute when clearing the screen after we've seen a form feed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-25elflink: Set PATH to the directory containing ldlinux.c32syslinux-5.01-pre5Matt Fleming1-2/+23
On ISOLINUX and PXELINUX, CurrentDirName doesn't contain anything useful when we enter load_env32(). commit 10bb72d1528b ("PATH: Use installation directory for 'PATH'") didn't handle the case where we don't have an installation path, or don't find ldlinux.c32 there. If we find ldlinux.c32 in one of 'search_directories' use that directory as the PATH string. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-24NEWS: Add entries for 5.01Matt Fleming1-0/+12
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-24Merge branch 'doc-elflink-for-mfleming' of git://github.com/geneC/syslinux ↵Matt Fleming11-1/+1038
into elflink Pull AsciiDoc-based documentation from Gene Cumm, * 'doc-elflink-for-mfleming' of git://github.com/geneC/syslinux: txt/Makefile: make directories txt/: Remove COMBOOT as of 5.00; spelling; add PATH NEWS: add txt/ Makefile: add txt/ txt/: Add new AsciiDoc formatted documentation
2013-01-24Merge branch 'for-upstream' of git://git.zytor.com/users/pcacjr/syslinux ↵Matt Fleming7-199/+251
into elflink Pull XFS changes from Paulo Alcantara, "feel free to pull my for-upstream branch on zytor. it contains the cache for directory blocks on XFS, ldlinux.c32 installation support for XFS and one trivial fix for shortform-directory lookup." * 'for-upstream' of git://git.zytor.com/users/pcacjr/syslinux: extlinux: Also install ldlinux.c32 file on XFS xfs: Flush cache of directory blocks once done with readdir() xfs: Remove unnecessary free()'s xfs: Fix bug when listing shortform directory entries xfs: Add cache for directory blocks xfs: Make xfs_dir2_entry_name_cmp() inline xfs: Avoid useless malloc()'s and free()'s xfs: Make it more verbose on debug xfs: Improve error and debug printing xfs: Do some refactoring
2013-01-24ldlinux: Fix serial output and delete eprintf()Matt Fleming10-94/+63
Tagging __syslinux_get_serial_info() with __constructor is pretty useless when the global variables it uses, such as SerialPort, etc, are assigned *after* the constructor has run. This constructor made sense when config parsing was done by the core, but parsing is now performed by ldlinux. We need to explicitly invoke the function to initialise __syslinux_serial_console_info once we've parsed any config files. eprintf.c was introduced in commit 086d698c642f ("ldlinux: Add eprintf() to print to VGA and serial") because printf() output wasn't appearing on the serial console. It turns out that the above __constructor confusion was the real bug. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-24ldlinux: Don't update UsingVGA when we just want the valueMatt Fleming1-8/+3
There was a bug introduced when this code was copied from the old 4.x assembly implementation, we don't need to update UsingVGA everytime we read a character, we only need its value when comparing it against the DisplayMask. This bug caused every other character to be displayed when only writing to the text console, as well as other nasties such as making syslinux_force_text_mode() think it's in VGA mode even when it's in text mode. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-24ldlinux: Dynamically allocate cmdline buffer to avoid overflowMatt Fleming1-5/+3
Also, because we no longer pass the allocated buffer to __intcall() and friends we can use malloc() instead of lmalloc(), leaving precious low memory for other users. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-24ldlinux: Clear screen on ASCII 12 (form feed) in DISPLAY fileMatt Fleming1-0/+8
The ansi code won't handle \f the way we want, so we need to explicitly clear the screen and reset the cursor position, like the old 4.x code. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23module: Replace cur_module with module_current()syslinux-5.01-pre4Matt Fleming3-9/+15
It's easy for cur_module and prev_module to get out of sync with reality (the actual module that is running), so add module_current() which returns the module at the head of the module_list, i.e. the module that was loaded most recently. Better still, by using the list we don't have to do any kind of stacking of module pointers ourselves. This fixes a bug where cur_module contained a stale pointer (the module had actually been unloaded) but the pointer value had since been reallocated for a new module in spawn_load(), meaning that the following check, if (!strcmp(cur_module->name, module->name)) was always going to be true, even though *no* module was actually loaded at this point as we were reloading ldlinux.c32 from start_ldlinux(). This could have been fixed with a NULL-assignment after module_unload(), but using the modules_head list to detect the current module is much cleaner. Note that the core module loaded in load_env32() is always on the list, therefore module_current() will always return a valid pointer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23hdt: Move ~162K byte data object from the stack to the bssMatt Fleming1-1/+1
A struct s_hardware is far too large to be placed onto the stack and was causing us run past the end of the allocated stack and overwrite the diskcache, which resulted in apparent file system corruption. Move this hefty object into the bss. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23module: Check for NULL ctors and dtorsMatt Fleming2-2/+2
Don't dereference a NULL ctor/dtor as that can cause us to crash. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23module: Check the return value of malloc()Matt Fleming1-0/+8
Instead of blindly writing through a possible-NULL pointer, check the return value of malloc(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23init: Leave mem_init() to fs_init()Matt Fleming1-3/+0
Remove the superfluous call from init(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-23realloc: Set the HEAP when splitting a blockMatt Fleming1-0/+2
Failure to do so means we may put a free block in some random location because ARENA_HEAP_GET() can return something invalid when used to find the correct free list in __free_block(). This bug manifested as running out of available free memory. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-22extlinux: Also install ldlinux.c32 file on XFSPaulo Alcantara1-4/+26
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-22xfs: Flush cache of directory blocks once done with readdir()Paulo Alcantara3-4/+33
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-22xfs: Remove unnecessary free()'sPaulo Alcantara3-37/+3
Those freed memories are all now cached and need to get flushed at some point. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-22xfs: Fix bug when listing shortform directory entriesPaulo Alcantara1-2/+3
The xfs_fmt_local_readdir() function should call xfs_readdir_dir2_local() instead. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Add cache for directory blocksPaulo Alcantara5-71/+118
This cache will avoid lots of malloc() and free() calls for getting an allocated area for directory blocks whenever listing and finding directory entries. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Make xfs_dir2_entry_name_cmp() inlinePaulo Alcantara2-13/+13
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Avoid useless malloc()'s and free()'sPaulo Alcantara3-61/+25
This patch speeds up the process of retrieving and comparing entry names while looking up inodes. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Make it more verbose on debugPaulo Alcantara5-11/+35
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Improve error and debug printingPaulo Alcantara1-2/+6
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21xfs: Do some refactoringPaulo Alcantara1-20/+15
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
2013-01-21Merge branch 'com32lib_spotless_for_mfleming' of ↵Matt Fleming1-1/+1
git://github.com/geneC/syslinux into elflink Pull clean up patch from Gene Cumm, * 'com32lib_spotless_for_mfleming' of git://github.com/geneC/syslinux: com32/lib: delete *.c32 on key target
2013-01-21pxe: Add PXELINUX-specific symbols to symbol whitelistMatt Fleming2-3/+3
We need to allow PXELINUX to link with required symbols at runtime otherwise, when executing prdhcp.c32, the user will be presented with the following message, Error: An undefined symbol was referenced Add pxe_call, dns_resolv and unload_pxe to the symbol whitelist. Reported-by: Gene Cumm <gene.cumm@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-20com32/lib: delete *.c32 on key targetGene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-01-17core/lzo: move LZO back to uncompressed sectionH. Peter Anvin1-1/+1
The LZO decompressor really can't live in the compressed part of the core, for some odd reason. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17txt/Makefile: make directoriesGene Cumm1-4/+7
2013-01-17txt/: Remove COMBOOT as of 5.00; spelling; add PATHGene Cumm3-14/+22
Also changing markup for AsciiDoc Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-01-17NEWS: add txt/Gene Cumm1-0/+4
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-01-17Makefile: add txt/Gene Cumm1-1/+1
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-01-17txt/: Add new AsciiDoc formatted documentationGene Cumm9-0/+1022
Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
2013-01-17elf: remove long-since-obsolete shallow module machineryH. Peter Anvin6-223/+5
Meant to handle symbols exported from the core, but we just pregenerate the dynamic section instead. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17core: switch LZO decompressor to "fast safe" versionH. Peter Anvin8-17/+42
Switch LZO decompressor to the "fast safe" version (and bump LZO source to version 2.06). This allows us to use that decompressor for module compression later without carrying another decompressor. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17core/fs: remove some stale functions, inode refcount debugH. Peter Anvin2-112/+9
Remove some stale (16-bit compatibility) functions in fs.c. Add some debugging for inode refcounts. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17bios.h: add missing dependent #includeH. Peter Anvin1-0/+2
io_delay() defined in bios.h depends on outb() defined in <sys/io.h>. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Rename libcom32gpl.c32 to libgpl.c32H. Peter Anvin2-4/+4
Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Rename libutil_com.c32 to libutil.c32H. Peter Anvin5-8/+7
Conform to 8.3 filenames for essential files. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-17Always strip all the modulesH. Peter Anvin15-25/+35
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>
2013-01-17dos: obtain the executable pathname, cleanupsH. Peter Anvin7-75/+175
DOS actually does provide the fully qualified pathname to the executable, which would be useful to make ldlinux.c32 data rather than live inside the executable itself -- it has gotten too large. Also, move some DOS internals -- inline functions only used inside the dos directory -- out of libinstaller. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2013-01-16ldlinux: Perform chdir() before parsing configsyslinux-5.01-pre3Matt Fleming1-3/+3
The old 4.x behaviour for handling CONFIG directives of the form, CONFIG foo.cfg /bar was to lookup the absolute pathname of foo.cfg, then chdir to /bar and finally to parse foo.cfg. The 5.x behaviour reversed the chdir and parsing steps. This meant if foo.cfg's contents were simply, INCLUDE say.txt 4.x would include /bar/say.txt and 5.x would include /boot/syslinux/say.txt (assuming the current working directory was /boot/syslinux). What's even worse is that because of the way 'config_cwd' is used in 5.x we'd actually perform the chdir() operation after the first INCLUDE in foo.cfg, e.g. INCLUDE say.txt INCLUDE say.txt would include /boot/syslinux/say.txt and /bar/say.txt, respectively. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-16module: Check return value of malloc()Matt Fleming1-0/+5
And return NULL after printing an appropriate error message if the call failed. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-15ldlinux: Strip whitespace from LABEL directiveMatt Fleming1-5/+11
Any LABEL directive arguments shouldn't include whitespace characters. If whitespace characters are needed use MENU LABEL. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
2013-01-14PXELINUX: Fix IPAPPEND to include BOOTIF and SYSUUIDsyslinux-5.01-pre2Matt Fleming1-1/+3
commit 14531c47bc95 ("core: Delete code that is duplicated in ldlinux") erroneously deleted the BOOTIFStr and SYSUUIDStr entries from the PXELINUX-version of IPAppends, meaning that IPAPPEND 3 and IPAPPEND 4 didn't append the corresponding strings to the command line. Signed-off-by: Matt Fleming <matt.fleming@intel.com>