aboutsummaryrefslogtreecommitdiffstats
path: root/mbr/gptmbr.S
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* | 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>
* mbr: Make sure the MBR code starts with the byte 0x33H. Peter Anvin2010-12-231-1/+1
| | | | | | | | | 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>
* 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-111-20/+24
| | | | | | | | | | | | | 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>
* mbr: generate normal versions, force-80 versions, and ctrl-80 versionsH. Peter Anvin2009-04-041-7/+6
| | | | | | | 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-041-0/+1
| | | | | | | Update copyright notices; add Intel copyright notices where appropriate. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* mbr/*.S: use a symbolic constant for BIOS_kbdflagsH. Peter Anvin2009-03-301-1/+2
| | | | | | | | | 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-301-4/+9
| | | | | | | | | | | 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>
* mbr, gptmbr, isohdpfx: don't lose the carry flagH. Peter Anvin2008-09-081-1/+1
| | | | | | | | 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>
* 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.
* 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-251-0/+284
Beginnings of a master boot record for GPT partition tables.