Browse Source

Always increase number of BIOS drives when registering

tags/v0.9.3
Michael Brown 17 years ago
parent
commit
cd7e296cbe
1 changed files with 5 additions and 3 deletions
  1. 5
    3
      src/arch/i386/interface/pcbios/int13.c

+ 5
- 3
src/arch/i386/interface/pcbios/int13.c View File

580
 	get_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
580
 	get_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
581
 	if ( ! drive->drive )
581
 	if ( ! drive->drive )
582
 		drive->drive = ( num_drives | 0x80 );
582
 		drive->drive = ( num_drives | 0x80 );
583
+	num_drives++;
583
 	if ( num_drives <= ( drive->drive & 0x7f ) )
584
 	if ( num_drives <= ( drive->drive & 0x7f ) )
584
 		num_drives = ( ( drive->drive & 0x7f ) + 1 );
585
 		num_drives = ( ( drive->drive & 0x7f ) + 1 );
585
-
586
-	num_drives = 2;
587
-
588
 	put_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
586
 	put_real ( num_drives, BDA_SEG, BDA_NUM_DRIVES );
589
 
587
 
590
 	DBG ( "Registered INT13 drive %02x with C/H/S geometry %d/%d/%d\n",
588
 	DBG ( "Registered INT13 drive %02x with C/H/S geometry %d/%d/%d\n",
612
 	/* Remove from list of emulated drives */
610
 	/* Remove from list of emulated drives */
613
 	list_del ( &drive->list );
611
 	list_del ( &drive->list );
614
 
612
 
613
+	/* Should adjust BIOS drive count, but it's difficult to do so
614
+	 * reliably.
615
+	 */
616
+
615
 	DBG ( "Unregistered INT13 drive %02x\n", drive->drive );
617
 	DBG ( "Unregistered INT13 drive %02x\n", drive->drive );
616
 
618
 
617
 	/* Unhook INT 13 vector if no more drives */
619
 	/* Unhook INT 13 vector if no more drives */

Loading…
Cancel
Save