home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / sys / amiga / programm / 12992 < prev    next >
Encoding:
Internet Message Format  |  1992-09-02  |  2.5 KB

  1. Path: sparky!uunet!sun-barr!rutgers!cbmvax!mks
  2. From: mks@cbmvax.commodore.com (Michael Sinz)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Testing a custom trap handler
  5. Message-ID: <34813@cbmvax.commodore.com>
  6. Date: 2 Sep 92 12:02:53 GMT
  7. References: <s442013.715318366@yorku.ca>
  8. Reply-To: mks@cbmvax.commodore.com (Michael Sinz)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 40
  11.  
  12. s442013@nexus.yorku.ca (Ray Frederick) writes:
  13. >I have a custom trap handler that I would like to test in Supervisor Mode
  14. >on my A3000. I am using Powervisor to step through the code but as soon as
  15. >I move the address of the handler to tc_TrapData, the computer executes
  16. >the code and stops at the RTE. In order to step through the trap handler
  17. >I would like to put my User program in Supervisor mode so I have access to
  18. >the usp and other privileged instructions. I'm also hoping this will allow
  19. >me to step through the code.
  20. >
  21. >Basically, I would like to set bit 13 of the SR from a user program so
  22. >it will have Supervisor access to the instructions.
  23.  
  24. Well, a use program really can't be in supervisor mode very easily
  25. since just changing the SR would end up with the wrong stack.
  26.  
  27. There are EXEC calls to do such things.  There is the Supervisor()
  28. call which will run some code in supervisor state.  When that code
  29. returns you should be back where you where.  (It is a function
  30. call that takes a function pointer...)
  31.  
  32. There is also SuperState() and UserState() that bounce you in/out of
  33. supervisor state.
  34.  
  35. See the EXEC autodocs for more information on these calls.
  36.  
  37. ***NOTE***  Being is supervisor state means that there are a number of
  38. things that you can not do.  You can *not* call anything other than
  39. the EXEC calls that are available in interrupt state.  Also, when in
  40. supervisor mode, you can *not* cause the system to Wait() in any
  41. way since being in supervisor state is a special form of Forbid()
  42. that can not be broken safely.  (IE : It may seem to work for a few
  43. tries but then will suddenly not and for good reason too...)
  44.  
  45. /----------------------------------------------------------------------\
  46. |      /// Michael Sinz  -  Senior Amiga Systems Engineer              |
  47. |     ///                   Operating System Development Group         |
  48. |    ///   BIX:  msinz      UUNET:  mks@cbmvax.commodore.com           |
  49. |\\\///                                                                |
  50. | \XX/     Quantum Physics:  The Dreams that Stuff is made of.         |
  51. \----------------------------------------------------------------------/
  52.