aboutsummaryrefslogtreecommitdiffstats
path: root/mbr
Commit message (Collapse)AuthorAgeFilesLines
* bios: Use int 0x16, ah=0x02 to probe for shift flagssyslinux-6.03-pre10H. Peter Anvin2014-04-171-2/+6
| | | | | | | | At least one USB keyboard BIOS has been reported to not properly handle the keyboard flags in memory. See if actually using INT 16h works better. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'elflink' into firmwareH. Peter Anvin2014-01-171-1/+1
|\ | | | | | | | | | | | | Resolved Conflict: diag/geodsp/Makefile Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * Merge branch 'master' into elflinkelflinkH. Peter Anvin2014-01-171-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Resolved Conflicts: NEWS core/fs/fs.c version Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| | * Remove some whitespaceRuben Kerkhof2013-12-301-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Ruben Kerkhof <ruben at rubenkerkhof.com> Signed-off-by: Gene Cumm <gene.cumm@gmail.com>
* | | Merge tag 'syslinux-5.10-pre2' into for-hpa/elflink/firmwareMatt Fleming2013-03-221-29/+44
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | syslinux-5.10-pre2 Conflicts: NEWS com32/include/netinet/in.h com32/include/sys/cpu.h com32/lib/Makefile core/Makefile core/fs/diskio.c core/fs/pxe/pxe.h core/init.c core/mem/free.c core/mem/malloc.c mk/devel.mk version
| * | 4k_sector: Support sectors >512Frediano Ziglio2013-02-111-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>
| * | 4k_sector: Reduce size reducing a messageFrediano Ziglio2013-02-111-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>
| * | 4k_sector: Save some bytes adding a function to set bx before read_sectorFrediano Ziglio2013-02-111-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>
| * | 4k_sector: Recover 3 bytes avoid a callFrediano Ziglio2013-02-111-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>
* | | Merge tag 'syslinux-5.00' into firmwaresyslinux-6.00-pre3Matt Fleming2012-12-071-0/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile com32/elflink/ldlinux/Makefile com32/lib/sys/module/elf_module.c core/cleanup.c core/comboot.inc core/conio.c core/fs/fs.c core/init.c core/mem/free.c core/mem/malloc.c core/timer.inc diag/geodsp/Makefile extlinux/main.c mk/embedded.mk modules/Makefile Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * | mbr: Add support for loading VBRs from XFS filesystemsPaulo Alcantara2012-07-211-0/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | Before reading the VBR into 0x7C00, we need to check the first 4 bytes of the read sector and check whether it is a XFS superblock or not. If it is, then we need to read the right sector, which is the 4th sector of the XFS partition where the Syslinux boot sector lives in. This patch adds support for booting off XFS partitions properly on MBR HDDs. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
* | Add per-firmware object directory supportMatt Fleming2012-10-161-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have multiple firmware backends it no longer makes sense to write object files to the same directory as their source. A better solution is to write the object files to a per-firmware directory under a top-level object directory. The top-level object directory can be specified on the command-line with the O= variable, e.g. make O=/tmp/obj. If no top-level object directory is specified an 'obj' directory is created in the top-level of the Syslinux source repository. All the existing make targets continue to work as before, however now they apply to all firmware backends, e.g. 'make installer' will build the BIOS, 32-bit EFI and 64-bit EFI installers and place them under $(OBJ)/bios, $(OBJ)/efi32 and $(OBJ)/efi64 respectively. Note unlike every other bit of Syslinux, the gpxe objects are still kept in the src directory, e.g. gpxe/src, since gpxe is only required by the BIOS backend. It is possible to specify a make target for a specific firmware or list of firmware with the following syntax, make [firmware[,firmware]] [target[,target]] To clean the object directory for just the BIOS firmware type, 'make bios clean' To build both the 32-bit and 64-bit EFI installers type, 'make efi32 efi64 installer' Since the Syslinux make infrastructure is now more complex a new file doc/building.txt has been created to explain how to build Syslinux. The top-level Makefile now exports some make variables for use in module Makefiles, - topdir - the top-level source directory of the Syslinux repository, e.g. /usr/src/syslinux - objdir - the top-level object directory for the firmware backend currently being built, e.g. /obj/syslinux/bios - SRC - the source directory in the Syslinux repository for the module currently being built, e.g. /usr/src/syslinux/com32/libupload - OBJ - the object directory for the module currently being built, e.g. /obj/syslinux/bios/com32/libupload Since we're rewriting the Makefile infrastructure anyway it seemed like a good idea to add parallel support. By writing subdirectories as prequisites for make targets the objects in those subdirectories can be built in parallel. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge remote-tracking branch 'mfleming/elflink' into for-hpa/elflink/firmwareMatt Fleming2012-07-302-1/+32
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile com32/elflink/ldlinux/adv.c com32/elflink/ldlinux/kernel.c com32/elflink/ldlinux/ldlinux.c com32/include/bitsize/stddef.h com32/include/bitsize/stdint.h com32/include/stdint.h com32/include/sys/module.h com32/include/sys/x86_64/bitops.h com32/include/syslinux/linux.h com32/lib/Makefile com32/lib/sys/ansicon_write.c com32/lib/sys/module/elfutils.h com32/lib/sys/vesa/efi/fill.h com32/lib/syslinux/load_linux.c com32/lib/syslinux/serial.c com32/lib/syslinux/shuffle.c core/conio.c core/elflink/config.c core/elflink/load_env32.c core/graphics.c core/include/graphics.h core/init.c core/pxelinux.asm mk/elf.mk mk/lib.mk
| * altmbr: actually invoke the correct partitionsyslinux-4.06-pre2H. Peter Anvin2012-03-211-1/+1
| | | | | | | | | | | | | | | | We would fail to correctly invoke primary partitions 2-4 because of a register usage bug. Reported-by: Maxim Kammerer <mk@dee.su> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * isohybrid: Generate GPT and Mac bootable imagesMatthew Garrett2011-08-241-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | EFI systems typically don't support booting off ISO 9660 filesystems, even if written to USB sticks. This patch adds support for generating a GPT that covers the stick as well, with an additional partition entry pointing purely at the secondary El Torito image. When burned to CD the secondary El Torito will be used as an EFI boot image, and when written to a USB stick the GPT partition will be found and may be booted from. However, some earlier EFI Macs don't support booting from El Torito images via EFI. To cater for them this also supports generating an Apple partition table, allowing a third El Torito image in HFS+ format to be made available to the firmware. This requires padding the MBR images slightly in order to leave space for the Apple header, but should have no functional impact. Sadly, this breaks the workaround for Acer BIOSes (magic xor instruction) when Mac support is enabled via -m... not much that can be done about that. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | The make files have undergone changes to support both i386 and x86_64 platforms.chandramouli narayanan2012-06-251-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pertinent changes are sprinkled through *.mk and Makefile in the syslinux tree. Build architecture is specified at the command line via ARCH macro. This is to enable whether one is building for the native platform or cross-building for a different architecture. Currently, the only supported architectures via ARCH macro are i386 and x86_64. There are some modules (e.g. memdump) that don't build under the EFI environment. To go forward with efi boot support, a separate EFI_BUILD=1 macro has been added and is required to be specified while building. This is a temporary solution for the current build environment. example build: On a x86_64 platform, the following cross-builds syslinux for i386 To build for i386: make EFI_BUILD=1 ARCH=i386 On a x86_64 platform, the following builds syslinux for x86_64 To build natively: make EFI_BUILD=1 Changes specific to GCC and LD options: Architecture specific flags and include/search directories are set up for GCC and LD commands. Internally, GCC options such as stack-boundary, PIC and machine architecture are set up based on ARCH macro. While stack-boundary=2 is fine for i386, it does not work for x86_64 and so it is left to the default value. Using -fPIE with gcc does not work with ld on x86_64, but -fPIC works fine. Similarly, target and elf options are set up for linking as approrpriate for architecture. Assumption about gnu-efi install path: Since the EFI build supports both EFI32 and EFI64, the following assumptions are made with regard to the installed location of gnu-efi on the build platform. 1. gnu-efi-ia32: assumed installed in /usr/local [ EFI-32 include files in /usr/local/include/efi and gnu-efi library in /usr/local/lib/ ] 2. gnu-efi-x86_64: assumed installed in /usr [ EFI-64 include files in /usr/include/efi and gnu-efi library in /usr/lib64/ ] Remanants of the unused old i386-only files, if any, need to be pruned.
* | This is a giant patch that splits the linker scripts for libraries, modules ↵chandramouli narayanan2012-06-252-0/+145
|/ | | | | | | | | | | | | | | | | | and executables into the architecture-dependent scripts to facilitate building syslinux modules/executables for i386 and x86_64 environments. The x86_64 linker scripts are derived from the earlier i386 counterparts. Subdirectories i386 and x86_64 hold the respective linker scripts mentioned below. com32/lib/sylinux.ld com32/lib/elf.ld core/syslinux.ld efi/syslinux.ld mbr/mbr.ld memdisk/memdisk.ld Remanants of the unused old i386-only files, if any, need to be pruned.
* Makefile: Move Makefile fragments into mk/Matt Fleming2011-04-071-1/+2
| | | | | | | | | | | | | | | | | | Move the MCONFIG files into a mk/ directory and give them more descriptive names. This is purely a cosmetic change to make the 'include' directives a bit more coherent by making it obvious exactly which MCONFIG file we're including. For example, in com32/lua/src/Makefile we exchange the line, include ../../MCONFIG for the much more comprehensible, include $(MAKEDIR)/com32.mk Signed-off-by: Matt Fleming <matt.fleming@linux.intel.com>
* Handoff *BR: Move to diagGene Cumm2011-03-091-345/+0
|
* mbr_ho.bin: Fix stack bug; also save/restore cx in another locationGene Cumm2011-03-091-1/+3
|
* mbr_ho.bin: Fix several non-8086 issuesGene Cumm2011-03-091-19/+54
|
* mbr_ho.bin: Update install instructionsGene Cumm2011-03-091-1/+1
|
* mbr_ho.bin: install instructionsGene Cumm2011-03-091-0/+11
|
* mbr_ho.bin: Fix bug in $PnP Scan; PressAnyKey; compare [ES:DI]Gene Cumm2011-03-091-33/+59
| | | | Also numerous uses of *w opcodes and spacing fixes
* mbr_ho.bin: Handoff MBRGene Cumm2011-03-091-0/+271
| | | | | | | This mbr code entity shows DL, DS, SI, 16 bytes of [DS:SI], ES, DI, 4 bytes of [ES:DI], and scans F0000h-FFFFFh on 16 byte alignment for $PnP. This is useful for testing when MBR or VBR/PBR handoff goes awry.
* mbr: Make sure the MBR code starts with the byte 0x33H. Peter Anvin2010-12-234-5/+4
| | | | | | | | | Apparently some BIOSes (including some Acer Travelmate machines) require an MBR to start with 0x33; apparently Micro$oft MBRs start with 33 C0, an alternate coding of the "xorw %ax,%ax" instruction. As such, follow suit to work on these braindead BIOSes. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohdpfx: update to the new !GPT protocolH. Peter Anvin2010-06-271-3/+5
| | | | | | Update the check for !GPT to match the updated protocol (with length). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* gptmbr: skip partitions with all-zero PartitionTypeGUIDH. Peter Anvin2010-06-261-0/+6
| | | | | | | PartitionTypeGUID being zero means an empty slot, and so we should not count that partition type. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* gptmbr: change synthetic partition type to 0xEDH. Peter Anvin2010-06-141-1/+1
| | | | | | | The committee didn't like re-using 0xEE for this purpose and wants 0xED instead. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* gptmbr: save four bytesH. Peter Anvin2010-06-111-2/+7
| | | | | | | Save four bytes by observing that none of our code relies on saturate_stosl not actually corrupting %eax. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* gptmbr: fix offset for MSW of partition endH. Peter Anvin2010-06-111-2/+2
| | | | | | Fix the offset for the MSW of the partition endpoint. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* gptmbr: implement the new T13-approved GPT protocolH. Peter Anvin2010-06-112-21/+25
| | | | | | | | | | | | | My GPT-based protocol was modified by the UEFI and T13 committees (the former responsible for the GPT format, the latter for EDD and therefore for the disk-related part of the BIOS specification.) This is thus now on its way to become an official protocol, so change the implementation to match. This still needs testing, and the Syslinux core needs to be adjusted to leverage the extended information. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* isohdpfx: actually generate the stack frame isolinux expectssyslinux-3.82-pre2H. Peter Anvin2009-05-311-6/+9
| | | | | | | | Actually generate the stack frame isolinux expects. This is not the optimal order, but it appears to be what both earlier and later versions of isolinux expects... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohdpfx: don't clear %ds before parsing partiting infosyslinux-3.81-pre15H. Peter Anvin2009-05-261-14/+15
| | | | | | | | | | | | The partition information is pointed to by ds:si; although ds will *usually* be 0 it isn't guaranteed (in particular, it may very well be 0x40 or 0x60); therefore, move the partition parsing up before the reset of %ds and %es. As a side benefit, we get to use push again... Also, fix the ordering of the two halves of the GPT LBA! Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* altmbr: cap at 439 bytes so the partition select byte followsH. Peter Anvin2009-05-251-1/+1
| | | | | | | | | | | | Cap altmbr at 439 bytes, so that the partition select byte is not part of the file. This means that: a) updating the altmbr doesn't clobber the configuration; b) it is easier to simply concatenate the select byte to the file. This also matches gptmbr behavior. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohybrid: revert to a stack format compatible with previous versionsyslinux-3.81-pre14H. Peter Anvin2009-05-251-17/+18
| | | | | | | | Revert the isohybrid handover protocol so that it has a stack format compatible with the previous versions; that way we can also revert the magic number to a compatible one. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* altmbr: fix accounting of logical partitionsH. Peter Anvin2009-05-251-15/+13
| | | | | | | Unlike the main MBR, we need to keep careful count when we process logical partitions... and we weren't. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohybrid: add missing isohdppx.S fileH. Peter Anvin2009-05-211-0/+2
| | | | | | | Add a file missing from previous checkin e462c28ffaca0132c1761736bc93cb06a41dc7a6. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohybrid: support booting from partition; fix CBIOS bootingH. Peter Anvin2009-05-213-25/+55
| | | | | | | | Fix CBIOS in isohybrid mode. Also allow an isohybrid image to be booted from a partition. Unfortunately this breaks compatibility between differing versions of isohybrid and isolinux.bin. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Unify dependency generation: MCONFIG.embeddedH. Peter Anvin2009-04-271-3/+3
| | | | | | | Unify dependency generation and move common rules into MCONFIG.embedded. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Unify dependency generationH. Peter Anvin2009-04-271-4/+4
| | | | | | | | | | | | Make the dependency generation more common; have a general pattern in MCONFIG, and use it in rules (not in CFLAGS). For NASM source, in order to stay compatible with old versions of NASM, run NASM twice; newer versions of NASM is capable of generating dependencies simultaneously like gcc can, but that would break compatibility with older distros. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* mbr: generate normal versions, force-80 versions, and ctrl-80 versionsH. Peter Anvin2009-04-047-46/+107
| | | | | | | Produce MBR variants with normal (DL) behavior, force to drive 80 behavior, and force to 80 on Ctrl pressed behavior. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Update copyright noticesH. Peter Anvin2009-04-043-0/+3
| | | | | | | Update copyright notices; add Intel copyright notices where appropriate. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* altmbr: an alternative MBR which ignores the active flagH. Peter Anvin2009-03-303-7/+326
| | | | | | | | | | | Impact: new feature Create an alternative MBR which takes a partition number in byte 439 instead of looking at the active flag. This is useful when dual-booting legacy operating systems which assume that their particular partition must be the active partition. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* mbr/*.S: use a symbolic constant for BIOS_kbdflagsH. Peter Anvin2009-03-303-6/+9
| | | | | | | | | Impact: cleanup Use a symbolic constant for BIOS_kbdflags instead of open-coding the address. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* mbr/*.S: if Ctrl is pressed, force the drive number to 0x80H. Peter Anvin2009-03-303-10/+27
| | | | | | | | | | | Impact: BIOS bug workaround, possible unexpected consequences? Escape hatch for BIOSes which pass in garbage in DL: if the Ctrl key is pressed during boot, force the drive number to 0x80. Based on a patch by "TJ <ubuntu@tjworld.net>". Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* isohdpfx: remove stray jmpw *%siH. Peter Anvin2009-03-101-1/+0
| | | | | Remove a stay jmpw *%si which was a test instruction and wasn't meant to have been checked in.
* isohdpfx: work around gas/ld miscompilationH. Peter Anvin2009-02-271-1/+9
| | | | | | | | Some, unknown, version of gas or ld miscompiles a relative jump to an absolute symbol, resulting in a broken isohybrid. Implement a workaround for it by using a far jmp, which is absolute. Fortunately, the isohybrid prefix is one of the very few boot sectors we have which isn't short on space.
* mbr, gptmbr, isohdpfx: don't lose the carry flagH. Peter Anvin2008-09-083-3/+3
| | | | | | | | Using addw to restore the stack pointer clobbers CF. Use leaw instead, even though this relies on the BIOS not clobbering %si. Worst case we can add a mov %sp, %si or similar. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* isohdpfx: save one byteH. Peter Anvin2008-09-081-1/+1
| | | | | | Save one byte in isohdpfx.S. Signed-off-by: H. Peter Anvin <hpa@zytor.com>