Misc fixes and implementation of SHELLHIGH. See history.txt for details.

git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@181 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
Bart Oldeman 2001-03-30 19:30:06 +00:00
parent ac1d293d9c
commit 31b068e497
15 changed files with 257 additions and 89 deletions

View File

@ -1,5 +1,19 @@
2001 Mar 28 - Build 2023 2001 Mar 30 - Build 2023
-------- Bart Oldeman (bart.oldeman@bristol.ac.uk) -------- Bart Oldeman (bart.oldeman@bristol.ac.uk)
+ Fixes Tom: Kernel alloc initialises to 0. This avoids some weird errors.
Implemented default divide by 0 handler (INT 0)
FILES= fixes from config.sys. fatfs.c ignored it and always
used the default of 16.
Misc debug code removal.
int 21/ax=3306 report running HIGH fix.
int 21/ah=69 : save CX
InitializeAllBPBs() or MakeNortonDiskEditorHappy()
More extended information if MCB chain corruption occurs.
Bart: getdpb fixes (int 21/ah=32).
fix carry handling in int 21/ah=5e.
fix {get,set}_machine_name in network.c
+ Add Support for SHELLHIGH in config.sys
2001 Mar 28 - Build 2023
+ Fixes Bug fix release 2023b: dsk.c (reported by Nagy Daniel), inthndlr and + Fixes Bug fix release 2023b: dsk.c (reported by Nagy Daniel), inthndlr and
int25/26 fixes by Tom Ehlert. int25/26 fixes by Tom Ehlert.
2001 Mar 27 - Build 2023 2001 Mar 27 - Build 2023

View File

@ -40,6 +40,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.14 2001/03/30 19:30:00 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.13 2001/03/27 20:27:27 bartoldeman * Revision 1.13 2001/03/27 20:27:27 bartoldeman
* dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert. * dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert.
* *
@ -197,6 +200,7 @@ INIT BOOL LoadDevice(BYTE * pLine, COUNT top, COUNT mode);
INIT VOID Dosmem(BYTE * pLine); INIT VOID Dosmem(BYTE * pLine);
INIT VOID Country(BYTE * pLine); INIT VOID Country(BYTE * pLine);
INIT VOID InitPgm(BYTE * pLine); INIT VOID InitPgm(BYTE * pLine);
INIT VOID InitPgmHigh(BYTE * pLine);
INIT VOID Switchar(BYTE * pLine); INIT VOID Switchar(BYTE * pLine);
INIT VOID CfgFailure(BYTE * pLine); INIT VOID CfgFailure(BYTE * pLine);
INIT VOID Stacks(BYTE * pLine); INIT VOID Stacks(BYTE * pLine);
@ -251,6 +255,7 @@ static struct table commands[] =
/* rem is never executed by locking out pass */ /* rem is never executed by locking out pass */
{"REM", 0, CfgFailure}, {"REM", 0, CfgFailure},
{"SHELL", 1, InitPgm}, {"SHELL", 1, InitPgm},
{"SHELLHIGH", 1, InitPgmHigh},
{"STACKS", 1, Stacks}, {"STACKS", 1, Stacks},
{"SWITCHAR", 1, Switchar}, {"SWITCHAR", 1, Switchar},
{"SCREEN", 1, sysScreenMode}, /* JPP */ {"SCREEN", 1, sysScreenMode}, /* JPP */
@ -322,6 +327,8 @@ INIT void PreConfig(void)
/* Initialize the file table */ /* Initialize the file table */
f_nodes = (struct f_node FAR *) f_nodes = (struct f_node FAR *)
KernelAlloc(Config.cfgFiles * sizeof(struct f_node)); KernelAlloc(Config.cfgFiles * sizeof(struct f_node));
f_nodes_cnt = Config.cfgFiles;
/* sfthead = (sfttbl FAR *)&basesft; */ /* sfthead = (sfttbl FAR *)&basesft; */
/* FCBp = (sfttbl FAR *)&FcbSft; */ /* FCBp = (sfttbl FAR *)&FcbSft; */
FCBp = (sfttbl FAR *) FCBp = (sfttbl FAR *)
@ -399,7 +406,9 @@ INIT void PostConfig(void)
/* Initialize the file table */ /* Initialize the file table */
f_nodes = (struct f_node FAR *) f_nodes = (struct f_node FAR *)
KernelAlloc(Config.cfgFiles * sizeof(struct f_node)); KernelAlloc(Config.cfgFiles * sizeof(struct f_node));
/* sfthead = (sfttbl FAR *)&basesft; */
f_nodes_cnt = Config.cfgFiles; /* and the number of allocated files */
/* sfthead = (sfttbl FAR *)&basesft; */
/* FCBp = (sfttbl FAR *)&FcbSft; */ /* FCBp = (sfttbl FAR *)&FcbSft; */
FCBp = (sfttbl FAR *) FCBp = (sfttbl FAR *)
KernelAlloc(sizeof(sftheader) KernelAlloc(sizeof(sftheader)
@ -920,6 +929,13 @@ INIT static VOID Stacks(BYTE * pLine)
} }
} }
INIT static VOID InitPgmHigh(BYTE * pLine)
{
InitPgm(pLine);
Config.cfgP_0_startmode = 0x80;
}
INIT static VOID InitPgm(BYTE * pLine) INIT static VOID InitPgm(BYTE * pLine)
{ {
/* Get the string argument that represents the new init pgm */ /* Get the string argument that represents the new init pgm */
@ -931,6 +947,8 @@ INIT static VOID InitPgm(BYTE * pLine)
/* and add a DOS new line just to be safe */ /* and add a DOS new line just to be safe */
strcat(Config.cfgInitTail, "\r\n"); strcat(Config.cfgInitTail, "\r\n");
Config.cfgP_0_startmode = 0;
} }
INIT static VOID Break(BYTE * pLine) INIT static VOID Break(BYTE * pLine)
@ -1101,6 +1119,8 @@ INIT BYTE FAR *KernelAlloc(WORD nBytes)
else else
lpBase += nBytes; lpBase += nBytes;
fmemset( lpAllocated, 0, nBytes);
return lpAllocated; return lpAllocated;
} }
#endif #endif

View File

@ -37,6 +37,9 @@ static BYTE *dosfnsRcsId = "$Id$";
* /// Added SHARE support. 2000/09/04 Ron Cemer * /// Added SHARE support. 2000/09/04 Ron Cemer
* *
* $Log$ * $Log$
* Revision 1.12 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.11 2001/03/21 02:56:25 bartoldeman * Revision 1.11 2001/03/21 02:56:25 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -1419,7 +1422,7 @@ COUNT DosSetFattr(BYTE FAR * name, UWORD FAR * attrp)
BYTE DosSelectDrv(BYTE drv) BYTE DosSelectDrv(BYTE drv)
{ {
if ((0 <= drv) && (drv <= (lastdrive -1 )) &&(CDSp->cds_table[drv].cdsFlags & 0xf000)) if ((0 <= drv) && (drv < lastdrive) &&(CDSp->cds_table[drv].cdsFlags & 0xf000))
{ {
current_ldt = &CDSp->cds_table[drv]; current_ldt = &CDSp->cds_table[drv];
default_drive = drv; default_drive = drv;

View File

@ -28,6 +28,9 @@
; $Id$ ; $Id$
; ;
; $Log$ ; $Log$
; Revision 1.9 2001/03/30 19:30:06 bartoldeman
; Misc fixes and implementation of SHELLHIGH. See history.txt for details.
;
; Revision 1.8 2001/03/27 20:27:43 bartoldeman ; Revision 1.8 2001/03/27 20:27:43 bartoldeman
; dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert. ; dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert.
; ;
@ -192,6 +195,39 @@ _RestartSysCall:
jmp short int21_reentry ; restart the system call jmp short int21_reentry ; restart the system call
;
; interrupt zero divide handler:
; print a message 'Interrupt divide by zero'
; Terminate the current process
;
; VOID INRPT far
; int20_handler(iregs UserRegs)
;
divide_by_zero_message db 0dh,0ah,'Interrupt divide by zero',0dh,0ah,0
global reloc_call_int0_handler
reloc_call_int0_handler:
mov si,divide_by_zero_message
zero_message_loop:
mov al, [cs:si]
test al,al
je zero_done
inc si
mov bx, 0070h
mov ah, 0eh
int 10h
jmp short zero_message_loop
zero_done:
mov ax,04c7fh ; terminate with errorlevel 127
int 21h
; ;
; Terminate the current process ; Terminate the current process
; ;

View File

@ -36,6 +36,9 @@ BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.13 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.12 2001/03/24 22:13:05 bartoldeman * Revision 1.12 2001/03/24 22:13:05 bartoldeman
* See history.txt: dsk.c changes, warning removal and int21 entry handling. * See history.txt: dsk.c changes, warning removal and int21 entry handling.
* *
@ -464,7 +467,7 @@ static void merge_file_changes(struct f_node FAR *fnp, int collect) {
int i; int i;
if (!IsShareInstalled()) return; if (!IsShareInstalled()) return;
for (i = 0; i < NFILES; i++) { for (i = 0; i < f_nodes_cnt; i++) {
fnp2 = &f_nodes[i]; fnp2 = &f_nodes[i];
if ( (fnp != (struct f_node FAR *)0) if ( (fnp != (struct f_node FAR *)0)
&& (fnp != fnp2) && (fnp != fnp2)
@ -2078,7 +2081,7 @@ struct f_node FAR *get_f_node(void)
{ {
REG i; REG i;
for (i = 0; i < NFILES; i++) for (i = 0; i < f_nodes_cnt; i++)
{ {
if (f_nodes[i].f_count == 0) if (f_nodes[i].f_count == 0)
{ {
@ -2297,7 +2300,7 @@ COUNT media_check(REG struct dpb * dpbp)
/* translate the fd into an f_node pointer */ /* translate the fd into an f_node pointer */
struct f_node FAR *xlt_fd(COUNT fd) struct f_node FAR *xlt_fd(COUNT fd)
{ {
return fd >= NFILES ? (struct f_node FAR *)0 : &f_nodes[fd]; return fd >= f_nodes_cnt ? (struct f_node FAR *)0 : &f_nodes[fd];
} }
/* translate the f_node pointer into an fd */ /* translate the f_node pointer into an fd */

View File

@ -36,6 +36,9 @@ static BYTE *Globals_hRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.8 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.7 2001/03/21 02:56:26 bartoldeman * Revision 1.7 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -604,6 +607,8 @@ GLOBAL struct dpb
GLOBAL struct f_node FAR GLOBAL struct f_node FAR
* f_nodes; /* pointer to the array */ * f_nodes; /* pointer to the array */
GLOBAL UWORD f_nodes_cnt; /* number of allocated f_nodes */
GLOBAL struct buffer GLOBAL struct buffer
FAR *lastbuf; /* tail of ditto */ FAR *lastbuf; /* tail of ditto */
/* FAR * buffers; /* pointer to array of track buffers */ /* FAR * buffers; /* pointer to array of track buffers */
@ -637,6 +642,7 @@ GLOBAL struct config
WORD cfgCSYS_memory; /* number of bytes required for the NLS pkg; WORD cfgCSYS_memory; /* number of bytes required for the NLS pkg;
0 if none */ 0 if none */
VOID FAR *cfgCSYS_data; /* where the loaded data is for PostConfig() */ VOID FAR *cfgCSYS_data; /* where the loaded data is for PostConfig() */
UBYTE cfgP_0_startmode; /* load command.com high or not */
} Config } Config
#ifdef MAIN #ifdef MAIN
= =
@ -656,6 +662,7 @@ GLOBAL struct config
,"" /* filename */ ,"" /* filename */
,0 /* amount required memory */ ,0 /* amount required memory */
,0 /* pointer to loaded data */ ,0 /* pointer to loaded data */
,0 /* strategy for command.com is low by default */
}; };
#else #else
; ;

View File

@ -75,6 +75,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.2 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.1 2001/03/21 03:01:45 bartoldeman * Revision 1.1 2001/03/21 03:01:45 bartoldeman
* New file by Tom Ehlert for HMA initialization. * New file by Tom Ehlert for HMA initialization.
* *
@ -233,8 +236,6 @@ int MoveKernelToHMA()
unsigned len; unsigned len;
int3();
if (DosLoadedInHMA) if (DosLoadedInHMA)
{ {
@ -306,7 +307,6 @@ int MoveKernelToHMA()
HMAFree = FP_OFF(HMADest)+len; /* first free byte after HMA_TEXT */ HMAFree = FP_OFF(HMADest)+len; /* first free byte after HMA_TEXT */
int3();
} }
{ {
@ -388,13 +388,15 @@ int MoveKernelToHMA()
DosLoadedInHMA = TRUE; DosLoadedInHMA = TRUE;
} }
/* report the fact we are running high thorugh int 21, ax=3306 */
version_flags |= 0x10;
int3();
return TRUE; return TRUE;
errorReturn: errorReturn:
printf("HMA errors, not doing HMA\n"); printf("HMA errors, not doing HMA\n");
int3();
return FALSE; return FALSE;
} }
@ -415,7 +417,7 @@ errorReturn:
void InstallVDISK() void InstallVDISK()
{ {
static struct { /* Boot-Sektor of a RAM-Disk */ static struct { /* Boot-Sektor of a RAM-Disk */
BYTE dummy1[3]; /* HIMEM.SYS uses 3, but FDXMS uses 2 */ UBYTE dummy1[3]; /* HIMEM.SYS uses 3, but FDXMS uses 2 */
char Name[5]; char Name[5];
BYTE dummy2[3]; BYTE dummy2[3];
WORD BpS; WORD BpS;
@ -529,6 +531,8 @@ VOID FAR *HMAalloc(COUNT bytesToAllocate)
/*printf("HMA allocated %d byte at %x\n", bytesToAllocate, HMAptr); */ /*printf("HMA allocated %d byte at %x\n", bytesToAllocate, HMAptr); */
fmemset( HMAptr,0, bytesToAllocate);
return HMAptr; return HMAptr;
} }

View File

@ -36,6 +36,9 @@ BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.17 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.16 2001/03/27 20:27:43 bartoldeman * Revision 1.16 2001/03/27 20:27:43 bartoldeman
* dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert. * dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert.
* *
@ -840,7 +843,10 @@ dispatch:
if (r->DL <= (lastdrive - 1)) if (r->DL <= (lastdrive - 1))
{ {
struct dpb FAR *dpb = CDSp->cds_table[r->DL].cdsDpb; struct dpb FAR *dpb = CDSp->cds_table[r->DL].cdsDpb;
if (dpb == 0) if (dpb == 0 ||
(CDSp->cds_table[r->DL].cdsFlags & CDSNETWDRV) ||
FP_SEG(dpb) != FP_SEG(&dpb) || /* check if it's a NEAR pointer */
media_check((struct dpb *)dpb) < 0)
{ {
r->AL = 0xff; r->AL = 0xff;
CritErrCode = 0x0f; CritErrCode = 0x0f;
@ -1485,6 +1491,7 @@ dispatch:
break; break;
case 0x5e: case 0x5e:
CLEAR_CARRY_FLAG();
switch (r->AL) switch (r->AL)
{ {
case 0x00: case 0x00:
@ -1500,13 +1507,9 @@ dispatch:
COUNT result; COUNT result;
result = int2f_Remote_call(REM_PRINTSET, r->BX, r->CX, r->DX, (MK_FP(r->ES, r->DI)), r->SI, (MK_FP(r->DS, Int21AX))); result = int2f_Remote_call(REM_PRINTSET, r->BX, r->CX, r->DX, (MK_FP(r->ES, r->DI)), r->SI, (MK_FP(r->DS, Int21AX)));
r->AX = result; r->AX = result;
if (result != SUCCESS) { if (result != SUCCESS) goto error_out;
goto error_out; break;
} else { }
CLEAR_CARRY_FLAG();
}
break;
}
} }
break; break;
@ -1679,6 +1682,7 @@ dispatch:
rc = ( r->BL == 0 ? default_drive : r->BL - 1); rc = ( r->BL == 0 ? default_drive : r->BL - 1);
if (rc <= (lastdrive -1)) if (rc <= (lastdrive -1))
{ {
UWORD saveCX = r->CX;
if (CDSp->cds_table[rc].cdsFlags & CDSNETWDRV) { if (CDSp->cds_table[rc].cdsFlags & CDSNETWDRV) {
goto error_invalid; goto error_invalid;
} }
@ -1695,6 +1699,7 @@ dispatch:
rc = DosDevIOctl(r, (COUNT FAR *) & rc1); rc = DosDevIOctl(r, (COUNT FAR *) & rc1);
break; break;
} }
r->CX = saveCX;
if (rc1 != SUCCESS) if (rc1 != SUCCESS)
{ {
r->AX = -rc1; r->AX = -rc1;

View File

@ -28,6 +28,9 @@
; $Id$ ; $Id$
; ;
; $Log$ ; $Log$
; Revision 1.8 2001/03/30 19:30:06 bartoldeman
; Misc fixes and implementation of SHELLHIGH. See history.txt for details.
;
; Revision 1.7 2001/03/21 02:56:26 bartoldeman ; Revision 1.7 2001/03/21 02:56:26 bartoldeman
; See history.txt for changes. Bug fixes and HMA support are the main ones. ; See history.txt for changes. Bug fixes and HMA support are the main ones.
; ;
@ -235,9 +238,7 @@ dos_data db 0
times (0eh - ($ - DATASTART)) db 0 times (0eh - ($ - DATASTART)) db 0
global _NetBios global _NetBios
_NetBios db 0 ; NetBios Number _NetBios dw 0 ; NetBios Number
global _Num_Name
_Num_Name db 0
times (26h - 0ch - ($ - DATASTART)) db 0 times (26h - 0ch - ($ - DATASTART)) db 0
@ -829,7 +830,10 @@ _low_int26_handler: jmp far reloc_call_low_int26_handler
_int27_handler: jmp far reloc_call_int27_handler _int27_handler: jmp far reloc_call_int27_handler
call near forceEnableA20 call near forceEnableA20
global _int0_handler
extern reloc_call_int0_handler
_int0_handler: jmp far reloc_call_int0_handler
call near forceEnableA20
global _cpm_entry global _cpm_entry
extern reloc_call_cpm_entry extern reloc_call_cpm_entry

View File

@ -39,6 +39,9 @@ static BYTE *mainRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.10 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.9 2001/03/25 17:11:54 bartoldeman * Revision 1.9 2001/03/25 17:11:54 bartoldeman
* Fixed sys.com compilation. Updated to 2023. Also: see history.txt. * Fixed sys.com compilation. Updated to 2023. Also: see history.txt.
* *
@ -184,6 +187,7 @@ void __int__(int); /* TC 2.01 requires this. :( -- ror4 */
INIT VOID main(void) INIT VOID main(void)
{ {
setvec(0, int0_handler); /* zero divide */
setvec(1, empty_handler); /* single step */ setvec(1, empty_handler); /* single step */
setvec(3, empty_handler); /* debug breakpoint */ setvec(3, empty_handler); /* debug breakpoint */
@ -209,6 +213,30 @@ INIT VOID main(void)
kernel(); kernel();
} }
/*
InitializeAllBPBs()
or MakeNortonDiskEditorHappy()
it has been determined, that FDOS's BPB tables are initialized,
only when used (like DIR H:).
at least one known utility (norton DE) seems to access them directly.
ok, so we access for all drives, that the stuff gets build
*/
void InitializeAllBPBs()
{
static char filename[] = "A:-@JUNK@-.TMP";
int drive,fileno;
for (drive = 'Z'; drive >= 'C'; drive--)
{
filename[0] = drive;
if ((fileno = dos_open((BYTE FAR *) filename, O_RDONLY)) >= 0)
dos_close(fileno);
}
}
INIT void init_kernel(void) INIT void init_kernel(void)
{ {
COUNT i; COUNT i;
@ -296,6 +324,9 @@ INIT void init_kernel(void)
version_flags = 0; version_flags = 0;
pDirFileNode = 0; pDirFileNode = 0;
dosidle_flag = 0; dosidle_flag = 0;
InitializeAllBPBs();
} }
INIT VOID FsConfig(VOID) INIT VOID FsConfig(VOID)
@ -303,7 +334,6 @@ INIT VOID FsConfig(VOID)
REG COUNT i; REG COUNT i;
date Date; date Date;
time Time; time Time;
BYTE x;
/* Get the start-up date and time */ /* Get the start-up date and time */
Date = dos_getdate(); Date = dos_getdate();
@ -439,7 +469,6 @@ INIT void kernel()
seg asize; seg asize;
BYTE FAR *ep, BYTE FAR *ep,
*sp; *sp;
COUNT ret_code;
#ifndef KDB #ifndef KDB
static BYTE *path = "PATH=."; static BYTE *path = "PATH=.";
#endif #endif

View File

@ -35,6 +35,9 @@ static BYTE *memmgrRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.10 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.9 2001/03/21 02:56:26 bartoldeman * Revision 1.9 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -518,7 +521,7 @@ COUNT DosMemChange(UWORD para, UWORD size, UWORD * maxSize)
COUNT DosMemCheck(void) COUNT DosMemCheck(void)
{ {
REG mcb FAR *p; REG mcb FAR *p;
REG mcb FAR *u; REG mcb FAR *pprev = 0;
/* Initialize */ /* Initialize */
p = para2far(first_mcb); p = para2far(first_mcb);
@ -528,9 +531,15 @@ COUNT DosMemCheck(void)
{ {
/* check for corruption */ /* check for corruption */
if (p->m_type != MCB_NORMAL) if (p->m_type != MCB_NORMAL)
{
printf("dos mem corrupt, first_mcb=%04x\n", first_mcb);
hexd("prev " ,pprev,16);
hexd("notMZ",p,16);
return DE_MCBDESTRY; return DE_MCBDESTRY;
}
/* not corrupted - but not end, bump the pointer */ /* not corrupted - but not end, bump the pointer */
pprev = p;
p = nxtMCB(p); p = nxtMCB(p);
} }
return SUCCESS; return SUCCESS;

View File

@ -36,6 +36,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.9 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.8 2001/03/21 02:56:26 bartoldeman * Revision 1.8 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -75,25 +78,20 @@ static BYTE *RcsId = "$Id$";
* *
*/ */
/* see RBIL D-2152 and D-215D06 before attempting
to change these two functions!
*/
UWORD get_machine_name(BYTE FAR * netname) UWORD get_machine_name(BYTE FAR * netname)
{ {
BYTE FAR *xn; fmemcpy(netname, &net_name, 15);
xn = MK_FP(net_name, 0);
fbcopy((BYTE FAR *) netname, xn, 15);
return (NetBios); return (NetBios);
} }
VOID set_machine_name(BYTE FAR * netname, UWORD name_num) VOID set_machine_name(BYTE FAR * netname, UWORD name_num)
{ {
BYTE FAR *xn;
xn = MK_FP(net_name, 0);
NetBios = name_num; NetBios = name_num;
fbcopy(xn, (BYTE FAR *) netname, 15); fmemcpy(&net_name, netname, 15);
net_set_count++; net_set_count++;
} }
/* /*
@ -161,44 +159,7 @@ COUNT Remote_find(UWORD func, BYTE FAR * name, REG dmatch FAR * dmp )
dmp->dm_date = SDp->dir_date; dmp->dm_date = SDp->dir_date;
dmp->dm_size = (LONG) SDp->dir_size; dmp->dm_size = (LONG) SDp->dir_size;
/*
Needed Code Rep-off.;)
*/
/*
p = dmp->dm_name;
if (SDp->dir_name[0] == '.')
{
for (x = 0, q = (BYTE FAR *) SDp->dir_name; x < FNAME_SIZE; x++)
{
if (*q == ' ')
break;
*p++ = *q++;
}
}
else
{
for (x = 0, q = (BYTE FAR *) SDp->dir_name; x < FNAME_SIZE; x++)
{
if (*q == ' ')
break;
*p++ = *q++;
}
if (SDp->dir_ext[0] != ' ')
{
*p++ = '.';
for (x = 0, q = (BYTE FAR *) SDp->dir_ext; x < FEXT_SIZE; x++)
{
if (*q == ' ')
break;
*p++ = *q++;
}
}
}
*p++ = NULL;
*/
ConvertName83ToNameSZ((BYTE FAR *) dmp->dm_name, (BYTE FAR *) SDp->dir_name); ConvertName83ToNameSZ((BYTE FAR *) dmp->dm_name, (BYTE FAR *) SDp->dir_name);
return i; return i;
} }

View File

@ -34,6 +34,9 @@ static BYTE *prfRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.6 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.5 2001/03/21 02:56:26 bartoldeman * Revision 1.5 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -41,6 +44,9 @@ static BYTE *prfRcsId = "$Id$";
* recoded for smaller object footprint, added main() for testing+QA * recoded for smaller object footprint, added main() for testing+QA
* *
* $Log$ * $Log$
* Revision 1.6 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.5 2001/03/21 02:56:26 bartoldeman * Revision 1.5 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -348,6 +354,20 @@ do_outputstring:
return 0; return 0;
} }
void hexd(char *title,UBYTE FAR *p,COUNT numBytes)
{
int loop;
printf("%s%04x|",title,p);
for (loop = 0; loop < numBytes; loop++)
printf("%02x ", p[loop]);
printf("|");
for (loop = 0; loop < numBytes; loop++)
printf("%c", p[loop] < 0x20 ? '.' : p[loop]);
printf("\n");
}
#ifdef TEST #ifdef TEST
/* /*

View File

@ -34,6 +34,9 @@ static BYTE *Proto_hRcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.12 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.11 2001/03/27 20:27:43 bartoldeman * Revision 1.11 2001/03/27 20:27:43 bartoldeman
* dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert. * dsk.c (reported by Nagy Daniel), inthndlr and int25/26 fixes by Tom Ehlert.
* *
@ -243,6 +246,8 @@ COUNT DosRename(BYTE FAR * path1, BYTE FAR * path2);
COUNT DosMkdir(BYTE FAR * dir); COUNT DosMkdir(BYTE FAR * dir);
COUNT DosRmdir(BYTE FAR * dir); COUNT DosRmdir(BYTE FAR * dir);
struct dhdr FAR * IsDevice(BYTE FAR * FileName); struct dhdr FAR * IsDevice(BYTE FAR * FileName);
/* extern sft FAR *get_free_sft(WORD FAR * sft_idx);
#define FcbGetFreeSft(sft_idx) get_free_sft(sft_idx) */
/*dosidle.asm */ /*dosidle.asm */
VOID DosIdle_int(void); VOID DosIdle_int(void);
@ -269,6 +274,7 @@ COUNT dir_write(REG struct f_node FAR * fnp);
VOID dir_close(REG struct f_node FAR * fnp); VOID dir_close(REG struct f_node FAR * fnp);
COUNT dos_findfirst(UCOUNT attr, BYTE FAR * name); COUNT dos_findfirst(UCOUNT attr, BYTE FAR * name);
COUNT dos_findnext(void); COUNT dos_findnext(void);
void ConvertName83ToNameSZ(BYTE FAR *destSZ, BYTE FAR *srcFCBName);
/* fatfs.c */ /* fatfs.c */
__FAR_WRAPPER(COUNT, dos_open, (BYTE FAR * path, COUNT flag)) __FAR_WRAPPER(COUNT, dos_open, (BYTE FAR * path, COUNT flag))
@ -353,6 +359,7 @@ BOOL FcbFindNext(xfcb FAR * lpXfcb);
/* inithma.c */ /* inithma.c */
int MoveKernelToHMA(void); int MoveKernelToHMA(void);
VOID FAR *HMAalloc(COUNT bytesToAllocate);
/* initoem.c */ /* initoem.c */
UWORD init_oem(void); UWORD init_oem(void);
@ -375,6 +382,7 @@ VOID INRPT FAR int28_handler(void);
VOID INRPT FAR int2a_handler(void); VOID INRPT FAR int2a_handler(void);
VOID INRPT FAR int2f_handler(void); VOID INRPT FAR int2f_handler(void);
VOID INRPT FAR empty_handler(void); VOID INRPT FAR empty_handler(void);
VOID INRPT FAR int0_handler(void);
/* ioctl.c */ /* ioctl.c */
COUNT DosDevIOctl(iregs FAR * r, COUNT FAR * err); COUNT DosDevIOctl(iregs FAR * r, COUNT FAR * err);
@ -454,6 +462,7 @@ UWORD syscall_MUX14(DIRECT_IREGS);
VOID put_console(COUNT c); VOID put_console(COUNT c);
__FAR_WRAPPER(WORD, printf, (CONST BYTE * fmt,...)) __FAR_WRAPPER(WORD, printf, (CONST BYTE * fmt,...))
WORD sprintf(BYTE * buff, CONST BYTE * fmt,...); WORD sprintf(BYTE * buff, CONST BYTE * fmt,...);
VOID hexd(char *title,VOID FAR *p,COUNT numBytes);
/* strings.c */ /* strings.c */
__FAR_WRAPPER(COUNT, strlen, (REG BYTE * s)) __FAR_WRAPPER(COUNT, strlen, (REG BYTE * s))
@ -547,8 +556,3 @@ unsigned long FAR is_dosemu(void);
*/ */
#define ASSERT_CONST(x) { typedef struct { char x[2 * (x) - 1]; } xx ; } #define ASSERT_CONST(x) { typedef struct { char x[2 * (x) - 1]; } xx ; }
void ConvertName83ToNameSZ(BYTE FAR *destSZ, BYTE FAR *srcFCBName);
VOID FAR *HMAalloc(COUNT bytesToAllocate);

View File

@ -35,6 +35,9 @@ static BYTE *RcsId = "$Id$";
/* /*
* $Log$ * $Log$
* Revision 1.8 2001/03/30 19:30:06 bartoldeman
* Misc fixes and implementation of SHELLHIGH. See history.txt for details.
*
* Revision 1.7 2001/03/21 02:56:26 bartoldeman * Revision 1.7 2001/03/21 02:56:26 bartoldeman
* See history.txt for changes. Bug fixes and HMA support are the main ones. * See history.txt for changes. Bug fixes and HMA support are the main ones.
* *
@ -149,6 +152,8 @@ static BYTE *RcsId = "$Id$";
#define LOAD 1 #define LOAD 1
#define OVERLAY 3 #define OVERLAY 3
#define LOAD_HIGH 0x80
static exe_header header; static exe_header header;
#define CHUNK 32256 #define CHUNK 32256
@ -176,7 +181,7 @@ LONG doslseek(COUNT fd, LONG foffset, COUNT origin)
LONG DosGetFsize(COUNT hndl) LONG DosGetFsize(COUNT hndl)
{ {
sft FAR *s; sft FAR *s;
sfttbl FAR *sp; /* sfttbl FAR *sp;*/
/* Test that the handle is valid */ /* Test that the handle is valid */
if (hndl < 0) if (hndl < 0)
@ -444,8 +449,8 @@ set_name:
COUNT DosComLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode) COUNT DosComLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
{ {
COUNT rc, COUNT rc,
err, err
env_size; /*,env_size*/;
COUNT nread; COUNT nread;
UWORD mem; UWORD mem;
UWORD env, UWORD env,
@ -456,6 +461,11 @@ COUNT DosComLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
iregs FAR *irp; iregs FAR *irp;
LONG com_size; LONG com_size;
int ModeLoadHigh = mode & 0x80;
int UMBstate = uppermem_link;
mode &= 0x7f;
if (mode != OVERLAY) if (mode != OVERLAY)
{ {
@ -470,6 +480,12 @@ COUNT DosComLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
return rc; return rc;
} }
com_size = asize; com_size = asize;
if ( ModeLoadHigh && uppermem_root)
{
DosUmbLink(1); /* link in UMB's */
}
/* Allocate our memory and pass back any errors */ /* Allocate our memory and pass back any errors */
if ((rc = DosMemAlloc((seg) com_size, mem_access_mode, (seg FAR *) & mem if ((rc = DosMemAlloc((seg) com_size, mem_access_mode, (seg FAR *) & mem
,(UWORD FAR *) & asize)) < 0) ,(UWORD FAR *) & asize)) < 0)
@ -500,6 +516,12 @@ COUNT DosComLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
} }
else else
mem = exp->load.load_seg; mem = exp->load.load_seg;
if ( ModeLoadHigh && uppermem_root)
{
DosUmbLink(UMBstate); /* restore link state */
}
/* Now load the executable */ /* Now load the executable */
/* If file not found - error */ /* If file not found - error */
@ -596,7 +618,7 @@ VOID return_user(void)
FAR * q; FAR * q;
REG COUNT i; REG COUNT i;
iregs FAR *irp; iregs FAR *irp;
long j; /* long j;*/
/* restore parent */ /* restore parent */
p = MK_FP(cu_psp, 0); p = MK_FP(cu_psp, 0);
@ -630,11 +652,11 @@ VOID return_user(void)
exec_user((iregs FAR *) q->ps_stack); exec_user((iregs FAR *) q->ps_stack);
} }
static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode) COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
{ {
COUNT rc, COUNT rc,
err, err,
env_size, /*env_size,*/
i; i;
COUNT nBytesRead; COUNT nBytesRead;
UWORD mem, UWORD mem,
@ -652,6 +674,12 @@ static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
seg FAR *spot; seg FAR *spot;
LONG exe_size; LONG exe_size;
int ModeLoadHigh = mode & 0x80;
int UMBstate = uppermem_link;
mode &= 0x7f;
/* Clone the environement and create a memory arena */ /* Clone the environement and create a memory arena */
if (mode != OVERLAY) if (mode != OVERLAY)
{ {
@ -675,7 +703,7 @@ static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
/* and finally add in the psp size */ /* and finally add in the psp size */
if (mode != OVERLAY) if (mode != OVERLAY)
image_size += sizeof(psp); /*TE 03/20/01*/ image_size += sizeof(psp); /*TE 03/20/01*/
if (mode != OVERLAY) if (mode != OVERLAY)
{ {
/* Now find out how many paragraphs are available */ /* Now find out how many paragraphs are available */
@ -704,11 +732,18 @@ static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
overlay (replace) the current exe file with a new one. overlay (replace) the current exe file with a new one.
Jun 11, 2000 - rbc Jun 11, 2000 - rbc
} */ } */
if ( ModeLoadHigh && uppermem_root)
{
DosUmbLink(1); /* link in UMB's */
}
/* Allocate our memory and pass back any errors */ /* Allocate our memory and pass back any errors */
/* We can still get an error on first fit if the above */ /* We can still get an error on first fit if the above */
/* returned size was a bet fit case */ /* returned size was a bet fit case */
if ((rc = DosMemAlloc((seg) exe_size, mem_access_mode, (seg FAR *) & mem /* ModeLoadHigh = 80 = try high, then low */
if ((rc = DosMemAlloc((seg) exe_size, mem_access_mode | ModeLoadHigh, (seg FAR *) & mem
,(UWORD FAR *) & asize)) < 0) ,(UWORD FAR *) & asize)) < 0)
{ {
if (rc == DE_NOMEM) if (rc == DE_NOMEM)
@ -737,6 +772,10 @@ static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
/* with no error, we got exactly what we asked for */ /* with no error, we got exactly what we asked for */
asize = exe_size; asize = exe_size;
#ifdef DEBUG
printf("loading %s at %04x\n", (char*)namep,mem);
#endif
/* /// Added open curly brace and "else" clause. We should not attempt /* /// Added open curly brace and "else" clause. We should not attempt
to allocate memory if we are overlaying the current process, because to allocate memory if we are overlaying the current process, because
the new process will simply re-use the block we already have allocated. the new process will simply re-use the block we already have allocated.
@ -747,6 +786,12 @@ static COUNT DosExeLoader(BYTE FAR * namep, exec_blk FAR * exp, COUNT mode)
else else
asize = exe_size; asize = exe_size;
/* /// End of additions. Jun 11, 2000 - rbc */ /* /// End of additions. Jun 11, 2000 - rbc */
if ( ModeLoadHigh && uppermem_root)
{
DosUmbLink(UMBstate); /* restore link state */
}
if (mode != OVERLAY) if (mode != OVERLAY)
{ {
@ -905,7 +950,7 @@ COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp)
COUNT rc, COUNT rc,
err; err;
exec_blk leb = *ep; exec_blk leb = *ep;
BYTE FAR *cp; /* BYTE FAR *cp;*/
BOOL bIsCom = FALSE; BOOL bIsCom = FALSE;
/* If file not found - free ram and return error */ /* If file not found - free ram and return error */
@ -918,6 +963,7 @@ COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp)
return DE_FILENOTFND; return DE_FILENOTFND;
} }
if (DosRead(rc, sizeof(exe_header), (VOID FAR *) & header, &err) if (DosRead(rc, sizeof(exe_header), (VOID FAR *) & header, &err)
!= sizeof(exe_header)) != sizeof(exe_header))
{ {
@ -955,6 +1001,8 @@ VOID InitPSP(VOID)
new_psp(p, 0); new_psp(p, 0);
} }
UBYTE P_0_startmode = 0;
/* process 0 */ /* process 0 */
VOID FAR reloc_call_p_0(VOID) VOID FAR reloc_call_p_0(VOID)
{ {
@ -979,7 +1027,8 @@ VOID FAR reloc_call_p_0(VOID)
#ifdef DEBUG #ifdef DEBUG
printf("Process 0 starting: %s\n\n", (BYTE *) szfInitialPrgm); printf("Process 0 starting: %s\n\n", (BYTE *) szfInitialPrgm);
#endif #endif
if ((rc = DosExec(0, (exec_blk FAR *) & exb, szfInitialPrgm)) != SUCCESS) if ((rc = DosExec(Config.cfgP_0_startmode,
(exec_blk FAR *) & exb, szfInitialPrgm)) != SUCCESS)
printf("\nBad or missing Command Interpreter: %d\n", rc); printf("\nBad or missing Command Interpreter: %d\n", rc);
else else
printf("\nSystem shutdown complete\nReboot now.\n"); printf("\nSystem shutdown complete\nReboot now.\n");