disklib: Add WEE bootloader detection code
authorGert Hulselmans <gerth@zytor.com>
Thu, 24 Jun 2010 20:08:21 +0000 (22:08 +0200)
committerErwan Velu <erwanaliasr1@gmail.com>
Thu, 24 Jun 2010 20:08:21 +0000 (22:08 +0200)
WEE, is a bootloader based on grub4dos. It fits in the first 63 sectors of
the drive.

The first 4 bytes are:
$ hexdump -n 4 /media/Data/ubcd-new/wee-2010-06-20/wee63.mbr
0000000 5eeb 0090
0000004

Or in the format get_mbr_string wants it:
$ hexdump -C -n 4 wee63.mbr
00000000  eb 5e 90 00

Patch tested in qemu:
  qemu -boot d -cdrom hdt.iso -hda wee-2010-06-20/wee63.mbr

com32/gpllib/disk/mbrs.c

index f2942fc..41bb20c 100644 (file)
@@ -71,6 +71,8 @@ void get_mbr_string(const uint32_t label, char *buffer, const int buffer_size)
            strlcpy(buffer, "fbinst", buffer_size - 1);
        else if (((label >> 8) & 0xff) == 0x80)
            strlcpy(buffer, "Grub4Dos", buffer_size - 1);
+       else if (((label >> 8) & 0xff) == 0x90)
+           strlcpy(buffer, "WEE", buffer_size - 1);
        else
            strlcpy(buffer, "Unknown mbr", buffer_size - 1);
        break;