]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[int13] Include disk signature in debugging output
authorMichael Brown <mcb30@ipxe.org>
Wed, 22 Sep 2010 20:39:01 +0000 (21:39 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 22 Sep 2010 20:39:01 +0000 (21:39 +0100)
The disk signature is used by some OSes (notably Windows) to identify
the boot disk, so it's useful debugging information to have.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/i386/include/int13.h
src/arch/i386/interface/pcbios/int13.c

index 0675572462e126461a72a624a2a08ccdd612b2e1..a14ebb2e93e79d5114ef210054d3dea056a0629c 100644 (file)
@@ -249,11 +249,16 @@ struct partition_table_entry {
 
 /** A Master Boot Record */
 struct master_boot_record {
-       uint8_t pad[446];
+       /** Code area */
+       uint8_t code[440];
+       /** Disk signature */
+       uint32_t signature;
+       /** Padding */
+       uint8_t pad[2];
        /** Partition table */
        struct partition_table_entry partitions[4];
        /** 0x55aa MBR signature */
-       uint16_t signature;
+       uint16_t magic;
 } __attribute__ (( packed ));
 
 /** Use natural BIOS drive number */
index e0acc07ceb6e3d85163c5ee9ca95332f510497ee..e13a42236759fd05f137cbc5100d04a746b93d79 100644 (file)
@@ -368,6 +368,8 @@ static int int13_guess_geometry ( struct int13_drive *int13 ) {
                       int13->drive, strerror ( rc ) );
                return rc;
        }
+       DBGC ( int13, "INT13 drive %02x has signature %08x\n",
+              int13->drive, mbr.signature );
 
        /* Scan through partition table and modify guesses for heads
         * and sectors_per_track if we find any used partitions.