Browse Source

Added support for INT 13,15; NTLDR calls it (though it may not

actually do anything with the result, since it carried on using us
even when we returned failure).
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
40724431e8
1 changed files with 20 additions and 1 deletions
  1. 20
    1
      src/arch/i386/interface/pcbios/int13.c

+ 20
- 1
src/arch/i386/interface/pcbios/int13.c View File

207
 	return 0;
207
 	return 0;
208
 }
208
 }
209
 
209
 
210
+/**
211
+ * INT 13, 15 - Get disk type
212
+ *
213
+ * @v drive		Emulated drive
214
+ * @ret ah		Type code
215
+ * @ret cx:dx		Sector count
216
+ * @ret status		Status code / disk type
217
+ */
218
+static int int13_get_disk_type ( struct int13_drive *drive,
219
+				 struct i386_all_regs *ix86 ) {
220
+	DBG ( "Get disk type\n" );
221
+	ix86->regs.cx = ( drive->cylinders >> 16 );
222
+	ix86->regs.dx = ( drive->cylinders & 0xffff );
223
+	return INT13_DISK_TYPE_HDD;
224
+}
225
+
210
 /**
226
 /**
211
  * INT 13, 41 - Extensions installation check
227
  * INT 13, 41 - Extensions installation check
212
  *
228
  *
348
 		case INT13_GET_PARAMETERS:
364
 		case INT13_GET_PARAMETERS:
349
 			status = int13_get_parameters ( drive, ix86 );
365
 			status = int13_get_parameters ( drive, ix86 );
350
 			break;
366
 			break;
367
+		case INT13_GET_DISK_TYPE:
368
+			status = int13_get_disk_type ( drive, ix86 );
369
+			break;
351
 		case INT13_EXTENSION_CHECK:
370
 		case INT13_EXTENSION_CHECK:
352
 			status = int13_extension_check ( drive, ix86 );
371
 			status = int13_extension_check ( drive, ix86 );
353
 			break;
372
 			break;
361
 			status = int13_get_extended_parameters ( drive, ix86 );
380
 			status = int13_get_extended_parameters ( drive, ix86 );
362
 			break;
381
 			break;
363
 		default:
382
 		default:
364
-			DBG ( "Unrecognised INT 13\n" );
383
+			DBG ( "*** Unrecognised INT 13 ***\n" );
365
 			status = -INT13_STATUS_INVALID;
384
 			status = -INT13_STATUS_INVALID;
366
 			break;
385
 			break;
367
 		}
386
 		}

Loading…
Cancel
Save