home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / m68k / 1079 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.7 KB

  1. Path: sparky!uunet!mcsun!sun4nl!philapd!alp!dolf
  2. From: dolf@echo.philips.nl (Dolf Grunbauer)
  3. Newsgroups: comp.sys.m68k
  4. Subject: Re: Which processor?
  5. Keywords: processor, cache
  6. Message-ID: <1992Sep1.074208.25185@echo.philips.nl>
  7. Date: 1 Sep 92 07:42:08 GMT
  8. References: <6040@pdxgate.UUCP> <1992Aug31.044532.570@ka8lvz.uucp>
  9. Organization: Digital Equipment Corporation, E.C.H.O. development department
  10. Lines: 29
  11.  
  12. lydic@ka8lvz.uucp (lydic) writes:
  13.  
  14. >In article <6040@pdxgate.UUCP> idr@rigel.cs.pdx.edu (Ian D Romanick) writes:
  15. >>How does one go about detmining what processor you are running on?  On my
  16. >>machine type only 68000, '010, '020, '030, and '040 are available and I need
  17. >>to be able to know which I'm running on.  I also need to know how to shut off
  18. >>the caches on the before mentioned processors.  I've though about using an
  19. >>illegal instruction trap, but I'm sure there has to be a more elegent method.
  20. >>If there's a FAQ for this, sorry, but point me in its direction. :)
  21.  
  22. >   The only way I know is to generate an illegal instruction or an address
  23. >   error (except '20 & '30) and look at the stack frame size.  Actually pretty
  24. >   easy to do, although not very elegant.
  25.  
  26. I always used the instruction address error, using an odd address.
  27. Coudl be done in C also:
  28.  
  29.     int (*func)() = (*)()1;
  30.  
  31.     (*func)();  /* <- this generates the address error */
  32.  
  33. and look at the stack frame.
  34.  
  35. If you want to see whether a math co-prossor is available, just try an FNOP.
  36. -- 
  37.    _ _
  38.   / U | Dolf Grunbauer    E.C.H.O. Development    Digital Equipment Enterprises
  39.  /__'<  dolf@echo.philips.nl  dolf@toet.echo.tds.philips.nl
  40. 88  |_\ mcsun!echo.philips.nl!dolf                         Was Dat voor niets ?
  41.