diff options
author | Michael Brown | 2009-11-18 01:50:45 +0100 |
---|---|---|
committer | Michael Brown | 2009-11-18 03:44:45 +0100 |
commit | 89de3e29e199078683134ef00aceb682adc83087 (patch) | |
tree | 83e88a1efafc79b1a0821b1db525b4686d7269d6 | |
parent | [autoboot] Ensure that an error message is always printed for a boot failure (diff) | |
download | ipxe-89de3e29e199078683134ef00aceb682adc83087.tar.gz ipxe-89de3e29e199078683134ef00aceb682adc83087.tar.xz ipxe-89de3e29e199078683134ef00aceb682adc83087.zip |
[int13] Fix number of sectors returned by INT 13,15
INT 13,15 should return the number of sectors, not the number of
cylinders.
-rw-r--r-- | src/arch/i386/interface/pcbios/int13.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/arch/i386/interface/pcbios/int13.c b/src/arch/i386/interface/pcbios/int13.c index 733060f2..07439b93 100644 --- a/src/arch/i386/interface/pcbios/int13.c +++ b/src/arch/i386/interface/pcbios/int13.c @@ -207,9 +207,13 @@ static int int13_get_parameters ( struct int13_drive *drive, */ static int int13_get_disk_type ( struct int13_drive *drive, struct i386_all_regs *ix86 ) { + uint32_t blocks; + DBG ( "Get disk type\n" ); - ix86->regs.cx = ( drive->cylinders >> 16 ); - ix86->regs.dx = ( drive->cylinders & 0xffff ); + blocks = ( ( drive->blockdev->blocks <= 0xffffffffUL ) ? + drive->blockdev->blocks : 0xffffffffUL ); + ix86->regs.cx = ( blocks >> 16 ); + ix86->regs.dx = ( blocks & 0xffff ); return INT13_DISK_TYPE_HDD; } |