aboutsummaryrefslogtreecommitdiffstats
path: root/mbr
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* mbr/Makefile: run checksize on the proper binaries...syslinux-3.72-pre4H. Peter Anvin2008-09-071-3/+3
| | | | | | | There is a reason other than stylistic for using macros like $@ in explicit rules, and that is that they get copied and pasted around... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* ISOLINUX: fix EBIOS information passing in hybrid HDD modeH. Peter Anvin2008-09-051-5/+7
| | | | | | | | | We were incorrectly not passing the EBIOS flag in hybrid HDD mode; also compute the EBIOS LBA correctly in hybrid HDD mode. Allow a 34-bit LBA for this, that way we still support up to 2^32 CD-ROM sectors (8 TB). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* ISOLINUX: support for hybrid mode (CD-ROM/USB key)H. Peter Anvin2008-09-052-5/+219
| | | | | | Still a work in progress. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Clean up embedded Makefile targets; fix build failureH. Peter Anvin2008-08-221-11/+1
| | | | | | Unify common pieces to "embedded" targets (those that produce code that runs neither in the host nor in a com32 environment); this fixes the broken sample/ directory Makefile.
* Major Makefile cleanups; gcc 4.3.0 compatiblityH. Peter Anvin2008-08-201-10/+7
| | | | | Cleanup and centralize the Makefile system even more. Fix a gcc 4.3 incompatibility in memdisk (definition of strlen).
* Build _bin.c files in libinstaller; clean up B/I separationH. Peter Anvin2008-06-271-5/+2
| | | | | | | Clean up the BSUBDIR/ISUBDIR separation further. Build _bin.c files, which are an intermediate stage toward building the installers, in the libinstaller directory, since that directory is used by all the installers anyway. That also lets us get bin2c.pl out of the root.
* mbr: clean up *_bin.c filesH. Peter Anvin2008-05-291-1/+1
|
* Move files out of root into core, dos, and utilsH. Peter Anvin2008-05-291-5/+11
| | | | | | | | Move source files out of the root directory; the root is a mess and has become virtually unmaintainable. The Syslinux core now lives in core/; the Linux and generic utilities has moved into utils/, and copybs.com has moved into dos/; it had to go somewhere, and it seemed as good a place as any.
* Document GPT boot protocol; add !GPT signature3.6xH. Peter Anvin2008-05-131-0/+1
| | | | | | Document the GPT boot protocol; add additional assurance by requiring that EAX contains "!GPT" for the GPT information to be valid.
* Merge commit 'origin/gptmbr'H. Peter Anvin2008-05-132-1/+295
|\
| * gptmbr: use cltq to extend a zero %eax into %edxH. Peter Anvin2008-02-251-1/+1
| | | | | | | | | | Using cltq (cdq) to clear %edx when %eax is zero is cheaper by one byte.
| * gptmbr: Add commentH. Peter Anvin2008-02-251-1/+1
| |
| * gptmbr: save phdr -> bootsect on the stack, saving one byteH. Peter Anvin2008-02-251-2/+4
| |
| * gptmbr: another confusion of start and end fieldsH. Peter Anvin2008-02-251-2/+2
| | | | | | | | Use the start field for the boot sector address...
| * gptmbr: fix confusion between start and end fieldsH. Peter Anvin2008-02-251-2/+4
| | | | | | | | | | | | Fix a case of bad confusion of the start and end fields (length = end-start+1, so we can't easily reuse the load of the start field.)