Home Type definitionsType definitions OHEADEROHEADER PrintDescPrintDesc

I.14 OSHEADER

typedef struct _osheader
{
    uint16_t    os_entry;       /* BRAnch instruction to Reset-handler  */
    uint16_t    os_version;     /* TOS version number                   */
    void       *reseth;         /* Pointer to Reset-handler             */
    struct _osheader *os_beg;   /* Base address of the operating system */
    void       *os_end;         /* First byte not used by the OS        */
    int32_t     os_rsvl;        /* Reserved                             */
    GEM_MUPB   *os_magic;       /* GEM memory-usage parameter block     */
    int32_t     os_date;        /* TOS date (English !) in BCD format   */
    uint16_t    os_conf;        /* Various configuration bits           */
    uint16_t    os_dosdate;     /* TOS date in GEMDOS format            */

    /* The following components are available only as of TOS Version
       1.02 (Blitter-TOS)               */
    int8_t    **p_root;         /* Base address of the GEMDOS pool      */
    int8_t    **pkbshift;       /* Pointer to BIOS Kbshift variable
                                   (for TOS 1.00 see Kbshift)           */
    BASEPAGE  **p_run;          /* Address of the variables containing
                                   a pointer to the current GEMDOS
                                   process.                             */
    int8_t     *p_rsv2;         /* Reserved                             */
                                /* If EmuTOS is present, then 'ETOS'    */
} OSHEADER;

The structure also appears under the name SYSHDR.

os_conf The component os_conf contains the so-called NTSC/PAL flag in its lowest bit; if this bit is set, then the machine has a PAL video system, if cleared NTSC. The remaining bits contain a country identifier, which can serve to denote the language used for menus etc. for instance. The folowing assignments apply:
 

Value Country
0 to 126 see the define by the _AKP cookie
127 All countries are supported.

Warning: To obtain the language in use, one should fall back not to the OSHEADER if possible, but use the _AKP cookie or the function appl_getinfo (opcode 3).
 
p_root With older TOS versions the address of p_root is 0x56FA (0x7E0A in spanish TOS).
 
p_run
 
BASEPAGE **GetRun (void)
{
  int32_t savessp = Super (0L);
  OSHEADER *O = *((OSHEADER **)(0x4f2L);
  Super ((void *) savessp );

  O = O->os_beg;  /* wegen eines Fehlers in alter AHDI-Version */

  if (O->os_version < 0x102)
  {
    if ((O->os_conf >> 1) == 4)      /* PAL-Modus wegshiften */
      return ((BASEPAGE **)0x873c);  /* Spanish TOS 1.0   */
    else
      return ((BASEPAGE **)0x602c);
  }
  else
    return O->p_run;
}

See also: Kbshift   _sysbase   System variables   System vectors


Home Type definitionsType definitions OHEADEROHEADER PrintDescPrintDesc