aboutsummaryrefslogtreecommitdiffstats
path: root/extlinux/main.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-14 15:38:35 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-14 15:41:37 -0700
commit441798c66ea1b7d065d819c1af6a8c799d38036e (patch)
tree0b7ef108ad5f3faa2e45d4a18d457bf6717a2a91 /extlinux/main.c
parent6899a6d1722b0f7b2989b9b38c1be0fa2912cb30 (diff)
downloadsyslinux-441798c66ea1b7d065d819c1af6a8c799d38036e.tar.gz
syslinux-441798c66ea1b7d065d819c1af6a8c799d38036e.tar.xz
syslinux-441798c66ea1b7d065d819c1af6a8c799d38036e.zip
Implement !GPT protocol in Syslinux core; handle offset > 2 TB
Implement the !GPT handover protocol in the Syslinux core, and handle partition offsets above 2 TB. We do not yet handle filesystem sizes above 2 TB, but that should be a reasonably straightforward extension at this time (need to switch to 8-byte block pointers). This finally meant moving getlinsec out of the boot sector, since it no longer fits. Instead have a very simple getonesec implementation in the boot sector. getlinsec still fits in Sector 1, although it doesn't leave space for very many block pointers. That's still better than adding yet another boot loader stage, however. Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'extlinux/main.c')
-rw-r--r--extlinux/main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/extlinux/main.c b/extlinux/main.c
index c76add41..0a55692a 100644
--- a/extlinux/main.c
+++ b/extlinux/main.c
@@ -314,9 +314,6 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
/* First sector need pointer in boot sector */
set_32(&bs->NextSector, *sectp++);
- /* Stupid mode? */
- if (opt.stupid_mode)
- set_16(&bs->MaxTransfer, 1);
/* Search for LDLINUX_MAGIC to find the patch area */
for (wp = (uint32_t *) boot_image; get_32(wp) != LDLINUX_MAGIC; wp++) ;
@@ -328,6 +325,10 @@ int patch_file_and_bootblock(int fd, const char *dir, int devfd)
set_16(&patcharea->adv_sectors, 2);
set_32(&patcharea->dwords, dw);
+ /* Stupid mode? */
+ if (opt.stupid_mode)
+ set_16(&patcharea->maxtransfer, 1);
+
/* Set the sector pointers */
secptroffset = get_16(&patcharea->secptroffset);
wp = (uint32_t *) ((char *)boot_image + secptroffset);