home *** CD-ROM | disk | FTP | other *** search
- Article 4641 of comp.sys.amiga:
- Path: mcdsun!noao!hao!gatech!rutgers!cbmvax!carolyn
- From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner CATS)
- Newsgroups: comp.sys.amiga
- Subject: Re: Posting of CSNEWS 'AMIGA' discussion, entry #193.
- Message-ID: <1875@cbmvax.cbmvax.cbm.UUCP>
- Date: 14 May 87 22:59:14 GMT
- References: <48CSNEWS@MAINE>
- Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS)
- Organization: Commodore Technology, West Chester, PA
- Lines: 178
-
- In article <48CSNEWS@MAINE> CSNEWS@MAINE.BITNET (CSNEWS CSBB Processor) writes:
- >[]
- >The documented call AddTask() in the RKM v.1 does not work properly
- >on my machine.
-
- AddTask() requires a bit of setup. I suggest using CreateTask() or
- at least looking at the CreateTask() source in the RKM (appendix D in
- A-W Exec manual or appendix after .i's in our 1.1 RKM Vol. II).
- In addition, if you are using Manx, you are going to need some inline
- assembler to fix the registers.
-
- > As a matter of fact, CreateProc() doesn't work either.
- >In the case of the AddTask() call, I get a Guru alert. In
- >the case of the CreateProc() call, aboslutely nothing happens.
-
- CreateProc() requires even more setup. For instance, if you are
- CreateProc'ing inline code rather than LoadSeg'd code, you must provide
- a dummy seglist. If you have LoadSeg'd a standalone program with normal
- startup code, you must create a port, build a WBenchMsg, and send it
- to the new process whose startup code is Wait'ing for that message.
-
- > After the CreateProc() goes to completion with a non-zero
- >return, the associated task state is 8, not defined in the RKM.
- >Anybody know what state this is?
-
- Got me. I could look at the source, but I don't have time.
-
- > Is or has anybody had any luck using either of these two
- >functions? Does anyone know for a fact that the RKM is in
- >error? (I got my set of manuals way back when Commodore first
- >released them, not the later Addison-Wesley publications)
-
- I've used CreateTask(). I've seen CreateProc() used. Again,
- see the Appendix. And the example at the end of this message.
-
- > Also, does LoadSeg return the address of the first instruction
- >of the loaded program, or does it return something else? If it
- >returns something else, how do you get the first instruction from
- >that.
-
- No. LoadSeg returns a BPTR to the initial Segment (a longword Bpointing
- to the next segment). Multiply the BPTE by 4 (or shift left twice) then
- add 4. Now it is a C pointer to the first instruction.
-
- > Lastly, an observation -- the call FindTask() returns a pointer
- >to a struct Process. The first element of a Process is a struct
- >Task, but the Process information is all there for you to look at.
-
- This is only true for Processes. If what you find is just a Task
- then the additional Process info is not there.
- ----------------------------------------------------------------------
-
- Here's an example using CreateTask. Phil Lindsay helped me straighten
- out the conditional inline assembler code that I added for Manx users.
- It has been tested with Lattice and Manx.
-
- ----------------------------------------------------------------------
-
- --
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
- Carolyn Scheppner -- CBM >>Amiga Technical Support<<
- UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn
- PHONE 215-431-9180
- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-