On Mon, 28 Apr 2025, Bret Johnson via Freedos-devel wrote:
Unfortunately, not all programs are that simple. Many of the MS utility
programs are looking for a very specific version of DOS, but some are
looking for "categories". On some of my programs, e.g., I have a
"GetDOSVersion" subroutine that simply returns the DOS version value to
the caller so the INT 21.30 call is not immediately followed by a CMP
AX/JNE. It could also be that the version is not "hard-coded" (ABCD)
but is store in a register, or uses something other than JNE, or all
kind of other possibilities. Some programs test the major & minor
version numbers separately for various reasons. As you stated earlier,
some programs need to look for "categories" (like do one thing for DOS <
3.30 and do something else for DOS <= 5.xx and yet something else for
DOS >= 6. The "heuristic" method wouldn't work on anything like that.
One particular method I use in my own code is this:
mov ah, 0x30
int 0x21
xchg ah, al
cmp ax, 0x031A
jae verok
mov dx, edos
mov ah, 0x09
int 0x21
int 0x20
edos: db "Incorrect DOS version", 13, 10, "$"
verok:
You'd need a bit fancier checks for something like that. I think some of
the MS-DOS apps also use a method like this.
-uso.
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel