This library is only available on GEM XM. These functions allow to run up to 10 GEM and DOS applications at once, swapping out to eXpanded Memory (XM) or to disk. Each process uses a 'channel' to store its system area, work area, interrupt table and swap file.
• proc_create | Create a new process |
• proc_delete | Close all desk accessories |
• proc_info | Obtain info about a process |
• proc_malloc | Allocate memory |
• proc_mfree | Release memory |
• proc_run | Run process |
• proc_setblock | Shrink channel and create swap file |
• proc_shrink | Shrink channel with optional swap creation |
• proc_switch | Switch to process |
Name: | »Process create« - Create a new process
| ||||||||||
Opcode: | 60
| ||||||||||
Syntax: | int16_t proc_create ( void *address, int32_t size, int16_t
is_swap, int16_t is_gem, int16_t *num );
| ||||||||||
Description: | The call proc_create allocates a new process ID but does not
launch the process. The following apply:
Note: Since GEM XM doesn't support having more than one newly-launched process waiting around, the process with ID num must be launched through proc_run before calling proc_create again. | ||||||||||
Return value: | An error has arisen only if the value 0 is returned (no more ID
available).
| ||||||||||
Availability: | This function is only available under GEM XM and FreeGEM/XM.
| ||||||||||
Group: | Process library
| ||||||||||
See also: | Binding proc_info proc_run proc_switch
|
C: | int16_t proc_create ( void *address, int32_t size, int16_t
is_swap, int16_t is_gem, int16_t *num );
| ||||||||||||||||||||||||||||||||||||
Binding: |
int16_t proc_create (void *address, int32_t size, int16_t is_swap, int16_t is_gem, int16_t *num) { int_in[0] = is_swap; int_in[1] = is_gem; addr_in[0] = address; addr_in[1] = size; crys_if(60); *num = int_out[1]; return ( int_out[0] ); } | ||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process delete« - Close all desk accessories
|
Opcode: | 62
|
Syntax: | int16_t proc_delete ( int16_t pr_deid );
|
Description: | The call proc_delete shuts down all desk accessories. The
pr_deid parameter is ignored, but Desktop uses -1.
|
Return value: | Return value of the function is unknown at present.
|
Availability: | The function is only available under GEM XM and FreeGEM/XM.
|
Group: | Process library
|
See also: | Binding
|
C: | int16_t proc_delete ( int16_t pr_deid );
| ||||||||||||||||||||||||
Binding: |
int16_t proc_delete (int16_t pr_deid) { int_in[0] = pr_deid; return ( crys_if(62) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process information« - Obtains information about a process
| ||||||||||||||||
Opcode: | 63
| ||||||||||||||||
Syntax: | int16_t proc_info ( int16_t pid, int16_t *is_swap, int16_t
*is_gem, void **address, int32_t *csize, void **endmem, int32_t
*ssize, void **intaddr );
| ||||||||||||||||
Description: | The call proc_info inquires information about a process. The
following apply:
| ||||||||||||||||
Return value: | An error has arisen only if the value 0 is returned.
| ||||||||||||||||
Availability: | The function is only available under GEM XM and FreeGEM/XM.
| ||||||||||||||||
Group: | Process library
| ||||||||||||||||
See also: | Binding proc_create proc_run proc_switch
|
C: | int16_t proc_info ( int16_t pid, int16_t *is_swap, int16_t
*is_gem, void **address, int32_t *csize, void **endmem, int32_t
*ssize, void **intaddr );
| |||||||||||||||||||||||||||||||||||||||||||||
Binding: |
int16_t proc_info (int16_t pid, int16_t *is_swap, int16_t *is_gem, void **address, int32_t *csize, void **endmem, int32_t *ssize, void **intaddr) { int_in[0] = pid; crys_if(63); *is_swap = int_out[1]; *is_gem = int_out[2]; *address = addr_out[0]; *csize = addr_out[1]; *endmem = addr_out[2]; *ssize = addr_out[3]; *intaddr = addr_out[4]; return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process memory allocation« - Allocate memory
|
Opcode: | 64
|
Syntax: | void *proc_malloc ( int32_t size, int32_t *ret_size );
|
Description: | The call proc_malloc allocates a memory block of size
bytes.
|
Return value: | The function returns a pointer to the allocated memory block,
or 0 if failed. ret_size is filled with either the size of the
allocated memory block, or with the maximum available size.
|
Availability: | The function is only available under GEM XM and FreeGEM/XM.
|
Group: | Process library
|
See also: | Binding proc_mfree proc_setblock proc_shrink
|
C: | void *proc_malloc ( int32_t size, int32_t *ret_size );
| ||||||||||||||||||||||||||||||
Binding: |
void *proc_malloc (int32_t size, int32_t *ret_size) { addr_in[0] = size; crys_if(64); *ret_size = addr_out[1]; return ( addr_out[0] ); } | ||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process memory free« - Release memory
|
Opcode: | 65
|
Syntax: | int16_t proc_mfree ( int16_t pr_mfid );
|
Description: | The call proc_mfree deletes the channel associated to the
process ID pr_mfid from memory and disk for reuse.
|
Return value: | An error has arisen if the value 0 is returned.
|
Availability: | This function is only available under GEM XM and FreeGEM/XM.
|
Group: | Process library
|
See also: | Binding proc_malloc proc_setblock proc_shrink
|
C: | int16_t proc_mfree ( int16_t pr_mfid );
| ||||||||||||||||||||||||
Binding: |
int16_t proc_mfree (int16_t pr_mfid) { int_in[0] = pr_mfid; return ( crys_if(65) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process run« - Run a process
| ||||||||||||||||
Opcode: | 61
| ||||||||||||||||
Syntax: | int16_t proc_run ( int16_t pid, int16_t is_graphical, int16_t
options, int8_t *command, int8_t *tail );
| ||||||||||||||||
Description: | The call proc_run launches a process previously created with
proc_create. The following apply:
Note: The odd range of values passed to the load options is chosen for compatibility with the isover flag of shel_write. | ||||||||||||||||
Return value: | An error has arisen only if the value 0 is returned.
| ||||||||||||||||
Availability: | The function is only available under GEM XM and FreeGEM/XM.
| ||||||||||||||||
Group: | Process library
| ||||||||||||||||
See also: | Binding proc_create proc_info proc_switch
|
C: | int16_t proc_run ( int16_t pid, int16_t is_graphical, int16_t
options, int8_t *command, int8_t *tail );
| ||||||||||||||||||||||||||||||||||||
Binding: |
int16_t proc_run (int16_t pid, int16_t is_graphical, int16_t options, int8_t *command, int8_t *tail) { int_in[0] = pid; int_in[1] = is_graphical; int_in[2] = options; addr_in[0] = command; addr_in[1] = tail; return ( crys_if(61) ); } | ||||||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process set block« - Shrink channel and create swap file
|
Opcode: | 67
|
Syntax: | int16_t proc_setblock ( int16_t pr_seid );
|
Description: | The call proc_setblock reduces the channel size allocated to
the process pr_seid to what it is using now by eliminating its
free memory, and creates the swap file used to page it out.
Note This function calls proc_shrink(pr_seid, 1, &dummy, &dummy). The FreeGEM/XM Desktop defines this function as proc_shrink() with PROC_SHRINK=67 and omit to define a function for opcode 68. Original sources stated PROC_SETBLOCK=67 (with PID only) and PROC_SHRINK=68 (with extra parameters), as documented here. |
Return value: | An error has arisen only if the value 0 is returned.
|
Availability: | The function is only available under GEM XM and FreeGEM/XM.
|
Group: | Process library
|
See also: | Binding proc_malloc proc_mfree proc_shrink
|
C: | int16_t proc_setblock ( int16_t pr_seid );
| ||||||||||||||||||||||||
Binding: |
int16_t proc_setblock (int16_t pr_seid) { int_in[0] = pr_seid; return ( crys_if(67) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process shrink« - Shrink channel
|
Opcode: | 68
|
Syntax: | int16_t proc_shrink ( int16_t pr_shid, int16_t createswap, void
*address, int32_t *size );
|
Description: | The call proc_shrink reduces the size of the channel allocated
to the process pr_shid to what it is using now by eliminating
its free memory, and optionally creates the swap file used to page it
out if createswap is set to 1.
Note: This function is not used by FreeGEM/XM Desktop. On this environment, the function with opcode 67 is called proc_shrink and there is no binding for opcode 68. |
Return value: | An error has arisen only if the value 0 is returned. On
success, this function returns the new size and
address of the channel.
|
Availability: | The function is only available under GEM XM.
|
Group: | Process library
|
See also: | Binding proc_malloc proc_mfree proc_setblock
|
C: | int16_t proc_shrink ( int16_t pr_shid, int16_t createswap, void
*address, int32_t *size );
| |||||||||||||||||||||||||||||||||
Binding: |
int16_t proc_shrink (int16_t pr_shid, int16_t createswap, void *address, int32_t *size) { int_in[0] = pr_shid; int_in[1] = createswap; crys_if(68); *address = addr_out[0]; *size = addr_out[1]; return ( int_out[0] ); } | |||||||||||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process switch« - Switch to process
|
Opcode: | 66
|
Syntax: | int16_t proc_switch ( int16_t pr_swid );
|
Description: | The call proc_switch switches to process with the ID
pr_swid.
|
Return value: | Returns 0 if process is already the active process, else 1.
|
Availability: | This function is only available under GEM XM and FreeGEM/XM.
|
Group: | Process library
|
See also: | Binding proc_create proc_info proc_run
|
C: | int16_t proc_switch ( int16_t pr_swid );
| ||||||||||||||||||||||||
Binding: |
int16_t proc_switch (int16_t pr_swid) { int_in[0] = pr_swid; return ( crys_if(66) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|