CP/M-86 4.1 XIOS data

The DEVICE utility in Personal CP/M-86 (and probably other utilities as well) uses an XIOS data area in the CP/M data segment. It assumes that the area is at a fixed offset within the XIOS.

To find the correct segment for this data area, call BDOS function 31. This will return the correct segment in ES.

Offsets in the area include:

Offset	Size	Data		Description

0F00h DB tickflag ;If this is nonzero, then, on each tick, the ;system flag change function will be called ;with DL=1. This is set by the BDOS if a ;process is waiting on the timer; it should ;be initialised to 0. 0F01h DB ticks ;Timeslices per second 0F02h DB mflg? ;The "Media changed" flag? Just a guess. 0F03h DB intflg ;Nonzero if the XIOS is servicing an ;interrupt. 0F04h DB nflags ;Number of XIOS system flags? 0F05h DB sys_flags ;Number of system flags 0F06h DB ? ;Byte 0Fh of system console device entry 0F07h DB flag8087 ;Nonzero if 8087 is present ;BUG: In the Amstrad PC1512 DOSPLUS, ;the code to detect the 8087 is buggy, and ;this byte never gets set. Instead some ;code in the code segment is overwritten; ;but fortunately this code is never called. ;This bug is fixed in DOSPLUS 1.2-je2. 0F08h DW drive0 ;This is the equivalent of the CP/M-80 DW drive1 ;drives table. Each entry is the offset ... ;within this segment of the DPH for a drive. DW drive15 0F28h DW physdev0 ;This is the equivalent of the CP/M-80 DW physdev1 ;devices table. Each entry is the offset DW physdev2 ;within this segment of a physical device DW physdev3 ;descriptor (eg: CON0 or PRN0). ... ;If all entries are 0, device redirection is DW physdev15 ;not supported. 0F48h DW lconin ;Device assignment for CONIN: DW lconout ;Device assignment for CONOUT: DW lauxin ;Device assignment for AUXIN: DW lauxout ;Device assignment for AUXOUT: DW llst ;Device assignment for LST: ;Device assignments are also stored as the ;offset of a physical device descriptor. ;CONOUT: AUXOUT: and LST: can have more ;than one physical device attached; this ;is done using a linked list. 0F52h DD 0 ;? 0F56h DW mem_table ;32 entries, each of 6 bytes. An entry is: ; DW segment of area ; DW length of area (paragraphs) ; DW status (0FEh is free; 0FFh is an ; unused entry) 1016 DW bdos_messages ; The addresses of 13 messages in this ; segment. Doing the messages like this ; allows national language versions to be ; put in (for example by N.CMD). ; The messages ($-terminated) are: ; 'Cannot load program' ; 'Cannot load CCP' ; 4,'USER' ; 'CP/M Error On ' ; 'BDOS function=' ; 'File=' ; 'Disk Read/Write Error' ; 'Read-Only Disk' ; 'Read-Only File' ; 'Invalid Drive' ; 'Password Error' ; 'File Exists' ; '? in Filename'

This area ends at 1030h; after that, the XIOSes diverge. However, the DOSPLUS CCP also depends on this variable:

1054	DW	ccp_msg		; The address of a table of CCP messages
				; in this segment.

Format of the physical device descriptor is:

Offset  Size    Data            Description

0 6 'NAME ' ;Physical device name 6 DW devmask ;Bitmap of supported protocol options ;Bit 0: XON/XOFF ;Bit 1: ETX/ACK ;Bit 2: RTS ;Bit 3: DTR ;Bit 4: DTR/RTS polarity ;Bit 5: Odd parity ;Bit 6: Even parity ;Bit 7: Mark parity ;Bit 8: Space parity ;Bit 9: 5 databits ;Bit 10: 6 databits ;Bit 11: 7 databits ;Bit 12: 8 databits ;Bit 13: 1 stop bit ;Bit 14: 1.5 stop bits ;Bit 15: 2 stop bits 8 DW devflags ;Bits 0-3: Protocol (only one can be set) ;Bit 0: XON/XOFF ;Bit 1: ETX/ACK ;Bit 2: RTS ;Bit 3: DTR ;Bit 4: Polarity (1=high 0=low) ;Bit 5: ? ;Bits 6-7: Parity (0=Odd 1=Even 2=Mark 3=Space) ;Bits 8-9: No. of data bits minus 5 ;Bits 10-11: No. of stop bits (0=>1 1=>1.5 2=>2) ;Bits 12-15: Unused A DW count ;Device buffer size? C DB txbaud ;Transmit baud rate D DB rxbaud ;Receive baud rate E DB type ;Device flags: ; Bit 0 set if device can input ; Bit 1 set if device can output ; Bit 2 set if baud rate can be set ; Bit 3 set if device is serial ; Bit 4 set if device provides 'coblock' ; Bit 5 set if device provides 'aiblock' ; Bit 6 set if device provides 'aoblock' F DB ? 10 DB ? 11 DB ? 12 DW nextcon ; Next device in CONOUT: linked list; 0 for end 14 DW nextaux ; Next device in AUXOUT: linked list 16 DW nextlst ; Next device in LST: linked list 18 DW initdev ; Offsets of functions in XIOS code segment: ; Initialise device (DEVINI) 1A DW inputdev ; Read character from device into AX (CONIN) 1C DW instatdev ; Return input ready status in AL (CONST) 1E DW outputdev ; Write character in CL to device (CONOUT) 20 DW ostatdev ; Return output ready status in al (CONOST) 22 DW coblock ; Output fixed-size buffer to console 24 DW aiblock ; Read fixed-size buffer from aux: input 26 DW aoblock ; Output fixed-size buffer to aux: output 28 DW ? 2A DW ? 2C DW ? 2E DW aux_trans ; Translation table for auxiliary devices 30 DW ? 32 DW lpt_trans ; Translation table for print devices
Baud rates are: 0 => None 1 => 50 2 => 62.5 3 => 75 4 => 110 5 => 134.5 6 => 150 7 => 200 8 => 300 9 => 600 A => 1200 B => 1800 C => 2000 D => 2400 E => 3600 F => 4800 10=> 7200 11=> 9600 12=> 19200 13=> 38400 14=> 56000 15=> 76800 16=> OEM1 17=> OEM2 18=> OEM3

Translation tables are used to change the characters being output to the printer or communications ports - for example, to translate the screen codepage to the printer codepage.


John Elliott 4-4-2001