Реферат: Making Utilities For MSDOS Essay Research Paper
Having seen that DOS external commands are not a good example for a program that
wants to be compatible with all DOS versions, I turned to Microsoft Network. One
of its utilities, REDIR, is very similar to SHARE in its operation. Like SHARE,
it accesses the DOS kernel variables by absolute offsets. I thought that unlike
SHARE, REDIR is not tied to a specific DOS version. Unfortunatelly, I wasn’t
able to disassemble it, because as a high school student, I don’t have a copy of
Microsoft Network. However, Geoff Chappell says that it has separate versions
for different versions of DOS, just like SHARE. Therefore, I turned to another
utility again.
My next stop was MSCDEX, the utility for accessing the High Sierra and ISO-9660
file systems used by CD-ROMs. Unlike SHARE and REDIR, MSCDEX is not tied to one
specific DOS version. I’m using MSCDEX version 2.21 with MS-DOS version 5.00,
but the same version of MSCDEX can be used with PC-DOS version 3.30. However, it
accesses the DOS kernel variables by absolute offsets in DOSGROUP, just like
SHARE and REDIR. Of course, my question was “How does it do that in a version-
independent manner?” When I disassembled it, I saw that it takes the flag at
offset 4 in DOSGROUP and uses it to determine the absolute offsets of all the
variables it needs. If this flag equals 0, MSCDEX assumes that all offsets it’s
interested in are the same as in DOS versions 3.10-3.30. If this flag equals 1,
MSCDEX assumes that all offsets it’s interested in are the same as in DOS
versions 4.00-5.00. For all other values of this flag MSCDEX refuses to load.
Sharp-eyed readers might notice that this check already makes MSCDEX potentially
incompatible with future DOS versions. The comments in the source code for MS-
DOS version 3.30 (DOS\MULT.INC file) refer to MSCDEX, therefore, it had existed
at the time of MS-DOS version 3.30. It is very doubtful that anyone, including
the author of MSCDEX, could know what offsets would the kernel variables in DOS
version 4.00 have at that time. If this is true, an MSCDEX version that predates
MS-DOS version 4.00 won’t run under DOS versions 4.00 and later.
MSCDEX uses the flag at offset 4 in DOSGROUP to determine not only the absolute