Hi, even though you now have an (0.82pl3w? Testing, unstable!)
FreeCOM, you STILL should "waste" those FEW BYTES in the environment
to maintain FreeCOM compatibility!

There is TRANSLATED FreeCOM, STABLE FreeCOM, DEBUGGING FreeCOM,
NON XMS SWAP FreeCOM, and possibly many other reasons why people
cannot upgrade to the FIXED FreeCOM. Still they want to be able
to test your kernel, even with F5 mode!!!

Problem:
some=var\0other=var\0\0c:\freecom.com
-> works with BOTH smartdrv and all FreeCOM versions
\0c:\freecom.com
-> BREAKS FreeCOM and possibly also FDAPMs "Am I run from INSTALL=?"
   detection: FreeCOM erroneously searches for "\0\0" as marker to
   find "c:\freecom.com" string, and FDAPM (and possibly several
   other programs!) searches for "\0\0" as marker to where it can
   stop looking for COMSPEC (if no COMSPEC found, FDAPM assumes
   that it is being run from INSTALL). In FreeCOM this means CRASH
   but in FDAPM this only crashes if there is no "\0\0" before the
   scan reaches environment:0xffff offset.

Correct behaviour:
pointer = start of environment
while (*pointer) {
  copy string at pointer, including the trailing \0, and
  update pointer to point after that trailing \0
}
pointer++; /* skip over the "end of variables" \0 which we found */
string at pointer (possibly empty) up to and including the trailing \0,
is the name of the program

However, COMMON behaviour is:
do {
  copy string at pointer, including the trailing \0 ...
  (or skip over it)
} until (!*pointer);
pointer++;
string at pointer is ...

Or in other programs, which are not interested in environment variables:
while (pointer[0] || pointer[1]) pointer++;

The BUG in this common behaviour: The two consecutive \0 are only an
artifact of "end of an environment variable string" being right before
"\0 which marks upcoming name-of-program string". Result:

\0c:\freecom.com\0 is only understood by CORRECT programs like SMARTDRV
\0\0c:\freecom.com\0 is only understood by BUGGY but COMMON programs like FreeCOM
*but*
A=B\0\0c:\freecom.com\0 is understood by ALL programs, I dare to say.

So Arkady has optimized away 4 "wasted" bytes in environment, but we *need*
them to make ALL programs work! The "A=B\0" is, however, ONLY needed for
SHELL/INSTALL lines and ONLY if there are no SET events before and if there
is no CONFIG=7 or anything in the environment anyway.

In other words: Only for non-multiconfig we would waste 4 bytes per environment
for the sake of being compatible to all programs! I think we *must* pay this
price, even though mathematical logics tell use the programs *should* accept
\0c:\freecom.com\0 after all.

Please re-add such a workaround (old string was "PATH=.\0" I think)
instead of forcing us to upgrade all versions of FreeCOM and possibly also
other programs. I think saving four bytes of kludge RAM are not worth
forcing us all to upgrade FreeCOM.

Eric



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Freedos-kernel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to