Detecting Minerva.

Anything QL Software or Programming Related.
Post Reply
prime
Trump Card
Posts: 192
Joined: Fri Feb 18, 2011 8:58 pm

Detecting Minerva.

Post by prime »

Is this a reasonable way to detect a Minerva equipped QL ?

Code: Select all

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.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Detecting Minerva.

Post by tofro »

prime wrote:Is this a reasonable way to detect a Minerva equipped QL ?

Code: Select all

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).

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Detecting Minerva.

Post by pjw »

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.

Per


Per
dont be happy. worry
- ?
User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Detecting Minerva.

Post by tofro »

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.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Detecting Minerva.

Post by pjw »

Or try something like

Code: Select all

 sysid.ql equ $d2540000

      ..
      cmp.l   #'1 80',d2          ; is it Minerva ?
      blo.s   NotMinerva          ; nope : skip
  
      cmp.l   #sysid.ql,(a0)       a0 -> sys vars: sys_idnt
      bne.s   NotMinerva

     ..
Per


Per
dont be happy. worry
- ?
RWAP
RWAP Master
Posts: 2834
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: Detecting Minerva.

Post by RWAP »

I thought Minerva returned a QDOS code of between 1.60 and 1.99.

I thought SMSQ/e started at 2.00

What versions of SMSQ/e show anything less than 2.00 ?


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Detecting Minerva.

Post by pjw »

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..

Code: Select all

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:   
	..
Per


Per
dont be happy. worry
- ?
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: Detecting Minerva.

Post by pjw »

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?

Per


Per
dont be happy. worry
- ?
User avatar
Dave
SandySuperQDave
Posts: 2765
Joined: Sat Jan 22, 2011 6:52 am
Location: Austin, TX
Contact:

Re: Detecting Minerva.

Post by Dave »

He's on my Skype. I'll ask him :)


Post Reply