[net.micro.amiga] Easy fix to fexecv compatibility problems.

dillon@CORY.BERKELEY.EDU (Matt Dillon) (10/14/86)

	There is one place in the code for Manx's fexecv where they try to
get the BCPL enviroment (I think that is what broke).  I like my solution
to the problem better:	Simply save the startup enviroment when you start
up.  That is, the first instruction in the startup object module should be:

	movem.l	D0-D7/A0-A6,_Startup_Regs

	Or something like that.  Then, when you need specific BCPL stuff,
just look at _Startup_Regs instead of meandering through DOS.

					-Matt

jesup@steinmetz.UUCP (Jesup) (10/17/86)

In article <8610132307.AA10388@cory.Berkeley.EDU> dillon@CORY.BERKELEY.EDU (Matt Dillon) writes:
>
>	There is one place in the code for Manx's fexecv where they try to
>get the BCPL enviroment (I think that is what broke).  I like my solution
>to the problem better:	Simply save the startup enviroment when you start
>up.  That is, the first instruction in the startup object module should be:
>
>	movem.l	D0-D7/A0-A6,_Startup_Regs
>
>	Or something like that.  Then, when you need specific BCPL stuff,
>just look at _Startup_Regs instead of meandering through DOS.

Ah, but can you be sure that the CLI will give you the same initial register
values that it would give a BCPL program?  I do believe that they are quite
different.
What broke in manx's fexec was the series of pointers & offsets leading to
'*bcpl', which holds the BPTR to the loaded seglist.  One of the offsets
changed by 4.  The CLI was using this value instead of cli_Module.

	Randell Jesup		jesup@ge-crd.arpa  jesup@kbsvax.uucp
				...!rochester!edison!steinmetz!jesup.uucp

dillon@CORY (Matt Dillon) (10/23/86)

>>	Or something like that.  Then, when you need specific BCPL stuff,
>>just look at _Startup_Regs instead of meandering through DOS.
>
>Ah, but can you be sure that the CLI will give you the same initial register
>values that it would give a BCPL program?  I do believe that they are quite
>different.

	Well, since the C startup registers and BCPL startup registers
don't conflict, I figure nobody will bother to check which type of
executable is being loaded (if it's even possible).  Besides, Manx's
(and my own) fexecv require the parent to have a CLI, and anything running
from a CLI will be given the BCPL startup enviroment in the registers on
startup.

	After about 30+ hours of hacking, I have finally got my SHELL
(V2.03) to do the right thing for every BCPL program except RUN (and
nothing has ever worked right with RUN redirection anyway so I'm not
going to bother).

				-Matt