From: Eric Luttmann <ecl@users.sourceforge.net>

Fix for multisegmented device drivers: If there are multiple device
drivers in a single driver file, only the END ADDRESS returned by the
last INIT call should be the used.  It is recommended that all the
device drivers in the file return the same address.
This fixes a load problem with DUSE.


git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@721 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2003-10-26 13:07:49 +00:00
parent 58808de6c8
commit 8db46073f9
1 changed files with 11 additions and 2 deletions

View File

@ -535,8 +535,17 @@ BOOL init_device(struct dhdr FAR * dhp, char *cmdLine, COUNT mode,
if (rq.r_endaddr == (BYTE FAR *) dhp)
return TRUE;
KernelAllocPara(FP_SEG(rq.r_endaddr) + (FP_OFF(rq.r_endaddr) + 15)/16
- FP_SEG(dhp), 'D', name, mode);
/* Fix for multisegmented device drivers: */
/* If there are multiple device drivers in a single driver file, */
/* only the END ADDRESS returned by the last INIT call should be */
/* the used. It is recommended that all the device drivers in */
/* the file return the same address */
if (FP_OFF(dhp->dh_next) == 0xffff)
{
KernelAllocPara(FP_SEG(rq.r_endaddr) + (FP_OFF(rq.r_endaddr) + 15)/16
- FP_SEG(dhp), 'D', name, mode);
}
}
if (!(dhp->dh_attr & ATTR_CHAR) && (rq.r_nunits != 0))