aboutsummaryrefslogtreecommitdiffstats
path: root/com32/chain/utility.c
diff options
context:
space:
mode:
authorMichal Soltys <soltys@ziu.info>2013-02-14 16:51:46 +0100
committerMichal Soltys <soltys@ziu.info>2013-02-14 16:53:05 +0100
commit2a6351535426d966745a82be71baf937994cb417 (patch)
treea3cd9412da3478119404d53fe0472c45bcf73041 /com32/chain/utility.c
parentd4ce5b911628423adeb53db8a3cb796f8de2016d (diff)
downloadsyslinux-2a6351535426d966745a82be71baf937994cb417.tar.gz
syslinux-2a6351535426d966745a82be71baf937994cb417.tar.xz
syslinux-2a6351535426d966745a82be71baf937994cb417.zip
com32/chain: recognize exFAT
The usual stuff - hidden sectors (now 64bit at different offset), drive offest, "BPB" type. Formally (?) region from 0x0B to 0x3F should be 0, but ... it's tempting to fill "old" values there. Might be worth adding a switch to handle such behavior. Signed-off-by: Michal Soltys <soltys@ziu.info>
Diffstat (limited to 'com32/chain/utility.c')
-rw-r--r--com32/chain/utility.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/com32/chain/utility.c b/com32/chain/utility.c
index d0da9f8f..7a0ce61c 100644
--- a/com32/chain/utility.c
+++ b/com32/chain/utility.c
@@ -48,6 +48,7 @@ static const char *bpbtypes[] = {
[5] = "4.0",
[6] = "8.0 (NT+)",
[7] = "7.0",
+ [8] = "exFAT",
};
void wait_key(void)
@@ -172,6 +173,8 @@ int drvoff_detect(int type)
return 0x24;
} else if (type == bpbV70) {
return 0x40;
+ } else if (type == bpbEXF) {
+ return 0x6F;
}
return -1;
@@ -184,6 +187,12 @@ int bpb_detect(const uint8_t *sec, const char *tag)
{
int a, b, c, jmp = -1, rev = 0;
+ /* exFAT mess first (media descriptor is 0 here) */
+ if (!memcmp(sec + 0x03, "EXFAT ", 8)) {
+ rev = bpbEXF;
+ goto out;
+ }
+
/* media descriptor check */
if ((sec[0x15] & 0xF0) != 0xF0)
goto out;