diff --git a/docs/history.txt b/docs/history.txt index 753b7bc..120343e 100644 --- a/docs/history.txt +++ b/docs/history.txt @@ -1,3 +1,11 @@ +2001 Mar 25 - Build 2023 +-------- Bart Oldeman (bart.oldeman@bristol.ac.uk) ++ Fixes sys.com compilation: it is a proper .com and works again. + Suggestions from Martin Stromberg: warning removal and some + debugging related changes. + Suggestion from Aitor Santamaria Merino: implemented NUMLOCK=ON/OFF + in config.sys. Also implemented strcasecmp. + Updated intfns.txt; reported version is now 5.0. 2001 Mar 24 - Build 2022 -------- Bart Oldeman (bart.oldeman@bristol.ac.uk) + Fixes Tom and Bart: cli/sti handling and other fixes in entry.asm, diff --git a/docs/intfns.txt b/docs/intfns.txt index ccc2396..9b6db7b 100644 --- a/docs/intfns.txt +++ b/docs/intfns.txt @@ -112,12 +112,12 @@ int 21 Description State Ver Status 5701h Set File Date and Time active 2.00 supported 5800h Get Allocation Strategy active 3.00 supported 5801h Set Allocation Strategy active 3.00 supported -5802h Get Upper-Memory Link active 5.00 planned -5803h Set Upper-Memory Link active 5.00 planned -59h Get Extended Error active 3.00 planned -5ah Create Temporary File active 3.00 -5bh Create New File active 3.00 -5ch Lock/Unlock File active 3.10 planned +5802h Get Upper-Memory Link active 5.00 supported +5803h Set Upper-Memory Link active 5.00 supported +59h Get Extended Error active 3.00 supported +5ah Create Temporary File active 3.00 supported +5bh Create New File active 3.00 supported +5ch Lock/Unlock File active 3.10 supported 5d00h Server Function Call active 3.10 supported 5d01h Commit All Files active 3.10 planned 5d02h Close File by Name active 3.10 planned @@ -142,8 +142,8 @@ int 21 Description State Ver Status 68h Commit File active 3.30 dummy func 69h GET/SET DISK SERIAL NUMBER active 4.00 supported 6ah COMMIT FILE (same as 68h) active 4.00 not supported -6bh NULL FUNCTION active 5.00 not supported -6ch Extended Open/Create active 4.00 supported +6bh NULL FUNCTION active 5.00 supported +6ch Extended Open/Create active 4.00 planned 71h LONG FILENAME FUNCTIONS active 7.00 not supported int 22: Program Termination Address. @@ -195,6 +195,9 @@ See COPYING in DOS-C root directory for license. $Id$ $Log$ +Revision 1.4 2001/03/25 17:11:53 bartoldeman +Fixed sys.com compilation. Updated to 2023. Also: see history.txt. + Revision 1.3 2000/05/09 00:29:50 jimtabor Clean up and Release diff --git a/hdr/version.h b/hdr/version.h index bfa903b..c8d7865 100644 --- a/hdr/version.h +++ b/hdr/version.h @@ -42,5 +42,5 @@ static BYTE *date_hRcsId = "$Id$"; #define REVISION_MAJOR 1 #define REVISION_MINOR 1 -#define REVISION_SEQ 22 -#define BUILD 2022 +#define REVISION_SEQ 23 +#define BUILD 2023 diff --git a/kernel/config.c b/kernel/config.c index 6beb11a..e5b072d 100644 --- a/kernel/config.c +++ b/kernel/config.c @@ -40,6 +40,9 @@ static BYTE *RcsId = "$Id$"; /* * $Log$ + * Revision 1.12 2001/03/25 17:11:54 bartoldeman + * Fixed sys.com compilation. Updated to 2023. Also: see history.txt. + * * Revision 1.11 2001/03/22 04:55:36 bartoldeman * Fix prototypes. * @@ -195,12 +198,14 @@ INIT VOID Switchar(BYTE * pLine); INIT VOID CfgFailure(BYTE * pLine); INIT VOID Stacks(BYTE * pLine); INIT VOID SetAnyDos(BYTE * pLine); +INIT VOID Numlock(BYTE * pLine); INIT BYTE *GetNumArg(BYTE * pLine, COUNT * pnArg); INIT BYTE *GetStringArg(BYTE * pLine, BYTE * pszString); INIT struct dhdr FAR *linkdev(struct dhdr FAR * dhp); INIT UWORD initdev(struct dhdr FAR * dhp, BYTE FAR * cmdTail); INIT int SkipLine(char *pLine); INIT char *stristr(char *s1, char *s2); +INIT COUNT strcasecmp(REG BYTE *d, REG BYTE *s); INIT BYTE FAR *KernelAlloc(WORD nBytes); @@ -239,6 +244,7 @@ static struct table commands[] = {"FCBS", 1, Fcbs}, {"FILES", 1, Files}, {"LASTDRIVE", 1, Lastdrive}, + {"NUMLOCK", 1, Numlock}, /* rem is never executed by locking out pass */ {"REM", 0, CfgFailure}, {"SHELL", 1, InitPgm}, @@ -585,10 +591,6 @@ INIT VOID DoConfig(VOID) /* Skip leading white space and get verb. */ pLine = scan(pLine, szBuf); - /* Translate the verb to upper case ... */ - for (pTmp = szBuf; *pTmp != '\0'; pTmp++) - *pTmp = toupper(*pTmp); - /* If the line was blank, skip it. Otherwise, look up */ /* the verb and execute the appropriate function. */ if (*szBuf != '\0') @@ -619,7 +621,7 @@ INIT struct table *LookUp(struct table *p, BYTE * token) { while (*(p->entry) != '\0') { - if (strcmp(p->entry, token) == 0) + if (strcasecmp(p->entry, token) == 0) break; else ++p; @@ -936,10 +938,22 @@ INIT static VOID InitPgm(BYTE * pLine) INIT static VOID Break(BYTE * pLine) { /* Format: BREAK = (ON | OFF) */ - BYTE *pTmp; + GetStringArg(pLine, szBuf); + break_ena = strcasecmp(szBuf, "OFF") ? 1 : 0; +} + +INIT static VOID Numlock(BYTE * pLine) +{ + /* Format: NUMLOCK = (ON | OFF) */ + iregs regs; + BYTE FAR *keyflags = (BYTE FAR *)MK_FP(0x40,0x17); GetStringArg(pLine, szBuf); - break_ena = strcmp(szBuf, "OFF") ? 1 : 0; + + *keyflags &= ~32; + *keyflags |= strcasecmp(szBuf, "OFF") ? 32 : 0; + regs.a.b.h = 1; + init_call_intr(0x16, ®s); } INIT static VOID DeviceHigh(BYTE * pLine) @@ -1279,8 +1293,26 @@ char *stristr(char *s1, char *s2) } return NULL; -} +} +/* compare two ASCII strings ignoring case */ +INIT COUNT strcasecmp(REG BYTE *d, REG BYTE *s) +{ + int loop; + + while (*s != '\0' && *d != '\0') + { + + if (toupper(*d) == toupper(*s)) + ++s, ++d; + + else + return toupper(*d) - toupper(*s); + + } + + return toupper(*d) - toupper(*s); +} /* moved from BLOCKIO.C here. diff --git a/kernel/inthndlr.c b/kernel/inthndlr.c index 152803b..16e54a2 100644 --- a/kernel/inthndlr.c +++ b/kernel/inthndlr.c @@ -36,6 +36,9 @@ BYTE *RcsId = "$Id$"; /* * $Log$ + * Revision 1.15 2001/03/25 17:11:54 bartoldeman + * Fixed sys.com compilation. Updated to 2023. Also: see history.txt. + * * Revision 1.14 2001/03/21 02:56:26 bartoldeman * See history.txt for changes. Bug fixes and HMA support are the main ones. * @@ -564,7 +567,13 @@ dispatch: r->AL = 0xff; break; - /* CP/M compatibility functions */ + default: +#ifdef DEBUG + printf("Unsupported INT21 AH = 0x%x, AL = 0x%x.\n", r->AH, r->AL); +#endif + /* Fall through. */ + + /* CP/M compatibility functions */ case 0x18: case 0x1d: case 0x1e: @@ -572,7 +581,6 @@ dispatch: #ifndef TSC case 0x61: #endif - default: r->AL = 0; break; diff --git a/kernel/kernel.mak b/kernel/kernel.mak index 5a00a41..26808d1 100644 --- a/kernel/kernel.mak +++ b/kernel/kernel.mak @@ -5,6 +5,9 @@ # # $Log$ +# Revision 1.7 2001/03/25 17:11:54 bartoldeman +# Fixed sys.com compilation. Updated to 2023. Also: see history.txt. +# # Revision 1.6 2001/03/21 02:56:26 bartoldeman # See history.txt for changes. Bug fixes and HMA support are the main ones. # @@ -125,7 +128,7 @@ INCLUDEPATH = ..\HDR #AFLAGS = /Mx /DSTANDALONE=1 /I..\HDR NASMFLAGS = -i../hdr/ LIBS =..\LIB\DEVICE.LIB ..\LIB\LIBM.LIB -#CFLAGS = -1- -O -Z -d -I..\hdr -I. \ +#ALLCFLAGS = -1- -O -Z -d -I..\hdr -I. \ # -D__STDC__=0;DEBUG;KERNEL;I86;PROTO;ASMSUPT ALLCFLAGS = -1- -O -Z -d -I..\hdr -I. \ -D__STDC__=0;KERNEL;I86;PROTO;ASMSUPT \ diff --git a/kernel/main.c b/kernel/main.c index 079d8ba..c53f278 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -36,11 +36,12 @@ #ifdef VERSION_STRINGS static BYTE *mainRcsId = "$Id$"; #endif -GLOBAL WORD bDumpRegs = FALSE; -GLOBAL WORD bDumpRdWrParms= FALSE; /* * $Log$ + * Revision 1.9 2001/03/25 17:11:54 bartoldeman + * Fixed sys.com compilation. Updated to 2023. Also: see history.txt. + * * Revision 1.8 2001/03/21 02:56:26 bartoldeman * See history.txt for changes. Bug fixes and HMA support are the main ones. * diff --git a/sys/sys.c b/sys/sys.c index d14d060..7114bc6 100644 --- a/sys/sys.c +++ b/sys/sys.c @@ -27,9 +27,12 @@ ***************************************************************/ /* $Log$ - * Revision 1.4 2000/08/06 05:50:17 jimtabor - * Add new files and update cvs with patches and changes + * Revision 1.5 2001/03/25 17:11:54 bartoldeman + * Fixed sys.com compilation. Updated to 2023. Also: see history.txt. * +/* Revision 1.4 2000/08/06 05:50:17 jimtabor +/* Add new files and update cvs with patches and changes +/* * Revision 1.3 2000/05/25 20:56:23 jimtabor * Fixed project history * @@ -510,12 +513,14 @@ VOID get_boot(COUNT drive) BOOL check_space(COUNT drive, BYTE * BlkBuffer) { BYTE *bpbp; +#if 0 /* these local variables are never used */ BYTE nfat; UWORD nfsect; ULONG hidden; + UBYTE nreserved; +#endif ULONG count; ULONG block; - UBYTE nreserved; UCOUNT i; WORD track, head, sector; UBYTE buffer[SEC_SIZE]; @@ -523,10 +528,12 @@ BOOL check_space(COUNT drive, BYTE * BlkBuffer) UWORD bpb_nsize; /* get local information */ +#if 0 /* these local variables are never used */ getbyte((VOID *) & BlkBuffer[BT_BPB + BPB_NFAT], &nfat); getword((VOID *) & BlkBuffer[BT_BPB + BPB_NFSECT], &nfsect); getlong((VOID *) & BlkBuffer[BT_BPB + BPB_HIDDEN], &hidden); getbyte((VOID *) & BlkBuffer[BT_BPB + BPB_NRESERVED], &nreserved); +#endif getlong((VOID *) & BlkBuffer[BT_BPB + BPB_HUGE], &bpb_huge); getword((VOID *) & BlkBuffer[BT_BPB + BPB_NSIZE], &bpb_nsize);