Преглед изворни кода

[int13] Fix number of sectors returned by INT 13,15

INT 13,15 should return the number of sectors, not the number of
cylinders.
tags/v1.0.0-rc1
Michael Brown пре 15 година
родитељ
комит
89de3e29e1
1 измењених фајлова са 6 додато и 2 уклоњено
  1. 6
    2
      src/arch/i386/interface/pcbios/int13.c

+ 6
- 2
src/arch/i386/interface/pcbios/int13.c Прегледај датотеку

@@ -207,9 +207,13 @@ static int int13_get_parameters ( struct int13_drive *drive,
207 207
  */
208 208
 static int int13_get_disk_type ( struct int13_drive *drive,
209 209
 				 struct i386_all_regs *ix86 ) {
210
+	uint32_t blocks;
211
+
210 212
 	DBG ( "Get disk type\n" );
211
-	ix86->regs.cx = ( drive->cylinders >> 16 );
212
-	ix86->regs.dx = ( drive->cylinders & 0xffff );
213
+	blocks = ( ( drive->blockdev->blocks <= 0xffffffffUL ) ?
214
+		   drive->blockdev->blocks : 0xffffffffUL );
215
+	ix86->regs.cx = ( blocks >> 16 );
216
+	ix86->regs.dx = ( blocks & 0xffff );
213 217
 	return INT13_DISK_TYPE_HDD;
214 218
 }
215 219
 

Loading…
Откажи
Сачувај