This is an old version from the tos.hyp. The new is on GitHub!

HomeBIOSBIOS function listXBIOS

3.11 BIOS Structures

3.11.1 BPB

typedef struct
  WORD   recsiz;       /* Bytes per sector                     */
  WORD   clsiz;        /* Sectors per cluster                  */
  WORD   clsizb;       /* Bytes per cluster                    */
  WORD   rdlen;        /* Directory length                     */
  WORD   fsiz;         /* Length of the FAT in sectors         */
  WORD   fatrec;       /* Start of the 2nd FAT                 */
  WORD   datrec;       /* 1st free sector                      */
  WORD   numcl;        /* Total numbr of clusters              */
  WORD   bflags;       /* Flags as bit-vector                  */
                       /* Bit 0: 0 (12-Bit-FAT), 1 16-Bit-FAT  */
                       /* Bit 1: 0 (two FATs), 1 (one FAT)     */
                       /*        only available since TOS 2.06 */
} BPB ;

See also: Getbpb

3.11.2 MD

typedef struct
     MD *m_link;         /* Next MD (or NULL)          */
     long m_start;       /* saddr of block             */
     long m_length;      /* # bytes in block           */
     PD *m_own;          /* Owner's process descriptor */
} MD;

See also: BIOS   Getmpb   MPB

3.11.3 MPB

typedef struct
    MD *mp_mfl;      /* Memory free list      */
    MD *mp_mal;      /* Memory allocated list */
    MD *mp_rover;    /* Roving ptr            */
} MPB;

See also: BIOS   Getmpb

3.11.4 patternrectdata

struct patternrectdata
  int16_t x1, y1;
  int16_t x2, y2;
  int32_t fg_color;
  int32_t bg_color;
  int16_t mode;
  int32_t *pattern;
  int32_t *patternmask;

See also: _VDI

3.11.5 PUN_INFO

typedef struct
    WORD puns;               /* Number of devices               */
    BYTE pun[16];            /* Various flags                   */
    LONG part_start[16];     /* Partition starts                */
    LONG P_cookie;           /* Must be "AHDI"                  */
    LONG *P_cooptr;          /* Points to the previous element  */
    UWORD P_version;         /* Version number (>= 0x0300)      */
    UWORD P_max_sector;      /* Maximum sector size             */
    LONG  reserved[16];      /* Reserved                        */
puns Contains the number of hard drives found by the hard disk driver.
Bit 0..2: Device number of the hard drive.
Bit 3: With the bit set, this is a device on the SCSI port (otherwise ACSI): Though this bit is not yet officially documented, it can be used without reservation.
Bit 4: Falcon IDE
Bit 5: USB
Bit 6: Removable media
Bit 7: If this bit is set, then the BIOS device is not controlled by the the hard disk driver (applies e.g. for the two floppy disk drives on device numbers 0 and 1).
part_start Contains for each (supported) device number the number of the start sector on the corresponding hard drive.
P_Cokkie Magic value; always "AHDI"
P_cookptr Should always point to the previous structure element.
P_version Version number e.g. 0x0300
P_max_sector Describes the largest occurring block size for BIOS sectors.

Example of how one obtains the address of the structure:

PUN_INFO *GetPunPtr (void)
  int32_t oldstack;

  oldstack = Super (0L);
  P = *((PUN_INFO **)(0x516L));
  Super ((void *)oldstack);

  if (p)
    if (P->P_cookptr == &(P->P_cookie)) /* Cookie ok? */
      if (P->P_version >= 0x300)
        return P;

  return 0L;

See also: XHDI specification   pun_ptr

3.11.6 solidrectdata

struct solidrectdata
  int16_t x1, y1;
  int16_t x2, y2;
  int32_t fg_color;
  int32_t bg_color;
  int16_t mode;

See also: _VDI

HomeBIOSBIOS function listXBIOS