|
GEOS SDK TechDocs
|
|
1 Geodes
|
1.2 Launching an Application
A geode is simply a special type of GEOS file. It has a special file header that gets loaded in as the geode's core block. This file header contains the geode's type, attributes, release and protocol levels, and many other pieces of information necessary for GEOS to work with the geode. You never will have to know the exact structure of this header as the kernel provides routines necessary to access important portions of it.
Several important items contained in the header are listed below.
-
Core Block Handle
The core block contains its own memory handle, filled in when the geode is loaded into memory.
-
Geode Attributes
Each geode has a record of type
GeodeAttrs
. The geode attributes are described below in Geode Attributes
.
-
Release and Protocol Levels
Each geode can have release and protocol levels associated with it to ensure compatibility between different versions. Release and protocol levels are discussed in Protocol Numbers
.
-
Geode Name
Each geode has a geode name and extension specified in the geode parameters (
.gp
) file.
-
Geode Token
Every geode has a token associated with it in the token database. The token describes the geode's icon and is a structure of type
GeodeToken
. Tokens and icons are discussed in Creating Icons
.
-
Geode Reference Count
The geode's reference count is stored in the core block. See above for a discussion of the reference count and how it's managed.
-
Geode File Handle
The file handle of the geode identifies the open GEO file so the kernel can locate, load, and access its various resources.
-
Geode Process Handle
Each geode that has a parent process will have the handle of the process in its core block. This is the handle of the parent process' core block. (The parent process is the owner of the thread that loaded the geode. It is notified when the geode exits, if the exiting geode is a process.)
-
Handle of the Next Geode
Because geode core blocks are stored in a linked list, each core block must contain a reference to the next geode in the list.
-
Handle of Private Data Space
Each geode that is not the kernel can have a "private data space." This private data space is discussed in Temporary Geode Memory
.
-
Resource, Library, and Driver Information
Each geode that imports or exports library or driver information must keep the import and export specifics available. Additionally, each geode must keep track of the resources it owns. All this information is stored in tables referenced from within the core block.
Geode Attributes
Each geode has in its core block a record of type
GeodeAttrs
. This record defines several things about the geode, including which aspects it uses and which of its aspects have been initialized. The
GeodeAttrs
record contains one bit for each of the following attributes.
-
GA_PROCESS
-
This geode has a process aspect and therefore an initial event-driven thread.
-
GA_LIBRARY
- This geode has a library aspect and therefore exports routines (and possibly object classes).
-
GA_DRIVER
- This geode has a driver aspect and therefore has a driver table, in which the strategy routine is specified.
-
GA_KEEP_FILE_OPEN
-
This geode must have its .GEO file kept open because its resources may be discardable or are initially discarded.
-
GA_SYSTEM
- This geode is a privileged geode and is almost certainly a system-used driver. These geodes have special exit requirements.
-
GA_MULTI_LAUNCHABLE
-
This geode may be loaded more than once and therefore may have more than one instance of its core block in memory.
-
GA_APPLICATION
-
This geode is a user-launchable application.
-
GA_DRIVER_INITIALIZED
-
This flag is set if the geode has had its driver aspect initialized (if the driver's strategy routine has been initialized). This flag will be set dynamically by the kernel.
-
GA_LIBRARY_INITIALIZED
-
This flag is set if the geode has had its library aspect initialized (if the library's entry routine has been called). This flag will be set dynamically by the kernel.
-
GA_GEODE_INITIALIZED
-
This flag is set if all aspects of the geode have been initialized.
-
GA_USES_COPROC
-
This geode uses a math coprocessor if one is available.
-
GA_REQUIRES_COPROC
-
This geode requires the presence of a math coprocessor or a coprocessor emulator.
-
GA_HAS_GENERAL_CONSUMER_MODE
-
This geode may be run in the General Consumer (appliance) Mode.
-
GA_ENTRY_POINTS_IN_C
-
This geode has its library entry routine in C rather than assembly language.
Geode Token
As stated above, every geode is associated with a token in the token database. This token is defined by the use of a
GeodeToken
structure. This structure and its uses are discussed in Creating Icons
.
|
GEOS SDK TechDocs
|
|
1 Geodes
|
1.2 Launching an Application