diff --git a/docs/history.txt b/docs/history.txt index 9318f9d..e640cba 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -380,6 +380,8 @@ - update to include all CONFIG.SYS options (except ANYDOS) * boot.asm - use static read buffer to avoid crossing 64KB boundary + * main.c + - treat block devices returning 0 units as load failure * oemboot.asm - add [optional] PC/MS DOS compatible boot sector * sys.c - incorporate changes from/for DR-DOS enhancement project diff --git a/kernel/config.c b/kernel/config.c index 48ea048..a2f6cd4 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -1444,8 +1444,8 @@ STATIC BOOL LoadDevice(PCStr p, VFP top, int mode) { struct dhdr FAR *dhp = MK_PTR(struct dhdr, base, next); /* init_device returns FALSE on SUCCESS, TRUE otherwise */ - if ((ret = init_device(dhp, szBuf, mode, &top))) - break; + ret = init_device(dhp, szBuf, mode, &top); + if (ret) break; next = FP_OFF(dhp->dh_next); diff --git a/sys/sys.c b/sys/sys.c index dfa5b60..c6ca0b7 100644 --- a/sys/sys.c +++ b/sys/sys.c @@ -987,7 +987,7 @@ void correct_bpb(struct bootsectortype *default_bpb, } /* reads in boot sector (1st SEC_SIZE bytes) from file */ -void readBS(const char *bsFile, BYTE *bootsector) +void readBS(const char *bsFile, UBYTE *bootsector) { if (bsFile != NULL) { @@ -1018,7 +1018,7 @@ void readBS(const char *bsFile, BYTE *bootsector) /* write bs in bsFile to drive's boot record unmodified */ void restoreBS(const char *bsFile, int drive) { - unsigned char bootsector[SEC_SIZE]; + UBYTE bootsector[SEC_SIZE]; if (bsFile == NULL) { @@ -1047,7 +1047,7 @@ void restoreBS(const char *bsFile, int drive) } /* write bootsector to file bsFile */ -void saveBS(const char *bsFile, BYTE *bootsector) +void saveBS(const char *bsFile, UBYTE *bootsector) { if (bsFile != NULL) {