(Translated by https://www.hiragana.jp/)
'Re: [fd-dev] How to detect FreeCOM/FreeDOS in-batch?' - MARC
The Wayback Machine - https://web.archive.org/web/20181106220459/https://marc.info/?l=freedos-dev&m=101423986407077&w=2
[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedos-dev
Subject:    Re: [fd-dev] How to detect FreeCOM/FreeDOS in-batch?
From:       Matthias Paul <Matthias.Paul () post ! rwth-aachen ! de>
Date:       2002-02-20 3:35:56
[Download message RAW]

On 2002-02-18, Steffen Kaiser wrote:

> There were several questions in the past about how to detect FreeCOM
> and/or FreeDOS from within batch scripts.
> 
> What I have collected til now is:
> 
> a) DRDOS is creating real environment variables (DRDOS=version I
> assume??),

DR-DOS traditionally supports two variables %OS% and %VER%. Here´s
a list of known values (if you know more, please let me know).

Contents of %OS%:   Corresponding operating system:

 "DOSPLUS"          DOS Plus 1.2+ in "DOS emulation"
 "DRDOS"            DR DOS 3.31, 3.32, 3.33, 3.34, 3.35,
                    3.40, 3.41, 3.41T, 3.42??? (I´ve never seen this one),
                    5.0, 6.0; DR DOS "Panther"; DR DOS "StarTrek",
                    DR-DOS 7.02, 7.03, 7.04/7.05
 "EZDOS"            2001 Sales Inc.'s EZ-DOS 3.41
 "PALMDOS"          DR PalmDOS 1.0
 "NetWare PalmDOS"  NetWare PalmDOS 1.0
 "NWDOS7"           Novell DOS 7 BETA 1 (1993-04-26)
 "NWDOS"            Novell DOS 7 (and OpenDOS 7.02 BETA)
 "OPENDOS"          OpenDOS 7.01 (and OpenDOS 7.02 BETA); DR-OpenDOS 7.02
 "CPCDOS"           Concurrent PC-DOS
 "CPCDOS 4.1"       DOS Plus 1.2 in "CP/M emulation"
 "CDOS"             Concurrent DOS
 "CDOS386"          Concurrent DOS/386
 "DRMDOS"           DR Multiuser DOS
 "MDOS"             CCI Multiuser DOS (including Gold/Plus/Lite)
 ???                IMS Multiuser DOS
 ???                Datapaq Australasia Multiuser DOS
 "REAL32"           IMS REAL/32

 "Windows_NT"       Windows NT

So consequently the value for FreeDOS should be:

 "FREEDOS"          FreeDOS

Contents of %VER%:  Corresponding operating system:

 "1.0"              DR PalmDOS; Novell DOS 7 BETA 1 (1993-04-26)
 "1.2"              DOS Plus 1.2 in "DOS emulation" mode
 "3.31"             DR DOS 3.31
 "3.32"             DR DOS 3.32
 "3.33"             DR DOS 3.33
 "3.34"             DR DOS 3.34
 "3.35"             DR DOS 3.35
 "3.40"             DR DOS 3.40
 "3.41"             DR DOS 3.41; EZ-DOS 3.41
 "3.41T"            DR DOS 3.31T
 "4.1"              Concurrent PC-DOS
 "5.0"              DR DOS 5.0; DR Multiuser DOS 5.???
 "5.1"              DR Multiuser DOS 5.???
 "6.0"              DR DOS 6.0 (including all updates); DR PalmDOS;
                    DR DOS "StarTrek"
 "X.X"              DR DOS "Panther" BETA 1 and DR DOS "StarTrek" as well
 "7"                Novell DOS 7 (including all updates); OpenDOS 7.01;
                    DR-OpenDOS 7.02; DR-DOS 7.02, 7.03, 7.04/7.05
 "7.00"             CCI Multiuser DOS 7.00
 "7.21"             CCI Multiuser DOS 7.21
 "7.22"             CCI Multiuser DOS 7.22 (Gold)
 ???                IMS REAL/32 ???

> Variant a) and b) are equal equal, except:
> a) can be cheated by changing the value, but is available to all programs,
> not scripts only; needs space in env segm;

Yes, it´s not 100% reliable, but mind that sometimes it might be
necessary to cheat. - Like DR-DOS 7.02+ SETVER /X not only allowing
to fake DOS versions, but also BDOS kernel versions (to let some
drivers like HPFSDOS, which were hard-wired to detect Novell DOS 7,
run with newer kernels).

As the %OS% variable was originally introduced in the DRDOS family,
some batchjobs only test for the existance of any DRDOS as follows:

 IF ""=="%OS%" GOTO wrong_dos

For course, this no longer works since the variable made it into
Windows NT, and also because it is possible to have a DR-DOS
installation without the variables set up (for example when using
4DOS/NDOS instead of COMMAND.COM, you will have to add them manually).

This means that, if FreeDOS would use the %OS% variable as well,
it must not be implemented as a "virtual" variable (or "system
information values" (in DRI terminology), or "internal variable"
in 4DOS jargon). The user must have means to override or suppress
the variable for maximum compatibility. Some applications actually
read this variable, including Microsoft´s MS-DOS INTERSRV which
looks for %OS%=DRDOS.

In issues before DR DOS 5.0, the default variable values were
part of the DRBIOS.SYS file, but with the introduction of
DR DOS 5.0, they moved into COMMAND.COM.

Note, that some issues of DRDOS (usually only the BETA issues)
also had a %BETA% variable, which could contain a string or
number to be displayed when a shell started up as well as in
the output of the VER command (which also reports the contents
of the %VER% variable BTW). (See the DRDOSTIP.TXT file in
MPDOSTIP.ZIP on my web-site for details.)

Greetings,

 Matthias

-- 
<mailto:Matthias.Paul@post.rwth-aachen.de>; <mailto:mpaul@drdos.org>
http://www.uni-bonn.de/~uzs180/mpdokeng.html; http://mpaul.drdos.org

============================================================
Imagine making ALL of your phone calls anywhere in the
world for FREE!! No Fees of any kind! Call from Any Phone,
not over the Internet! No purchases and No credit cards
required. Join Dialfreecalls.com- It's Simple, Easy, and
Best of All, it's FREE!
http://click.topica.com/caaaf3Rbz8Rv5bAgbuZf/Dialfreecalls.com
============================================================

----------
list options/archives/etc.: http://www.topica.com/lists/fd-dev
unsubscribe: send blank email to: fd-dev-unsubscribe@topica.com

==^================================================================
This email was sent to: freedos@progressive-comp.com

EASY UNSUBSCRIBE click here: http://topica.com/u/?bz8Rv5.bAgbuZ
Or send an email to: fd-dev-unsubscribe@topica.com

T O P I C A -- Register now to manage your mail!
http://www.topica.com/partner/tag02/register
==^================================================================

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic