do not fail on internal driver, corrects bug 1850 fix to work with test case

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1085 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Kenneth J Davis 2005-01-01 18:07:03 +00:00
parent ebecfcb6b0
commit 51adbac8fd

View File

@ -482,6 +482,14 @@ BOOL init_device(struct dhdr FAR * dhp, PCStr cmdLine, int mode, VFP *r_top)
if (rq.r_endaddr == (BYTE FAR *) dhp) if (rq.r_endaddr == (BYTE FAR *) dhp)
return TRUE; return TRUE;
/* Don't link in block device drivers which indicate no units */
if (!(dhp->dh_attr & ATTR_CHAR) && !rq.r_nunits)
{
rq.r_endaddr = (BYTE FAR *) dhp;
return TRUE;
}
/* Fix for multisegmented device drivers: */ /* Fix for multisegmented device drivers: */
/* If there are multiple device drivers in a single driver file, */ /* If there are multiple device drivers in a single driver file, */
/* only the END ADDRESS returned by the last INIT call should be */ /* only the END ADDRESS returned by the last INIT call should be */
@ -531,15 +539,11 @@ BOOL init_device(struct dhdr FAR * dhp, PCStr cmdLine, int mode, VFP *r_top)
*r_top = rq.r_endaddr; *r_top = rq.r_endaddr;
} }
if (!(dhp->dh_attr & ATTR_CHAR)) /* if block device (not character) */ /* if block device (not character) and unit count is nonzero */
if (!(dhp->dh_attr & ATTR_CHAR) && rq.r_nunits)
{ {
if (rq.r_nunits) /* if unit count is nonzero */ dhp->dh_name[0] = rq.r_nunits;
{ update_dcb(dhp);
dhp->dh_name[0] = rq.r_nunits;
update_dcb(dhp);
}
else /* returned unit count of 0, indication of load failure */
return TRUE;
} }
if (dhp->dh_attr & ATTR_CONIN) if (dhp->dh_attr & ATTR_CONIN)
@ -615,7 +619,7 @@ STATIC VOID InitSerialPorts(VOID)
booted from HD booted from HD
*/ */
static int EmulatedDriveStatus(int drive,char statusOnly) STATIC int EmulatedDriveStatus(int drive,char statusOnly)
{ {
iregs r; iregs r;
char buffer[0x13]; char buffer[0x13];