Chain/Exe/Run Problem

DOS specific questions.
Post Reply
Username
Posts: 30
Joined: Jun 22, 2020 5:56

Chain/Exe/Run Problem

Post by Username »

In FreeBASIC when I use the Chain/Exe/Run functions it won't run the other problem, but instead sometimes it overwrites some memory of the current program and freezes, or it corrupts some of the screen but mostly does nothing.
And when I use the shell command, it's the same or it says "Insufficient extended memory!"
How can I launch other programs?

Thanks.
GeoffB17
Posts: 9
Joined: Feb 02, 2023 18:33
Location: Guisborough, UK
Contact:

Re: Chain/Exe/Run Problem

Post by GeoffB17 »

Could you give some indication as to the program you are trying to run. Maybe it's just too big for the space available, or, once it's loaded (and the calling program has made space available for it) it then tries to use a lot of memory that the launching program knew nothing about.

I recently used the example program that invoked DIR (DOS command) - see earlier thread - and this worked fine, and control returned fine to the calling prog.

Further, your mention of an error message re 'extended memory' raises the question of - does your memory setup/config allow any extended memory, and how much, especially compared to how much the program being called is demanding?

Geoff
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Chain/Exe/Run Problem

Post by marcov »

Dos always executes in the parent's memory space as it is a single process OS. Afaik this is normal
GeoffB17
Posts: 9
Joined: Feb 02, 2023 18:33
Location: Guisborough, UK
Contact:

Re: Chain/Exe/Run Problem

Post by GeoffB17 »

Over the years (tens of years) I've had a number of systems that swap and return quite happily.

Yes, DOS is single process, but there are certainly ways of either just stopping the current prog, creating a new space within existing memory, running something there, and then returning to the original prog, OR, to swap out the old prog to HD, or x-memory, or whatever, so as to free up normal memory.

to name a couple of things, MS C uses the 'spawnxx' family of commands, these can do a certain amount of swapping out options, also the BLINKER linker system I use for many of my projects includes 'swpruncmd' which frees up almost all normal RAM. The commands mentioned here are based on fairly old standard BASIC options, but I would have expected more modern capabilities within them. Extra RAM is usually available (X or E) that plain DOS does not necessarily use (although active progs may well).

OP here might be trying to go beyond what the basic (BASIC) environment can handle?

DIR.EXE is only small, if you do a large listing and need to use /o to sort the output this prob needs some extra RAM for sorting, but this is still tiny compared to likely available RAM. BUT, if OP here is trying to run something that immed MUST try to grab multi MB of space??

Geoff
marcov
Posts: 3455
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Chain/Exe/Run Problem

Post by marcov »

It is possible that the extender has snapped up all extended memory. IIRC you could tell it to allocate less using environment variables. (DPMI_MAXMEM or something similar)
Post Reply