[comp.sys.atari.st] Use of _shell_p in GEMBOOT

t68@nikhefh.UUCP (Jos Vermaseren) (04/24/87)

----------For indigestion--------munchies-----------

It is alarming to see that some people use the currently empty system
variables for different purposes than they have been intended too.
If GEMBOOT uses the variable _shell_p for its own purposes this is
going to upset the programs that use it properly.
This variable is intended for shell programs that submit child processes.
The shell program can put here the address of one of its subroutines.
The child process sees then that there is a shell and can have the already
resident shell execute commands. This is particularly convenient for an
editor and here we have already some beta versions of a shell and an editor
running this way.
The proper usage is ( in assembler ) :
	move.l	$4F6,a1		Do this in supervisor mode

After coming back from the supervisor mode one does:

	move.l	a2,-(sp)	If in a2 there is a pointer to the string with
				the command to be executed
	jsr	(a1)
	addq.l	#4,sp

Using the location at $4F6 for different purposes will crash more than one
program. If one needs to use anything, use some of the space at either the
$500 range, or in the $300 range ( before the save area for the registers
during a crash ). Especially for a program like GEMBOOT it is safe to use
that undocumented area. A totally, completely new version of the ROMS that
would start using that space would probably also fix the 40 folder limit.
( Can you believe that ? ).

Jos Vermaseren
t68@nikhefh.uucp