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
| ||||||||||
AES-Nummer: | 60
| ||||||||||
Deklaration: | int16_t proc_create ( void *address, int32_t size, int16_t
is_swap, int16_t is_gem, int16_t *num );
| ||||||||||
Beschreibung: | 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. | ||||||||||
Ergebnis: | An error has arisen only if the value 0 is returned (no more ID
available).
| ||||||||||
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
| ||||||||||
Gruppe: | Prozessverwaltung
| ||||||||||
Querverweis: | Binding proc_run proc_info proc_switch
|
C: | int16_t proc_create ( void *address, int32_t size, int16_t
is_swap, int16_t is_gem, int16_t *num );
| ||||||||||||||||||||||||||||||||||||
Umsetzung: |
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
|
AES-Nummer: | 62
|
Deklaration: | int16_t proc_delete ( int16_t pr_deid );
|
Beschreibung: | The call proc_delete shuts down all desk accessories. The
pr_deid parameter is ignored, but Desktop uses -1.
|
Ergebnis: | Return value of the function is unknown at present.
|
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding
|
C: | int16_t proc_delete ( int16_t pr_deid );
| ||||||||||||||||||||||||
Umsetzung: |
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
| ||||||||||||||||
AES-Nummer: | 63
| ||||||||||||||||
Deklaration: | 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 );
| ||||||||||||||||
Beschreibung: | The call proc_info inquires information about a process. The
following apply:
| ||||||||||||||||
Ergebnis: | An error has arisen only if the value 0 is returned.
| ||||||||||||||||
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
| ||||||||||||||||
Gruppe: | Fensterverwaltung
| ||||||||||||||||
Querverweis: | 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 );
| |||||||||||||||||||||||||||||||||||||||||||||
Umsetzung: |
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
|
AES-Nummer: | 64
|
Deklaration: | void *proc_malloc ( int32_t size, int32_t *ret_size );
|
Beschreibung: | The call proc_malloc allocates a memory block of size
bytes.
|
Ergebnis: | 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.
|
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding proc_mfree proc_setblock proc_shrink
|
C: | void *proc_malloc ( int32_t size, int32_t *ret_size );
| ||||||||||||||||||||||||||||||
Umsetzung: |
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
|
AES-Nummer: | 65
|
Deklaration: | int16_t proc_mfree ( int16_t pr_mfid );
|
Beschreibung: | The call proc_mfree deletes the channel associated to the
process ID pr_mfid from memory and disk for reuse.
|
Ergebnis: | An error has arisen if the value 0 is returned.
|
Verfügbar: | This function is only available under GEM XM and FreeGEM/XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding proc_malloc proc_setblock proc_shrink
|
C: | int16_t proc_mfree ( int16_t pr_mfid );
| ||||||||||||||||||||||||
Umsetzung: |
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
| ||||||||||||||||
AES-Nummer: | 61
| ||||||||||||||||
Deklaration: | int16_t proc_run ( int16_t pid, int16_t is_graphical, int16_t
options, int8_t *command, int8_t *tail );
| ||||||||||||||||
Beschreibung: | 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. | ||||||||||||||||
Ergebnis: | An error has arisen only if the value 0 is returned.
| ||||||||||||||||
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
| ||||||||||||||||
Gruppe: | Prozessverwaltung
| ||||||||||||||||
Querverweis: | 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 );
| ||||||||||||||||||||||||||||||||||||
Umsetzung: |
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
|
AES-Nummer: | 67
|
Deklaration: | int16_t proc_setblock ( int16_t pr_seid );
|
Beschreibung: | 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. |
Ergebnis: | An error has arisen only if the value 0 is returned.
|
Verfügbar: | The function is only available under GEM XM and FreeGEM/XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding proc_malloc proc_mfree proc_shrink
|
C: | int16_t proc_setblock ( int16_t pr_seid );
| ||||||||||||||||||||||||
Umsetzung: |
int16_t proc_setblock (int16_t pr_seid) { int_in[0] = pr_seid; return ( crys_if(67) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|
Name: | »Process shrink« - Shrink channel
|
AES-Nummer: | 68
|
Deklaration: | int16_t proc_shrink ( int16_t pr_shid, int16_t createswap, void
*address, int32_t *size );
|
Beschreibung: | 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. |
Ergebnis: | An error has arisen only if the value 0 is returned. On
success, this function returns the new size and
address of the channel.
|
Verfügbar: | The function is only available under GEM XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding proc_malloc proc_mfree proc_setblock
|
C: | int16_t proc_shrink ( int16_t pr_shid, int16_t createswap, void
*address, int32_t *size );
| |||||||||||||||||||||||||||||||||
Umsetzung: |
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
|
AES-Nummer: | 66
|
Deklaration: | int16_t proc_switch ( int16_t pr_swid );
|
Beschreibung: | The call proc_switch switches to process with the ID
pr_swid.
|
Ergebnis: | Returns 0 if process is already the active process, else 1.
|
Verfügbar: | This function is only available under GEM XM and FreeGEM/XM.
|
Gruppe: | Prozessverwaltung
|
Querverweis: | Binding proc_create proc_info proc_run
|
C: | int16_t proc_switch ( int16_t pr_swid );
| ||||||||||||||||||||||||
Umsetzung: |
int16_t proc_switch (int16_t pr_swid) { int_in[0] = pr_swid; return ( crys_if(66) ); } | ||||||||||||||||||||||||
GEM-Arrays: |
|