Browse Source

[int13] Include disk signature in debugging output

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>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
4a30637d38
2 changed files with 9 additions and 2 deletions
  1. 7
    2
      src/arch/i386/include/int13.h
  2. 2
    0
      src/arch/i386/interface/pcbios/int13.c

+ 7
- 2
src/arch/i386/include/int13.h View File

249
 
249
 
250
 /** A Master Boot Record */
250
 /** A Master Boot Record */
251
 struct master_boot_record {
251
 struct master_boot_record {
252
-	uint8_t pad[446];
252
+	/** Code area */
253
+	uint8_t code[440];
254
+	/** Disk signature */
255
+	uint32_t signature;
256
+	/** Padding */
257
+	uint8_t pad[2];
253
 	/** Partition table */
258
 	/** Partition table */
254
 	struct partition_table_entry partitions[4];
259
 	struct partition_table_entry partitions[4];
255
 	/** 0x55aa MBR signature */
260
 	/** 0x55aa MBR signature */
256
-	uint16_t signature;
261
+	uint16_t magic;
257
 } __attribute__ (( packed ));
262
 } __attribute__ (( packed ));
258
 
263
 
259
 /** Use natural BIOS drive number */
264
 /** Use natural BIOS drive number */

+ 2
- 0
src/arch/i386/interface/pcbios/int13.c View File

368
 		       int13->drive, strerror ( rc ) );
368
 		       int13->drive, strerror ( rc ) );
369
 		return rc;
369
 		return rc;
370
 	}
370
 	}
371
+	DBGC ( int13, "INT13 drive %02x has signature %08x\n",
372
+	       int13->drive, mbr.signature );
371
 
373
 
372
 	/* Scan through partition table and modify guesses for heads
374
 	/* Scan through partition table and modify guesses for heads
373
 	 * and sectors_per_track if we find any used partitions.
375
 	 * and sectors_per_track if we find any used partitions.

Loading…
Cancel
Save