Pārlūkot izejas kodu

[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 gadus atpakaļ
vecāks
revīzija
89de3e29e1
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  1. 6
    2
      src/arch/i386/interface/pcbios/int13.c

+ 6
- 2
src/arch/i386/interface/pcbios/int13.c Parādīt failu

@@ -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
 

Notiek ielāde…
Atcelt
Saglabāt