| One thing you may know already (I can't tell from from your listing)
is that SETBLOCK (also known as Mfree) is better described as FREEING
memory that your process does not need (ie: when your program first
runs it grabs all available memory and you need to use SETBLOCK
to return enough memory to TOS so your pexeced programs can run).
It's sounds like from what you said that you know this already but
I thought I'd make sure.
Attached is an example (not mine) of doing a pexec in C. Also
you can copy PEXEC.DOC By Allan Pratt (of Atari) from,
LEDDEV::DISK$USER9:[WALLACE.PUBILC.ST]
Both of these were taken off of Usenet quite some time ago. Since
I have not used pexec myself I can not vouche for the accuracy.
Ray
/* gemshell.c forms gemshell.tos STdNet-StPaulMN 17Sep88 CJPurcell */
/* "one-liner" shell to compile w/gcc on an ATARI-1040ST or ATARI-520+ */
#include <osbind.h> /* provides maximum available execute space in 1meg */
/* eventually,read this info from an initialization file, i.e., gnu.rc */
static char *envp[] = { "gcc=g:\\exec\\gcc.ttp",
"cc1=g:\\exec\\gcc-cc1.ttp",
"cpp=g:\\exec\\gcc-cpp.ttp",
"ld=g:\\exec\\gcc-ld.ttp",
"as=g:\\exec\\gcc-as.ttp",
"GCCEXEC=g:\\exec\\gcc-",
"INCLUDE=g:\\include",
"GNULIB=g:\\lib",
"TEMP=p:",
"PATH=",
"A:\\",
0 };
main() {
unsigned char buffer[130];
int status;
buffer[0] = 128;
Cconws("gccGEMshell Enter: command_line_string (^C exits)\r\n:");
Cconrs(buffer);
Cconws("\r\n");
buffer[1] = ' '; /* command buffer mandatory space prefix */
/* 0 selects loadgo */
status = (int) Pexec( 0 , "g:\\exec\\gcc.ttp", &buffer[1], *envp );
Cconws("\r\n Pause to read compiler messages; Any key continues: \r\n");
Bconin(2);
return(status);
}
|
| If you Pexec a GEM program, and do NOT return to the desktop, your
system will bomb the first time it tries to redraw the desktop
background. Exiting a program does not automatically reset the GEM
desktop background object tree - and most applicatios replace this with
their own object tree.
After the application returns, try doing a
wind_set( 0, WF_NEWDESK, tree, 0, 0);
where "tree" is the starting address of an object tree containing
something interesting to look at.
|