I could not find DPTE revision 0x10 mentioned in the specifications.

Size of 66 bytes is invalid. Also clear DPT "reserved3" field.

Sebastian
This commit is contained in:
Stanislav Shwartsman 2010-08-07 06:58:10 +00:00
parent 19398ed178
commit e989201277

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: rombios.c,v 1.249 2010-08-01 21:54:32 sshwarts Exp $
// $Id: rombios.c,v 1.250 2010-08-07 06:58:10 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -869,7 +869,7 @@ Bit16u cdrom_boot();
#endif // BX_ELTORITO_BOOT
static char bios_cvs_version_string[] = "$Revision: 1.249 $ $Date: 2010-08-01 21:54:32 $";
static char bios_cvs_version_string[] = "$Revision: 1.250 $ $Date: 2010-08-07 06:58:10 $";
#define BIOS_COPYRIGHT_STRING "(c) 2002 MandrakeSoft S.A. Written by Kevin Lawton & the Bochs team."
@ -5523,10 +5523,7 @@ int13_harddisk(EHAX, DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
write_byte(ebda_seg, &EbdaData->ata.dpte.pio, 0 );
write_word(ebda_seg, &EbdaData->ata.dpte.options, options);
write_word(ebda_seg, &EbdaData->ata.dpte.reserved, 0);
if (size >= 66)
write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x11);
else
write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x10);
write_byte(ebda_seg, &EbdaData->ata.dpte.revision, 0x11);
checksum=0;
for (i=0; i<15; i++) checksum+=read_byte(ebda_seg, ((Bit8u*)(&EbdaData->ata.dpte)) + i);
@ -5543,7 +5540,6 @@ int13_harddisk(EHAX, DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
iface = read_byte(ebda_seg, &EbdaData->ata.channels[channel].iface);
iobase1 = read_word(ebda_seg, &EbdaData->ata.channels[channel].iobase1);
write_word(DS, SI+(Bit16u)&Int13DPT->size, 66);
write_word(DS, SI+(Bit16u)&Int13DPT->key, 0xbedd);
write_byte(DS, SI+(Bit16u)&Int13DPT->dpi_length, 36);
write_byte(DS, SI+(Bit16u)&Int13DPT->reserved1, 0);
@ -5576,6 +5572,8 @@ int13_harddisk(EHAX, DS, ES, DI, SI, BP, ELDX, BX, DX, CX, AX, IP, CS, FLAGS)
write_word(DS, SI+(Bit16u)&Int13DPT->device_path[2], 0);
write_dword(DS, SI+(Bit16u)&Int13DPT->device_path[4], 0L);
write_byte(DS, SI+(Bit16u)&Int13DPT->reserved3, 0);
checksum=0;
for (i=30; i<65; i++) checksum+=read_byte(DS, SI + i);
checksum = -checksum;