[int13] Fix number of sectors returned by INT 13,15
INT 13,15 should return the number of sectors, not the number of cylinders.
This commit is contained in:
parent
5bee2a2991
commit
89de3e29e1
|
@ -207,9 +207,13 @@ static int int13_get_parameters ( struct int13_drive *drive,
|
||||||
*/
|
*/
|
||||||
static int int13_get_disk_type ( struct int13_drive *drive,
|
static int int13_get_disk_type ( struct int13_drive *drive,
|
||||||
struct i386_all_regs *ix86 ) {
|
struct i386_all_regs *ix86 ) {
|
||||||
|
uint32_t blocks;
|
||||||
|
|
||||||
DBG ( "Get disk type\n" );
|
DBG ( "Get disk type\n" );
|
||||||
ix86->regs.cx = ( drive->cylinders >> 16 );
|
blocks = ( ( drive->blockdev->blocks <= 0xffffffffUL ) ?
|
||||||
ix86->regs.dx = ( drive->cylinders & 0xffff );
|
drive->blockdev->blocks : 0xffffffffUL );
|
||||||
|
ix86->regs.cx = ( blocks >> 16 );
|
||||||
|
ix86->regs.dx = ( blocks & 0xffff );
|
||||||
return INT13_DISK_TYPE_HDD;
|
return INT13_DISK_TYPE_HDD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in New Issue