[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference 7.286::atarist

Title:Atari ST, TT, & Falcon
Notice:Please read note 1.0 and its replies before posting!
Moderator:FUNYET::ANDERSON
Created:Mon Apr 04 1988
Last Modified:Tue May 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1433
Total number of notes:10312

476.0. "Execute PRG" by ZUR01::BOLLIGER () Sun May 14 1989 05:32

    			( EXEC BOMBS ......)
    
Could someone give me a Solution for the following problem .
Maybe an Example in Assembler or C or Pascal or Basic 
        
PROBLEM DESCRIPTION:

    I wrote a Assenbler Program who brings a Fileselect so that you
    can select a Program (.PRG) that selected Program is then
    started with EXEC (gemdos) now after returning from that Program
    i get sometimes a RESET (Bombs) while i try to start another Program.
    
    
    usualy after WORDPLUS or K-RESOURCE
                     
    i wrote the same program in Basic GFA v3 but the same problem
    happens
    
    now mi Program (Brief)
    
    		    1.	make new stack
    		    2.	reserve space with SETBLOCK (gemdos)
    			values from Basepage
    		    3.	Fileselect Box
    		    4.  execute Program (exec mod 0)
    		    5.  goto 3.
    
    
    					Thanks for a Reply or Hints
    
PS: Sorry for my poor english  		FRED
    greetings from Switzerland
    
    	   
    				 				    	         
T.RTitleUserPersonal
Name
DateLines
476.1Pexec doc and exampleLEDDEV::WALLACESun May 14 1989 14:1746
    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);
}
476.2The application had it's own desktop background?PRNSYS::LOMICKAJJeff LomickaSun May 14 1989 23:2413
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.