[syslinux:master] disklib: Detect new Syslinux (normal + isohybrid) MBR

syslinux-bot for Gert Hulselmans gerth at zytor.com
Tue Jan 25 17:00:04 PST 2011


Commit-ID:  07cabef97538fdb83594e99ccc93805da19c7e50
Gitweb:     http://syslinux.zytor.com/commit/07cabef97538fdb83594e99ccc93805da19c7e50
Author:     Gert Hulselmans <gerth at zytor.com>
AuthorDate: Mon, 24 Jan 2011 23:08:23 +0100
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Tue, 25 Jan 2011 20:54:08 +0100

disklib: Detect new Syslinux (normal + isohybrid) MBR

Add detection code for new Syslinux (normal + isohybrid) MBR to disklib.
Switch old Syslinux MBR and Master Boot LoaDeR detection code.

Signed-off-by: Gert Hulselmans <gerth at zytor.com>


---
 com32/gpllib/disk/mbrs.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/com32/gpllib/disk/mbrs.c b/com32/gpllib/disk/mbrs.c
index da69228..c889eec 100644
--- a/com32/gpllib/disk/mbrs.c
+++ b/com32/gpllib/disk/mbrs.c
@@ -39,7 +39,16 @@ void get_mbr_string(const uint32_t label, char *buffer, const int buffer_size)
 	strlcpy(buffer, "Acer 3", buffer_size - 1);
 	break;
     case 0x33c0:
-	strlcpy(buffer, "Windows", buffer_size - 1);
+	/* We need more than 2 bytes */
+	if (((label >> 8) & 0xff) == 0x8e)
+	    strlcpy(buffer, "Windows", buffer_size - 1);
+	else if (((label >> 8) & 0xff) == 0xfa)
+	    strlcpy(buffer, "Syslinux", buffer_size - 1);
+	else
+	    strlcpy(buffer, "Unknown mbr", buffer_size - 1);
+	break;
+    case 0x33ed:
+	strlcpy(buffer, "Syslinux ISOhybrid", buffer_size - 1);
 	break;
     case 0x33ff:
 	strlcpy(buffer, "HP/Gateway", buffer_size - 1);
@@ -81,10 +90,10 @@ void get_mbr_string(const uint32_t label, char *buffer, const int buffer_size)
 	break;
     case 0xfa31:
 	/* We need more than 2 bytes */
-	if (((label >> 8) & 0xff) == 0xc9)
-	    strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
-	else if (((label >> 8) & 0xff) == 0xc0)
+	if (((label >> 8) & 0xff) == 0xc0)
 	    strlcpy(buffer, "Syslinux", buffer_size - 1);
+	else if (((label >> 8) & 0xff) == 0xc9)
+	    strlcpy(buffer, "Master Boot LoaDeR", buffer_size - 1);
 	else
 	    strlcpy(buffer, "Unknown mbr", buffer_size - 1);
 	break;



More information about the Syslinux-commits mailing list