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 */
#define DF_LBA 0x400
#define DF_WRTVERIFY 0x800
#define DF_DMA_TRANSPARENT 0x1000 /* DMA boundary errors are handled transparently */
/* 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);
for (; totaltodo != 0;)
{
/* avoid overflowing 64K DMA boundary */
count = DMA_max_transfer(buffer, totaltodo);
count = 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)
{

View File

@ -710,6 +710,11 @@ STATIC int LBA_Get_Drive_Parameters(int drive, struct DriveParamS *driveParam)
driveParam->descflags = DF_LBA;
if (lba_bios_parameters.information & 8)
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 */