From Tom Ehlert: don't split disk transfers crossing DMA boundary if BIOS indicates can handle transparently

This commit is contained in:
Kenneth J Davis 2021-07-30 23:04:06 -04:00
parent ab1e31e0ba
commit dd91e3c005
3 changed files with 13 additions and 2 deletions

View File

@ -253,6 +253,7 @@ typedef struct ddtstruct {
/* freedos specific flag bits */ /* freedos specific flag bits */
#define DF_LBA 0x400 #define DF_LBA 0x400
#define DF_WRTVERIFY 0x800 #define DF_WRTVERIFY 0x800
#define DF_DMA_TRANSPARENT 0x1000 /* DMA boundary errors are handled transparently */
/* typedef struct ddtstruct ddt;*/ /* typedef struct ddtstruct ddt;*/

View File

@ -1021,8 +1021,13 @@ STATIC int LBA_Transfer(ddt * pddt, UWORD mode, VOID FAR * buffer,
buffer = adjust_far(buffer); buffer = adjust_far(buffer);
for (; totaltodo != 0;) for (; totaltodo != 0;)
{ {
/* avoid overflowing 64K DMA boundary */ count = totaltodo;
count = DMA_max_transfer(buffer, totaltodo); if ((pddt->ddt_descflags & DF_DMA_TRANSPARENT) == 0)
{
/* avoid overflowing 64K DMA boundary
for drives that don't handle this transparently */
count = DMA_max_transfer(buffer, totaltodo);
}
if (FP_SEG(buffer) >= 0xa000 || count == 0) if (FP_SEG(buffer) >= 0xa000 || count == 0)
{ {

View File

@ -711,6 +711,11 @@ STATIC int LBA_Get_Drive_Parameters(int drive, struct DriveParamS *driveParam)
if (lba_bios_parameters.information & 8) if (lba_bios_parameters.information & 8)
driveParam->descflags |= DF_WRTVERIFY; driveParam->descflags |= DF_WRTVERIFY;
if (lba_bios_parameters.information & 1)
{
driveParam->descflags |= DF_DMA_TRANSPARENT; /* DMA boundary errors are handled transparently */
}
StandardBios: /* old way to get parameters */ StandardBios: /* old way to get parameters */
regs.a.b.h = 0x08; regs.a.b.h = 0x08;