5.3.5 Attribute Data
Attribute data is classi.ed broadly into the following three kinds of data.
- Common attributes
Attributes defined in common for all devices (device drivers).
- Device kind attributes
Attributes defined in common for devices (device drivers) of the same kind.
- Device-specific attributes
Attributes defined independently for each device (device driver).
For the device kind attributes and device-specific attributes, see the specifications for each device. Only the common attributes are defined here.
Common attributes are assigned attribute data numbers in the range from -1 to -99. While common attribute data numbers are the same for all devices, not all devices necessarily support all common attributes. If an unsupported data number is specified, error code epar is returned.
#define TDN_EVENT (-1) /* RW: event notification message buffer ID */
#define TDN_DISKINFO (-2) /* R: disk information */
#define TDN_DISPSPEC (-3) /* R: display device specification */
RW: read (tk_rea_dev)/write (tk_wri_dev) enabled
R: read (tk_rea_dev) only
TDN_EVENT: Event Noti.cation Message Buffer ID
Data typE_ID
The ID of the message buffer used for device event noti.cation. Since the system default message bu.er ID is passed in device registration, that ID is set as the initial setting when a driver is started.
If 0 is set, device events are not noti.ed.
Device event noti.cation is discussed later below.
TDN_DISKINFO: Disk Information
Data type: DiskInfo
typedef enum {
DiskFmt_STD = 0, /* standard (HD, etc.) */
DiskFmt_2DD = 1, /* 2DD 720KB */
DiskFmt_2HD = 2, /* 2HD 1.44MB */
DiskFmt_CDROM = 4, /* CD-ROM 640MB */
} DiskFormat;
typedef struct {
DiskFormat format; /* format */
UW protect:1; /* protected status */
UW removable:1; /* removable */
UW rsv:30; /* reserved (always 0) */
W blocksize; /* block size in bytes */
W blockcount; /* total block count */
} DiskInfo;
See the disk driver speci.cation for details.
TDN_DISPSPEC: Display Device Speci.cation
Data type: DEV_SPEC
typedef struct {
H attr; /* device attributes */
H planes; /* number of planes */
H pixbits; /* pixel bits (boundary/valid) */
H hpixels; /* horizontal pixels */
H vpixels; /* vertical pixels */
H hres; /* horizontal resolution */
H vres; /* vertical resolution */
H color[4]; /* color information */
H resv[6]; /* reserved */
} DEV_SPEC;
See the screen driver speci.cation for details.

Comments