Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
GizMo79

29.09.2020, 22:21
 

DOS prompt from external programm (Developers)

I have created my own text editor from which I can program and compile programs, I have inserted a function to start a DOS prompt leaving the editor in the background, I get this with the system function ("c:\command.com"); but this uses a lot of memory because I have 2 "command.com" active in addition to the editor, is it possible to jump to the command.com already loaded in memory without loading another one?

tom

Homepage

Germany (West),
30.09.2020, 17:16

@ GizMo79

DOS prompt from external programm

> I have created my own text editor from which I can program and compile
> programs, I have inserted a function to start a DOS prompt leaving the
> editor in the background, I get this with the system function
> ("c:\command.com"); but this uses a lot of memory because I have 2
> "command.com" active in addition to the editor, is it possible to jump to
> the command.com already loaded in memory without loading another one?

This is not possible.

OTOH working this way should use 2 times ~3 kb for 2 copies of (FreeDOS) command, + the space for your editor which is most likely MUCH larger.

see the output of MEM /D to check this.

tom

Homepage

Germany (West),
30.09.2020, 17:23

@ tom

DOS prompt from external programm

> > I have created my own text editor from which I can program and compile
> > programs, I have inserted a function to start a DOS prompt leaving the
> > editor in the background, I get this with the system function
> > ("c:\command.com"); but this uses a lot of memory because I have 2
> > "command.com" active in addition to the editor, is it possible to jump
> to
> > the command.com already loaded in memory without loading another one?
>
> This is not possible.
>
> OTOH working this way should use 2 times ~3 kb for 2 copies of (FreeDOS)
> command, + the space for your editor which is most likely MUCH larger.
>
> see the output of MEM /D to check this.

of course, without XMS in a 80188 world the footprint of command.com is much larger. you might have a problem ;)

tkchia

Homepage

30.09.2020, 18:19

@ GizMo79

DOS prompt from external programm

Hello GizMo79,

> I have created my own text editor from which I can program and compile
> programs, I have inserted a function to start a DOS prompt leaving the
> editor in the background, I get this with the system function
> ("c:\command.com"); but this uses a lot of memory because I have 2
> "command.com" active in addition to the editor, is it possible to jump to
> the command.com already loaded in memory without loading another one?

Maybe, instead of saying something like system(getenv("COMSPEC")), you can use one of the spawn...(...) functions --- spawnve, spawnl, etc. --- which will likely come with whichever DOS compiler you are using.

Saying system(getenv("COMSPEC")) will most likely spawn a new copy of (e.g.) c:\command.com to run the command "c:\command.com". That is, it will spawn _two_ new copies of command.com, which is of course needlessly wasteful.

If you just want to run command.com without giving it any command, you can just use spawn...(...) directly with the value of COMSPEC. This will create just one new copy of command.com in memory.

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

Rugxulo

Homepage

Usono,
01.10.2020, 00:44

@ tkchia

DOS prompt from external programm

The main use of COMMAND.COM specifically is batch (.BAT) files. So, if you don't need that compatibility, you can use any shell.

One old one that FreeDOS sometimes linked to was Dog, which was very small because it offloaded all internal commands to external utilities. So you could also try that, maybe.

There was also Gcom. Remember that these are incomplete, especially in internal commands and .BAT compatibility.

I already mentioned 0.82pl3 + KSSF/VSPAWN (e.g. BARE_DOS), so I assume you either tried that or just weren't interested.

EDIT: I always forget 4DOS because I prefer FreeCOM, but (IIRC) it had optional swapping (disk, EMS, XMS). Not sure what you can do for EMS on a 186 without actual hardware EMS, but maybe try TSR EMS Magic (uses conventional memory)?

tkchia

Homepage

01.10.2020, 18:20

@ Rugxulo

DOS prompt from external programm

Hello Rugxulo,

> The main use of COMMAND.COM specifically is batch (.BAT) files. So, if you
> don't need that compatibility, you can use any shell.

If you ask me, this kind of goes against the Principle of Least Surprise.

If someone wishes to bring up a command shell from inside an editor, it is probably better for the editor to just bring up whatever shell the user has configured as the system default.

(Once that is pinned down though, we can think about memory-efficient ways of bringing up this shell.)

Thank you!

---
https://gitlab.com/tkchia · https://codeberg.org/tkchia · 😴 "MOV AX,0D500H+CMOS_REG_D+NMI"

GizMo79

04.10.2020, 12:10

@ Rugxulo

DOS prompt from external programm

> The main use of COMMAND.COM specifically is batch (.BAT) files. So, if you
> don't need that compatibility, you can use any shell.
>
> One old one that FreeDOS sometimes linked to was
> Dog,
> which was very small because it offloaded all internal commands to external
> utilities. So you could also try that, maybe.
>
> There was also
> Gcom.
> Remember that these are incomplete, especially in internal commands and
> .BAT compatibility.
>
> I already mentioned 0.82pl3 + KSSF/VSPAWN (e.g. BARE_DOS)


where do I download it?

GizMo79

04.10.2020, 12:16

@ Rugxulo

DOS prompt from external programm

> EMS, but maybe try TSR EMS Magic (uses
> conventional memory)?


he says he wants 32bit systems

Rugxulo

Homepage

Usono,
09.10.2020, 07:15

@ GizMo79

DOS prompt from external programm

> > I already mentioned 0.82pl3 + KSSF/VSPAWN (e.g. BARE_DOS)
>
> where do I download it?

What, BARE_DOS? You already had it, you said "baredos boot ok" in the SBC188 thread. Like I said, "call /s" (see here) will swap out temporarily (for those without XMS, e.g. pre-286 cpus).

BARE_DOS.ZIP + (optional) BARE_DOS.TXT

Rugxulo

Homepage

Usono,
09.10.2020, 07:16

@ GizMo79

DOS prompt from external programm

> > EMS, but maybe try TSR EMS Magic
> (uses
> > conventional memory)?
>
>
> he says he wants 32bit systems

The manual install .ZIP (.EXE) download???

DosWorld

10.10.2020, 13:17
(edited by DosWorld, 10.10.2020, 13:35)

@ GizMo79

DOS prompt from external programmg

> is it possible to jump to
> the command.com already loaded in memory without loading another one?

Answer: NO (No API to do it. No any guarantee. If you solve this question - it will be unstable solution)

https://github.com/DosWorld/smallmake/blob/master/SRC/EXEC.C
https://github.com/DosWorld/smallmake/blob/master/SRC/ENV.C

---
Make DOS great again!

Carthago delenda est, Ceterum censeo Carthaginem delendam esse.

Back to the board
Thread view  Mix view  Order
22049 Postings in 2034 Threads, 396 registered users, 253 users online (0 registered, 253 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum