home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!umn.edu!msus1.msus.edu!msus1.msus.edu!news
- Newsgroups: comp.sys.m68k
- Subject: Re: Which processor?
- Message-ID: <1992Sep1.143752.1090@msus1.msus.edu>
- From: lkoop@TIGGER.STCLOUD.MSUS.EDU (LaMonte Koop)
- Date: 1 Sep 92 14:37:52 -0600
- Reply-To: lkoop@TIGGER.STCLOUD.MSUS.EDU
- References: <6040@pdxgate.UUCP>,<1992Sep1.005747.17504@col.hp.com>
- Organization: St. Cloud State University, St. Cloud, MN
- Nntp-Posting-Host: tigger.stcloud.msus.edu
- Lines: 66
-
- In article <1992Sep1.005747.17504@col.hp.com>, jpm@col.hp.com (Jonathan Mahaffy) writes:
- >idr@rigel.cs.pdx.edu (Ian D Romanick) writes:
- > How does one go about detmining what processor you are running on?
- > On my machine type only 68000, '010, '020, '030, and '040 are
- > available and I need to be able to know which I'm running on....
- >
- >let's see...
- >
- >supposing you are in supervisor state, and can hack
- >the illegal instruction trap,
- >
- >code MOVEC (4e7a 0000). if you trap, you're a 68000; else
- >
- >code CALLM (06d0 0000)*. if you don't trap, you're a 68020; else
- >
- >code MOVE16 (f620 9000)**. if you don't trap, you're a 68040; else
- >
- >code EXTB (49c0). if you trap you're a 68010; else you're a 68030.
- >
- >* make sure A0 points to an RTM
- >** make sure A0 & A1 point to read/write memory on 16-byte boundaries
- >
- >there may be better ways...you could take off the cover, and look at
- >the chip...
- > jonathan
-
- Actually, a somewhat different way to avoid all the trap catches (though
- some are required) would be the following: (this assumes supervisor mode
- operation)
-
- do a movec vbr,d0
-
- If a trap occurs, you are a 68000 - done with checks. Else:
-
- do a movec cacr,d0
-
- If a trap occurs, you must be a 68010 - done with checks. Else you are
- a 68020 or above...determining which can be done without traps:
-
- 1.) get a copy of the current CACR register contents.
- 2.) duplicate the copy.
- 3.) set the CACR instruction cache BURST enable bit in the duplicate copy
- 4.) set the CACR 68040 instruction cache enable bit in the duplicate copy
- 5.) write the copy to the CACR
- 6.) re-read the CACR and save the value read
- 7.) write back the old CACR register contents preseved in step 1.
-
- Now, do these checks:
-
- check the CACR copy from step 6 above for a set 030 BURST bit.
- if this is set, you have a 68030. Else:
-
- check the CACR copy from setp 6 above for a set 68040 instruction enable
- bit. If this is set, you have a 68040. Else:
-
- You have a processor from mars.
-
- I hope this helps some. Note that with this method, you cannot identify between
- a 68030 and a 68EC030, likewise for a 68040 and 68LC040/68EC040. Doing such
- checks is MUCH more complicated, and not always guaranteed to be effective.
-
- ----------------------------------------
- LaMonte Koop -- SCSU Electrical/Computer Engineering
- Internet: lkoop@tigger.stcloud.msus.edu -OR- f00012@kanga.stcloud.msus.edu
- "You mean you want MORE lights on this thing???"
- ---------------------------------------------------------------------------
-