summaryrefslogtreecommitdiffstats
path: root/mbr
Commit message (Collapse)AuthorAgeFilesLines
* 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 expectsH. 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 infoH. 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 versionH. 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...H. 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 signatureH. 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.)
| * gptmbr: use xchgw %ax,... instead of movw %ax,... when %ax is deadH. Peter Anvin2008-02-251-1/+1
| | | | | | | | | | xhcgw with %ax and a register is one byte shorter than movw with %ax if %ax is then dead.
| * gptmbr: Use %bp for references into phdr and the stackH. Peter Anvin2008-02-251-20/+19
| | | | | | | | | | | | Set up %bp as a permanent frame pointer and use it to reference stack and phdr fields; by putting phdr in the bootsect slot we can use it for phdr references with small displacements. This saves 5 bytes.
| * gptmbr: since %bx is advanced, we can test -2(%bx) == (bootsec+510)H. Peter Anvin2008-02-251-1/+1
| | | | | | | | | | With %bx advanced to the end of the boot sector, we can use -2(%bx) instead of (bootsec+510), thus saving one byte.
| * gptmbr: addw $512, %bx -> addb $2, %bhH. Peter Anvin2008-02-251-1/+1
| | | | | | | | Save one byte...
| * gptmbr: offsets into phdr are decimal, not hexH. Peter Anvin2008-02-251-4/+4
| | | | | | | | The offsets into phdr, from the EFI spec, are in decimal, not hex.
| * gptmbr: move advancing %bx into read_sectorH. Peter Anvin2008-02-251-4/+3
| | | | | | | | Move the advancing of %bx into read_sector, saving 3 bytes.
| * gptmbr: need to set %bx -> bootsecH. Peter Anvin2008-02-251-0/+1
| | | | | | | | | | | | Need to tell read_sector where to load the boot sector (unlike the MBR code, where we always loaded into 0x7c00, this code uses multiple buffers.)
| * gptmbr: shuffle slightly to reduce register pressureH. Peter Anvin2008-02-251-6/+3
| | | | | | | | | | Shuffle some code slightly to reduce register pressure; no size change but this might make the code easier to follow and/or change.
| * gptmbr: shuffle slightly to save 3 bytesH. Peter Anvin2008-02-251-14/+17
| | | | | | | | Shuffle some code to reduce the total size by 3 bytes
| * rep; cmpsw -> repe; cmpswH. Peter Anvin2008-02-251-1/+1
| | | | | | | | Same instruction, but repe is more correct for cmpsw
| * Master boot record for GPT partition tablesH. Peter Anvin2008-02-252-1/+292
| | | | | | | | Beginnings of a master boot record for GPT partition tables.