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

Re: [MiNT] FPU detection, who is wrong?



According to the M68881/M68882 User's Manual (p. 6-35), 0x3f clearly indicates a 68881, while 0x1f could be both.

Apparently, you are right: a clean distinction can only be made if you take the frame size into consideration which is the only value OS code should be interested in anyway.


Am 16.02.2015 um 09:33 schrieb Thorsten Otto:

> For what it's worth, FreeMiNT has always reported correct FPU on Falcon so I'd say there's pretty good chance Hatari is the wrong one :)

Are you sure? ;) As far as i can tell, both TOS 3.x and  4.x only check wether there is an FPU at all, and set the cookie to value "some 6888x", but dont try to figure out which one exactly.

It also occurs more logical to me that a new processor also has a higher revision number.

Just found on comp.sys.m68k:

example Motorola suggest for detecting 68881/2.
It's not complete, but should give a good idea. The code runs in supervisor
mode:        CLR.B    FLAG      Clear no processor flag
        FNOP               Detect coprocessor (see note below)
        MOVE.B   FLAG,D0   Load flag
        BNE      NOCOP     No coprocessor branch
        FSAVE    -(SP)     Save internal state
        CLR.L    D0        Zero index
        MOVE.B   1(SP),D0  Obtain state frame size
        CMPI     #$18,D0   MC68881?
        BEQ      ONE       Yes
         .                 Code for MC68882
         .
        BRA      START     End of 68882 code
ONE      .                 Code for MC68881

So this code checks the frame size rather than the revision number. I guess that should be more clean.

Im asking the folks at Hatari what they think about this.

Greetings
Thorsten



Miro Kropáček <miro.kropacek@gmail.com> schrieb am 8:28 Montag, 16.Februar 2015:



On Mon, Feb 16, 2015 at 7:53 AM, Thorsten Otto <halgara@yahoo.de> wrote:
So MiNT reports 68882 if the revision number is 0x1f, 68881 otherwise. However, the opposite code in Hatari looks like this:
For what it's worth, FreeMiNT has always reported correct FPU on Falcon so I'd say there's pretty good chance Hatari is the wrong one :)


--
MiKRO / Mystic Bytes
http://mikro.atari.org