Kaynağa Gözat

[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 13 yıl önce
ebeveyn
işleme
4a30637d38

+ 7
- 2
src/arch/i386/include/int13.h Dosyayı Görüntüle

@@ -249,11 +249,16 @@ struct partition_table_entry {
249 249
 
250 250
 /** A Master Boot Record */
251 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 258
 	/** Partition table */
254 259
 	struct partition_table_entry partitions[4];
255 260
 	/** 0x55aa MBR signature */
256
-	uint16_t signature;
261
+	uint16_t magic;
257 262
 } __attribute__ (( packed ));
258 263
 
259 264
 /** Use natural BIOS drive number */

+ 2
- 0
src/arch/i386/interface/pcbios/int13.c Dosyayı Görüntüle

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

Loading…
İptal
Kaydet