OutQDOSVer:
moveq.l #MT_INF,d0 ; Get sysinfo
trap #1
sub.l #6,a7 ; Make room on stack
move.l d2,2(a7) ; save ascii os ver
move.w #4,(a7)
and.l #$FF00FFFF,d2 ; Mask out 3rd character as this may not be
; '.' in international versions
or.l #$00200000,d2 ; mask in space
cmp.l #'1 80',d2 ; is it Minerva ?
blo.s NotMinerva ; nope : skip
; If we get here, this is Minerva, so print an 'M' to indicate
move.b #'M',d1 ; Print an m
bsr OutD1Ch0 ; output it
NotMinerva:
move.l a7,a1 ; point to string
bsr.s OutStringCh0 ; output the string
add.l #6,a7 ; restore stack
rts
Basically call MT_INF, mask out bits 16 to 23, as the third character will contain a '.' for UK roms, but may contain a different letter in international versions. Then compare with 1.80, if greater assume that it is minerva?
OutQDOSVer:
moveq.l #MT_INF,d0 ; Get sysinfo
trap #1
sub.l #6,a7 ; Make room on stack
move.l d2,2(a7) ; save ascii os ver
move.w #4,(a7)
and.l #$FF00FFFF,d2 ; Mask out 3rd character as this may not be
; '.' in international versions
or.l #$00200000,d2 ; mask in space
cmp.l #'1 80',d2 ; is it Minerva ?
blo.s NotMinerva ; nope : skip
; If we get here, this is Minerva, so print an 'M' to indicate
move.b #'M',d1 ; Print an m
bsr OutD1Ch0 ; output it
NotMinerva:
move.l a7,a1 ; point to string
bsr.s OutStringCh0 ; output the string
add.l #6,a7 ; restore stack
rts
Basically call MT_INF, mask out bits 16 to 23, as the third character will contain a '.' for UK roms, but may contain a different letter in international versions. Then compare with 1.80, if greater assume that it is minerva?
Cheers.
Phill.
Phill,
that is OK if you limit yourself to QDOS-OSs, but putting SMSQ/E into the picture, things would be messed up. (SMSQ/E would identify as Minerva, because it also has version numbers >1.13).
Minerva uniquely returns "JSL1" for VER$ (please shout if you know otherwise!). So this string must exist somewhere. However, I dont think the location is documented nor is there a "legal" way to access it. A pity. In SMSQ/E the location of the system identifier is sensibly located at sys_vars offset 0. Sadly Minerva and QDOS both sport the same identifier, $d2540000, at that address.
What you can always do is check for QDOS version >1.80, like you do, then call a known SMSQ/E only trap (like, for example TRAP#1, D0=$2f, D1=-1 - This should retrieve the processor cache enable state) and see if that comes back with an error. If yes, you've got Minerva.
Phill, I only looked at a small part of your code when I replied yesterday. Looking at the whole, I cant just leave it there. You will probably have figured it out yourself, but just for the record Ill spell it out in full. I also made a suggestion to shave off a few bytes. I hope it works, as I havent tested..
sysid.ql equ $d2540000 or
* include dev8_keys_sys
..
OutQDOSVer:
moveq.l #MT_INF,d0 ; Get sysinfo
trap #1
sub.l #6,a7 ; Make room on stack
move.l d2,2(a7) ; save ascii os ver
move.w #4,(a7)
cmp.l #sysid.ql,(a0) a0 -> sys vars: sys_idnt
bne.s NotMinerva
; We've got either QDOS or Minerva. Massage version string
swap d2 V?vv -> vvV?
move.b #' ',d2 vvVs
swap d2 Vsvv
cmp.l #'1 80',d2 ; is it Minerva ?
blo.s NotMinerva ; nope : skip
; If we get here, this is Minerva, so print an 'M' to indicate
move.b #'M',d1 ; Print an m
bsr OutD1Ch0 ; output it
NotMinerva:
..
Rich, I guess youre right about version numbers. If that is set in stone the test could of course be simplified again. However, it might be worth considering how future updates to Minerva and possibly also QDOS (Classic) would be affected. We're at the cusp of a Minerva V2.xx
Perhaps a next version of Minerva could incorporate a unique identifier at sys_idnt? Or is that likely to break a lot of existing software?
Laurence Reeves, author of Minerva, might have a suggestion for a simple sure-fire test. Is anyone in touch with him? Or any other ideas?