On Tue, 12 Jul 2005, tom ehlert wrote:

> >>The XMS swap feature means: Copy most of FreeCOM to XMS while a program
> >>is running, and mark the memory as free. So FreeCOM LOOKS as if it would
> >>be only 3 kilobytes small in RAM.
> > ...
> >>Having a version which is 8086 compatible but uses XMS Swap is a very 
> >>special
> >>choice for "universal" boot disks:
>
> >  In other words, it is what I thought it is. However, most versions of
> > COMMAND.COM (indeed,all of MS,DR,PC and PTS I ever used) also keep only
> > a small part of them permanently in RAM, but reload from disk instead:
> > COMSPEC= path if set, if not, SHELL= path and if nothing else, from the
> > boot disk. This is slower than from XMS but not by much if COMSPEC= points
> > to a ramdisk. I always thought non-xmsswap versions of FreeCOM also behave
> > this way. Don't them ?
>
> no. they only way to have a small memory footprint when executing
> programs is HIMEM+XMSSWAP or CALL /S
>
> > If not, do you know why ?
>
> someone 'forgot' to implement it

it is also very tough to reload the code portions of the executable on
demand at the right place if you write your command.com in C instead of in
assembly language.

It is not even the C perse that makes it tough, but rather the
interactions with its run-time library. This is why we can pull such
tricks in the kernel for instance, because it doesn't use any RTL
functionality, apart, perhaps, for some 32 bit arithmetic.

as far as I understand MS command.com relocates its code part to just
under 640k, and keeps all data together in a fixed sized area at the
start.

Freecom and C library functions use malloc() and related dynamic memory
allocation functions that allocate data higher up.

It *is* possible to make freecom RTL independent of course, just like
the kernel, or replace memory allocation functions, but that's a lot of
work, and even then there are lots of things that can go wrong (we saw
that in kernel development, this stuff is crazy).

Bart


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to