home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / alib / d0xx / d079 / task.lha / Task / POSTER next >
Encoding:
Text File  |  1987-06-03  |  3.4 KB  |  77 lines

  1. Article 4641 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!gatech!rutgers!cbmvax!carolyn
  3. From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner CATS)
  4. Newsgroups: comp.sys.amiga
  5. Subject: Re: Posting of CSNEWS 'AMIGA' discussion, entry #193.
  6. Message-ID: <1875@cbmvax.cbmvax.cbm.UUCP>
  7. Date: 14 May 87 22:59:14 GMT
  8. References: <48CSNEWS@MAINE>
  9. Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS)
  10. Organization: Commodore Technology, West Chester, PA
  11. Lines: 178
  12.  
  13. In article <48CSNEWS@MAINE> CSNEWS@MAINE.BITNET (CSNEWS CSBB Processor) writes:
  14. >[]
  15. >The documented call AddTask() in the RKM v.1 does not work properly
  16. >on my machine.
  17.  
  18.    AddTask() requires a bit of setup.  I suggest using CreateTask() or
  19. at least looking at the CreateTask() source in the RKM (appendix D in
  20. A-W Exec manual or appendix after .i's in our 1.1 RKM Vol. II).
  21. In addition, if you are using Manx, you are going to need some inline
  22. assembler to fix the registers.
  23.  
  24. >    As a matter of fact, CreateProc() doesn't work either.
  25. >In the case of the AddTask() call, I get a Guru alert.  In
  26. >the case of the CreateProc() call, aboslutely nothing happens.
  27.  
  28.    CreateProc() requires even more setup.  For instance, if you are
  29. CreateProc'ing inline code rather than LoadSeg'd code, you must provide
  30. a dummy seglist.  If you have LoadSeg'd a standalone program with normal
  31. startup code, you must create a port, build a WBenchMsg, and send it
  32. to the new process whose startup code is Wait'ing for that message.
  33.  
  34. >    After the CreateProc() goes to completion with a non-zero
  35. >return, the associated task state is 8, not defined in the RKM.
  36. >Anybody know what state this is?
  37.  
  38.    Got me.  I could look at the source, but I don't have time.
  39.  
  40. >    Is or has anybody had any luck using either of these two
  41. >functions?  Does anyone know for a fact that the RKM is in
  42. >error?  (I got my set of manuals way back when Commodore first
  43. >released them, not the later Addison-Wesley publications)
  44.  
  45.    I've used CreateTask().  I've seen CreateProc() used.  Again,
  46. see the Appendix.  And the example at the end of this message.
  47.  
  48. >    Also, does LoadSeg return the address of the first instruction
  49. >of the loaded program, or does it return something else?  If it
  50. >returns something else, how do you get the first instruction from
  51. >that.
  52.  
  53.    No.  LoadSeg returns a BPTR to the initial Segment (a longword Bpointing
  54. to the next segment).  Multiply the BPTE by 4 (or shift left twice) then
  55. add 4.  Now it is a C pointer to the first instruction.
  56.  
  57. >    Lastly, an observation -- the call FindTask() returns a pointer
  58. >to a struct Process.  The first element of a Process is a struct
  59. >Task, but the Process information is all there for you to look at.
  60.  
  61.    This is only true for Processes.  If what you find is just a Task
  62. then the additional Process info is not there.
  63. ----------------------------------------------------------------------
  64.  
  65. Here's an example using CreateTask.  Phil Lindsay helped me straighten
  66. out the conditional inline assembler code that I added for Manx users.
  67. It has been tested with Lattice and Manx.
  68.  
  69. ----------------------------------------------------------------------
  70.  
  71. -- 
  72. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  73. Carolyn Scheppner -- CBM   >>Amiga Technical Support<<
  74.                      UUCP  ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn 
  75.                      PHONE 215-431-9180
  76. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  77.