home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / atari / st / tech / 4151 < prev    next >
Encoding:
Text File  |  1992-07-27  |  3.1 KB  |  82 lines

  1. Newsgroups: comp.sys.atari.st.tech
  2. Path: sparky!uunet!mcsun!Germany.EU.net!news.netmbx.de!zrz.tu-berlin.de!math.fu-berlin.de!news.th-darmstadt.de!backus.pu.informatik.th-darmstadt.de!wallmann
  3. From: wallmann@backus.pu.informatik.th-darmstadt.de (Natuerlich!)
  4. Subject: MFP yet again
  5. Sender: news@infoserver.th-darmstadt.de (The Usenet-News System)
  6. Message-ID: <1992Jul27.201854.20396@infoserver.th-darmstadt.de>
  7. Date: Mon, 27 Jul 1992 20:18:54 GMT
  8. Nntp-Posting-Host: backus.pu.informatik.th-darmstadt.de
  9. Organization: MSD software vault #9 @THD
  10. Lines: 70
  11.  
  12. I have bothered the net for the last couple of years with
  13. this problem. But now, since I feel _really_ confident that
  14. I know what's going on I feel oblidged (oh so oblidged (har))
  15. to bother you once more.
  16.  
  17. The problem:
  18. /* ----------------------------------------------------------
  19.      WARNING!!  You have to reboot after running this program  
  20.    ---------------------------------------------------------- */
  21. #include <tos.h>
  22.  
  23. main()
  24. {
  25.    unsigned long  count = 200000;
  26.    
  27.    Cconws( "Move the mouse, hit the keys!\r\n");
  28.    while( count--)
  29.    {
  30.       Jdisint( 6);
  31.       Jenabint( 6);
  32.    }
  33.    Cconws("Mmmh, either you were lucky or I was wrong :-P\r\n");
  34. }
  35. ----------------------------------------------------------------
  36. Now these are only TOS calls and you wouldn't expect them to
  37. produce a crash (in an ideal world). Alas they do.
  38.  
  39. What's happening is that the MFP chip that is accessed here with
  40. the Jdisint, Jenabint (aside: why not Jdis*b*int ?) has a problem
  41. dealing with an interrupt JUST WHEN it's being turned off to this
  42. interrupt source. The Jdisint call in this case is sort of 
  43. asynchronously interrupting the interrupt processing of the MFP
  44. (maybe just when communicating with the CPU). [#1#]
  45.  
  46. Now the MFP doesn't know what to tell the CPU properly anymore
  47. and sends the CPU a spurious interrupt. On the ST though, normally
  48. a spurious interrupt (which can't be masked, coz it's NMI) leads
  49. to bombs!
  50.  
  51. EVERY program that uses Jdisint (or disables/masks off the MFP
  52. directly) on an interrupt channel which might still produce interrupts 
  53. has a slight chance of crashing. 
  54.  
  55. Solution:
  56.  
  57.    a) Programmers that use Jdisint or turn off -active- MFP 
  58.       interrupts in any way, may want to intercept the exception 
  59.       vector at $60 and just do an RTE on it.
  60.       
  61.    b) Users who feel that they might suffer from spurious IRQs 
  62.       install the little ditty appended here, that just ignores
  63.       spurious IRQs, and put it anywhere in there AUTO folder.
  64.       
  65. Nat!
  66. ----------------------------------------------------------------
  67. table
  68.  !"#$%&'()*+,-./0123456789:;<=>?
  69. @ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
  70. begin 644 spurious.prg
  71. M8!H   !D        $                 <  $*G/SP ($Y!0_H 'B+X & Az
  72. MR0!@0E=(> ( /SP ,4Y!6$)204Y33OD'____3G,-"@!3<'5R:6]U<R!)4E$@y
  73. J4')O=&5C=&]R('8P+C @:6YS=&%L;&5D("AN870A+SDR*0T*        x
  74.  w
  75. end
  76. ----------------------------------------------------------------
  77. [#1#] My -model- of what's happening. 
  78. -- 
  79. Email: wallmann@backus.pu.informatik.th-darmstadt.de
  80.          "Bang that bit that doesn't bang"
  81. Waiting for the time when chips are measured in color.
  82.