Hi,

On Fri, Mar 22, 2013 at 12:35 AM, John Sowden
<jsow...@americansentry.net> wrote:
>
> I just downloaded defrag.exe, a Freedos 32bit defrag program for DOS.

It's not 32-bit at all, AFAICT, only a 16-bit MZ DOS .exe compiled by
Turbo C++ (though seems to have some support for building with
OpenWatcom as well).

Latest version seems to be 1.32 from 2009:

http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/dos/defrag/

> Unfortunately, I received the immediate notice in RED that it will not
> run under windows, a reasonable declaration. Unfortunately, neither of
> the two computers that I ran defrag on was running Windows:

> 1) On computer #1, Windows was on the computer, but it was not executed,
> as I run DOS (7.0 for 32 bit file system).  All programs are run in true
> DOS, not DOS under Windows.

MS-DOS 7, I presume?

(Yes, I know FreeDOS kernel with FAT32 support defaults to version 7
as well, but this shouldn't be a problem, especially since you can put
"VERSION=x.yy" in your FDCONFIG.SYS and/or use Eric's CALLVER.COM
utility if needed).

> 2) Computer #2 boots into either DOS (7.0) and 4DOS or Linux (Suse
> 8.x).  Since it only has 48 MB RAM, I don't use Suse on this computer.
>
> Q: How is defrag deciding that it is running under Windows (when it
> really is not)?

The relevant files seem to be these:

defrag/source/defrag/environ/os_id.c
defrag/source/defrag/environ/checkos.c

os_id.c is the one that has the get_os() function. It checks for
Windows via 0x1600 and 0x160A, int 2Fh.

checkos.c seems to abort if one of three conditions is met:

* if IN_WINDOWS(os) is true
* if DPMIinstalled() is true
* if ((os != FreeDOS) && (id_os_ver[DOS].maj >= 7))

I suspect that since you're (presumably) running MS-DOS 7 that it sees
it's not FreeDOS (OEM != 0xFD) and_also is version 7, hence it assumes
Win9x.

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to