aboutsummaryrefslogtreecommitdiffstats
path: root/libinstaller
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 /libinstaller
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 'libinstaller')
-rw-r--r--libinstaller/syslxint.h6
-rw-r--r--libinstaller/syslxmod.c15
2 files changed, 11 insertions, 10 deletions
diff --git a/libinstaller/syslxint.h b/libinstaller/syslxint.h
index 2276bfed..bc818df6 100644
--- a/libinstaller/syslxint.h
+++ b/libinstaller/syslxint.h
@@ -87,6 +87,7 @@ struct patch_area {
uint16_t adv_sectors;
uint32_t dwords;
uint32_t checksum;
+ uint16_t maxtransfer;
uint16_t diroffset;
uint16_t dirlen;
uint16_t subvoloffset;
@@ -120,7 +121,7 @@ struct boot_sector {
uint32_t VolumeID;
char VolumeLabel[11];
char FileSysType[8];
- uint8_t Code[442];
+ uint8_t Code[444];
} __attribute__ ((packed)) bs16;
struct {
uint32_t FATSz32;
@@ -136,12 +137,11 @@ struct boot_sector {
uint32_t VolumeID;
char VolumeLabel[11];
char FileSysType[8];
- uint8_t Code[414];
+ uint8_t Code[416];
} __attribute__ ((packed)) bs32;
} __attribute__ ((packed));
uint32_t NextSector; /* Pointer to the first unused sector */
- uint16_t MaxTransfer; /* Max sectors per transfer */
uint16_t bsSignature;
} __attribute__ ((packed));
diff --git a/libinstaller/syslxmod.c b/libinstaller/syslxmod.c
index 96f155ff..c600a816 100644
--- a/libinstaller/syslxmod.c
+++ b/libinstaller/syslxmod.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -241,12 +241,7 @@ int syslinux_patch(const uint32_t * sectors, int nsectors,
if (nsectors < nsect)
return -1;
- /* Patch in options, as appropriate */
- if (stupid) {
- /* Access only one sector at a time */
- set_16(&sbs->MaxTransfer, 1);
- }
-
+ /* Handle RAID mode, write proper bsSignature */
i = get_16(&sbs->bsSignature);
if (raid_mode)
set_16((uint16_t *) ((char *)sbs + i), 0x18CD); /* INT 18h */
@@ -277,6 +272,12 @@ int syslinux_patch(const uint32_t * sectors, int nsectors,
memcpy((char *)boot_image + diroffset, subdir, strlen(subdir) + 1);
}
+ /* Handle Stupid mode */
+ if (stupid) {
+ /* Access only one sector at a time */
+ set_16(&patcharea->maxtransfer, 1);
+ }
+
/* Set the sector pointers */
wp = (uint32_t *) ((char *)boot_image +
get_16_sl(&patcharea->secptroffset));