[comp.sys.amiga] Message ports in 68000

bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) (04/26/87)

Some time after writting a complete hyper-tiny replacment for the
exec_support library in	68000 I	realized that my purpose of opening a
message	port could be served far easier; each process has an associated
pre-allocated message port that	can be had quite simply:
-
-	move.l	 4,a6
-	suba.l	 a1,a1
-	jsr	 _LVOFindTask(a6)
-	add.l	 #pr_MsgPort,d0
-
Now is this being clever, or will problems crop	up later?  Every bit
of sample code that needs a port for Packets or	other uses creates
a custom one.
 
PS. Two requests by mail gets exec_support in 68000 posted to comp.sources

   //
\\// Save the sanity of millions, ban the BPTR!!

phillip@cbmvax.cbm.UUCP (Phillip Lindsay CATS) (04/27/87)

in article <8704260218.AA05317@cogsci.berkeley.edu>, bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) says:
> 
> Some time after writting a complete hyper-tiny replacment for the
> exec_support library in	68000 I	realized that my purpose of opening a
> message	port could be served far easier; each process has an associated
> pre-allocated message port that	can be had quite simply:
> -
> -	move.l	 4,a6
> -	suba.l	 a1,a1
> -	jsr	 _LVOFindTask(a6)
> -	add.l	 #pr_MsgPort,d0
> -
> Now is this being clever, or will problems crop	up later?  Every bit
> of sample code that needs a port for Packets or	other uses creates
> a custom one.

NO!!! 
	In almost every call you make to DOS *that* port is used.

BTW, What happens if a TASK wants to create a port with your exec_support code?
==============================================================================
Phillip (Flip) Lindsay - Commodore Business Machines - Amiga Technical Support
  UUCP: {ihnp4|seismo|caip}!cbmvax!phillip      - Phone: (215) 431-9180
  No warranty is implied or otherwise given in the form of suggestion or 
  example. Any opinions found here are of my making.

bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) (04/28/87)

In article <1764@cbmvax.cbmvax.cbm.UUCP> phillip@cbmvax.cbm.UUCP (Phillip Lindsay CATS) writes:
>in article <8704260218.AA05317@cogsci.berkeley.edu>, bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) says:
>> 
>> Some time after writting a complete hyper-tiny replacment for [exec_support]
             ^^^^^
>> -	move.l	 4,a6		[;hyper cheap msg port create]
>> -    suba.l	 a1,a1
>> -	jsr	 _LVOFindTask(a6)
>> -	add.l	 #pr_MsgPort,d0
>
>NO!!! 
>	In almost every call you make to DOS *that* port is used.
>
>BTW, What happens if a TASK wants to create a port with your exec_support code?

Sorry that it was not clear that ->THIS<- was the experiment and the 
exec_support clone "rolls it's own" as is good and proper.  This was tried
only in an experimental program that fires packets directly at DOS (rather
than calling the usual stubs).  It assumes far too much for general use,
however since this was guaranteed a process, was doing the DOS work and 
was only a exploratory test probe never to leave even the security of VD0:
no danger was involved.
The several persons asked for the *real* thing, and that has been posted to
comp.sources.amiga.

jmsynge@sqm.dec.com (James M Synge, DTN 381-1545) (05/04/87)

	
COGSCI.BERKELEY.EDU!bryce writes:
> ... each process has an associated pre-allocated message port that
> can be had quite simply:
> -
> -	move.l	 4,a6
> -	suba.l	 a1,a1
> -	jsr	 _LVOFindTask(a6)
> -	add.l	 #pr_MsgPort,d0
> -
> Now is this being clever, or will problems crop	up later?

	The only caution I would add is that you must be SURE that you are
being executed in an AmigaDOS PROCESS, not just a TASK.

	What I want (and am slowly working on) is a library of routines which
a TASK can call which enable it to do all disk related activity just like a
PROCESS.

James Synge

USENET:  {decvax, ucbvax, allegra}!decwrl!sqm.dec.com!jmsynge
ARPAnet: jmsynge%sqm.DEC@decwrl.DEC.COM

#include <disclaimer.h>
"Ken Olsen can speak for Digital, not me!"