[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] shel_write questions



Hello,

I have some questions in order to update gemlib and its documentation regarding the shel_write() function.

For mode 20 (thread creation), there is a constant
#define SWM_THRCREATE		20	/**< create a new thread, see mt_shel_write() */

What about mode 21 (thread terminate) and 22 (thread terminated by parent) : is there any "official" constant name ? If not, i would suggest the following:
#define SWM_THRTERMINATE	21
#define SWM_THRSCHEDULE		22

I'm looking for documentation on the THREADINFO structure:
/** description of a thread, see mt_shel_write() with #SWM_THRCREATE mode */
typedef struct
{
	long			__CDECL (*proc)(void *par);	/**< entry point of the thread */
	void			*user_stack;			/**< user stack for the thread */
	unsigned long	stacksize;				/**< size of the user stack */
	short			mode;					/**< immer auf 0 setzen! (???)  */
	long			res1;					/**< immer auf 0L setzen! (???) */
} THREADINFO;

what shall we set in user_stack : the address of the top or the bottom of the memory allocated for the stack ? Is NULL a value allowed ?
What are mode and res1 fields for ?

In gemlib, there is a SHELTAIL structure: what's for ?
/** TODO */
typedef  struct
{
	short   dummy;		/**< a null  word 			   */
	long    magic;		/**< 'SHEL', if it's a Shell   */
	short   isfirst;	/**< first call of the Shell   */
	long    lasterr;	/**< last error  			   */
	short   wasgr;		/**< Program was a grafic app. */
} SHELTAIL;

In gemlib, there are the following constants, but i don't know what's for:
/* shel_write */
#define SHW_IMMED			0	/* PC-GEM  2.x */	/**< TODO */
#define SHW_CHAIN			1	/* TOS */			/**< TODO */
#define SHW_DOS				2	/* PC-GEM  2.x */	/**< TODO */
#define SHW_PARALLEL		100	/* MAG!X */			/**< TODO */
#define SHW_SINGLE			101	/* MAG!X */			/**< TODO */
(well, for the last two, i know...)

Last: the following constant seems to be a message value to terminate the AES (that mean that any AES application may terminate the AES???)
/* Werte f?r Modus SWM_AESMSG (f?r shel_write) */
#define AP_AESTERM 52 /* Mode 10: N.AES komplett terminieren. */ /**< TODO */

best regards,
Arnaud.