GeneveOS Device Operation

From Ninerpedia
Revision as of 20:06, 22 July 2016 by Mizapf (talk | contribs)
Jump to navigation Jump to search

Accessing devices (floppy disk, hard disk, serial connector, printer) is possible in GeneveOS via XOP calls.

User-task XOPs

User-task XOPs are available for use in application programs. Here is a typical example:

PABADD EQU  >F180   
       LI   R0,PABADD
       XOP  @FILE,0
       MOVB @PABADD+2,R0
       JNE  ERROR

Similar as with the TI-99/4A device service routine concept (DSR), a Peripheral Access Block (PAB) must be set up prior to invoking the XOP.

Device Service Routine Call

Input Output
R0 Pointer to PAB -

The actual operation is contained in the Peripheral Access Block (PAB).

Peripheral Access Block

While the TI-99/4A DSRs expect the PAB to be stored in VDP RAM, the Geneve OS DSRs use CPU RAM for the PAB, which means the PAB need not be copied to the video RAM before use. Also, you can choose to have the I/O buffers in VDP or CPU RAM.

The general layout of the PAB is as follows:

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 ...
Opcode Mode Error code Buffer address Record number Record length Memory type Character count Status byte Name length Name