[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: detecting ProDOS vs. Dos3.3



Rubywand (rubywand@my-deja.com) wrote:
: Dennis Jenkins <dennis@usb.com> writes ...

: > Hello,
: > I am writing some code that needs to know which OS it is running
: > under.  I'd prefer a "rock solid" way of doing this.
: > Currently, I just examine the jump table target address
: > on the $3d0 JMP.  If it is "BE00"
: > I assume prodos and if it is (I forgot) then
: > I assume Dos 3.3, anything else is an error.
: > Is this a good method?  What about all of the Dos 3.3
: > hacks out there...
: >
:  ....

:      It's a pretty good check. 4C 00 BE seems to be a good indicator for
: ProDOS. Meanwhile, DOS 3.3 and popular variants like Prontodos, EsDOS,
: and DavidDOS all have 4C BF 9D at $03D0.

If you want to be truly bulletproof, it might be safer to look for the 4C
00 BE to indicate ProDOS and assume that anything else is a DOS 3.3
variant.  Why?  Well, Rubywand mentioned the possibility of DOS having
been moved to the Language Card (which you can't do with ProDOS since it's
already there...).  There is another possibility as well...if the DOS 3.3
disk is an old one, built on a system with less than 48k RAM, and without
the DOS relocation code (i.e. not a master disk), then DOS isn't smart
enough to load high.  So location $3D0-$3D2 might contain 4C BF 5D, for
instance, if the disk were created on a 32k machine.

That said, I don't think Apple has sold a machine with less than 48k in it
in the last 20 years or so, so the point is probably needlessly nitpicky
and pedantic.  Of course, ProDOS requires a 64k machine to operate, so
this isn't an issue.

As one not familiar with the guts of ProDOS...Is the code at $BE00
actually in ProDOS, or is that sitting in some .SYSTEM file someplace and
so can't necessarily be counted on either?  That is, does $BE00 reconnect
ProDOS, or does it reconnect BASIC.SYSTEM?

--Dave Althoff, ][.
-- 
    /X\        _       _               _    *** Happy New Year!!! ***
   /XXX\      /X\     /X\_      _     /X\__      _     _        _____  
  /XXXXX\    /XXX\  _/XXXX\_   /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX