From bae20d053366d84e8104ea304300162e87169799 Mon Sep 17 00:00:00 2001 From: Kenneth J Davis Date: Sun, 30 Jan 2005 19:32:09 +0000 Subject: [PATCH] some of Arkady's suggestions (simplify logic), add comments git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1105 6ac86273-5f31-0410-b378-82cca8765d1b --- defaults.bat | 7 +++++-- kernel/initdisk.c | 14 ++++++-------- kernel/inthndlr.c | 4 ++-- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/defaults.bat b/defaults.bat index 163ac97..3835e3d 100644 --- a/defaults.bat +++ b/defaults.bat @@ -17,11 +17,13 @@ if "%BASE%" == "" goto clearset :----------------------------------------------------------------------- +if not "%BINPATH%" == "" goto skip_binpath set BINPATH=%BASE%\bin if "%COMPILER%" == "TC" set BINPATH=%BASE% if "%COMPILER%" == "WATCOM" set BINPATH=%BASE%\binw -if "%COMPILER%" == "WATCOM" if "%OS%" == "Windows_NT" set BINPATH=%BASE%\binnt +if "%COMPILER%-%OS%" == "WATCOM-Windows_NT" set BINPATH=%BASE%\binnt +:skip_binpath echo Path to compiler programs (binaries) is %BINPATH% :----------------------------------------------------------------------- @@ -32,7 +34,8 @@ set OLDPATH=%PATH% set PATH=%BINPATH%;%PATH% :- MSC searches libraries only through LIB variable. -if "%COMPILER%" == "MSC" set LIB=%MSC_BASE%\lib +:- If already set then assume preset to include MSC's lib +if "%COMPILER%%LIB%" == "MSC" set LIB=%MSC_BASE%\lib :----------------------------------------------------------------------- diff --git a/kernel/initdisk.c b/kernel/initdisk.c index 4134a08..f756928 100644 --- a/kernel/initdisk.c +++ b/kernel/initdisk.c @@ -595,15 +595,13 @@ void DosDefinePartition(struct DriveParamS *driveParam, pddt->ddt_defbpb.bpb_nheads = driveParam->chs.Head; pddt->ddt_defbpb.bpb_nsecs = driveParam->chs.Sector; pddt->ddt_defbpb.bpb_hidden = pEntry->RelSect; - if (pEntry->NumSect > 0xffff) + + pddt->ddt_defbpb.bpb_nsize = 0; + pddt->ddt_defbpb.bpb_huge = pEntry->NumSect; + if (pEntry->NumSect <= 0xffff) { - pddt->ddt_defbpb.bpb_nsize = 0; - pddt->ddt_defbpb.bpb_huge = pEntry->NumSect; - } - else - { - pddt->ddt_defbpb.bpb_nsize = (UWORD) (pEntry->NumSect); - pddt->ddt_defbpb.bpb_huge = 0; + pddt->ddt_defbpb.bpb_nsize = loword (pEntry->NumSect); + pddt->ddt_defbpb.bpb_huge = 0; /* may still be set on Win95 */ } /* sectors per cluster, sectors per FAT etc. */ diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index b0943c2..dd1e689 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -252,7 +252,7 @@ int int21_fat32(lregs *r) if (ISFAT32(dpb)) { if ((dpb->dpb_xfsinfosec == 0xffff - && (nfreeclst != 0 || cluster != 0)) + && (nfreeclst || cluster)) || nfreeclst > dpb->dpb_xsize || cluster > dpb->dpb_xsize) { @@ -1962,7 +1962,7 @@ VOID ASMCFUNC int2F_12_handler(struct int2f12regs r) omitting the NUL device TE */ r.BX = FP_SEG(nul_dev.dh_next); r.AX = FP_OFF(nul_dev.dh_next); - + /* fall through only to re-use break */ case 0x2e: /* GET or SET error table addresse - ignored called by MS debug with DS != DOSDS, printf doesn't work!! */