Hi Bret,

> I am writing a TSR, and having trouble getting it to work with FreeDOS.  It
> installs just fine in MSDOS, also also installs just fine from a FreeDOS
> command prompt.  But, when I try to install it using an INSTALL= or
> INSTALLHIGH= from CONFIG.SYS, the machine hangs.  The hang occurs right
> after the program exits (INT 21.4Ch or INT 21.31h).  If it helps in
> troubleshooting, the TSR does allocate and leave in place some "extra"
> memory segments that the TSR needs.

That could be related. How do you allocate the extra memory and where?

> I can install some of my other TSR's just fine from CONFIG.SYS.  If I load
> JEMMEX, when the problem program exits, JEMM displays an Error 0D at CS:EIP
> X:Y, where X is always the CS of the previous TSR that was installed, and Y
> is always either 0000FFFF or 00010000.  If I don't use JEMM, the machine
> just hangs with no error messages at all.

Maybe JEMMEX has problems with fragmented memory, did you try JEMM386?
The error itself does not tell much - GPF at a 64k segment boundary...
Could mean that code jumped into an empty segment and fell of its end.

> I've been looking at some of the source code for FreeDOS, but nothing has
> revealed itself yet.  I'm just wondering if someone could explain, at least
> in general terms, what is "not there" or is "different" (other than the
> shell program) when INSTALL is being used as opposed to an installation from
> the command-line?

While INSTALL differs from normal running of apps
(as child tasks of SHELL) it should do so in the
same way for different versions of DOS.

In FreeDOS, you get - apart from a not complete PSP which
is probably normal for all INSTALL situations anyway...:

STATIC VOID InstallExec(struct instCmds *icmd)
   exb.exec.env_seg  = 0;
   exb.exec.cmd_line = (CommandTail FAR *) args;
   exb.exec.fcb_1 = exb.exec.fcb_2 = (fcb FAR *) 0xfffffffful;
... init_DosExec(icmd->mode, &exb, filename) ...

...where AL = mode is either 0 or 0x80 for low / high install
which is a non-standard use of the high bit of AL. A possible
bug in FreeDOS could be:

COUNT DosExec(COUNT mode, exec_blk FAR * ep, BYTE FAR * lp)
   if (mode == LOAD && rc == SUCCESS)
     fmemcpy(ep, &TempExeBlock, sizeof(exec_blk));

This should probably use "if mode and 0x7f is load" instead?
However, INSTALL does not use LOAD mode, it uses LOADNGO...
And value LOAD_HIGH which is 0x80 is defined but never used.

Other functions: DosExeLoader, DosComLoader, load_transfer...

It might be possible that DosComLoader tries to give the COM
all available memory and unless you specify otherwise when
going TSR none is left for others, but thats just guessing.

Is your TSR a COM or is it EXE?  Does it keep handles open?
Does it use environment variables or other PSP related data?
Does it make a difference whether to INSTALL or INSTALLHIGH?

Regards, Eric

Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
Freedos-user mailing list

Reply via email to