1066-2023-001 Concurrent DOS 86 Programmers Guide Version 5.0 Mar1986
1066-2023-001 Concurrent DOS 86 Programmers Guide Version 5.0 Mar1986
PROGRAMMER'S GUIDE
Version 5.0
1066-2023-001
COPYRIGHT
Copyright©1986 Digital Research Inc. All rights reserved. No part of this
publication may be reproduced, transmitted, transcribed, stored in a retrieval
system. or translated into any language or computer language, in any form or by
any means, electronic, mechanical, magnetic, optical, chemical, manual or
otherwise, without the prior written permission of Digital Research Inc., P.O. Box
DRI, Monterey, California 93950.
DISCLAIMER
DIGITAL RESEARCH INC. MAKES NO REPRESENTATIONS OR WARRANTIES WITH
RESPECT TO THE CONTENTS HEREOF AND SPECIFICALLY DISCLAIMS ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE.
Further, Digital Research Inc. reserves the right to revise this publication and to
make changes from time to time in the content hereof without obligation of Digital
Research Inc. to notify any person of such revision or changes.
NOTICE TO USER
This manual should not be construed as any representation or warranty with
respect to the software named herein. Occasionally, changes or variations exist in
the software that are not reflected in the manual. Generally, if such changes or
variations are known to exist and to affect the product significantly, a release note
or README.DOC file accompanies the manual and distribution disk(s). In that
event, be sure to read the release note or README.DOC file before using the
product.
TRADEMARKS
CP/M, CP/M-86, and Digital Research and its logo are registered trademarks of
Digital Research Inc. DR Assembler Plus Tools, Concurrent. Concurrent CP/M,
Concurrent PC DOS, GEM. LINK-86, LIB-86, MP/M, MP/M-86, RASM-86, and SID-86
are trademarks of Digital Research Inc. We Make Computers Work is a service
mark of Digital Research Inc. AST and RAMpage! are trademarks of AST Research,
Inc. MS-DOS is a registered trademark of Microsoft Corporation. IBM is a
registered trademark of International Business Machines, Corp. Intel is a registered
trademark of Intel Corp. Lotus is a registered trademark of Lotus Developement
Corp. CompuPro is a registered trademark of Viasyn Corp, a Godbout Company.
Contents
ii
Contents
iii
Contents
10 WINDOW MANAGEMENT
Appendices
Figures
iv
Contents
Tables
v
Contents
vi
Contents
Listings
vii
Foreword
Concurrent TM DOS 86 (hereinafter cited as Concurrent) is a multi- or single-user
operating system targeted specifically for the lntel®8086/8088/80186/80286 family
of micro-processors. It supports multiple CP/M™ or DOS 1 programming
environments each implemented on a virtual console. A different task can run
concurrently in each environment.
Intended audience
This manual is primarily a reference tool intended for experienced programmers. It
is not a tutorial on programming. It assumes you are already familiar with general
aspects of assembly-language programming and in particular, Intel microprocessor
architecture. It also assumes you are familiar with the hardware components of
your own system.
* Section 7 describes all the PC DOS system calls that Concurrent supports.
Notation conventions
The following notation conventions are used throughout this manual:
2RASM-86, LINK-86. LIB-86 and SID-86 are sold together as DR Assembler Plus Tools TM
2
SECTION 1
1.1 Introduction
1-1
1.1 Introduction Concurrent DOS 86 Programmer's Guide
* The shared file system allows multiple programs to access common data files
while maintaining data integrity.
* Shared code support eliminates loading multiple copies of the same program
and conserves memory space.
* Virtual console handling lets a single user run multiple programs, each in its
own console environment.
1-2
Concurrent DOS 86 Programmer's Guide 1.1 Introduction
* The Memory Management module (MEM) allocates and frees memory upon
demand from executing processes.
* The Character 1/0 module (CIO) handles all character 1/0 for console, list. and
auxiliary devices.
* The Virtual Console Screen Manager extends the CIO to support virtual
console environments.
The Supervisor module (SUP) manages the interface between processes and
Concurrent's multitasking nucleus. It also manages internal communication
between the other Concurrent modules. All system calls, whether they originate
from a transient process or internally from another system module, go. through a
common table-driven function interface in SUP. SUP also handles the P_LOAD
(Load Process) and P_CLI (Call Command Line Interpreter) calls.
1-3
1.3 Real-time Monitor (RTM) Concurrent DOS 86 Programmer's Guide
The primary task of the RTM is to transfer, or dispatch, the CPU resource from one
process to another. The RTM module called the Dispatcher performs this task.
The RTM maintains two data structures, the Process Descriptor (PD) and the User
Data Area (UDA). for each process running under Concurrent. The Dispatcher uses
these data structures to save and restore the current state of each running
process.
Each process in the system resides in one of three states: ready, running, or
suspended. A ready process is one that is waiting for the CPU resource only. A
running process is one that the CPU is currently executing. A suspended process
is one that is waiting for a system resource or a specified event, such as the
occurrence of an interrupt, an indication that polled hardware is ready, or the
expiration of a delay period.
Every existing process is represented on a system list. The Dispatcher removes a
process from one list and places it on another. The Process Descriptor of the
currently running process is the first entry on the Ready List. Other processes
ready to run are represented on the Ready List in priority order. Suspended
processes are on other system lists, depending on why the processes were
suspended.
Process dispatching can be summarized as follows:
1. The Dispatcher suspends the process from execution and stores its current
state in the Process Descriptor and the UDA.
2. The Dispatcher places the process on an appropriate system list, depending
on why the Dispatcher was called. For example, if a process is to delay for a
certain number of system ticks, the Dispatcher places its Process Descriptor
on the Delay List. When a process releases a resource, the Dispatcher usually
places the process back on the Ready List. If another process is waiting for
the resource, the Dispatcher removes that process from its current system list
and places it on the Ready List.
3. The Dispatcher chooses the highest priority process on the Ready List for
execution. If two or more processes have the same priority, the process that
has waited the longest executes first.
4. The Dispatcher restores the state of the selected process from its Process
Descriptor and UDA, and gives it the CPU resource.
1-4
Concurrent DOS 86 Programmer's Guide 1.3 Real-time Monitor (RTM)
* a specified number of system clock ticks before it can be removed from the
system Delay List.
1-5
1.3 Real-time Monitor (RTM) Concurrent DOS 86 Programmer's Guide
When the Q_MAKE call creates a queue, the queue is assigned a unique 8-
character name. As the name queue implies, messages are read from a queue on
a first-in, first-out basis.
A process can read from or write to a queue conditionally or unconditionally. If
the queue is empty when a conditional read is performed, or full when a
conditional write is performed, Concurrent returns an Error Code to the calling
process. However. if a process attempts an unconditional queue operation in
these circumstances, Concurrent suspends it from execution until the operation
becomes possible.
More than one process can wait to read or write a queue message from the same
queue at the same time. When these operations become possible, Concurrent
restores the highest priority process first; processes with the same priority are
restored on a first-come, first-served basis.
Mutual exclusion queues are a special type of queue under Concurrent. They
contain one message of zero length and their names follow a convention,
beginning with the upper-case letters MX. A mutual exclusion queue acts as a
binary semaphore, ensuring that only one process uses a resource at any time.
Access to a resource protected by a mutual exclusion queue takes place as
follows:
2. When the message becomes available, the process accesses the protected
resource. Note that from the time the process issues the unconditional read.
any other process attempting to access the same resource is suspended.
3. The process writes the zero-length message back to the queue when it has
finished using the protected resource, thus freeing the resource for other
processes.
As an example, the system mutual exclusion queue, MXdisk. ensures that
processes cannot access the file system simultaneously. Note that the BOOS, not
the application software, executes the preceding series of queue calls. Therefore,
the mutual exclusion process is transparent to the programmer, who is only
responsible for originating the disk system calls.
Mutual exclusion queues differ from normal queues in another way. When a
process reads a message from a mutual exclusion queue, the RTM notes the
Process Descriptor address within the Queue Descriptor. This establishes the
owner of the queue message. If Concurrent aborts the process while it owns the
mutual exclusion message, the RTM automatically writes the message back to all
mutual exclusion queues whose messages are owned by the aborted process.
This grants other processes access to protected resources owned by the aborted
process.
1-6
Concurrent DOS 86 Programmer's Guide 1.3 Real-time Monitor (RTM)
1-7
1.4 Memory Management Module (MEM) Concurrent DOS 86 Programmer's Guide
Concurrent supports EMM through the Memory Manager (MEM), Real-time Monitor
(RTM), and the XIOS functions that enable it to perform a technique called memory
paging. Concurrent dynamically maps regions (usually 16K bytes) of physical
memory in and out of the 1Mb logical address space accessible to the processor.
The regions of physical memory are called pages, and the areas in the processor's
logical address space into which pages are mapped are called logical address
windows, or simply windows.
1-8
Concurrent DOS 86 Programmer's Guide 1.4 Memory Management Module (MEM)
+---------------+
Application
+-------v-------+
I
+-------------+ I
Supervisor I I
+----------v--+ I
I I
v v
+-------------+ +-------------+
RTM MEM
+----------v--+ +--v----------+
v v
+-------------+
XIOS
+------v------+
v
+-----------------+
I Expanded Memory I
I Hardware I
+-----------------+
Figure 1-2. Generic Environment Memory Paging Interfaces
EMM Environment
In the EMM environment, the XIOS passes all memory page allocation and release
requests to the EMM Driver, which handles the page mapping hardware. Calls into
the XIOS are translated to EMM Driver calls, and the EMM Driver is invoked with an
Interrupt 67H.
An application running in the EMM environment can make calls directly to the EMM
Driver, but the Interceptor module intercepts such calls so Concurrent can handle
context switching and memory deallocation for aborted processes. To reserve
some memory for system use, the Interceptor might not allow an application to
know the total number of available memory pages.
The Interceptor's primary functions are creating and linking new Memory Page
Allocation Descriptors (MPADs) as an application performs EMM Allocate calls.
The Interceptor destroys these MPADs when the application performs an EMM
Close call. These functions allow the Interceptor to track an application's calls to
the EMM Driver. The MPAD data structure is described in the System Guide.
Figure 1-3 illustrates the interfaces within the EMM environment.
1-9
1.4 Memory Management Module (MEM) Concurrent DOS 86 Programmer's Guide
+---------------+
Application
+----v-----v----+
+--------------+ I
Supervisor I
+-----------v--+ I
I I
v v
+-------------+ +-------------+
RTM MEM
+----------v--+ +--v----------+
I I
v v
+-------------+
XIOS
+----------v--+
I
v v
+-------------------+
Interceptor
+---------v---------+
v
+-------------+
EMM Driver I
+------v------+
v
+-----------------+
I Expanded Memory I
I Hardware I
+-----------------+
Figure 1-3. EMM Environment Memory Paging
1-10
Concurrent DOS 86 Programmer's Guide 1.4 Memory Management Module (MEM)
* Shared access to files. As a special option, independent users can open the
same file in Shared or Unlocked mode. Concurrent supports record locking
and unlocking commands for files opened in this mode and protects files
opened In Shared mode from deletion by other processes.
* Date Stamps. The BOOS optionally supports two time and date stamps, one
recording when a file is updated, and the other recording when the file was
created or last accessed. 1
* Extended Error Module. Besides the default error mode. Concurrent has two
optional error-handling modes that return an error code to the calling process
in the event of an irrecoverable disk error.
The Character 1/0 module handles all console, list, and auxiliary device 1/0. Every
character 1/0 device is associated with a data structure called a Console Control
Block (CCB) or a List Control Block (LCB). These data structures reside in the
XIOS.
1-11
1.6 Character 1/0 Module (CIO) Concurrent DOS 86 Programmer's Guide
The CCB contains the current owner, status information, line editing variables, and
the root of a linked list of Process Descriptors (PDs) that are waiting for access.
More than one process can wait for access to a single console. These processes
are maintained on a linked list of Process Descriptors in priority order. The LCBs
contain similar information about the list devices. See the ffitem Guide for more
information about LCBs and CCBs.
1-12
Concurrent DOS 86 Programmer's Guide 1.7 Virtual Console Screen Management
c
All of the above control keys can be disabled by the _MODE call. When one of
the above control characters is disabled with C_MODE, or when the process
owning the virtual console is using the C_RAWIO call, the PIN does not act on the
control character but instead writes it to the VINO. It is thus possible to read any
of the above control characters from an application program. These control keys
are discussed in the User's_Q_uide.
The XIOS module is similar to the CP/M-86 Basic Input/Output System (BIOS)
module, but it is extended in several ways. Primitive operations, such as console
1/0, are modified to support multiple virtual consoles. Several additional primitive
system calls, such as DEV_POLL, support Concurrent's additional features, including
elimination of wait loops for real-time 1/0 operations.
Terminal Message Processes (TMPs) are resident system processes that accept
command lines from the virtual consoles and call the Command line Interpreter
(CU) to execute them. The TMP prints the prompt on the virtual consoles. Each
virtual console has an independent TMP defining that console's environment.
including default disk, user number, printer, and console.
When a Concurrent process makes a system call, it loads values into the registers
shown in Table 1-1 and initiates Interrupt 224 (via the INT 224 instruction),
reserved by the Intel Corporation for this purpose.
1-13
1.11 System Call Calling Conventions Concurrent DOS 86 Programmer's Guide
Entry Parameters
Return Values
BX: Same as AX
CX: Error Code
Concurrent preserves the contents of registers SI, DI. BP, SP, SS, OS, and CS
through the system calls. The ES register is preserved when it is not used to hold
a return segment value. Error codes returned in CX are shown in Table 6-5, "CX
Error Codes:
The SYSTAT utility is a development tool that can show Concurrent's internal state
including memory allocation, current processes, system queue activity, and many
informative parameters associated with these system data structures.
SYSTAT can present two views: either a static snapshot of system activity, or a
continuous, real-time window into Concurrent.
You can specify SYSTAT in one of two modes. If you know which display you
want, you can specify it in the invocation, using an option shown in the menu
below. If you do not specify an option, select a display from this menu by typing
A>SYSTAT <er>
The screen clears and the main menu appears:
1-14
Concurrent DOS 86 Programmer's Guide 1.12 SYSTAT: System Status
Which Option?
H(elp)
M(emory)
O(verview)
P(rocesses - All)
Q(ueues)
U(ser Processes)
C(onsoles)
E(xit)
->
Press the appropriate letter to obtain a display.
When you select H(elp), the HELP file demonstrates the proper syntax and available
options:
SYSTAT [option]
SYSTAT [option C]
SYSTAT [option C ##]
-where-
-> c Continuous display
## 1-2 digits indicating the period,
in seconds, between display refreshes.
-> option
M(emory) P(rocesses) O(verview) C(onsols)
U(ser Processes) Q(ueues) H(elp)
The M. P. O. and U and C options ask you if you prefer a continuous display. If
you type y, Concurrent asks for a time interval, in seconds, and then displays a
real-time window of information. If you type n, a static snapshot of the requested
information appears. In either case, press any key to return to the menu.
1-15
1.12 SYSTAT: System Status Concurrent DOS 86 Programmer's Guide
The M(emory) option displays all memory potentially available to you, but It does
not display restricted memory. The partitions are listed in memory-address order.
Length parameter is shown in paragraph values.
The O(verview) option displays an overview of the system parameters, as specified
at system generation time. The display is not continuous.
The P(rocesses) option displays all system processes and the resources they are
using.
The Q(ueues) option displays all system queues, listing queue readers. writers, and
owners.
The U(ser Processes) option displays only user-initiated processes in the same
format as the P(rocess) option.
The C(onsoles) option displays console information; for example, back.ground,
foreground, buffered, suspended, purging, and CTRL-0.
The E(xit) option returns you to system level from the menu. as does CTRL-C.
End of Section 1
1-16
SECTION 2
The Basic Disk Operating System (BOOS) file system supports from one to thirteen
logical drives. Each logical drive has two regions; a directory area and a data
area. The directory area defines the files that exist on the drive and identifies the
data area space that belongs to each file. The data area contains the file data
defined by the directory.
The directory area consists of sixteen logically independent directories, which are
Identified by user numbers 0 through 15. During execution, a process runs with a
system parameter called the user number set to a single value. The user number
specifies the current active directories for all drives on the system. For example,
Concurrent's DIR utility displays only files within a directory selected by the
current user number.
The file system automatically allocates directory and data area space when a
process creates or extends a file, and returns previously allocated space to free
space when a process deletes or truncates a file. If no directory or data space is
available for a requested operation, the BOOS returns an error code to the calling
process. The allocation and retrieval of directory and data space is transparent to
the process making file system calls.
An eight-character filename and a three-character filetype field identify each file in
a directory. Together, these fields must be unique for each file within a directory.
However, files with the same filename and filetype can reside in different user
directories without conflict. Processes can also assign an eight-character
password to a file to protect it from unauthorized access.
All system calls that involve file operations specify the requested file by filename
and filetype. For some system calls, multiple files can be specified by a technique
called ambiguous reference whereby question marks and asterisks are used as
wildcard characters to give the file system a pattern to match as it searches a
directory.
The file system supports two categories of system calls: file-access calls and
drive-related calls. The file-access calls have mnemonics beginning with F_. and
the drive-related calls have mnemonics beginning with ORV . The next two
sections introduce the file system calls.
2-1
2. 1 File System Overview Concurrent DOS 86 Programmer's Guide
System calls in the first file-access group include calls to search for one or more
files, delete one or more files, rename or truncate a file, set file attributes, assign a
password to a file, and compute the size of a file. Also included in this group are
system calls to open a file, to create a file, and to close a file.
The second file-access group includes system calls to read or write records to a
file, either sequentially or randomly, by record position. BOOS read and write
system calls transfer data in 128-byte units, which is the basic record size of the
file system. This group also includes system calls to lock and unlock records and
thereby allow multiple processes to coordinate access to records within a
commonly accessed file.
Before making read, write, lock. or unlock system calls for a file, you must first
open or create the file. Creating a file has the side effect of opening the file for
record access. In addition, because Concurrent supports three different modes of
opening files (Locked, Unlocked, and Read-Only), there can be other restrictions on
system calls in this group that are related to the open mode. For example, you
cannot write to a file that you have opened in Read-Only mode.
After a process has opened a file, access to the file by other processes is
restricted until the file is closed. Again, the exact nature of the restrictions
depends on the open mode. However, in all cases the file system does not allow
a process to delete, rename, or change a file's attributes if another process has
opened the file. Thus, F_CLOSE performs two steps to terminate record access to
a file. It permanently records the current status of the file in the directory and
removes the open-file restrictions limiting access to the file by other processes.
The miscellaneous file-access system calls include calls to set the current user
number. set the OMA address, parse an ASCII file specification and set a default
password. This group also includes system calls to set the BOOS Multisector
Count and the BOOS Error Mode. The BOOS Multisector count determines the
number of 128-byte records to be processed by the read, write, lock. and unlock
system calls. The Multisector count can range from 1 to 128; the default value is
one. The BOOS Error Mode determines whether the file system intercepts certain
errors or returns on all errors to the calling process.
2-2
Concurrent DOS 86 Programmer's Guide 2.1 File System Overview
Logging in a drive initializes the drive for directory and file operations. A drive
reset call prepares for a media change on drives that support removable media.
Under Concurrent, drive reset calls are conditional. A process cannot reset a drive
if another process has a file open on the drive.
Table 2-1 summarizes the BOOS file system calls.
Mnemonic Description
2-3
2.1 File System Overview Concurrent DOS 86 Programmer's Gulde
Mnemonic Description
The following sections contain information on important topics related to the file
system. Read these sections carefully before attempting to use the system calls
described individually in Section 6.
Under Concurrent, a file specification has four parts: a drive specifier, the filename
field, the filetype field, and the file password field. The general format for a
command line file specification is shown below:
{d:} filename {.typ} {;password}
The drive specifier is a letter (A,B,C, etc.), where the actual drive letters supported
on a given system are determined by the XIOS. When no drive letter is specified,
Concurrent assumes the current default drive.
The filename and password fields can contain one to eight nondelimiter characters.
The filetype field can contain one to three nondelimiter characters. All three fields
are padded with blanks, if necessary.
The drive, type, and password fields are optional, and the delimiters : . ; are
required only when specifying their associated fields. Omitting the optional type
or password fields implies a field specification of all blanks.
Under Concurrent, the P_cu call . interprets ASCII command lines and loads
programs. P CLI in turn calls F PARSE to parse file specifications from a command
line. F_PARSE recognizes certain ASCII characters as delimiters when it parses a
file specification. These characters are shown in Table 2-2.
2-4
Concurrent DOS 86 Programmer's Guide 2.2 File Naming Conventions
null OOOH
space 020H
return OODH
tab 009H
03AH
02EH
03BH
03DH
02CH
05BH
05DH
< 03CH
> 03EH
I 07CH
F_PARSE also excludes all control characters from the file specification fields and
translates all lowercase letters to uppercase.
Avoid using parentheses and the backslash character, \. in the filename and filetype
fields because they are commonly used delimiters. Use asterisk and question mark
characters. * and ?, only to make an ambiguous file reference. When F_PARSE
encounters an asterisk in a filename or filetype field, it pads the remainder of the
field with question marks.
For example, a filename of X"." is parsed to X???????.???. F_SFIRST. F_SNEXT, and
F_DELETE all match a question mark in the filename or filetype fields to the
corresponding position of any directory entry belonging to the current user
number. Thus. a search operation for X???????.??? finds all the files in the current
user directory beginning in X. Most other file-access calls treat a question mark in
the filename or filetype fields as an error.
It is not mandatory to follow Concurrent's file naming conventions when you
create or rename a file with BOOS system calls directly from an application
program. However, the conventions must be used if the file is to be accessed
from a command line. For example, P_CLI cannot locate a command file in the
directory if its filename or filetype field contains a lowercase letter.
As a general rule. the filetype field names the generic category of a particular file,
and the filename field distinguishes individual files within each category. Although
they are generally arbitrary, Table 2-3 lists some of the generic filetype categories
that have been established.
2-5
2.2 File Naming Conventions Concurrent DOS 86 Programmer's Guide
Filetype Description
The file system can support up to thirteen logical drives. identified by the letters A
through M. A logical drive usually corresponds to a physical drive on the system,
particularly for physical drives that support removable media such as floppy disks.
High-capacity hard disks, however, are commonly divided up into multiple logical
drives.
If a disk contains system tracks reserved for the boot loader, these tracks precede
the tracks of the disk mapped by the logical drive. In this manual, references to
drives means logical drives, unless explicitly stated otherwise.
The maximum file size supported on a drive is 32 megabytes. The maximum
capacity of a drive is determined by the data block size specified for the drive in
the XIOS. The data block size is the basic unit in which the BOOS allocates space
to files. Table 2-4 displays the relationship between data block size and total drive
capacity.
2-6
Concurrent DOS 86 Programmer's Guide 2.3 Disk Drive and File Organization
lK 256 kilobytes
2K 64 megabytes
4K 128 megabytes
SK 256 megabytes
16K 512 megabytes
Each drive is divided into two regions: a directory area and a data area. The
directory area contains from one to sixteen blocks located at the beginning of the
drive. The actual number is set in the XIOS. Directory entries residing in this area
define the files that exist on the drive. In addition, the directory entries belonging
to a file identify the data blocks in the drive's data area that contain the file's
records.
The directory area is logically subdivided into sixteen independent directories
identified as user O through 15. Each independent directory shares the actual
directory area on the drive.
Each disk file may consist of a set of up to 262, 144 (40000H) 128-byte records.
Each record is identified by its position in the file, which is called the record's
Random Record Number. If a file is created sequentially, the first record has a
position of zero, while the last record has a position one less than the number of
records in the file. Such a file can be read sequentially, beginning at record zero,
or randomly by record position.
Conversely, if a file is created randomly, records are added to the file by specified
position. A file created in this way is called sparse if positions exist within the file
where a record has not been written (on CP/M media files only.)
The BOOS automatically allocates data blocks to a file to contain the file's records
on the basis of the record positions consumed. Thus, a sparse file that contains
two records, one at position zero, the other at position 262, 143, consumes only
two data blocks in the data area. Sparse files can be created and accessed only
randomly, not sequentially.
Note that any data block allocated to a file is permanently allocated until the file is
deleted or truncated. These are the only mechanisms supported by the BOOS for
releasing data blocks belonging to a file.
Source files under Concurrent are treated as a sequence of ASCII characters.
where each line of the source file is followed by a carriage return/line-feed
sequence, OOH followed by OAH. Thus, a single 128-byte record could contain
several lines of source text. The end of an ASCII file is denoted by a CTRL-Z
character (1AH), or a real end-of-file, returned by the BOOS read system call.
2-7
2.3 Disk Drive and File Organization Concurrent DOS 86 Programmer's Guide
Note that these source file conventions are not supported in the file system
directly but are followed by Concurrent utilities such as TYPE and RASM-86. In
addition, CTRL-Z characters embedded within other types of files such as CMD
files do not signal end-of-file.
The File Control Block (FCB) is a system data structure that serves as an important
channel for information exchange between a process and BOOS file-access system
calls. A process initializes an FCB to specify the drive location, filename and
filetype fields, and other information that is required to make a file-access call.
For example, in an F_OPEN call, the FCB specifies the name and location of the file
to be opened. In addition, the file system uses the FCB to maintain the current
state and record position of an open file.
Some file-access system calls use special fields within the FCB for invoking
options. Other file-access system calls use the FCB to return data to the calling
program. All BOOS random 1/0 system calls require the calling process to specify
the Random Record Number in a 3-byte field at the end of the FCB. Some file-
access system calls use a modified FCB to perform special DOS-directory related
operations when accessing DOS media files.
When a process makes a BOOS file-access system call, it passes an FCB address
to the BOOS. This address has two 16-bit components: register DX, which
contains the offset, and register OS, which contains the segment. The length of
the FCB data area depends on the BOOS system call. For most system calls. the
minimum length is 33 bytes. For F READRAND, F WRITERAND, F WRITEZF, F LOCK,
F_UNLOCK, F_RANDREC, F_SIZE, and- F_TRUNCATE.- the minimum - FCB length- is 36
bytes. When F_OPEN or F_MAKE open a file in Unlocked mode, the FCB must be at
least 35 bytes long.
Figure 2-1 shows the FCB data structure.
+--------------------------------------------------+
OOH I DR I Fl I F2 I F3 I F4 I F5 I F6 I F7. . • I
1--------------------------------------------------1
08H I F8 I Tl I T2 I T3 I EX I CS I RS I RC I
1--------------------------------------------------1
lOH I DO I Dl I 02 I D3 I 04 I D5 I D6 I D7. • • I
1--------------------------------------------------1
18H I oa I D9 I 010 I 011 I 012 I Dl3 I Dl4 I Dl5 I
20H
!--------------------------------------------------+
I CR I RO I Rl I R2 I
+-----------------------+
Figure 2-1. FCB - File Control Block
2-8
Concurrent DOS 86 Programmer's Guide 2.4 File Control Block Definition
Field Definitions
DR Contains the Drive Code, with 0 for the default drive, 1 for
drive A, 2 for drive B. etc. Note that drives N, 0, and P are
reserved for Concurrent.
F1 ... F8 Contain the filename in ASCII uppercase. The high-order
bits of Fl...F8 are called attribute bits (see Table 2-8 and
Table 2-12).
Tl ...T3 Contain the filetype in ASCII uppercase. The high-order
bits of Tl ... T3' are called attribute bits (see Table 2-7).
EX Contains the current extent number. This field is usually
set to O by the calling process, but it can range from O to
31 during file 1/0.
cs Contains the FCB checksum value for open FCBs.
RS Reserved for internal system use
RC Record count for extent EX. This field takes on values from
0 to 255 (values greater than 128 imply a record count of
128).
DO ... D15 Normally filled in by Concurrent and reserved for system
use. Also used to specify the new filename and filetype
with F RENAME.
CR Current record to read or write in a sequential file
operation. This field is normally set to zero by the calling
process when a file is opened or created.
RO,R1,R2 Optional Random Record Number in the range 0-262,143
(0- 3FFFFH). RO, Rl, R2 constitute an 18-bit value with low
byte RO, middle byte R 1, and high byte R2. Note: The 2-
byte File ID is returned in bytes RO and Rl of the FCB when
a file is successfully opened in Unlocked mode (see Section
2.10).
2-9
2.4 File Control Block Definition Concurrent DOS 86 Programmer's Guide
2-10
Concurrent DOS 86 Programmer's Guide 2.4 File Control Block Definition
The BOOS updates the memory copy of the FCB during file processing to maintain
the current position within the file. During file write operations. the BOOS also
updates the memory copy of the FCB to record the allocation of data blocks to the
file. At the termination of file processing, F CLOSE permanently records this
information on disk. -
Note that the BOOS does not record the data blocks allocated to a file during write
operations in the disk directory until the calling process issues an F_CLOSE call.
Therefore, a process that creates or modifies files must close the files at the
termination of file processing. Otherwise, data might be lost.
Figure 2-2 shows an FCB initialized for directory operations with DOS media files.
7 6 5 4 3 2 1 0
+---+-----------+----------------+ +----------+---------+
fl(O(O(O(DRVCODE( DIRECTORY NAME 1 ••• 1 DIR TYPE f EXTENT# I
+---------------+----------------+ +----------+---------+
Byte: 00 01 . • • 09 • • • 12
Figure 2-2. FCB Initialized for a DOS Directory
2-11
2.4 File Control Block Definition Concurrent DOS 86 Programmer's Guide
The calling process sets the high-order bit of byte 0 in the FCB and places the
drive code in the remainder of byte 0. Bytes 01 through 08 are initialized with the
directory name, and bytes 09 through 11 contain the directory type field.
The calling process initializes the Extent field (byte 12) to a value of 0, or sets it to
a floating-drive code. To specify a floating drive, set byte 12 to 1 for N, 2 for 0,
or 3 for P. This will map the appropriate floating drive to the drive and directory
specified in the FCB.
Note that when a process calls F_SFIRST (11H) or F_SNEXT (12H) to locate a DOS
directory FCB, it must set the first bit of the referenced FCB. Concurrent clears
this bit following these calls. Without the first bit of the referenced FCB set on
F_SFIRST and F_SNEXT calls, Concurrent will not search for any DOS directory
FCBs.
The first two bytes of the Disk Map field in the FCB (beginning at offset lOH) have
special meaning when a process reads or writes to DOS media. Table 2-6 shows
the values these bytes have for DOS media file 1/0.
Dl 1 lH Same as DO
Bytes D6 through D9 (16H-19H) also have special meaning for processes reading
from or writing to files on DOS media. These bytes contain the time of day and
date the DOS media file was created or last updated. This information is mapped
to the bits of D6-D9 as shown in Figure 2-3.
2-12
Concurrent DOS 86 Programmer's Guide 2.4 File Control Block Definition
h h h h h m m m m m m s s s s s
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
Y Y Y Y Y Y Y M M M M D D D D D
15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
You can perform the following steps to determine the type of medium in the
current default drive:
1. Call F_SFIRST with byte O of the referenced FCB set to a question mark. This
returns the first FCB in the directory.
2. Read byte 0 of the first directory FCB to identify the directory label. If this
byte has a value of 32 (20H), the returned FCB is a directory label. Any other
value indicates CP/M media.
3. Read byte OFH of the directory label; a value of 80H indicates DOS media.
Any other value indicates CP/M media.
2-13
2.4 File Control Block Definition Concurrent DOS 86 Programmer's Gulde
Note: The file system ignores the file attribute bits when it attempts to locate a
file in the directory.
Table 2-7 shows the definitions for file attributes T1',T2', and T3'.
Attribute Definition
2-14
Concurrent DOS 86 Programmer's Guide 2.4 File Control Block Definition
F DELETE F5' = 1 : Delete file XFCBs only and Maintain extended file lock
Section 6 details the above interface attribute definitions for each of the preceding
system calls. Note that the BOOS always resets interface attributes F5' and F6'
before returning to the calling process. Interface attributes F7' and F8' are
reserved for internal use by the file system.
2-15
2.5 User Number Conventions Concurrent DOS 86 Programmer's Guide
2-16
Concurrent DOS 86 Programmer's Guide 2.6 Directory Labels and XFCBs
The file system includes three special types of FCBs: the directory label and the
XFCB, described in this section, and the SFCB, described in detail in Section 2.8.
The directory label specifies for its drive whether password support is to be
activated, and if date and time stamping for files is to be performed.
Figure 2-4 shows the format of the directory label.
+-------------------------------------------------------+
IDRINamelTypel DL I Sl I S2 I RC I Password I TSl I TS2 I
+---------------------------~---------------------------+
00 01.. 09.. 12 13 14 15 16 •••••• 25.. 29 ••
Figure 2-4. Directory Label Format
Field Definition
Only one directory label can exist in a drive's directory area~ The directory label
name and type fields are not used to search for a directory label; they can be used
to Identify a disk.
2-17
2.6 Directory Labels and XFCBs Concurrent DOS 86 Programmer's Guide
You can use ORV SETLABEL to create a directory label or update its fields.
DRV SETLABEL can also assign a password to a directory label. . The directory label
pass-word, if assigned, cannot be circumvented, whereas file password protection
on a drive is an option controlled by the directory label. Thus, access to the
directory label password provides the ability to bypass password protection on the
drive.
Note: Concurrent does not provide a system call to read the directory label FCB
directly. However, you can read the directory label data byte directly with the
ORV_GETLABEL call. In addition, you can use the search calls F_SFIRST and
F_SNEXT to find a directory label. You can identify the directory label by a value
of 32 (020H) in byte 0 of the directory FCB.
The XFCB is an extended FCB that can optionally be associated with a file in the
directory. If present, it contains the file's password and password mode. Figure
2-5 shows the format of the XFCB.
+---------------------------------------------------------+
I DR I File I Type I PM ISl IS2 IRC I Password I RESERVED I
+---------------------------------------------------------+
00 01... 09... 12 13 14 15 16 ••• 25 29
Figure 2-5. XFCB - Extended File Control Block
Field Definition
2-18
Concurrent DOS 86 Programmer's Guide 2.6 Directory Labels and XFCBs
You can create an XFCB only on a drive that has a directory label, and only if the
directory label enables password protection. For drives in this state, there are two
ways to create an XFCB for a file: with F MAKE or F WRITEXFCB. F MAKE creates
an XFCB if the calling process requests that a password be assigned to the created
file. F_WRITEXFCB creates an XFCB when it is called to assign a password to an
existing file. You can identify an XFCB in the directory by a value of 16 (OlOH) + N
in byte O of the FCB, where N equals the user number.
There are two ways to assign passwords to a file: with F MAKE or with
F_WRITEXFCB. You can also change a file's password or password mode with
F_WRITEXFCB if you can supply the original password. Note that you cannot
change a file's password or password mode if password protection for the drive is
disabled by the directory label. However, even if you cannot supply a file's
password, you can delete a file's XFCB, thereby removing its password protection,
if password protection is disabled on the drive.
The Concurrent BOOS provides password protection in one of three modes when
password support is enabled by the directory label. Table 2-11 shows the
difference in access level allowed to BOOS system calls when the password is not
supplied.
If a file is password protected in Read mode, a process must supply the password
to open the file. Processes cannot write to a file protected in Write mode without
the password.
A file protected in Delete mode allows read and write access, but a process must
specify the password to delete or truncate the file, rename the file, or to modify
the file's attributes. Thus, mode 1 protection implies mode 2 and 3 protection, and
mode 2 protection implies mode 3 protection. All three modes require you to
specify the password to delete or truncate the file, rename the file, or to modify
the file's attributes.
2-19
2.7 File Passwords Concurrent DOS 86 Programmer's Guide
If a process supplies the correct password or the directory label disables password
protection, then access to the BOOS system calls is the same as for a file that is
not password-protected. In addition. F_SFIRST and F_SNEXT are not affected by
file passwords.
The following BOOS system calls test for passwords:
* ORV SETLABEL
* F ATTRIB
* F DELETE
* F OPEN
* F RENAME
* F WRITEXFCB
* F TRUNCATE
The BOOS maintains file passwords in the XFCB and directory label in encrypted
form. To make a BOOS system call for a file that requires a password, a process
must place the password in the first eight bytes of the current OMA, or make it the
default password with an F_PASSWD call, before making the system call.
Note: The BOOS maintains the assigned default password for each process.
Processes inherit the default password of their parent process. You can set a
given TMP's default password using the FSET utility; all programs loaded by this
TMP inherit the same default password.
2-20
Concurrent DOS 86 Programmer's Guide 2.8 File Date and Time Stamps: SFCBs
The Concurrent file system uses a special type of directory entry called an SFCB to
record date and time stamps for files. When a directory has been initialized for
date and time stamping, SFCBs reside in every fourth position of the directory.
Each SFCB maintains the date and time stamps for the previous three directory
entries, as shown in Figure 2-6
+---------------------------------------------+
I I FCB 1 I
!----------------------------------------------
' I FCB 2 I
!---------------------------------------------!
I I FCB 3 I
!---------------------------------------------!
I 21 I Stamps I stamps I stamps I II I
I I for FCB 1 I for FCB 2 I for FCB 3 I // I
+---------------------------------------------+
Byte#
0 1 11 21 31 32
Figure 2-6. Directory Record with SFCB
+--------------------------------------------------------+
I Create/Access I Update I Password I Reserved I
I Time and Date I Time and Date I Mode I I
+--------------------------------------------------------+
Byte #
0 4 8 9 10
Figure 2-7. SFCB Subfields
2-21
2.8 File Date and Time Stamps: SFCBs Concurrent DOS 86 Programmer's Guide
An SFCB subfield only contains valid information if its corresponding FCB in the
directory record is an extent zero FCB. This FCB is a file's first directory entry.
For password protected files, the SFCB subfield also contains the password mode
of the file; the password mode field is zero for files without password protection.
You can read SFCBs by making F_SFIRST and F_SNEXT calls. In addition, you can
make a F_TIMEDATE call to retrieve the date and time stamps and password mode
of a specified file. The explanation of T _GET in Section 6 describes the format of a
date and time stamp field.
Concurrent supports three kinds of file stamping: create, access, and update.
Create stamps record when the file was created, access stamps record when the
file was last opened, and update stamps record the last time the file was modified.
Create and access stamps share the same field. As a result, file access stamps
overwrite any create stamps.
The directory label of a properly initialized disk determines the type of date and
time stamping for files on the drive. The INITDIR utility initializes a directory for
date and time stamping by placing an SFCB in every fourth directory entry. Disks
not initialized in this way cannot support date and time stamping. In addition, date
and time stamping is not performed if the disk's directory label is absent or does
not specify date and time stamping, or if the disk is Read-Only.
Note that the directory label is also time stamped, but these stamps are not made
in an SFCB; time stamp fields in the last eight bytes of the directory label show
when it was created and last updated~ Access stamping is not supported for
directory labels.
The BOOS file system uses the system date and time when it records a date and
time stamp. This value is maintained in a field in the SYSDAT part of the System
Data Segment. The DATE utility sets the system time and date {see the User's
Guide for details of using DATE).
The file system provides three different modes for opening files:
Locked Mode
Locked mode is the Default mode for opening files under Concurrent. A process
can open a file in Locked mode only if the file is not currently opened by another
process. Once open In Locked mode, no other process can open the file until it is
closed. Thus, if a process successfully opens a file in Locked mode, that process
owns the file until the file is closed or the process terminates.
Files opened in Locked mode support read and write operations unless the file is a
Read-Only file {attribute Tl' set) or the file is password-protected in Write mode,
and the process issuing the F OPEN call cannot supply the password. In both of
these cases, the BOOS allows only read operations to the file.
2-22
Concurrent DOS 86 Programmer's Guide 2.9 File Open Modes
Unlocked Mode
A process can open a file in Unlocked mode if the file is not currently open, or if
another process has already opened the file in Unlocked mode. Unlocked mode
allows more than one process to open the same file. Files opened in Unlocked
mode support read and write operations unless the file is a Read-Only file
(attribute Tl' set) or the file is password-protected in Write mode and the process
Issuing the F_OPEN call cannot supply the password.
When opening a file in Unlocked mode, a process must reserve 35 bytes in the
FCB because F_OPEN returns a 2-byte value called the File ID in the RO and R1
bytes of the FCB. The File ID is a required parameter for the F_LOCK and
F_UNLOCK calls which work only for files opened in Unlocked mode.
Read-Only Mode
A process can open a file in Read-Only mode if the file is not currently opened by
another process or if another process has opened the file in Read-Only mode.
This mode allows more than one process to open the same file for Read-Only
access.
F_OPEN performs the following steps for files opened in Locked or Read-Only
mode:
* If the current user number is nonzero, and the file to be opened does not
exist under the current user number, F_OPEN searches the user zero directory
for the file.
* If the file exists under user zero and has the System attribute T2' set, the
BOOS opens the file under user zero. with the open mode automatically forced
to Read-Only.
F_OPEN also performs the following action for files opened in Locked mode when
the current user number is zero.
* If the file exists under user zero and has both the System T2' and Read-Only
(Tl') attributes set, the open mode is automatically set to Read-Only. The
Read-Only attribute controls whether a user-zero process and processes on
other user numbers can concurrently open a user-zero system file when each
process opens the file in the default Locked mode.
* If the Read-Only attribute is set, all processes open the file in Read-Only
mode and the BOOS allows concurrent access of the file. However, if the
Read-Only attribute is reset, the user-zero process opens the file in Locked
mode to prevent sharing the file with other processes.
F OPEN and F MAKE both use FCB interface attributes F5' and F6' to specify the
open mode. The interface attribute definitions for these functions are listed in
Table 2-8.
Note: F_MAKE does not allow opening the file in Read-Only mode.
2-23
---------------
2.10 File Security Concurrent DOS 86 Programmer's Guide
The security measures implemented in the file system are designed to prevent
accidental collisions between running processes. It is not possible to provide total
security because the file system maintains file allocation information in open FCBs
in the user's memory region. and Concurrent does not require memory protection.
However, the file system is designed to ensure that multiple processes can share
the same file system without interfering with each other by performing checksum
verification of open FCBs. and monitoring all open files and locked records via the
system Lock list.
The BOOS validates the checksum of user FCBs before all 1/0 operations to protect
the integrity of the file system from corrupted FCBs. The F_OPEN and F_MAKE
calls compute and assign checksums to FCBs. F_READRAND, F_READ,
F_WRITERAND, F_WRITEZF, F_WRITE, F_LOCK, and F_UNLOCK subsequently verify and
recompute the checksums when they change the FCB. F_CLOSE also verifies FCB
checksums. Although you can disable FCB verification by these system calls (see
Section 2.12), it is not recommended because Concurrent's file security is reduced.
If the BOOS detects an FCB checksum error, it does not perform the requested
command. Instead, it either returns to the calling process with an error code, or if
the system call is F_CLOSE and the BOOS Error mode is in the default state (see
Section 2.18), it terminates the calling process with an error message.
Concurrent uses a system data structure, called the Lock List, to manage file
opening and record locking by running processes. Each time a process opens a
file or locks a record successfully, the file system allocates an entry in the system
Lock list to record the fact. The file system uses the lock list to:
2-24
Concurrent DOS 86 Programmer's Guide 2. 10 File Security
The most common way a process releases a lock entry for an open file is by
closing the file. A close operation is permanent if it causes the removal of the
file's open lock list entry. The file system invalidates the FCB checksum field on
permanent close operations to prevent continued open file operations with the
FCB.
However, not all close operations are permanent. For example, if a process makes
multiple F_OPEN or F_MAKE calls to an open file, a matching number of F_CLOSE
calls must be made before the file system permanently closes the file. Of course,
if you only open a file once, a single close operation permanently closes the file.
In addition, a process can optionally make partial F_CLOSE calls to a file by setting
interface attribute FS'. A partial close operation does not affect the open state of
a file. In the above example, a partial close operation would not count against an
F_OPEN or F_MAKE call. A partial close operation simply updates the directory to
reflect the current state of the file.
As a general rule, under Concurrent a process should close files as soon as it no
longer needs them, even if it has not modified them. While a process has a file
open, access by other processes to the file is restricted. For example, after a
process has opened a file in Locked mode, the file cannot be opened by other
processes until the file is closed or the process terminates.
Furthermore, space in the Lock List is limited. If a process attempts to open a file
and no space remains in the Lock List, or if the process exceeds the open file limit,
the BOOS denies the open request and usually terminates the calling process. You
can change the way the file system handles this error by making an F_ERRMODE
call. Note that the size of the Lock List and the process open file limit are
GENCCPM parameters.
Under Concurrent. deleting an open file is not recommended but it is supported for
files opened in Locked mode to provide compatibility with software written under
earlier releases of MP/M™ and CP/M. The file system does not allow deletion of a
file opened in Unlocked or Read-Only mode.
To ensure that the process does not use the open FCB corresponding to the
deleted file, the file system subsequently checks all open FCBs for the process.
Each open FCB is checked the next it is used with a file-access system call that
requires an open FCB. If a Lock List entry exists for the file, the BOOS allows the
operation to proceed; if not, it indicates that the file has been purged and the file
system returns an FCB checksum error.
The BOOS performs FCB verification whenever it purges open file entries from the
system Lock List in the following situations:
2-25
2.10 File Security Concurrent DOS 86 Programmer's Guide
* A process issues a DRV_FREE call for a drive on which it has an open file.
* The BOOS detects a change in media on a drive that has open files. This is a
special case because a process cannot control the occurrence of this
situation, and because it can impact more than one process. Refer to Section
2.17 for more details on this situation.
Open FCB verification can affect performance because each verification operation
requires a directory search operation. In general, you should avoid such situations
when creating new programs for Concurrent.
2-26
Concurrent DOS 86 Programmer's Guide 2.11 Extended File Locking
You can make an F_OPEN call to resume record operations on a file with an
extended lock. Note that you can also change the open mode when you reopen
the file. The following steps illustrate the use of extended locks.
2. Perform read and write operations on the file EXLOCK.TST using the open FCB.
3. Close file EXLOCK.TST with interface attribute F6' set to retain the file's lock
item.
4. Use F_RENAME to change the name of the file to EXLOCK.NEW with interface
attribute F5' set to retain the file's extended lock item.
6. Perform read and write operations on the file EXLOCK.NEW, using the open
FCB.
7. Close file EXLOCK.NEW again with interface attribute F6' set to retain the file's
lock item.
8. Set the Read-Only attribute and release the file's lock item by making an
F_A TTRIB call with interface attribute F5' reset.
At this point, the file EXLOCK.NEW becomes available for access by another
process.
Compatibility attributes are defined as file attributes Fl' through F4' of program
(CMO) files, and they provide a mechanism to modify some of Concurrent's file
security rules. This facility is needed because some programs developed under
earlier Digital Research operating systems do not run properly under Concurrent.
Most of the problems encountered by such programs occur because they were
designed for single-tasking operating systems where file security is not required.
For example, suppose a program closes a file and then continues reading and
writing to the file. Under CP/M-86, this is not a problem but under Concurrent,
the BOOS intercepts open file operations with a deactivated FCB to ensure file
system integrity. Compatibility attributes are a tool for dealing with such
situations, and you should use them only with existing programs that run properly
under CP/M-86, not with new programs developed under Concurrent.
If the GENCCPM COMPATMOOE option has been selected during system
generation, you can use Concurrent's FSET utility to set compatibility attributes
from the command line. When COMPATMOOE is selected, the P_CLI call
interrogates the command file's compatibility attributes during program loading
and modifies the Concurrent file security rules for the loaded program.
Table 2-12 defines the Concurrent BOOS Compatibility Attributes.
2-27
2.12 Compatibility Attributes Concurrent DOS 86 Programmer's Guide
Attribute Definition
2-28
Concurrent DOS 86 Programmer's Guide 2.12 Compatibility Attributes
Attribute Definition
F4' Disable FCB Checksum verification for read and write operations.
Setting F4' also sets attributes F2' and F3'. The F4' attribute
is intended for programs that modify open FCBs during read
and write operations. Use this attribute very carefully, and
only with software known to work, because it effectively
disables Concurrent's file security.
* If the program ends with the "File Currently Opened" message when multiple
copies of the program are run, set compatibility attribute Fl'. or place all
common s;..Hic files under User O with the SYS and Read-Only attributes set.
* If the program terminates with the message "Close Checksum Error·, set
compatibility attribute F3'.
* If the program terminates with an 1/0 error, try running the program with
attribute F2' set. If the problem persists. then try attribute F4'. Use attribute
F4' only as a last resort.
2-29
2.13 Multisector 1/0 Concurrent DOS 86 Programmer's Guide
The file system provides the capability to read or write multiple 128-byte records
in a single BOOS system call. This multisector facility can be visualized as a BOOS
burst mode, enabling a process to complete multiple 1/0 operations without
interference from other running processes. In addition, the file system bypasses,
when possible, all intermediate record buffering during multisector 1/0 operations.
Data is transferred directly between the calling process's memory and the drive.
The BOOS also informs the XIOS when it is reading or writing multiple physical
records on a drive. The XIOS can use this information to further optimize the 1/0
operation resulting in even better performance. As a result, using this facility in an
application program can improve its performance and also enhance overall system
throughput, particularly when performing sequential 1/0.
The number of records that can be transferred with multisector 1/0 ranges from 1
to 128. This value, called the BOOS Multisector Count, can be set with
F MULTISEC. P CU sets the Multisector Count to one when it initiates a transient
- -
program for execution.
Note that the greatest potential performance increases are obtained when the
Multisector Count is set to 128. Of course, this requires a 16K buffer. The
Concurrent PIP utility performs its sequential 1/0 with a Multisector Count of 128.
The Multisector Count determines the number of operations to be performed by
the following BOOS system calls; F READ, F WRITE, F READRAND, F WRITERAND,
F_WRITEZF, F_LOCK and F- UNLOCK. It the Multlsector Count is N, making one of
these calls is equivalent to making N calls.
With the exception of disk 1/0 errors encountered by the XIOS, if an error
interrupts a multisector read or write operation, the file system returns the number
of 128-byte records successfully transferred in register AH. Section 2.14 describes
how the Multisector Count affects F LOCK and F UNLOCK.
- -
Concurrent supports two open modes, Read-Only and Unlocked, which allow
concurrently running processes to access common files for record operations. The
Read-Only open mode allows multiple processes to read from a common file, but
processes cannot write to a file open in this mode. Thus, files remain static when
they are opened in Read-Only mode. The Unlocked open mode is more complex
because it allows multiple processes to read and write records to a common file.
As a result, Unlocked mode has some important differences from the other open
modes.
When a process opens a file in Unlocked mode, the file system returns a 2-byte
field called the File ID in the RO and R1 bytes of the FCB. The File ID is a required
parameter of Concurrent's record locking system calls. F LOCK and F UNLOCK.
which are only supported for files open in Unlocked mode. - -
2-30
Concurrent DOS 86 Programmer's Guide 2.14 Concurrent File Access
Note that these system calls return a successful error code if they are called for
files opened in Locked mode. However, they perform no action in this case,
because, by definition, the calling process has the entire file locked.
F_LOCK and F_UNLOCK allow a process to establish and release temporary
ownership of particular records within a file. You must set the FCB Random
Record field and place the File ID in the first two bytes of the current OMA buffer
before making these calls. The file system locks and unlocks records in units of
128 bytes, which is the standard Concurrent record size. The number of records
locked or unlocked is controlled by the BOOS Multisector count, which can range
from 1 to 128 (see Section 2.13).
In order to simplify the discussion of record locking and unlocking, the following
paragraphs assume the Multisector count is one. However, as discussed later in
this section, the more general case of multiple record locking and unlocking is a
simple extension of the single record case.
F_LOCK supports two types of lock operations: exclusive locks and shared locks.
Interface attribute F5' specifies the type of lock. F5' = 0 requests an exclusive lock;
F5' "' 1 requests a shared lock. If a process locks a record with an exclusive lock,
other processes cannot read, write, or lock the record. The locking process,
however, can access the record with no restrictions. You should use this type of
lock when exclusive control over a record is required.
If a process locks a record with a shared lock, other processes cannot write to the
record or make an exclusive lock of the record. However, other processes are
allowed to read the record and make their own shared locks on the record. No
process, including the locking process, can write to a record with a shared lock.
Shared locks are useful when you want to ensure that a record does not change,
but you want to allow other processes to read the record.
F_LOCK also lets you change the lock of a record if there is no conflict. For
example, you can convert an exclusive lock into a shared lock with no restrictions.
On the other hand, if a process attempts to convert a record's shared lock to an
exclusive lock if another process has a shared lock on the record, Concurrent
returns an error.
F LOCK has another option, specified by interface attribute F6'. which controls
vihether a record must exist in order to be locked. If you make an F_LOCK call
with F6' = 0, the file system returns an error code if the specified record does not
exist. Setting F6' to 1 requests a logical lock operation. Logical lock operations
are only limited by the maximum Concurrent file size of 32 megabytes, which
corresponds to a maximum Random Record Number of 262, 143. You can use
logical locks to control extending a shared file.
F_UNLOCK is similar to F_LOCK except that it removes locks instead of creating
them. There are few restrictions on unlock operations. Of course a process can
only remove locks that it has made.
2-31
2.14 Concurrent File Access Concurrent DOS 86 Programmer's Guide
F_UNLOCK has one option, controlled by Interface attribute FS'. If FS' is set to one,
F_UNLOCK removes all locks for the file made by the calling process. Otherwise, it
removes the locks specified by the Random Record field and the BOOS Multisector
Count. Note that F_CLOSE also removes all locks for a file on permanent close
operations.
If the BOOS Multisector Count is greater than one, F_LOCK and F_UNLOCK perform
multiple record locking or unlocking. In general, multiple record locking and
unlocking can be viewed as a sequence of N independent operations, where N
equals the Multisector Count. However, if an an error occurs on any record within
the sequence, no locking or unlocking is performed.
For example, both F_LOCK and F_UNLOCK perform no action and return an error
code if the sum of the FCB Random Record Number and the BOOS Multisector
Count is greater that 262, 144. As another example, F_LOCK also returns an error
code if another process has an exclusive lock on any record within the sequence.
When a process makes an F_LOCK call, the file system allocates a new entry in the
system Lock List to record the lock operation and associate it with the calling
process. A corresponding F_UNLOCK call removes the locked entry from the list.
While the lock entry exists In the Lock List, the file system enforces the
restrictions implied by the lock item.
Because each lock item includes a record count field, a multiple lock operation
normally results in the creation of a single new entry. However, if the file system
must split an existing lock entry to satisfy the lock operation, an additional entry is
required. Similarly, an unlock operation can require the creation of a new entry if
a split is needed. Thus, in the worst case, a lock operation can require two new
lock entries and an unlock operation can require one. Note that lock item splitting
can be avoided by locking and unlocking records in consistent units.
These considerations are important because the Lock List is a limited resource
under Concurrent. The file system performs no action and returns an error code if
insufficient available entries exist in the Lock List to satisfy the lock or unlock
request. In addition, the number of lock items a single process is allowed to
consume is a GENCCPM parameter. The file system also returns an error code if
this limit is exceeded.
The file system performs several special operations for read and write system calls
to a file open in Unlocked mode. These operations are required because the file
system maintains the current state of an open file in the calling process's FCB.
When multiple processes have the same file open, FCBs for the same file exist in
each process's memory.
To ensure that all processes have current information, the file system updates the
directory immediately when an FCB for an unlocked file is changed. In addition.
the file system verifies error situations such as end-of-file, or reading unwritten
data with the directory before returning an error. As a result, read and write
operations are less efficient for files open in Unlocked mode when compared to
equivalent operations for files opened in Locked mode.
2-32
Concurrent DOS 86 Programmer's Guide 2.15 File Byte Counts
Although the logical record size of Concurrent is restricted to 128 bytes, the file
system does provide a mechanism to store and retrieve a byte count for a file.
This facility can identify the last byte of the last record of a file. The F_SIZE call
returns the last Random Record Number, + 1, of the last record of a file.
The F_ATIRIB call can set a file's byte count. This is an option controlled by
interface attribute F6'. Conversely, F OPEN can return a file's byte count to the CR
field of the FCB. F SFIRST and F SNEXT also return a file's byte count in the CS
field of the FCB returned in the current OMA buffer.
Note that the file system does not access or update the byte count value in BOOS
read or write system calls. However, the F MAKE call does set the byte count
value to zero when it creates a file in the directory.
Under Concurrent, the logical record size for disk 1/0 is 128 bytes. This is the
basic unit of data transfer between the operating system and running processes.
However, on disk, the physical record size is not restricted to 128 bytes, but can
range from 128 bytes to 4K bytes. Record blocking and deblocking is required on
systems that support drives with physical record sizes larger than 128 bytes.
The process of building up physical records from 128-byte logical records is called
record blocking and is required in write operations. The reverse process of
breaking up physical records into their component 128-byte logical records is
called record deblocking and is required in read operations. Under Concurrent,
record blocking and deblocking is normally performed by the BOOS.
Record deblocking implies a read-ahead operation. For example, if a process reads
a logical record that resides at the beginning of a physical record, the entire
physical record is read into an internal buffer. Subsequent BOOS read calls for the
remaining logical records access the buffer instead of the disk.
2-33
2.16 Record Blocking and Deblocking Concurrent DOS 86 Programmer's Guide
Note: The file system discards all pending physical data buffers when a process
terminates. However, the file system automatically makes an F_FLUSH call in the
F_CLOSE call. Thus, it is sufficient to make an F_CLOSE call to ensure that all
pending physical buffers for that file are written to the disk.
2-34
Concurrent DOS 86 Programmer's Guide 2.17 Reset, Access, and Free Drive
However, if the drive, is removable or set to Read-Only, the file system determines
whether other processes have open files on the drive. If they do, then it denies
ORV_RESET operation and returns an error code to the calling process.
If all the open files on a removable drive belong to the calling process, the
process is said to own the drive. In this case, the file system performs a qualified
reset on the drive and returns a successful result. This means that the next time a
process accesses this drive, the BOOS performs the log-in operation only if it
detects a media change on the drive.
Figure 2-8 illustrates the logic flow of the drive reset operation.
YES
OPEN FILES
ON DRIVE?
NO
DRIVE YES
REMOVABLE?
NO
YES
NO
~ NO
QUALIFIED
RESET
PEnf-OAMFC1
DISK OISK
RESET RESET
SUCCESS DENIED
2-35
2.17 Reset, Access, and Free Drive Concurrent DOS 86 Programmer's Guide
If the BOOS detects a media change on a drive after a qualified reset, it purges all
open files on the drive from the Lock List and subsequently verifies all open FCBs
in file operations for the owning process (refer to Section 2.10 for details of FCB
verification).
In all other cases where the BOOS detects a media change on a drive, the file
system purges all open files on the drive from the Lock List, and flags all
processes owning a purged file for automatic open FCB verification.
Note: If a process references a purged file with a BOOS command that requires
an open FCB, the file system returns to the process with an FCB checksum error.
The primary purpose of the drive reset functions is to prepare for a media change
on a drive. Because a drive reset operation is conditional, it allows a process to
test whether it is safe to change disks. Thus, a process should make a successful
drive reset call before prompting the user to change disks. In addition, you should
close all your open files on the drive, particularly files you have written to, before
prompting the user to change disks. Otherwise, you might lose data.
ORV ACCESS and ORV FREE perform special actions under Concurrent.
ORV_ACCESS inserts a dummy open file item into the system Lock List for each
specified drive. While that item exists in the system Lock List, no other process
can reset the drive. ORV_FREE purges the Lock List of all items, including open file
items, belonging to the calling process. on the specified drives. Any subsequent
reference to those files by a BOOS system call requiring an open FCB results in a
FCB checksum error return.
ORV FREE has two important side effects. First of all, any pending
blocking/deblocking buffers on a specified drive that belong to the calling process
are discarded. Secondly, any data blocks that have been allocated to files that
have not been closed are lost. Be sure to close your files before calling ORV_FREE.
ORV_SETRO is also conditional under Concurrent. The file system does not allow a
process to set a drive to Read-Only if another process has an open file on the
drive. This applies to both removable and permanent drives.
A process can prevent other processes from resetting a Read-Only drive by
opening a file on the drive or by issuing a ORV ACCESS call for the drive and then
making a ORV SETRO call. Executing ORV SETRO before the F OPEN or
ORV_ACCESS caii leaves an interval In which another process could set- the drive
back to Read-Write. While the open file or dummy item belonging to the process
resides in the Lock List, no other process can reset the drive to take it out of
Read-Only status.
2-36
Concurrent DOS 86 Programmer's Guide 2.18 BOOS Error Handling
The Concurrent file system has an extensive error handling capability. When an
error is detected, the BOOS can respond in one of three ways:
3. Display an error message on the console and return an error code to the
calling process,' as in method 2.
The file system handles the majority of errors it detects by method 2. Two
examples of this kind of error are the "file not found" error for F_OPEN and the
"reading unwritten data" error for F_READ.
More serious errors, such as disk 1/0 errors, are normally handled by method 1.
Errors in this category, called physical and extended errors, can also be reported
by methods 2 and 3 under program control.
The BOOS Error mode, which has three states, determines how the file system
handles physical and extended errors.
* In the default Error mode, the BOOS displays the error message and
terminates the calling process (method 1).
* In Return Error mode, the BOOS returns control to the calling process with
the error identified in register AX (method 2).
* In Return and Display Error mode, the BOOS returns control to the calling
process with the error identified in register AX and also displays the error
message at the console (method 3).
While both return modes protect a process from termination because of a physical
or extended error, the Return and Display mode also allows the calling process to
take advantage of the built-in error reporting of the file system.
Physical and extended errors are displayed in the following format:
Concurrent Error on d: error message
BOOS Function = nn File = f ilename.typ
where d is the name of the drive selected when the error condition occurs; error
message identifies the error; nn is the BOOS function number, and filename.typ
identifies the file specified by the BOOS function. If the BOOS function did not
involve an FCB, the file information is omitted.
The following tables detail BOOS physical and extended error messages.
2-37
2.18 BOOS Error Handling Concurrent DOS 86 Programmer's Guide
Message Meaning
Disk 1/0
The "Disk 1/0" error results from an error condition returned
to the BOOS from the XIOS module. The file system makes
XIOS read and write calls to execute BOOS file-access
system calls. If the XIOS read or write routine detects an
error, it returns an error code to the BOOS, causing this
error message.
Invalid Drive
The "Invalid Drive" error also results from an error condition
returned to the BOOS from the XIOS module. The BOOS
makes an XIOS Select Disk call before accessing a drive to
perform a requested BOOS function. If the XIOS does not
support the selected disk. it returns an error code resulting
In this error.
Read/Only File
The BOOS returns the "Read/Only File" error message when
a process attempts to write to a file with the R/O attribute
set.
Read/Only Disk
2-38
Concurrent DOS 86 Programmer's Guide 2.18 BOOS Error Handling
Message Meaning
2-39
2. 18 BOOS Error Handling Concurrent DOS 86 Programmer's Guide
Message Meaning
The following paragraphs describe the error return code conventions of the file
system calls. Most file system calls fall into three categories in regard to return
codes; they return an error code, a directory code, or an error flag. The error
conventions let programs written for CP/M-86 run without modification.
The following BOOS system calls return an error code in register AL:
* FLOCK
* F READ
* F_READRAND
* F_UNLOCK
* F_WRITE
* F_WRITERAND
* F WRITEZF
Table 2-15 lists error code definitions for register AL.
2-40
Concurrent DOS 86 Programmer's Guide 2.18 BOOS Error Handling
Code Definition
For BOOS read and write system calls, the file system also sets register AH when
the returned error code is a value other than zero or OFFH. In this case. register
AH contains the number of 128-byte records successfully read or written before
the error was encountered. Note that register AH can only contain a nonzero
value if the calling process has set the BOOS Multisector Count to a value other
than one; otherwise register AH is always set to zero. On successful system calls
(Error Code • 0), register AH is also set to zero. If the Error Code OFFH, register
AH contains a physical error code (see Table 2-16).
2-41
2. 18 BOOS Error Handling Concurrent DOS 86 Programmer's Guide
The following BOOS system calls return a directory code in register AL:
* ORV SETLABEL
* F ATIRIB
* F CLOSE
* F DELETE
* F MAKE
* F_OPEN
* F RENAME
* F SETDATE
* F SIZE
* F SFIRST
* F SNEXT
* F TIMEDATE
* F TRUNCATE
* F WRITEXFCB
The directory code definitions for register AL are:
OOH - 03H successful function
OFFH unsuccessful function
With the exception of F_SFIRST and F_SNEXT, all functions in this category return
with the directory code set to zero upon a successful return. However, for these
two system calls, a successful directory code identifies the relative starting
position of the directory entry in the calling process's current OMA buffer.
If a process uses F_ERRMODE to place the BOOS in Return Error mode, the
following system calls return an error flag in register AL on physical errors:
* ORV GETLABEL
* ORV ACCESS
* ORV SET
* ORV SPACE
* ORV FLUSH
The error flag definitions for register AL are:
OOH successful function
OFFH physical error : refer to register AH
The BOOS returns nonzero values in register AH to identify a physical or extended
error if the BOOS Error mode is in one of the return modes. Except for system
calls that return a Directory Code, register AL equal to OFFH indicates that register
AH identifies the physical or extended error.
For functions that return a Directory Code, if register AL equals OFFH, and register
AH is not equal to zero, register AH identifies the physical or extended error.
Table 2-16 shows the physical and extended error codes returned in register AH.
2-42
Concurrent DOS 86 Programmer's Guide 2.18 BOOS Error Handling
Code Explanation
The following two system calls represent a special case because they return an
address in register AX.
* ORV ALLOCVEC
*ORV DBP
When the calling process is in one of the BOOS return error modes and the BOOS
detects a physical error for these system calls, it returns to the calling process
with registers AX and BX set to OFFFFH. Otherwise, they return no error code.
2-43
2.18 BOOS Error Handling Concurrent DOS 86 Programmer's Guide
Under Concurrent, the following system calls also represent a special case:
* ORV ALLRESET
* DRV_RESET
* DRV_SETRO
These system calls return to the calling process with registers AL and BL set to
OFFH if another process has an open file or has made a ORV_ACCESS call that
prevents the reset or write protect operation. If the calling process is not in
Return Error mode, these system calls also display an error message identifying
the process that prevented the requested operation.
End of Section 2
2-44
SECTION 3
A transient program is a file of type CMD that is loaded from disk and resides in
memory only during its operation. A Resident System Process (RSP) is a file that
is included in Concurrent during system generation.
You can initiate a transient process by entering a command at a system console.
The console's TMP (Terminal Message Process) then calls P CU (Command Line
Interpreter), and passes to it the command line you entered.- If the command is
not an RSP, then P CU locates and then loads the proper CMD file. P CU then
calls F_PARSE to pa;se up to two filenames following the command, and place the
properly formatted FCBs at locations 005CH and 006CH in the Base Page of the
initial Data Segment (see Section 3.3).
P_CU initializes memory, the Process Descriptor (PD), and the User Data Area
(UDA), and then allocates a 96-byte stack area, independent of the program, to
contain the process's initial stack. If 8087 processing is required (see Section
3.1.2) P_cu allocates an additional 96 bytes for the UDA.
Concurrent divides the Direct Memory Address (OMA) into the OMA segment
address and the OMA offset. P_CU initializes the default OMA segment to the
value of the initial data segment, and the default OMA offset to 0080H.
P_CU creates the new process with a P_CREATE call and sets the initial stack so
that the process can execute a Far Return instruction to terminate. A process also
ends when it calls P TERMCPM or P TERM.
- -
You can also terminate a process by typing a single CTRL-C during console input.
See C_MODE in Section 6 for the details of enabling/disabling CTRL-C. CTRL-C
also forces a ORV_RESET call for each logged-in drive. This ORV_RESET operation
only affects removable media drives.
Note: Additional UOA space is allocated for 8087 processing only if the process is
initialized by P_CU. Other processes (such as RSPs) that require 8087 processing
and do not use P_CU must allocate this additional UDA space themselves.
3-1
3.1 Transient Program Loading Concurrent DOS 86 Programmer's Gulde
3-2
Concurrent DOS 86 Programmer's Guide 3.2 Command File Format
+------------------------------------------------------+
IGD 1 I GD 2 I GD 3 I GD 4 I GD 5 I GD 6 I GD 7 I GD 8 I
+------------------------------------------------------+
<--------------------- 128 Bytes ---------------------->
Figure 3-1. CMD File Header Format
G_Type determines the Group Descriptor type. The valid Group Descriptors have a
G_Type in the range 1 through 9, as shown in Table 3-1. All other values are
reserved for future use. For a given CMD file header only a Code Group and one
of any other type can be included. If a program uses either the Small or Compact
Model, the code group is typically pure; that is, it is not modified during program
execution.
All remaining values in the Group Descriptor are given in increments of 16-byte
paragraph units with an assumed low-order 0 nibble to complete the 20-bit
address.
3-3
3.2 Command File Format Concurrent DOS 86 Programmer's Guide
Field Description
The Base Page contains default values and locations initialized by P CU and
P_LOAD and used by the transient process.
The Base Page occupies the regions from offset OOOOH through OOFFH relative to
the initial data segment, and contains the values shown in Figure 3-3.
3-4
Concurrent DOS 86 Programmer's Guide 3.3 Base Page Initialization
L M H L H
0 1 2 3 4 5 6
+--------+--------+--------+--------+--------+--------+
0 CODE LENGTH CODE BASE M80
--------+--------+--------+--------+--------+--------!
6 DATA LENGTH I DATA BASE I RESERVED I
--------+--------+--------+--------+--------+--------!
c EXTRA LENGTH I EXTRA BASE I RESERVED I
--------+--------+--------+--------+--------+--------!
12 STACK LENGTH I STACK BASE I RESERVED I
--------+--------+--------+--------+--------+--------!
18 AUX 1 AUX 1 IRESERVEDI
--------+--------+--------+--------+--------+--------!
lE AUX 2 AUX 2 IRESERVEDI
--------+--------+--------+--------+--------+--------!
24 AUX 3 AUX 3 !RESERVED!
--------+--------+--------+--------+--------+--------!
2A AUX 4 AUX 4 IRESERVEDI
--------+--------+--------+--------+--------+--------!
30 Bytes 030H through 04FH are not currently used; I
they are reserved for future use by Digital Research!
I
I
. I
--------+--------+--------+--------+--------+--------!
50 DRIVE I Pl ADDR IPl LEN I P2 ADDR I
-----------------------------------------------------!
56 P2 LEN I RESERVED I I
--------+--------+--------+--------+--------+--------!
5C DEFAULT FILENAMEl I
I
. I
--------+--------+--------+--------+--------+--------!
6C I
DEFAULT FILENAME2 I
I
I
--------+--------+--------+--------+--------+--------!
7C CR I RANDOM RECORD NUMBER (opt) I I
--------+--------+--------+--------+--------+--------!
80 DEFAULT 128-byte OMA BUFFER I
I
+-----------------------------------------------------+
Figure 3-3. Base Page Values
3-5
3.3 Base Page Initialization Concurrent DOS 86 Programmer's Guide
Field Definition
M80 The M80 byte is a flag indicating whether the 8080 Memory
Model was used during load. The values of the flag are:
1 .. 8080 Model
0 .. not 8080 Model
3-6
Concurrent DOS 86 Programmer's Guide 3.3 Base Page Initialization
Field Definition
Under Concurrent when one process (the parent) creates another process (the
child), the child process inherits most of the default values of the parent process.
This includes the default disk, user number, console, list device, and password.
The child process also inherits interrupt vectors 0, 1, 3, 4, 224, and 225, which the
parent process initialized.
Processes which bypass Concurrent's Character 1/0 system calls and use a video
map or screen buffer directly cannot be monitored, and continue to put characters
on the screen even when running in the background. Consequently, any screen
displayed by the program in the foreground console is interspersed with characters
displayed by the program in the background using direct video map 1/0.
To avoid the problems created by using direct video 1/0, set bit 3 of the Program
Flag to tell Concurrent that the process is to be put in suspend mode whenever it
is running in the background and may continue running only when switched to the
foreground. You can use the CHSET utility (see the User's Guide) to set bit 3 of
the Program Flag.
3-7
3.5 Direct Video Mapping Concurrent DOS 86 Programmer's Guide
Note that by-passing Concurrent's Character 1/0 system calls negates the
concurrency of a process, because Concurrent suspends it from running (If bit 3 of
Program Flag is set) unless It Is running In the foreground.
End of Section 3
3-8
SECTION 4
When Concurrent loads a program, the initial values of the segment registers, the
instruction pointer. and the stack pointer are determined by the memory model
indicated in the CMD file header record.
There are three transient program models, the 8080 model, the Small Model, and
the Compact Model, summarized in Table 4-1.
The 8080 Model supports programs that are directly translated from an 8080
environment where code and data are intermixed. The 8080 Model consists of one
group containing all the code, data, and stack areas. Segment registers are
initialized to the starting address of the region containing this group. The segment
registers can, however, be managed by the program during execution so that
multiple segments in the code group can be addressed.
The Small Model is similar to that defined by Intel, consisting of an independent
code group and a data group. The code and data groups often consist of, but are
not restricted to, single 64K byte segments.
The Compact Model occurs when any of the extra, stack, or auxiliary groups are
present in a program. Each group can consist of one or more segments, but if any
group exceeds one segment in size, or if auxiliary groups are present, then the
program must manage its own segment registers during execution in order to
address all code and data areas.
The three memory models differ primarily in how Concurrent initializes the
segment registers when it loads a program. P_LOAD determines which memory
model to use by examining the program group usage, as described in the following
sections.
4-1
4.0 Concurrent DOS 86 Programmer's Guide
For all three memory models, Concurrent initializes an internal 96-byte stack. The
first two words of this stack are reserved for the double word return for
termination by a RETF (Far return) instruction. Figure 4-1 shows the initial
program stack for all three memory models.
+-----------+
IRet Segment!
Far Return Address 1-----------1
SS:SP------------> IRet Offset I
1-----------1
I I
I 92 bytes I
I I
+-----------+
Figure 4-1. Initial Program Stack
P_LOAD assumes the 8080 Model when the transient program contains only a code
group. The intermixed code and data areas are indistinguishable. In this case,
P_CU (Command Line Interpreter) initializes the CS, OS, and ES registers to the
beginning of the code group and sets the SS and SP registers to a 96-byte initial
stack area that it allocates.
Note: P _cu initializes the stack so that if the process executes a Far Return
instruction, it terminates. P _cu sets the Instruction Pointer (IP) Register to 1OOH,
thus allowing Base Page values at the ·beginning of the code group. Following
program load, the 8080 Model appears as shown in Figure 4-2.
4-2
Concurrent DOS 86 Programmer's Guide 4.1 The 8080 Memory Model
+------------+
I CODE/DATA
I
I
I
I CODE/DATA I
CS:IP ---> OlOOH 1------------1
I I
I BASE PAGE I
I I
CS:O,DS:O,ES:O ---> OOOOH +------------+
Figure 4-2. 8080 Memory Model
The following RASM-86 code fragment shows how to define an 8080 Model
transient program.
cseg
org lOOh
{code)
endcs equ $
dseg
org offset endcs
{data)
end
P LOAD assumes the Small Model when the transient program contains both a
code and data group. (In RASM-86, all code is generated following a CSEG
directive. Data is defined following a DSEG directive, with the origin of the Data
Segment independent of the Code Segment.)
In this model, P CLI sets the CS register to the beginning of the code group, the IP
to OOOOH, the D-S and ES registers to the beginning of the data group, and the SS
and SP registers to a 96-byte initial stack area that it initializes. Following
program load, the Small Model appears as shown in Figure 4-3.
4-3
4.2 The Small Memory Model Concurrent DOS 86 Programmer's Guide
+-----------+ +-----------+
I
I
CODE I DATA I
OlOOH 1-----------1
I I
CS:O DS:O I BASE PAGE I
IP:O -> OOOOH +-----------+ ES:O -> OOOOH +-----------+
Figure 4-3. Small Memory Model
The machine code begins at CS+OOOOH, the Base Page values begin at DS+OOOOH,
and the data area starts at OS+OlOOH.
The following RASM-86 code fragment shows how to define a Small Model
transient program.
cseg
(code)
dseg
org lOOh
(data)
end
P_LOAD assumes the Compact Model when code and data groups are present,
along with one or more of the remaining stack. extra, or auxiliary groups. In this
case. P _cu sets the CS, OS, and ES registers to the base addresses of their
respective areas, with the IP set to OOOOH, and the SS and SP registers set to a
96-byte stack area it allocates.
Figure 4-4 shows the initial configuration of the segments in the Compact Model.
The values of the various segment registers can be changed during execution by
loading from the initial values placed in Base Page. This allows access to the
entire memory space.
4-4
Concurrent DOS 86 Programmer's Guide 4.3 The Compact Memory Model
If the transient program intends to use the stack group as a stack area, the SS and
SP registers must be set upon entry. The SS and SP registers remain in the initial
stack area, even if a stack group is defined.
Although it appears that the SS and SP registers should be set to address the
stack group, there are two contradictions. First, the transient program might be
using the stack group as a data area. In that case, the stack values set by P_CLI
so a tar return can terminate a transient program could overwrite data in the stack
area. Second. the SS register would logically be set to the base of the group,
while the SP would be set to the offset of the end of the group. However, if the
stack group exceeds 64K, the address range from the base to the end of the group
exceeds a 16-bit offset value.
The following RASM-86 code fragment shows how to define a Compact Model
transient program.
cseg
(code)
dseg
org lOOh
(data)
eseg
(more data)
sseg
(stack area)
end
End of Section 4
4-5
SECTION 5
Resident System Processes are programs that become part of Concurrent during
system generation. GENCCPM searches the directory for all files with the filetype
RSP and prompts you to choose whether to include them in the system file,
CCPM.SYS. You create an RSP file by generating a CMD file and then renaming it
with an RSP filetype.
RSPs can be useful in several ways: to create a turnkey system, autoloading
programs when Concurrent is booted; to build customized user interfaces or shells
at the consoles, for monitoring hardware not supported in the XIOS; and to avoid
disk loading time for frequently-used commands.
Appendix A includes the source code for the ECHO RSP. Study this listing carefully
while reading this section. The discussion of P_CREATE in Section 6 is also helpful
in understanding RSPs.
RSPs have two memory models that are similar to the 8080 Model and the Small
Model for transient programs. However, there are several important distinctions
between transient program and RSP memory models.
The RSP has no equivalent of the Base Page in a transient program's Data
Segment. The RSP is responsible for its own Process Descriptor (PD) and User
Data Area (UDA). The RSP must also allocate an additional 96 bytes at the end of
the User Data Area if 8087 processing is required. Concurrent automatically
creates and initializes these data structures for transient programs at load time.
RSPs, on the other hand, must initialize these structures within their own Data
Segments (See P_CU and P_CREATE in Section 6 for PD and UDA descriptions).
Although there is no Base Page in an RSP, there is an RSP header that must exist
at offset OOH of the Data Segment. In the 8080 Model, this implies that the RSP
header is in the Code Segment. Section 5.4 describes the RSP header and its
associated data structures.
5-1
5.2 RSP Memory Models Concurrent DOS 86 Programmer's Guide
GENCCPM assumes the 8080 Model if the RSP's CMD File Header Record has a
single Code Group Descriptor and no other Group Descriptors (refer to Section
3.3). When discussing an 8080 Model RSP, any reference to the Data Segment also
refers to the Code Segment.
Note: Concurrent does not support compact model RSPs. Extra and Stack
Segments must be part of the Data Segment.
GENCCPM can make up to 255 copies of an RSP, with each copy generating a
separate process. The number of copies made by GENCCPM can be fixed, or
dependent on a byte value in the System Data Area. To determine the numbe~ of
copies to make, GENCCPM examines the RSP Header. Figure 5-2 shows the RSP
Header format.
5-2
Concurrent DOS 86 Programmer's Guide 5.3 Multiple Copies of RSPs
5-3
5.3 Multiple Copies of RSPs Concurrent DOS 86 Programmer's Guide
An RSP that is to be invoked from a console, or through a P_CU call, must create a
special queue called an ASP Command Queue. Such an ASP is called a Command
RSP. and usually performs some initialization routine then goes into a loop. The
initialization routine consists of creating and opening an RSP Command Queue as
well as changing the priority to the default transient process priority. (Priority
values with regard to RSPs are discussed below.)
The first step of the loop reads a message from the RSP Command Queue. The
process that writes the message to the RSP Command Queue activates the
associated RSP. After the RSP returns from the Q_READ call, it obtains the system
resources it needs, such as the calling process's console.
Typically, P_CU assigns the RSP process the console process after successfully
writing the command tail to the RSP Queue. This is only true if the RSP Process
Descriptor name matches the RSP Command Queue name. See P_CU in Section 6
for more information.
When the RSP completes its activities for the given command, it releases any
system resources it has acquired, including the console, and restarts the loop by
reading from its RSP Command Queue.
A Command RSP is a single process and is a serially reusable resource; in other
words, the RSP acts on one message at a time. When several processes attempt
to invoke a single Command RSP, they must wait. See Q_READ, Q_CREAD,
Q_WRITE and Q_CWRITE in Section 6 for further details.
Note: It is certainly possible to create ASPs that are invoked differently.
Figure 5-3 shows the RSP Command Queue Message format.
The PDADDRESS is the offset (relative to the System Data Area segment) of the
Process Descriptor of the process calling the RSP. A program that wants to invoke
an RSP and is forming an RSP Command Queue Message, can find its Process
Descriptor address by calling P PDADA. The COMMAND TAIL usually contains what
the TMP sends to P_CU minus -the command name, and is terminated with a zero
byte.
When you enter a command at a console, the TMP performs a P_cu call which
attempts to open a queue that has the RSP Flag on, and has the same name as
the command sent to the CU. If the Q OPEN is successful, P CU attempts to
assign the calling process's console to a- process with the same name as the
command.
5-4
Concurrent DOS 86 Programmer's Guide 5.4 Creating and Initializing an RSP
P_CLI then creates an RSP Command Queue Message with the command tail sent
to the CU from the TMP. and writes it to the RSP Command Queue. A transient
program can use a Command ASP in the same manner by writing directly to the
appropriate RSP Command Queue. An advantage of using P_CU is that it looks for
an RSP first and only searches on disk for a CMD file if the the ASP is not found.
When an RSP reads a ASP Command Queue Message, it often needs information
about the calling process, such as which console, list device, drive, or user number
to use. If a P_CU call invokes an ASP, the RSP is assigned the calling process's
console, but if the ASP Command Queue is written to directly, the calling process
might or might not assign its console to the ASP.
A Command ASP can use the PD address in the Command ASP Message to find
out what the default devices of the calling process are. The ASP should release
any resources it assigns to itself when it is finished.
The ASP Header begins at offset 0 from the beginning of the RSP Data Segment.
Note that in the 8080 Model, the ASP Header is also in the Code Segment. After
the ASP Header is a Process Descriptor starting at offset 010H. A User Data Area
and a stack must also be within the Data Segment, with the UDA placed at a
paragraph boundary relative to the beginning of the Data Segment.
If system calls assuming a default OMA buffer are used, a 128-byte OMA Buffer
must also exist. The OMA OFFSET field in the User Data Area should be set to the
address of the OMA buffer. When Concurrent creates the process, the OMA
SEGMENT field is initialized to the same value as the OS register. The OMA
SEGMENT and OFFSET can also be set by calling F_DMASEG and F_DMAOFF once
the RSP is running.
Figure 5-4 shows the beginning of the ASP Data Segment.
5-5
5.4 Creating and Initializing an RSP Concurrent DOS 86 Programmer's Guide
PROGRAM, DATA,
AND RSP STACK
1--------------------IOlAOH
I I
I Optional 8087 I
I UDA extension I
I I
l--------------------I0140H
I USER I
I DATA I
I AREA I
l--------------------l0040H
I PROCESS DESCRIPTOR I
1--------------------IOOlOH
I RSP HEADER I
DS: --> +--------------------+
Figure 5-4. RSP Data Segment
The RSP Header must be located at offset zero in the RSP Data Segment, the RSP
Process Descriptor must be at offset OlOH, and the RSP User Data Area must
begin on an even paragraph boundary.
5-6
Concurrent DOS 86 Programmer's Guide 5.4 Creating and Initializing an RSP
Note: There are no guarantees about the order in which Concurrent creates the
RSPs. If one RSP must run before another, it must have a higher priority. Such is
the case when one RSP uses a resource created by a second RSP; the second
must run (at least during initialization) with a priority higher than the first.
The Process Descriptor SYS and KEEP Flags can be initialized in the RSP Data
Segment. The SYS Flag allows a process to read and write to and from restricted
system queues. This is discussed below with regard to RSP Command Queues.
The KEEP flag signals Concurrent that the process cannot be terminated. KEEP is
necessary if an RSP is not to be terminated when you type CTRL-C on a console
being used by the RSP. The 8087 flag tells Concurrent that a process is actively
using the 8087 processor.
The NAME field of the RSP's Process Descriptor is 8 bytes long. It is assumed to
be left-justified and padded with blanks on the right. If an RSP Command Queue
is going to be used to invoke the RSP through the CU, the PD must have the same
upper-case name as the Command Queue.
The UDA field in the Process Descriptor must be the offset (in paragraphs) of the
UDA relative to the RSP data segment. GENCCPM restores the UDA field In the
Process Descriptor to the actual UDA paragraph address when the system is
loaded.
If the PD field name is not the same as the Command Queue, the CU does not
assign the console to the RSP.
5-7
5.4 Creating and Initializing an RSP Concurrent DOS 86 Programmer's Guide
5-8
Concurrent DOS 86 Programmer's Guide 5.4 Creating and Initializing an RSP
Note: For any queues created by an RSP, the Queue Buffer areas associated with
the Queue Descriptor and the Queue Parameter Block are separate, distinct areas
of storage.
The first RSP you attempt should be very simple, on the order of the ECHO RSP.
New RSPs should be developed and debugged as if they were transient processes,
such as Concurrent's CMD utilities, then converted into RSPs.
An RSP debugging session should proceed like an XIOS debugging session: first
load CP/M-86, then invoke SID-86™, and then bring up Concurrent. The ~~_t_e_m
Q!-JL<l!! provides more information about running Concurrent under CP/M-86.
After reading in the CCPM.SYS file under SID-86, find the RSPSEG field of the
System Data Segment (SYSDAT). The paragraph address of the SYSDAT is found
in the A_BASE field of the Data Group Descriptor in the CCPM.SYS command file
header. The RSPSEG field contains the paragraph address of the Data Segment of
the first RSP in a lin.ked list of the RSPs included by GENCCPM.
See S SYSDAT in Section 6 for details of SYSDAT.
Using SID-86's Display Memory (D) command to show memory at the segment
RSPSEG, you can identify the name of the first RSP in the RSP's Process
Descriptor. The LINK field in the RSP Header, which is the first word in the
RSPSEG segment, is the paragraph value of the next RSP's Data Segment. A zero
in the LINK field means the end of the list of RSPs.
Note that linkage information is lost once Concurrent is initialized. The LINK field
of the RSP Header contains the System Data Segment once an RSP begins
execution.
Once you locate the RSP to be debugged, the initial code entry point can also be
found. As discussed previously, the SP field in the RSP's UDA is the offset from
the beginning of the RSP's Data Segment of the three-word IRET structure. The
first word of the IRET structure contains the initial value of the IP register when
Concurrent creates the RSP process. The initial value of the CS register is in the
CS field also in the RSP's UDA. Once this is done, you can set break points in the
RSP, similar to setting break points in XIOS system calls.
End of Section 5
5-9
SECTION 6
This section summarizes the Concurrent DOS 86 system calls in tabular form. It is
intended both as an introduction to the calls and as a reference for use when
programming. You should be familiar with the material in Sections 1 through 5
before proceeding.
Note: The system calls described in this section are native to Concurrent. Section
7 describes the DOS system calls that Concurrent emulates. It is strongly
recommended that you do not mix Concurrent and DOS system calls in the same
program; code purely in one or the other.
Table 6-1 describes the functional categories of Concurrent system calls and their
general uses.
Table 6-2 lists the system calls in each category and serves as a quick reference
to find the call you need while programming.
Table 6-3 is a summary of the system calls in alphabetical order (by mnemonics)
along with the parameters you must pass when making the call, and the values
returned by the call.
Table 6-4 lists the system calls numerically by function number.
Table 6-5 lists the error codes returned in register CX.
Table 6-6 is an index of the page numbers and figure titles for commonly used
data structures.
6-1
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
Category Use
6-2
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
Category Use
6-3
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
Mnemonic Definition
6-4
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
Mnemonic Definition
C SET Set or change the default virtual console for the calling process.
C STAT Obtain the input status of the default virtual console.
C WRITE Write a character to the default virtual console.
C WRITEBLK Write a specified number (block) of characters to the default
virtual console.
C_WRITESTR Write a string to the default virtual console until delimiter.
Device Calls
DEV POLL Poll a noninterrupt-driven device.
DEV SETFLAG Set a system flag.
DEV WAITFLAG Wait for a system flag to be set before restoring the current
process.
Disk Drive Calls
ORV_ACCESS Indicate access to specified drives.
ORV ALLOCVEC Get the address of the disk Allocation Vector.
ORV ALLRESET Reset all disk drives.
ORV DPB Return the segment and offset address of the Disk Parameter
Block for the default disk of the calling process.
ORV_FLUSH Write internal pending blocking/deblocking data buffers to disk.
ORV FREE Relinquish access to specified drives.
ORV GET Return the default drive of the calling process.
ORV GETLABEL Return the directory label data byte for the specified drive.
ORV LOGINVEC Return bit map of logged-in disk drives.
ORV RESET Reset the specified drives.
DRV_ROVEC Return bit map vector of drives set to Read-Only.
ORV SET Set default drive of calling process.
ORV SETLABEL Create or update a directory label.
DRV_SETRO Set the default drive to Read-Only.
ORV_SPACE Return unallocated space on the specified drive.
6-5
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
Mnemonic Definition
6-6
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
Mnemonic Definition
6-7
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
Mnemonic Definition
Process/Program Calls
P ABORT Terminate a process specified by name or Process Descriptor
address.
P CHAIN Pass control to the program specified in the OMA buffer.
p cu Interpret and execute the specified command line by calling
Command Line Interpreter (CU).
P CREATE Create a subprocess.
P DELAY Suspend the calling process for a specified number of system
clock ticks.
P DISPATCH Force a dispatch operation; give up the CPU resource to the
highest priority process ready to run.
P LOAD Load the specified CMD file in memory; return its Base Page
segment address.
P PDADR Return the address of the Process Descriptor of the calling
process.
P PRIORITY Set the priority of the calling process.
P RPL Invoke a system call from a Resident Procedure Library.
P TERM Terminate the calling process.
P TERMCPM Terminate calling process unconditionally, release all owned
resources.
6-8
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
Mnemonic Definition
6-9
6.1 Reference Tablas Concurrent DOS 86 Programmer's Guide
6-10
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
6-11
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
6-12
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
6-13
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
0 0 P TERMCPM
1 1 C READ
2 2 C WRITE
3 3 A READ
4 4 A WRITE
5 5 L WRITE
6 6 C RAWIO
7 7 A STATIN
8 8 A STATOUT
9 9 C WRITESTR
10 A C READSTR
11 B C STAT
12 c S BDOSVER
13 D ORV ALLRESET
14 E ORV SET
15 F F OPEN
16 10 F_CLOSE
17 11 F_SFIRST
18 12 F_SNEXT
19 13 F DELETE
20 14 F READ
21 15 F WRITE
22 16 F MAKE
23 17 F RENAME
24 18 ORV LOGINVEC
25 19 DRV_GET
26 lA F DMAOFF
27 18 ORV ALLOCVEC
28 lC ORV SETRO
29 10 ORV-ROVEC
30 lE F ATTRIB
31 lF ORV OPB
32 20 F USERNUM
33 21 F READRANO
34 22 F WRITERANO
35 23 F SIZE
36 24 F RANDREC
37 25 ORV RESET
38 26 ORV_ACCESS
39 27 ORV_FREE
40 28 F WRITEZF
6-14
Concurrent DOS 86 Programmer's Guide 6. 1 Reference Tables
42 2A FLOCK
43 2B F UNLOCK
44 2C F MULTISEC
45 20 F ERRMODE
46 2E ORV SPACE
47 2F P CHAIN
48 30 ORV FLUSH
50 32 S BIOS
51 33 F DMASEG
52 34 F DMAGET
53 35 MC MAX
54 36 MC ABSMAX
55 37 MC ALLOC
56 38 MC ABSALLOC
57 39 MC FREE
58 3A MC ALLFREE
59 3B P LOAD
99 63 F TRUNCATE
100 64 ORV SETLABEL
101 65 ORV GETLABEL
102 66 F TIMEDATE
103 67 F WRITEXFCB
104 68 T SET
105 69 T GET
106 SA F PASSWD
107 6B S SERIAL
109 60 C MODE
110 6E C DELIMIT
111 6F C WRITEBLK
112 70 L WRITEBLK
116 74 F SETDATE
128 80 M ALLOC
129 81 M_ALLOC
130 82 M FREE
131 83 DEV POLL
132 84 DEV WAITFLAG
133 85 DEV SETFLAG
134 86 Q MAKE
135 87 Q OPEN
136 88 O_DELETE
137 89 Q READ
6-15
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
138 SA Q CREAD
139 SB Q WRITE
140 SC Q CWRITE
141 SD P DELAY
142 SE P DISPATCH
143 SF P TERM
144 90 P CREATE
145 91 P PRIORITY
146 92 C ATTACH
147 93 C DETACH
148 94 C SET
149 95 C ASSIGN
150 96 p cu
151 97 P RPL
152 98 F PARSE
153 99 C GET
154 9A S SYSDAT
155 9B T SECONDS
156 9C P PDADR
157 9D P ABORT
158 9E L ATTACH
159 9F L DETACH
160 AO L SET
161 Al L CATTACH
162 A2 C CATTACH
163 A3 S OSVER
164 A4 L GET
165 AS A ATTACH
166 A6 A_DETACH
167 A7 A CATTACH
16S AS A SET
169 A9 A GET
172 AC A READBLK
173 AD A WRITEBLK
6-16
Concurrent DOS 86 Programmer's Guide 6.1 Reference Tables
0 OOH No error
1 OlH System call not implemented
2 02H Illegal system call number
3 03H Cannot find memory
4 04H Illegal flag number
5 05H Flag overrun
6 06H Flag underrun
7 07H No unused Queue Descriptors
8 08H No free queue buffer
9 09H Cannot find queue
10 OAH Queue in use
12 OCH No free process descriptors
13 OOH No queue access
14 OEH Empty queue
15 OFH Full queue
16 10H CLI queue missing
17 11H No 8087 in system
18 12H No unused Memory Descriptors
19 13H Illegal console number
20 14H No Process Descriptor match
21 15H No console match
22 16H No CLI process
23 17H Illegal disk number
24 18H Illegal filename
25 19H Illegal filetype
26 lAH Character not ready
27 1BH Illegal memory descriptor
28 lCH Bad return from BOOS load
29 1DH Bad return from BOOS read
30 1EH Bad return from BOOS open
31 1FH Null command
32 20H Not owner of resource
33 21H No CSEG in load file
34 22H Process Descriptor exists on Thread Root
35 23H Could not terminate process
36 24H Cannot attach to process
37 25H Illegal list device number
38 26H Illegal password
40 28H External termination occurred
41 29H Fixup error upon load
42 2AH Flag set ignored
43 2BH Illegal auxiliary device number
6-17
6.1 Reference Tables Concurrent DOS 86 Programmer's Guide
6-18
Concurrent DOS 86 Programmer's Guide A ATTACH
A ATTACH
Entry Parameters:
Register CL: A5H (165)
A_ATTACH attaches the default auxiliary device to the calling process. If the
auxiliary device is already owned by the calling process or if it is not owned by
another process, A_ATTACH immediately returns with ownership established and
verified. If another process owns the auxiliary device, the calling process
relinquishes the CPU and waits until the auxiliary device becomes available.
The A_READ, A_READBLK, A_WRITE, and A_WRITEBLK calls internally invoke
A_ATTACH to ensure the calling process owns the auxiliary device before
attempting the appropriate read or write operation. If the process does not own
the device, these Auxiliary Device 1/0 system calls use A_ATTACH to establish
ownership.
The preferred method of performing auxiliary device 1/0 is to call A ATTACH to
establish device ownership before invoking the appropriate read or write system
function.
6-19
A CATTACH Concurrent DOS 86 Programmer's Guide
A CATTACH
Entry Parameters:
Register CL: A7H (167)
Returned Values:
Register AX: 0000 on attach, FFFFH on failure
BX: Same as AX
A_CATTACH attaches the default auxiliary device to the calling process only if the
device is currently available. If the auxiliary device is currently attached to another
process, A_ATTACH returns a value of FFFFH to indicate the device could not be
attached. A_CATTACH returns a value of 0000 to indicate that either the auxiliary
device Is already attached to the process, or that it was successful in attaching the
device.
6-20
Concurrent DOS 86 Programmer's Guide A DETACH
A DETACH
Entry Parameters:
Register CL: ASH (166)
Returned Values:
Register AX: 0000 on detach. FFFFH on failure
BX: Same as AX
CX: Error code
A_DETACH detaches the default auxiliary device from the calling process.
A_DETACH performs no action if the auxiliary device is not currently attached to
the calling process.
Table 6-5 contains the list of error codes returned in register CX.
6-21
A GET Concurrent DOS 86 Programmer's Guide
A GET
Entry Parameters:
Register CL: A9H (169)
Returned Values:
Register AL: Auxiliary device number
BL: Same as AL
A_GET returns the default auxiliary device number of the calling process.
6-22
Concurrent DOS 86 Programmer's Gulde A READ
A READ
Entry Parameters:
Register CL: 03H (3)
Returned Values:
Register AL: ASCII character
BL: Same as AL
A_READ reads the next 8-bit character from the logical auxiliary input device
(AUXIN:) and returns It In register AL. Before reading the character, Concurrent
internally calls A_ATTACH to ensure that the calling process owns its default
auxiliary device (see A_ATTACH). A_READ does not return control to the calling
process until it has read the character.
6-23
A READBLK Concurrent DOS 86 Programmer's Guide
A READBLK
Entry Parameters:
Register CL: ACH (172)
DX: CHCB address
Returned Values:
Register AX: Number of characters read
BX: Same as AX
A_READBLK reads characters from the default auxiliary input device (AUXIN:) and
writes them into the character buffer located by the Character Control Block
(CHCB) addressed in OX. Concurrent calls A ATTACH to ensure the calling process
owns its default auxiliary device before -performing the read operation (see
A_ATTACH).
The format of the CHCB is as follows:
Bytes 0-1: Offset of character buffer
Bytes 2-3: Segment address of character buffer
Bytes 4-5: Length of character buffer
A_READBLK returns the number of characters actually read from the default
auxiliary device in register AX. A READBLK returns to the calling process when the
status of AUXIN: indicates that th-e device is empty or the character buffer is full.
A_READBLK does not return control to the calling process until at least one
character has been read.
6-24
Concurrent DOS 86 Programmer's Guide A SET
A SET
Entry Parameters:
Register CL: ASH (168)
Dl: Auxiliary device number
Returned Values:
Register AX: 0000 on set, FFFF on failure
BX: Same as AX
CX: Error code
A_SET sets the default auxiliary device for the calling process.
Table 6-5 contains the list of error codes returned in register CX.
6-25
A STATIN Concurrent DOS 86 Programmer's Guide
A STATIN
Entry Parameters:
Register Cl: 07H (7)
Returned Values:
Register AL: FFH Character ready, 00 Not ready
Bl: Same as AL
A_STATIN checks the Input status of the AUXIN: device. If a character is ready for
Input from the auxiliary device, A_STATIN returns the value FFH in register AL.
A_STATIN returns OOH If no Input is ready.
6-26
Concurrent DOS 86 Programmer's Guide A STATOUT
A STATOUT
Entry Parameters:
Register CL: 08H (8)
Returned Values:
Register AL: FFH Ready for output, 00 Not ready
BL: Same as AL
A_STATOUT checks the output status of the AUXOUT: device. If AUXOUT: is ready
for output, A_STATOUT returns the value FFH in register AL A STATOUT returns
OOH if the auxiliary device is not ready for output.
6-27
A WRITE Concurrent DOS 86 Programmer's Guide
A WRITE
Entry Parameters:
Register CL: 04H (4)
DL: ASCII character
A_WRITE writes the specified character to the default auxiliary device of the calling
process. Before writing the character, A WRITE calls A ATTACH to ensure the
calling process owns Its default auxiliary device. If the process does not own the
device, A_WRITE uses A_ATTACH to establish ownership (see A_ATTACH).
6-28
Concurrent DOS 86 Programmer's Guide A WRITEBLK
A WRITEBLK
Entry Parameters:
Register CL: ADH ( 173)
DX: CHCB address
Returned Values:
Register AX: Number of characters written
BX: Same as AX
A_WRITEBLK writes the character string located by the Character Control Block
(CHCB) addressed in register DX to the default auxiliary device. As with A WRITE,
Concurrent ensures the calling process owns the auxiliary device by - calling
A_ATTACH before attempting the write operation (see A_ATTACH).
The format of the CHCB is as follows:
Bytes 0-1: Offset of character string
Bytes 2-3: Segment address of character string
Bytes 4-5: Length of character string
A_WRITEBLK returns the number of characters written to the default auxiliary
device in register AX. A_WRITEBLK returns to the calling process when the status
of AUXOUT: indicates that the device is full or the character string has been
written. A_WRITEBLK does not return control to the calling process until at least
one character has been written.
6-29
C ASSIGN Concurrent DOS 86 Programmer's Gulde
C ASSIGN
Entry Parameters:
Register CL: 095H (149)
DX: ACB Address - Offset
OS: ACB Address - Segment
Returned Values:
Register AX: 0 If assign "OK", OFFFFH on Failure
BX: Same as AX
CX: Error Code
+-----------------------+
00 I CNS I MATCH I PD I
!------------------------------------------------+
04 I NAME I
+------------------------------------------------+
Figure 6-1. ACB - Assign Control Block
6-30
Concurrent DOS 86 Programmer's Guide C ASSIGN
Field Definitions
6-31
C ATTACH Concurrent DOS 86 Programmer's Guide
C ATTACH
Entry Parameters:
Register CL: 092H ( 146)
C_ATTACH attaches the default console to the calling process. If the console is
already owned by the calling process or if it is not owned by another process,
C_ATTACH immediately returns with ownership established and verified. If another
process owns the console, the calling process waits until the console becomes
available.
6-32
Concurrent DOS 86 Programmer's Guide C CATTACH
C CATTACH
Entry Parameters:
Register CL: OA2H (162)
Returned Values:
Register AX: 0 if attach 'OK', OFFFFH on failure
BX: Same as AX
CX: Error Code
C_CATTACH attaches the default console of the calling process only if the console
is currently unattached. If the console is currently attached to another process,
C_CATTACH returns a value of OFFH indicating the console could not be attached.
C_CATTACH returns a value of O to indicate that either the console is already
attached to the process or that it was unattached and a successful attach
operation was made.
Table 6-5 contains the list of error codes returned in ex.
6-33
C DELIMIT Concurrent DOS 86 Programmer's Guide
C DELIMIT
Entry Parameters:
Register CL: 06EH (110)
DX: OFFFFH (get) or
Dl: Output Delimiter (set)
Returned Values:
Register Al: Output Delimiter, or no value if set
Bl: Same as Al
6-34
Concurrent DOS 86 Programmer's Guide C DETACH
C DETACH
Entry Parameters:
Register CL: 093H (147)
Returned Values:
Register AX: 0 if detach 'OK", OFFFFH on failure
BX: Same as AX
C DETACH detaches the default console from the calling process. If the default
console is not attached to the calling process. no action is taken. If other
processes are waiting to attach to the console, the process with the highest
priority attaches the console. If there is more than one process with the same
priority waiting for the console, it is given to the queue writing processes on a
first-come. first-serve basis.
6-35
C GET Concurrent DOS 86 Programmer's Guide
C GET
Entry Parameters:
Register CL: 099H ( 153)
Returned Values:
Register AL: Console number
BL: Same as AL
6-36
Concurrent DOS 86 Programmer's Guide C MODE
C MODE
Entry Parameters:
Register CL: 06DH (109)
DX: FFFFH (get) or Console mode (Set)
Returned Values:
Register AX: Console mode or (no value)
BX: Same as AX
C_MODE can set or interrogate the Console Mode, which is a 16-bit system
parameter that determines the action of certain Console 1/0 functions. The
Console Mode is set to zero when a new process created; it is not inherited from
its parent.
If register DX = FFFFH, C_MODE returns the current Console Mode in register AX.
Otherwise, C_MODE sets the Console Mode to the value contained in register DX.
The Console Mode definition is:
Note that the Console mode bits are numbered from right to left.
6-37
C RAWIO Concurrent DOS 86 Programmer's Guide
C RAWIO
Entry Parameters:
Register CL: 06H (6)
DL: OFFH (Input/Status) or
OFEH (Status) or
OFDH (Input) or Character (Output)
Returned Values:
Register AL: (Input/Status)
,. OH (No Character)
• Character
(Status)
• OH (No Character)
• OFFH (Ready)
(Input)
• Character
(Output)
No return value
BL: Same as AL
C_RAWIO allows the calling process to do raw console 1/0 to its default console.
Concurrent verifies that the calling process owns its default console before
allowing any 1/0.
In Raw mode, the CTRL-C, CTRL-P, CTRL-S, and CTRL-0 characters are not acted
on by the PIN (Physical Input Process) but are passed on to the calling process.
Note: If the virtual console is in CRTL-S mode, and the process that owns the
virtual console then performs a C_RAWIO call, the CTRL-S state is reset.
A process calls C_RAWIO by passing one of three values shown in Table 6-8.
6-38
Concurrent DOS 86 Programmer's Guide C RAWIO
Value Description
6-39
C READ Concurrent DOS 86 Programmer's Guide
C READ
Entry Parameters:
Register CL: 01 H ( 1)
Returned Values:
Register AL: Character
BL: Same as AL
C_READ reads a character from the default console of the calling process. Before
attempting the read, Concurrent verifies the ownership of the console. If the
calling process does not own the console, It relinquishes the CPU resource until
the calling process can attach to the console. Typically, a process created through
a P_CU call owns its default console when it begins execution.
C_READ echoes graphic characters read from the console. This includes the
carriage return, line feed, and backspace characters. It expands tab characters
(CTRL-1) in columns of eight characters.
C_READ ignores the termination character (CTRL-C) if the calling process cannot
terminate (refer to P_TERM). C_READ does not return until a character is typed on
the console. Concurrent suspends the calling process until a character Is ready.
6-40
Concurrent DOS 86 Programmer's Guide C READSTR
C READSTR
Entry Parameters:
Register CL: OAH ( 10)
DX: Console Buffer Address - Offset
OS: Console Buffer Address - Segment
C_READS TR reads characters from the calling process's default console and places
them into the specified Console Buffer. Figure 6-2 shows the format of the
Console Buffer, and Table 6-9 lists the Console Buffer field definitions.
C_READSTR performs line-editing system calls on the line as it is read from the
console; it completes a line and returns upon receiving a terminator character
(carriage return or line feed) from the console, or when the maximum number of
characters is reached.
As with C_READ, C_READSTR echoes all graphic characters read from the console.
Concurrent verifies that the calling process owns its default console before
allowing 1/0 to begin.
0 1 MAX + 2
+------------------------------------------------+
I MAX I NCHAR I CHARACTERS .•.
+------------------------------------------------+
figure 6-2. Console Buffer Format
Field Definition
6-41
C READSTR Concurrent DOS 86 Programmer's Guide
Character Function
6-42
Concurrent DOS 86 Programmer's Guide C READSTR
Character Function
CTRL R Toggles the search mode on/off for the current line. After
entering the line, the search mode returns to the default
(off).
CTRL Toggles the default search mode on/off and sets the
current line's mode to the new default. Initially, the default
begins each line with the search mode off.
RUB/DEL Same as CTRL-H.
BACKSPACE Same as CTRL-H.
6-43
C SET Concurrent DOS 86 Programmer's Guide
C SET
Entry Parameters:
Register CL: 094H (148)
DL: Console Number
Returned Values:
AX: O If successful, OFFFFH on failure
BX: Same as AX
CX: Error Code
C_SET changes the calling process's default console to the value specified. If the
console number specified Is not one supported by this particular implementation of
Concurrent, C_SET returns an error code, and does not change the default console.
Table 6-5 contains the list of error codes returned in CX.
6-44
Concurrent DOS 86 Programmer's Guide C STAT
C STAT
Entry Parameters:
Register CL: OBH (11)
Returned Values:
Register AL: 01 H character ready, OOH not ready
BL: Same as AL
C_STAT checks to see if a character has been typed at the default console. If the
calling process is not attached to its default console, C_STAT causes a dispatch to
occur and returns OOH (the Not Ready condition).
C STAT sets the console to the Nonraw mode, allowing recognition of special
control characters such as the terminate character, CTRL-C. Use C_RAWIO to
obtain console status in Raw mode.
Note: If C_MODE is used to set bit 0 in the console mode word, C STAT only
returns AL = 01 H when a CTRL-C is typed on the default console.
6-45
C WRITE Concurrent DOS 86 Programmer's Guide
C WRITE
Entry Parameters:
Register CL: 02H (2)
DL: ASCII character
C_WRITE writes the specified character to the calling process's default console. As
with C_READ, Concurrent verifies that the calling process owns its default console
before performing the operation. On output, C_WRITE expands tabs in columns of
eight characters.
6-46
Concurrent DOS 86 Programmer's Guide C WRITEBLK
C WRITEBLK
Entry Parameters:
Register CL: 06FH (111)
DX: CHCB Address
C_WRITEBLK sends the character string located by the Character Control Block
CHCB, addressed in register pair DX to the logical console, CONOUT:. If the
Console mode is in the default state, C_WRITEBLK expands CTRL-1 tab characters in
columns of eight characters.
The CHCB format is:
bytes 0-1: Offset of character string
bytes 2-3: Segment of character string
bytes 4-5: Length of character string to print
6-47
C WRITESTR Concurrent DOS 86 Programmer's Guide
C WRITESTR
Entry Parameters:
Register CL: 09H (9)
DX: STRING Address - Offset
OS: STRING Address - Segment
C_WRITESTR prints an ASCII string starting at the indicated string address and
continuing until it reaches a dollar sign ($) character (024H; $ is the default string
delimiter, and can be changed by with C_DELIMIT). C_WRITESTR writes this string
to the calling process's default console.
Concurrent verifies that the calling process owns the console before writing the
string. C_WRITESTR sets the console to a Nonraw state and expands tabs in
columns of eight characters, as does C_WRITE.
Use C_WRITESTR whenever possible, rather than the single-character system calls.
The CPU overhead involved in handling the first character is the same as that for a
single-character system call, but subsequent characters require as little as one-
fifth the CPU overhead.
6-48
Concurrent DOS 86 Programmer's Guide DEV POLL
DEV POLL
Poll A Device
Entry Parameters:
Register CL: 083H ( 131)
DL: Device Number
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
6-49
DEV SETFLAG Concurrent DOS 86 Programmer's Guide
DEV SETFLAG
Entry Parameters:
Register CL: 085H (133)
DL: Flag Number
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
6-50
Concurrent DOS 86 Programmer's Guide DEV WAITFLAG
DEV WAITFLAG
Entry Parameters:
Register CL: 084H (132)
DL: Flag Number
Returned Values:
Register AX: 0 on success. OFFFFH on failure
BX: Same as AX
CX: Error Code
6-51
ORV ACCESS Concurrent DOS 86 Programmer's Gulde
ORV ACCESS
Entry Parameters:
Register CL: 026H (38)
DX: Drive Vector
Returned Values:
AL: Return Code
AH: Extended Error
BX: Same as AX
ORV_ACCESS inserts a special open file item into the system Lock list for each
drive specified in the Drive Vector, which is passed in register DX. While the item
exists In the Lock list, no other process can reset the drive. ORV_ACCESS inserts
no items if insufficient free space exists in the Lock list to support all the new
items. or If the number of items to be Inserted puts the calling process over the
Lock list open flle maximum.
Figure 6-3 Illustrates the format of the Drive Vector. The least significant bit
corresponds to drive A, and the high-order bit corresponds to the sixteenth drive,
labeled P.
Drive
+-------------------------------+
IPIOINIMILIKIJIIIHIGIFIEIDICIBIAI
+-------------------------------+
Bit 15 ••• 3 2 1
Figure 6-3. Drive Vector Structure
If the BOOS Is In the default Error mode (see F_ERRMODE), the file system displays
a message at the console Identifying the error and terminates the calling process.
Otherwise, ORV_ACCESS returns to the calling process with register AL set to OFFH
and register AH set to one of the following hexadecimal values:
OAH - Open File limit Exceeded
OBH - No Room In System Lock list
On successful calls, ORV_ACCESS returns with register Al set to OOH.
6-52
Concurrent DOS 86 Programmer's Guide ORV ALLOCVEC
ORV ALLOCVEC
Get Allocation Vector Address For the Calling Process's Default Disk
Entry Parameters:
Register CL: OlBH (27)
Returned Values:
Register AX: ALLOC Address - Offset
BX: Same as AX
ES: ALLOC Address - Segment
ORV_ALLOCVEC returns the address of the allocation vector (ALLOC) for the
currently selected drive. If a physical error is encountered when the BOOS Error
mode Is in one of the return modes (see F_ERRMODE), ORV_ALLOCVEC returns the
value OFFFFH in AX.
Concurrent maintains an allocation vector in memory for each active disk drive.
Some programs use the information provided by the allocation vector to determine
the amount of free data space on a drive. Note, however, that the allocation
information can be inaccurate if the drive has been marked Read-Only.
You can use ORV_SPACE to directly return the number of free 128-byte records on
a drive. Concurrent's SHOW utility displays a drive's free space by using the
ORV_SPACE call.
6-53
ORV ALLRESET Concurrent DOS 86 Programmer's Guide
ORV ALLRESET
Entry Parameters:
Register CL: OOH (13)
Returned Values:
Register AL: 0 if successful, OFFH on error
BL: Same as AL
ORV_ALLRESET restores the file system to a reset state where all the disk drives
are set to Read-Write (see also DRV_SETRO and DRV_ROVEC), the default disk is
set to drive A, and the default OMA address is reset to offset 080H relative to the
current OMA segment address.
DRV_ALLRESET can be used, for example, by an application program that requires
disk changes during operation. You can also use DRV_RESET for this purpose.
DRV_ALLRESET is conditional under Concurrent, so if another process has a file
open on any of the drives to be reset, and the drive is also Read-Only or
removable, the DRV_ALLRESET call is denied, and none of the specified drives are
reset (see Section 2.17).
Upon return, If the reset operation is successful, ORV_ALLRESET sets register AL to
OOH. Otherwise, it sets register AL to OFFH. If the BOOS is not in one of the
return error modes (see F ERRMODE), the file system displays an error message at
the console identifying the process owning the first open file that caused the
ORV ALLRESET to be denied.
6-54
Concurrent DOS 86 Programmer's Guide ORV DPB
ORV DPB
Entry Parameters:
Register CL: OlFH (31)
Returned Values:
Register AX: DPB Address - Offset, OFFFFH - on Physical Error
BX: Same as AX
ES: DPB Address - Segment
ORV_DPB returns the address of the XIOS-resident Disk Parameter Block (DPB) for
the currently selected drive. The calling process can use this address to extract
the disk parameter values.
If a physical error is encountered when the BOOS Error mode is one of the Return
Error modes (see F_ERRMODE), ORV_DPB returns the value OFFFFH.
Figure 6-4 shows the Disk Parameter Block format. Table 6-11 contains the DPB
field defintions.
+-----+-----+-----+-----+-----+-----+-----+-----+
OOH SPT I BSH I BLM I EXM I DSM I DRM I
+-----------+-----------+-----+-----+-----+-----+
08H I DRM I ALO I ALl I CKS OFF I PSH I
+-----------+-----+-----+-----+-----+-----+-----+
lOH I PRM I
+-----+
6-55
ORV DPB Concurrent DOS 86 Programmer's Guide
Field Definition
6-56
Concurrent DOS 86 Programmer's Guide ORV DPB
Field Definition
6-57
ORV FLUSH Concurrent DOS 86 Programmer's Guide
ORV FLUSH
Entry Parameters:
Register CL: 030H (48)
DL: Purge Flag
Returned Values:
Register AL: Error Flag
AH: Permanent Error
BX: Same as AX
6-58
Concurrent DOS 86 Programmer's Guida ORV FREE
ORV FREE
Entry Parameters:
Register CL: 027H (39)
DX: Drive Vector
ORV_FREE purges the system Lock List of all file and locked record items that
belong to the calling process on the specified drives. ORV_FREE passes the drive
vector in register DX.
ORV_FREE does not close files associated with purged open file Lock List items. In
addition, if a process references a purged file with a BOOS system call requiring an
open FCB, ORV_FREE returns a checksum error. A file that has been written to
should be closed before making a ORV_FREE call to the file's drive, or data can be
lost. Refer to Section 2.17 for more information on ORV FREE.
Figure 6-3 on page 6-52, shows the format of the Drive Vector.
Note: ORV FREE treats a floating drive as the physical drive to which it is mapped.
For example, if drive N is mapped unto drive A and you call ORV_FREE on A, all
files on N are lost in addition to those on A.
ORV GET Concurrent DOS 86 Programmer's Guide
ORV GET
Entry Parameters:
Register CL: 019H (25)
Returned Values:
Register AL: Drive Number
BL: Same as AL
ORV_GET returns the calling process's currently selected default disk number. The
disk numbers range from 0 through 15, corresponding to drives A through P.
Concurrent DOS 86 Programmer's Guide ORV GETLABEL
ORV GETLABEL
Entry Parameters:
Register CL: 065H (101)
DL: Drive
Returned Values:
Register AL: Directory Label Data Byte
AH: Physical Error
BX: Same as AX
ORV_GETLABEL returns the directory label data byte for the specified drive. The
calling process passes the drive number in register DL with 0 for drive A, 1 for
drive B, continuing through 15 for drive P in a full 16-drive system.
The directory label data byte has the following format:
bit 7 Require passwords for password protected files
bit 6 Perform access time and date stamping
bit 5 Perform update time and date stamping
bit 4 Perform create time and date stamping
bit 0 Directory label exists on drive
n-n1
ORV LOGINVEC Concurrent DOS 86 Programmer's Gulde
ORV LOGINVEC
Entry Parameters:
Register CL: 018H (24)
Returned Values:
Register AX: Login Vector
BX: Same as AX
ORV_LOGINVEC returns the Login Vector in register AX. The Login Vector is a 16-
bit value with the least significant bit corresponding to drive A, and the high-order
bit corresponding to the 16th drive, drive P. A 0 bit indicates the drive Is not
logged-In, while a 1 bit Indicates the drive is logged in.
The Login Vector is identical in format to the Drive Vector show in Figure 6-3. on
page 6-52.
Concurrent DOS 86 Programmer's Guide ORV RESET
ORV RESET
Entry Parameters:
Register CL: 025H (37)
OX: Drive Vector
Returned Values:
AL: Return Code
BL: Same as AL
6-63
DRV ROVEC Concurrent DOS 86 Programmer's Guide
ORV ROVEC
Entry Parameters:
Register CL: OlDH (29)
Returned Values:
Register AX: R/O Vector
BX: Same as AX
ORV_ROVEC returns a bit vector indicating which drives have the temporary Read-
Only bit set. The Read-Only bit can only be set by a DRV_SETRO call.
Note: When the file system detects a change In the media on a drive, it
automatically logs in the drive and sets it to Read-Write.
The format of the R/O Vector Is analogous to that of the Login Vector (see Figure
6-3). The least significant bit corresponds to drive A; the most significant bit
corresponds to drive P.
6-64
Concurrent DOS 86 Programmer's Guide ORV SET
ORV SET
Entry Parameters:
Register CL: OEH (14)
DL: Selected disk
Returned Values:
Register AL: Error Flag
AH: Physical Error
BX: Same as AX
ORV_SET designates the specified disk drive as the default disk for subsequent
BOOS file operations. Set the DL register to 0 for drive A. 1 for drive B, continuing
through 15 for drive P. ORV_SET also logs in the designated drive if it is currently
in the reset state. Logging in a drive activates the drive's directory for file
operations.
FCBs that specify drive code zero (DR = OOH) automatically reference the currently
selected default drive. FCBs with drive code values between 1 and 16, however.
ignore the selected default drive and directly reference drives A through P.
Upon return, register AL equal to OOH indicates the select operation was
successful. If a physical error is encountered, ORV_ SET performs different actions
depending on the BOOS Error mode (see F_ERRMODE).
If the BOOS is in the default Error mode, Concurrent displays a message at the
console, identifying the error and terminates the calling process. Otherwise,
DRV_SET returns to the calling process with register AL set to OFFH and register
AH set to one of the following physical error codes:
OlH - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
6-65
ORV SETLABEL Concurrent DOS 86 Programmer's Guide
ORV SETLABEL
Entry Parameters:
Register CL: 064H (100)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
ORV SETLABEL creates a directory label or updates the existing directory label for
the specified drive. The calling process passes the address of an FCB containing
the name, type, and extent fields to be assigned to the directory label.
The name and type fields of the referenced FCB are not used to locate the
directory label in the directory; they are simply copied into the updated or created
directory label. Byte 12 of the FCB contains the user's specification of the
directory label data byte.
The directory label data byte has the following definition:
bit 7 Require passwords for password protected files
bit 6 Perform access time and date stamping
bit 5 Perform update time and date stamping
bit 4 Perform create time and date stamping
bit 0 Assign a new password to the directory label
6-66
Concurrent DOS 86 Programmer's Guide ORV SETLABEL
Upon return, DRV_SETLABEL returns a directory code in register Al with the value
OOH if the directory label create or update was successful, or OFFH if no space
existed in the referenced directory to create a directory label. It also returns OFFH
if date and time stamping was requested and the referenced directory did not
contain SFCBs. Register AH is set to OOH In all of these cases.
If a physical or extended error is encountered, ORV_SETLABEL performs different
actions depending on the BOOS Error mode (see F_ERRMODE). If the BOOS is in
the default Error mode, Concurrent displays a message at the console identifying
the error and terminates the calling process. Otherwise, ORV_SETLABEL returns to
the calling process with register AL set to OFFH and register AH set to one of the
following physical or extended error codes:
O1H - Disk 1/0 Error : permanent error
02H - Read/Only Disk
04H - Invalid Drive : drive select error
07H - Password Error
6-67
DRV SETRO Concurrent DOS 86 Programmer's Guide
ORV SETRO
Entry Parameters:
Register CL: OlCH (28)
Returned Values:
Register AL: Return Code
BL: Same as AL
ORV_SETRO provides temporary write protection for the currently selected disk by
marking the drive as Read-Only. No process can write to a disk that is in the
Read-Only state. You must perform a successful ORV _RESET operation to restore
a Read-Only drive to the Read-Write state (see ORV_ALLRESET and ORV_RESET).
ORV_SETRO is conditional under Concurrent, so if another process has an open file
on the drive, the operation is denied, and ORV_SETRO returns the value OFFH to the
calling process. Otherwise, it returns a OOH.
If the BOOS is not In Return Error mode (see F_ERRMODE), Concurrent displays an
error message at the console, identifying the process owning the first open file
that caused the ORV_ SETRO request to be denied.
Note that a drive in the Read-Only state cannot be reset by a process if another
process has an open file on the drive.
6-68
Concurrent DOS 86 Programmer's Guide ORV SPACE
ORV SPACE
Entry Parameters:
Register CL: 02EH (46)
Dl: Drive
Returned Values:
Register Al: Error Flag
AH: Physical Error
BX: Same as AX. First 3 bytes of OMA Buffer filled in
ORV_ SPACE determines the number of free sectors ( 128-byte records) on the
specified drive. The calling process passes the drive number in register Dl, with 0
for drive A, 1 for B, continuing through 15 for drive P.
ORV_SPACE returns a binary number in the first 3 bytes of the current OMA buffer.
Figure 6-5 shows the format of the returned number.
+--------------------------------+
I FSO FSl I FS2 I
I low byte I high byte I
+--------------------------------+
Figure 6-5. Disk Free Space Field Format
Note that the returned free space value might be inaccurate if the drive has been
marked Read-Only.
Upon return. ORV_ SPACE sets register Al to OOH. indicating the operation was
successful. However. if the BOOS is in one of the return Error modes (see
F_ERRMODE), and a physical error occurs, it sets register Al to OFFH. and register
AH to one of the following values:
01 H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
6-69
F ATTRIB Concurrent DOS 86 Programmer's Guide
F ATTRIB
Entry Parameters:
Register CL: OlEH (30)
DX: FCB Address - Offset
DS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
BL: Same as AL
F_ATTRIB can modify a file's attributes and set its last record byte count. Other
BOOS system calls can interrogate these file parameters, but only F ATTRIB can
change them.
F_ATTRIB can set or reset the file attributes: Fl' through F4', Read-Only (Tl'),
System (T2'), and Archive (T3').
The specified FCB contains a filename with the appropriate attributes set or reset.
The calling process must ensure that it does not specify an ambiguous filename.
Also, if the specified file Is password protected, the correct password must be
placed in the first eight bytes of the current OMA buffer or have been previously
establlshed as the default password (see· F_PASSWD).
Interface attribute F5' specifies whether an extended file lock is to be maintained
after the F_ATTRIB call. Interface attribute F6' specifies If the specified file's byte
count Is to be set. The Interface attribute definitions are listed below:
F5'• 0 Do not maintain an extended file lock (default)
F5'• 1 Maintain an extended file lock
F6'• 0 Do not set byte count (default)
F6'• 1 Set byte count
If F5' Is set and the referenced FCB specifies a file with an extended file lock. the
calling process maintains the lock on the file. Otherwise, the file becomes
available to other processes. Section 2.11 describes extended file locking in detail.
If Interface attribute F6' is set. the calling process must set the CR field of the
referenced FCB to the new byte count value. A process can access a file's byte
count value with the BOOS F OPEN, F SFIRST, and F SNEXT system calls. File byte
counts are described in Section 2.15. - -
6-70
Concurrent DOS 86 Programmer's Guide F ATTRIB
F_ATTRIB searches the FCB specified directory for an entry belonging to the
current user number that matches the FCB specified name and type fields.
F_ATTRIB then updates the directory to contain the selected indicators, and if
Interface attribute F6' is set, the specified byte count value. Note that the last
record byte count is maintained in the byte 13 of a file's directory FCBs.
File attributes Tl', T2', and T3' are defined by Concurrent as described in Section
2.4.2. Attributes Fl' through F4' of command files are defined as Compatibility
Attributes, as described in Section 2.12. However, for all other files, attributes F1'
through F4' can be redefined. Attribute:; f'5' through F8' are reserved as Interface
Attributes and cannot be used as file attributes. Interface attributes are described
in Section 2.4.3.
An F_A TTRIB call is not performed if the referenced FCB specifies a file currently
open for another process. It is performed. however, if the referenced file is open
by the calling process in Locked mode. However, the file's lock entry is purged
when this is done and the file system prevents continued read and write
operations on the file. F_ATTRIB does not set the attributes of a file currently
open in Read-Only or Unlocked mode for any process.
Making an F_ATTRIB call for an open file can adversely affect the performance of
the calling process. For this reason. you should close an open file before you call
F ATTRIB.
Upon return, F_A TTRIB returns a directory code in register AL with the value OOH if
the call is successful, or OFFH if the file specified by the referenced FCB is not
found. Register AH is set to OOH in both cases.
If a physical or extended error is encountered, F_ATTRIB performs different actions
depending on the BOOS Error mode (see F_ERR MODE). If the BOOS is in the
default Error mode, Concurrent displays a message at the console identifying the
error and terminates the process. Otherwise, it returns to the calling process with
register AL set to OFFH and register AH set to one of the following physical or
extended error codes:
01 H - Disk 1/0 Error : permanent error
02H - Read/Only Disk
04H - Invalid Drive : drive select error
05H - File open by another process
07H - Password Error
09H - Illegal ? in FCB
6-71
F CLOSE Concurrent DOS 86 Programmer's Gulde
F CLOSE
Entry Parameters:
Register CL: OlOH (16)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_CLOSE performs the Inverse operation of F_OPEN. The referenced FCB must
have been previously activated by a successful F_OPEN or F_MAKE call. Interface
attributes FS' and F6' specify how the file Is to be closed, as shown below:
FS' • 0, F6' a O Default Close
FS' • 0, F6' • 1 Extend Fiie Lock
FS' • 1, F6' • 0 Partial Close
FS' • 1, F6' • 1 Partial Close
F_CLOSE performs the following steps regardless of the interface attribute
specification.
1. First, It verifies the referenced FCB has a valid checksum. If the checksum is
invalid, F_CLOSE performs no action and returns an error code.
2. If the checksum is valid and the referenced FCB contains new information
because of write operations to the FCB, F_CLOSE permanently records the new
Information In the directory. If the FCB does not contain new Information, the
directory update step is bypassed. However, F CLOSE always attempts to
locate the FCB's corresponding entry In the directory and returns an error
code If the directory entry cannot be found.
If F_CLOSE successfully performs the above steps, it performs different actions,
depending on how the interface attributes are set.
In default close operations. F_CLOSE decrements the file's open count, which is
maintained In the file's system Lock List entry. If the open count decrements to
zero, It indicates that the number of default close operations for the file matches
the number of open operations.
6-72
Concurrent DOS 86 Programmer's Guide F CLOSE
If the open count decrements to zero, F CLOSE permanently closes the file by
performing the following steps. -
1. First, it removes the file's item from the system Lock List. If the FCB is opened
in Unlocked mode. it also purges all record locks belonging to the file from
the system Lock List.
3. If the open count does not decrement to zero, F_CLOSE simply returns to the
calling process and the file remains open.
For partial close operations, F_CLOSE does not decrement the file's open count and
returns to the calling process. The file always remains open following a partial
close request.
Closing a file with an extended file lock modifies the way F_CLOSE performs a
permanent close. F_CLOSE only honors an extended lock request on a permanent
close of a file opened in Locked Mode. If these conditions are satisfied, F_CLOSE
invalidates the FCB's checksum but maintains the lock item. Thus, although the file
is permanently closed, other processes cannot access the file. Section 2.11
describes extended file locking in detail.
Upon return. F_CLOSE returns a directory code in register AL with the value OOH if
the close operation is successful, or OFFH if the file is not found. Register AH is
set to O in both of these cases.
If a physical or extended error is encountered, F_CLOSE performs different actions
depending on the BOOS Error mode (see F_ERR MODE). If the BOOS is in the
default Error mode, Concurrent displays a message identifying the error at the
console and terminates the calling process. Otherwise F_CLOSE returns to the
calling process with register AL set to OFFH and register AH set to one of the
following physical or extended error codes:
01H - Disk 1/0 Error : permanent error
02H - Read/Only Disk.
04H - Invalid Drive : drive select error
06H - Close Checksum Error
6-73
F DELETE Concurrent DOS 86 Programmer's Guide
F DELETE
Entry Parameters:
Register CL: 013H (19)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_OELETE removes flies and/or XFCBs that match the FCB addressed in register DX.
The filename and filetype fields can contain wildcard file specifications (question
marks in bytes 1 through 11), but byte 0 cannot be a wildcard as it can be in the
F_SFIRST and F_SNEXT calls.
Interface attribute FS' specifies the type of delete operation to be performed, as
shown below:
FS' • 0 Standard Delete (Default mode)
FS' • 1 Delete only XFCB's and maintain an extended file lock.
If any of the files specified by the referenced FCB are password protected, the
correct password must be placed in the first eight bytes of the current OMA buffer
or it must have been previously established as the default password (see
F_PASSWD).
For standard delete operations. F_DELETE removes all directory entries belonging to
files that match the referenced FCB. All disk directory and data space owned by
the deleted flies is returned to free space and becomes available to other files.
Directory XFCBs that were owned by the deleted files are also removed from the
directory. If interface attribute FS' of the FCB is set to 1, F DELETE deletes only
the directory XFCBs matching the referenced FCB. -
Note: If any of the files matching the input FCB specification fail the password
check, are Read-Only, or are currently open by another process. then F DELETE
deletes no files or XFCBs. This applies to both types of delete operations. -
Interface attribute FS' also specifies whether an extended file lock is to be
maintained after the F DELETE call. If FS' is set and the referenced FCB specifies a
file with an extended- lock. the calling process maintains the lock on the file.
Section 2.11 describes extended file locking in detail.
6-74
Concurrent DOS 86 Programmer's Guide F DELETE
A process can delete a file that it currently has open if the file is opened in locked
mode. However, the BOOS returns a checksum error if the process makes a
subsequent reference to the file with a BOOS system call requiring an open FCB.
A process cannot delete files open in Read-Only or Unlocked mode.
Deleting an open file can adversely affect the performance of the calling process.
For this reason, you should close an open file before you delete it.
Upon return, F DELETE returns a directory code in register AL with the value OOH if
the delete is iuccessful, or OFFH if no file matching the referenced FCB is found.
Register AH is set to O in both of these cases.
If a physical or extended error is encountered, F_DELETE performs different actions,
depending on the BDOS Error mode (see F_ERRMODE).
If the BOOS is the default Error mode, Concurrent displays a message identifying
the error at the console and terminates the calling process. Otherwise, it returns
to the calling process with register AL set to OFFH and register AH set to one of
the following physical or extended error codes:
O1H -
Disk 1/0 Error : permanent error
02H -
Read/Only Disk
03H -
Read/Only File
04H Invalid Drive : drive select error
-
05H -
File opened by another process or
open in Read-Only or Unlocked mode
07H - Password Error
6-75
F DMAGET Concurrent DOS 86 Programmer's Guide
F DMAGET
Entry Parameters:
Register CL: 034H (52)
Returned Values:
Register AX: OMA Offset
BX: Same as AX
ES: OMA Segment
F DMAGET returns the current OMA Base Segment address in ES, with the current
OMA Offset in AX.
OMA Is an acronym for Direct Memory Address, which is often used with disk
controllers that directly access the memory of the computer to transfer data to
and from the disk subsystem.
Under Concurrent, the current OMA is usually defined as the buffer in memory
where a record resides before a disk write and after a disk read operation. If the
BOOS Multlsector Count is equal to one (see F MULTISEC), the size of the buffer is
128 bytes. However, If the BOOS Multisector Count Is greater than one, the size of
the buffer must equal N • 128, where N equals the Multisector Count.
Some BOOS system calls also use the current OMA to pass parameters and to
return values. For example, BOOS system calls that check and assign file
passwords require that the password be placed in the current OMA Buffer. As
another example, ORV_SPACE returns its results in the first 3 bytes of the current
OMA. When the current OMA is used in this context, the size of the buffer in
memory is determined by the specific requirements of the system call.
6-76
Concurrent DOS 86 Programmer's Guide F DMAOFF
F DMAOFF
Entry Parameters:
Register CL: OlAH (26)
DX: OMA Address - Offset
F_DMAOFF can change the default value of the OMA offset to another memory
address. When P_CU initiates a transient program, it sets the OMA offset to OSOH
and the OMA Segment or Base to its initial Data Segment. ORV_ALLRESET also
sets the OMA offset to OSOH. The OMA address remains at its current value until it
is changed by an F_DMASEG, F_DMAOFF, or ORV _ALLRESET call.
6-77
F DMASEG Concurrent DOS 86 Programmer's Gulde
F DMASEG
Entry Parameters:
Register CL 033H (51)
DX: OMA Segment Address
F_DMASEG sets the segment value of the current OMA buffer address. The word
parameter in DX is a paragraph address and Is used with the OMA offset value to
specify the 20-blt address of the OMA buffer.
Note that upon initial program loading, the default OMA base is set to the address
of the user's data segment (the initial value of OS) and the OMA offset is set to
0080H, which provides access to the default buffer in the Base Page.
6-78
Concurrent DOS 86 Programmer's Guide F ERRMODE
F ERRMODE
Entry Parameters:
Register CL: 020H (45)
OL: BOOS Error mode
F_ERRMODE sets the BOOS Error mode, which is a system parameter maintained
for each running process that determines how the file system handles physical and
extended errors. Physical and extended errors are described in Section 2.18.
The BOOS Error mode has three states: the default mode, Return and Error mode,
and Return and Display mode.
The BOOS performs different actions in each mode when a physical or extended
error occurs:
* In the default Error mode, the BOOS displays a system message at the
console identifying the error and terminates the calling process.
* In Return Error mode, the BOOS sets register AL to OFFH, places an error code
identifying the physical or extended error in register AH, and returns to the
calling process.
* In Return and Display mode, the BOOS displays the system message before
returning to the calling process, and sets registers AH and Al as in the Return
Error mode.
F ERRMODE sets the BOOS Error mode as specified in register Dl. If register DL is
set to OFFH, the mode is set to Return Error mode. If register DL is set to OFEH.
the mode is set to Return and Display mode. If register DL is set to any other
value, the mode is set to the default mode.
6-79
FLOCK Concurrent DOS 86 Programmer's Guide
FLOCK
Entry Parameters:
Register CL: 02AH (42)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
6-80
Concurrent DOS 86 Programmer's Guide FLOCK
Upon return, F_LOCK sets register AL to OOH if the lock operation is successful.
Otherwise, register AL contains one of the following error codes:
01 H - Reading unwritten data
03H - Cannot close current extent
04H - Seek to unwritten extent
06H - Random Record Number out of range
OSH - Record locked by another process
OAH - FCB Checksum Error
OBH - Unlocked file verification error
OCH - Process record lock limit exceeded
OOH - Invalid File ID
OEH - No Room in System Lock List
OFFH - Physical error; refer to register AH
F LOCK returns error code OlH when it accesses a data block that has not been
previously written.
F LOCK returns error code 03H when it cannot close the current extent prior to
moving to a new extent.
F LOCK returns error code 04H when it accesses an extent that has not been
created.
F_LOCK returns error code 06H when byte 35 (R2) of the referenced FCB is greater
than 3.
F_LOCK returns error code OSH if the specified record is locked by another process
with an incompatible lock type.
F LOCK returns error code OAH if the referenced FCB failed the FCB checksum test.
F LOCK returns error code OBH if the BOOS cannot locate the referenced FCB's
directory entry when attempting to verify that the FCB contains current
information.
F LOCK returns error code OCH if performing the lock request would require that
the process consume more than the maximum allowed number of system Lock List
entries.
F LOCK returns error code OOH when an invalid File ID is placed at the beginning
of the current OMA.
F LOCK returns error code OEH when the system Lock List is full and performing
the lock request would require at least one new entry.
6-81
FLOCK Concurrent DOS 86 Programmer's Guide
F LOCK returns error code OFFH if a physical error is encountered, and the BOOS
Error mode Is either Return Error mode or Return and Display Error mode (see
F_ERRMODE). If the BOOS Is In the default Error mode, Concurrent displays a
message at the console identifying the physical error and terminates the calling
process. When F_LOCK returns a physical error to the calling process, it is
Identified by register AH as shown below:
01H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
6-82
Concurrent DOS 86 Programmer's Guide F MAKE
F MAKE
Entry Parameters:
Register CL: 016H (22)
DX: FCB Address - Offset
DS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_MAKE creates a new directory entry for a file under the current user number. It
also creates an XFCB for the file if the referenced drive has a directory label that
enables password protection on the drive, and the calling process assigns a
password to the file.
The calling process passes the address of the FCB with byte 0 of the FCB
specifying the drive, bytes 1 through 11 specifying the filename and filetype, and
byte 12 set to the extent number. Byte 12, the EX field, is usually set to OOH.
Byte 32 of the FCB, the CR field, must be initialized to OOH. before or after the
F_MAKE call, if the intent is to write sequentially from the beginning of the file.
Interface attribute F5' specifies the mode in which the file is to be opened.
Interface attribute F6' specifies whether a password is to be assigned to the
created file. The interface attributes are summarized below:
F5' • 0 Open in Locked mode (default)
F5' • 1 Open in Unlocked mode
F6' • 0 Do not assign password (default)
F6' = 1 Assign password to created file
When attribute F6' is set to 1, the calling process must place the password in the
first 8 bytes of the current DMA buffer and set byte 9 of the DMA buffer to the
password mode. Note that F MAKE only interrogates attribute F6' if the referenced
drive's directory label has enabled password support. The XFCB Password mode is
summarized below:
Bit 7 Read mode
Bit 6 Write mode
Bit 5 Delete mode
F_MAKE returns with an error code if the referenced FCB names a file that
currently exists in the directory under the current user number. If there is any
possibility of duplication, an F_DELETE call should precede the F_MAKE call.
6-83
F MAKE Concurrent DOS 86 Programmer's Guide
If the make file operation is successful, F_MAKE activates the referenced FCB for
record operations (opens the FCB) and Initializes both the directory entry and the
referenced FCB to an empty file.
F_MAKE also computes a checksum and assigns it to the FCB. BOOS system calls
that require an open FCB {for example, F_WRITE) verify that the FCB checksum is
valid before performing their operation.
If the file is opened in Unlocked mode, F_MAKE also sets bytes RO and R1 in the
FCB to a two-byte value called the File ID. The File ID is a required parameter for
the BOOS Lock Record and Unlock Record system calls. Note that F_MAKE
Initializes all file attributes to 0.
The BOOS also creates an open file item in the system Lock List to record a
successful F_MAKE operation. While this Item exists, no other process can delete,
rename, truncate, or set the file attributes of this file.
A creation and/or update stamp is made for the created file if the referenced drive
contains a directory label that enables creation and/or update time and date
stamping and the FCB extent number is equal to 0.
F_MAKE also creates an XFCB for the created file if the referenced drive contains a
directory label that enables password protection, Interface attribute F6' of the FCB
is 1, and the FCB Is an extent zero FCB. In addition, F_MAKE also assigns the
password and password mode placed in the first nine bytes of the OMA to the
XFCB.
Upon return, F_MAKE returns a directory code in register AL with the value OOH if
the make operation is successful, or OFFH if no directory space is available.
Register AH is set to OOH in both cases.
If a physical or extended error Is encountered, F MAKE performs different actions
depending on the BOOS Error mode (see F ERRMODE). If the BOOS is in the
default Error mode, Concurrent displays a me-ssage at the console identifying the
error and terminates the calling process. Otherwise, it returns to the calling
process with register AL set to OFFH and register AH set to one of the following
physical or extended error codes:
01H - Disk 1/0 Error : permanent error
02H - Read/Only Disk
04H - Invalid Drive : drive select error
08H - File Already Exists
09H - Illegal ? in FCB
OAH - Open File Limit Exceeded
OBH - No Room In System Lock List
6-84
Concurrent DOS 86 Programmer's Guide F MULTISEC
F MULTISEC
Entry Parameters:
Register CL: 02CH (44)
OL: Number of Sectors
Returned Values:
Register AL: Return Code
BL: Same as AL
6-85
F OPEN Concurrent DOS 86 Programmer's Guide
F OPEN
Entry Parameters:
Register CL: OFH (15)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register Al: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F OPEN activates the FCB for a file that exists in the disk directory under the
c;:;rrently active user number or user zero. The calling process passes the address
of the FCB, with byte O of the FCB specifying the drive, bytes 1 through 11
specifying the filename and filetype, and byte 12 specifying the extent. Byte 12 is
usually set to zero.
Interface attributes FS' and F6' of the FCB specify the mode in which the file is to
be opened, as shown below:
FS' a o. F6' m 0 Open in locked mode (Default mode)
FS' " 1, F6' • 0 Open in Unlocked mode
FS' • 0 or 1. F6' • 1 Open in Read-Only mode
If the file is password protected in Read mode. the correct password must be
placed in the first eight bytes of the current DMA or have been previously
established as the default password (see F PASSWD). If the current record field of
the FCB, CR, is set to OFFH, F OPEN returns-the byte count of the last record of the
file In the CR field. The last record byte count for a file can be set using
F ATTRIB.
Note: The calling process must set the CR field of the FCB to OOH if the file is to
be accessed sequentially from the first record.
F_OPEN performs the following steps for files opened in locked or Read-Only
mode. if the current user is nonzero and the file to be opened does not exist
under the current user number. F OPEN searches user 0 for the file. If the file
exists under user O and has the system attribute (T2') set, the file is opened under
user 0. The Open mode is automatically set to Read-Only when this is done.
F_OPEN also performs the following action for files opened in locked mode when
the current user number Is 0. If the file exists in the directory under user 0, and
has both the system attribute {T2') set and the Read-Only attribute (Tl') set, the
Open mode is automatically set to Read-Only. Note that Read-Only mode implies
the file can be concurrently accessed by other processes if they also open the file
in Read-Only mode.
6-86
Concurrent DOS 86 Programmer's Guide F OPEN
ff the open operation is successful. F_OPEN activates the user's FCB for record
operations as follows: F_OPEN copies the relevant directory information from the
matching directory FCB into bytes DO through D 15 of the FCB. It also computes a
checksum and assigns it to the FCB. All BDOS system calls that require an open
FCB (for example, F_REAO) verify that the FCB checksum is valid before performing
their operation.
If the file is opened in Unlocked mode, F_OPEN sets bytes RO and Rl of the FCB to
a two-byte value called the File ID. The File ID is a required parameter for the
F_LOCK and F_UNLOCK calls. If the Open mode is forced to Read-Only, F_OPEN
sets interface attribute FB' to 1 in the user's FCB. In addition, the system call sets
attribute F7' to 1 if the referenced file is password protected in Write mode and
the correct password was not passed in the OMA or did not match the default
password. The BDOS does not support write operations for an activated FCB if
interface attribute F7' or FB' is set to 1.
The BOOS also creates an open file item in the system Lock List to record a
successful open file operation. While this item exists, no other process can delete,
rename, or modify the file's attributes. In addition, this item prevents other
processes from opening the file if the file is opened in Locked mode. It also
requires that other processes match the file's Open mode if the file is opened in
Unlocked or Read-Only mode. This item remains in the system Lock List until the
file is permanently closed or until the process that opened the file terminates.
When the open operation is successful, F_OPEN also makes an access time and
date stamp for the opened file when the following conditions are satisfied: the
referenced drive has a directory label that requests access date and time stamping,
the FCB extent field is equal to zero, and the referenced drive is Read-Write.
Upon return, F_OPEN returns a directory code in register AL with the value OOH if
the open is successful, or OFFH if the file is not found. Register AH is set to 0 in
both of these cases. If a physical or extended error is encountered, F_OPEN
performs different actions depending on the BOOS Error mode (see F_ERRMOOE).
If the BDOS is in the default Error mode, Concurrent displays a message identifying
the error at the console and terminates the process. Otherwise, F_OPEN returns to
the calling process with register AL set to OFFH and register AH set to one of the
following physical or extended error codes:
01 H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
05H - File is open by another process or by the
current process in an incompatible mode
07H - Password Error
09H - Illegal ? in FCB
OAH - Open File Limit Exceeded
OBH - No Room in System Lock List
6-87
F PARSE Concurrent DOS 86 Programmer's Guide
F PARSE
Entry Parameters:
Register CL: 098H (152)
DX: PFCB Address - Offset
OS: PFCB Address - Segment
Returned Values:
Register AX: OFFFFH if error
O if end of filename string
O if end of line address of next item to parse
BX: Same as AX
CX: Error Code
F_PARSE parses an ASCII file specification and prepares a File Control Block. The
calling process passes the address of a data structure called the Parse Filename
Control Block, (PFCB) in registers DX and OS.
Figure 6-6 shows the format of the Parse Filename Control Block. Table 6-12 lists
the fields in the PFCB.
+-------------------+
I FILENAME I FCBADR I
+-------------------+
Figure 6-6. PFCB - Parse Filename Control Block
Field Description
6-88
Concurrent DOS 86 Programmer's Guide F PARSE
6-89
F PARSE Concurrent DOS 86 Programmer's Guide
Byte Definition
byte O The drive field Is set to the specified drive. If the drive is
not specified, the default value is used. O = default, 1 = A,
2 • B, etc.
byte 1-8 The name is set to the specified filename. All letters are
converted to upper-case. If the name is not eight
characters long, the remaining bytes in the filename field
are padded with blanks. If the filename has an asterisk (*),
all remaining bytes in the filename field are filled in with
question marks (?). F_PARSE returns an error if the filename
is more than eight bytes long.
byte 9-11 The type is set to the specified filetype. If no type is
specified, the type field Is initialized to blanks. All letters
are converted to upper-case. If the type is not three
characters long, the remaining bytes in the filetype field are
padded with blanks. If an asterisk is encountered, all
remaining bytes are filled in with question marks. F_PARSE
returns an error if the type field Is more than 3 bytes long.
byte 12-15 Filled in with zeros.
byte 16-23 The password field Is set to the specified password. If no
password is specified, this field is initialized to blanks. If
the password is not eight characters long, remaining bytes
are padded with blanks. All letters are converted to upper-
case. F_PARSE returns an error if the password field is
more than eight bytes long.
byte 24-31 Reserved for system use.
6-90
Concurrent DOS 86 Programmer's Guide F PASSWD
F PASSWD
Entry Parameters:
Register CL: 06AH ( 106)
DX: Password Address - Offset
DS: Password Address - Segment
6-91
F RANDREC Concurrent DOS 86 Programmer's Guide
F RANDREC
Entry Parameters:
Register CL: 024H (36)
DX: FCB Address - Offset
DS: FCB Address - Segment
Returned Values:
Random Record Field of FCB Set
F_RANDREC returns the Random Record Number of the next record to be accessed
from a file that has been read or written sequentially to a particular point.
F_RANDREC returns this value in the Random Record field, bytes RO, R1, and R2, of
the addressed FCB. F_RANDREC can be useful in two ways.
First, it is often necessary to initially read and scan a sequential file to extract the
positions of various key fields. As each key is encountered, you call F_RANDREC
to compute the random record position for the data corresponding to this key. If
the data unit size is 128 bytes, the resulting record number minus one is placed
into a table with the key tor later retrieval.
After scanning the entire file and tabularizing the keys and their record numbers,
you can move directly to a particular record by performing a random read using
the corresponding Random Record Number that was saved earlier. The scheme is
easily generalized when variable record lengths are involved, because the program
need only store the buffer-relative byte position along with the key and record
number in order to find the exact starting position of the keyed data at a later
time.
F_RANDREC can also be used when switching from a sequential read or write to a
random read or write. Access records sequentially to a particular point in the file,
call F_RANDREC to set the record number, and then subsequent random read and
write operations can continue from the next record in the file.
6-92
Concurrent DOS 86 Programmer's Guide F READ
F READ
Entry Parameters:
Register CL: 014H (20)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
F_READ reads the next 1 to 128 128-byte records from a file into memory,
beginning at the current OMA address. The BOOS Multisector Count {see
F_MULTISEC) determines the number of records to be read. The default is one
record. The addressed FCB must have been previously activated by an F OPEN or
F_MAKE call. -
F_READ reads each record from the current record (CR) field in the FCB, relative to
the current extent, then automatically increments the CR field to the next record
position. If the CR field overflows, then F_READ automatically opens the next
logical extent and resets the CR field to zero for the next read operation. The
calling process must set the CR field to OOH following the open call if the intent is
to read sequentially from the beginning of the file.
Upon return, F_READ sets register AL to zero if the read operation is successful.
Otherwise, register AL contains an error code identifying the error as shown below:
01H - Reading unwritten data (end-of-file)
08H - Record locked by another process
09H - Invalid FCB
OAH - FCB Checksum Error
OBH - Unlocked file verification error
OFFH - Physical error; refer to register AH
F_READ returns error code 01 H if no data exists at the next record position of the
file. The no data situation is usually encountered at the end of a file. However, it
can also occur if you try to read a data block that has not been previously written
or an extent that has not been created. These situations are usually restricted to
files created or appended with the BOOS random write calls (F_WRITE RAND and
F_WRITEZF).
6-93
F READ Concurrent DOS 86 Programmer's Gulde
F_READ returns error code OSH if the calling process attempts to read a record
locked by another process with an exclusive lock. This error code is only returned
for files opened In Unlocked mode.
F_READ returns error code 09H if the FCB is invalidated by a previous F_CLOSE call
that returned an error.
F_READ returns error code OAH if the referenced FCB failed the FCB checksum test.
F_READ returns error code OBH if the BOOS cannot locate the FCB's directory entry
when attempting to verify that the referenced FCB contains current information.
F_READ only returns this error for files opened in Unlocked mode.
F_READ returns error code OFFH if a physical error is encountered and the BOOS
Error mode is in one of the return modes (see F_ERRMODE). If the BOOS is in the
default Error mode, Concurrent displays a message at the console identifying the
physical error and terminates the calling process. When F_READ returns a physical
error to the calling process, It Is identified by register AH as shown below:
O1H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
On all error returns, except for physical error returns (AL ~ 255), F_READ sets
register AH to the number of records successfully read before the error was
encountered. This value can range from O to 127 depending on the current BOOS
Multlsector Count. It is always set to zero when the Multisector Count Is equal to
one.
6-94
Concurrent DOS 86 Programmer's Guide F READRAND
F READRAND
Entry Parameters:
Register CL: 021H (33)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
F_READRAND is similar to F_READ except that the read operation takes place at a
particular Random Record Number, selected by the 24-bit value constructed from
the three-byte, RO, R1, R2, field beginning at position 33 of the FCB. Note that the
sequence of 24 bits is stored with the least significant byte first, RO, the middle
byte next, Rl, and the high byte last, R2. The Random Record Number can range
from 0 to 262, 143. This corresponds to a maximum value of 3 in byte R2.
To read a file with F_READ RAND, the calling process must first open the base
extent, extent 0. This ensures that the FCB is properly initialized for subsequent
random access operations. The base extent might or might not contain any
allocated data.
F_READRAND reads the record specified by the random record field into the
current OMA address. F_READRAND automatically sets the FCB extent and current
record number values, EX and CR, but unlike F_READ, it does not advance the
current record number. Thus, a subsequent F_READRAND call rereads the same
record. After a random read operation, a file can be accessed sequentially, starting
from the current randomly accessed position. However, the last randomly
accessed record is reread or rewritten when switching from random to sequential
mode.
If the BOOS Multlsector count is greater than one (see F_MULTISEC), F_READRAND
reads multiple consecutive records into memory beginning at the current OMA.
F READRAND automatically increments the RO, Rl, R2 field of the FCB to read each
record. However, it restores the FCB's Random Record Number to the first record's
value upon return to the calling process.
6-95
F READRAND Concurrent DOS 86 Programmer's Guide
6-96
Concurrent DOS 86 Programmer's Guide F RENAME
F RENAME
Entry Parameters:
Register CL: 017H (23)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_RENAME uses the referenced FCB to change all directory entries of the file
specified by the drive and filename in bytes O to 11 of the FCB to the filename
specified in bytes 17 through 27.
If the file specified by the first filename is password-protected, the correct
password must be placed in the first eight bytes of the current OMA buffer, or
have been previously established as the default password (see F_PASSWD).
The calling process must also ensure that the filenames specified in the FCB are
valid and unambiguous, and that the new filename does not already exist on the
drive. F_RENAME uses the drive code at byte O of the FCB to select the drive. The
drive code at byte 16 of the FCB is ignored.
Interface attribute F5' specifies whether an extended file lock is to be maintained
after the F ATIRIB call as shown below:
F5'• 0 Do not maintain an extended file lock (default)
F5'= 1 Maintain an extended file lock
If F5' is set and the referenced FCB specifies a file with an extended file lock, the
calling process maintains the lock on the file. Otherwise, the file becomes
available to other processes on the system. Section 2.11 describes extended file
locking in detail.
A process can rename a file that it has open if the file is open in locked mode.
However, the BOOS returns a checksum error if the process subsequently
references the file with a system call requiring an open FCB. A file open in Read-
Only or Unlocked mode cannot be renamed by any process.
Renaming an open file can adversely affect the performance of the calling process.
For this reason, you should close an open file before you rename it.
Upon return, F RENAME returns a directory code in register AL with the value OOH
If the rename is successful, or OFFH if the file named by the first filename in the
FCB is not found. Register AH is set to OOH in both of these cases.
6-97
F RENAME Concurrent DOS 86 Programmer's Guide
6-98
Concurrent DOS 86 Programmer's Guide F SETDATE
F SETDATE
Entry Parameters:
Register CL: 74H (116)
DX: FCB address -- Offset
OS: FCB address - Segment
Returned Values:
Register AL: Directory code
AH: Physical error
BX: Same as AX
F_SETDATE sets the time and date stamp fields for the specified file to the time
and date stamp values specified in the first eight bytes of the OMA buffer. The
specified file must currently be open in Locked mode by the calling process.
The first 4-byte field in the OMA buffer contains the access or create stamp field
for CP/M™ media files. This field is copied into the file's access or create stamp
field if the directory label has activated access and/or creation time and date
stamping on the file's drive.
Note that only the update stamp field can be set for DOS media files. DOS media
files are not stamped for access or create times.
The second 4-byte field of the OMA buffer contains the update stamp field. This
field is copied into the update stamp field for CP/M files only when the directory
label has activated update time and date stamping on the file's drive. The OMA
update stamp field is always copied into the update stamp field of DOS media files.
Upon return from a successful operation, F SETDATE sets register AL to OOH. If
the referenced FCB does not specify a file opened by the calling process in Locked
mode, register AL will be set to OAH. Register AH is set to OOH in both cases.
If a physical or extended error is encountered, F_SETDATE performs different
actions, depending upon the BOOS Error mode (see F ERRMODE). If the BOOS is in
the default Error mode, Concurrent displays an error- message at the console and
terminates the calling process. Otherwise, F SETDATE returns to the calling
process with register AL set to FFH and registe-r AH set to one of the following
physical error codes:
01H - Disk 1/0 Error : Permanent Error
02H - Read/Only Disk
04H - Invalid Drive : Drive Select Error
09H - Illegal ? in FCB
6-99
F SFIRST Concurrent DOS 86 Programmer's Guide
F SFIRST
Entry Parameters:
Register CL: 011H (17)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F SFIRST scans the directory for a match with the referenced FCB. Two types of
searches can be performed. For standard searches, the calling process initializes
bytes 0 through 12 of the referenced FCB, with byte 0 specifying the drive
directory to be searched, bytes 1 through 11 specifying the file or files to be
searched for, and byte 12 specifying the extent. Byte 12 Is usually set to OOH.
An ASCII question mark (63, or 03FH hexadecimal) in any of the bytes 1 through 12
matches all entries on the directory in the corresponding position. This facility,
called ambiguous file reference, can be used to search for multiple files on the
directory. When called in the standard mode, F_SFIRST scans for the first file entry
In the specified directory that matches the FCB and belongs to the current user
number.
F SFIRST also Initializes the F SNEXT call. After the search call has located the
first directory entry matchln-g the referenced FCB, F_SNEXT can be called
repeatedly to locate all remaining matching entries. In terms of execution
sequence, however, the F_SNEXT call must follow either an F_SFIRST or F_SNEXT
call with no other intervening BOOS file-access system calls.
If byte O of the referenced FCB Is set to a question mark, F SFIRST ignores the
remainder of the referenced FCB and locates the first directory entry residing on
the current default drive. All remaining directory entries can be located by making
multiple F_SN EXT calls.
This type of search operation Is not usually made by application programs, but it
does provide complete flexibility to scan all directory entries. Note that this type
of search operation must be performed to access a drlve's directory label.
6-100
Concurrent DOS 86 Programmer's Guide F SFIRST
Upon return, F_SFIRST returns a directory code in register Al with the value 0 to 3
if the search is successful, or OFFH if a matching directory entry is not found.
Register AH is set to zero in both of these cases. For successful searches. the
current OMA Is also filled with the directory record containing the matching entry,
and the relative starting position is (AL*32). The directory information can be
extracted from the buffer at this position.
If the directory has been initialized for date and time stamping, then an FCB
resides in every fourth directory entry, and successful directory codes are
restricted to the values 0 to 2. For successful searches, if the matching directory
record is an extent zero entry, and if an SFCB resides at offset 96 within the
current OMA buffer, then the contents of (OMA Address + 96) = 021 H, and the
SFCB contains the time and date stamp information and password mode for the
file. This information is located at the relative starting position of 97 + (AL " 10)
within the current OMA in the following format:
0 - 3 Create or Access Date and Time Stamp Field
4 - 7 Update Date and Time Stamp Field
8 Password Mode Field
Refer to Section 2.8 for more information about SFCBs.
If a physical error is encountered, F_SFIRST performs different actions depending
on the BOOS error mode (see F_ERRMODE). If the BOOS is in the default Error
mode, Concurrent displays a message identifying the error at the console and
terminates the calling process. Otherwise, it returns to the calling process with
register AL set to OFFH and register AH set to one of the following physical error
codes:
01 H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
6-101
F SIZE Concurrent DOS 86 Programmer's Guide
F SIZE
Entry Parameters:
Register CL: 023H (35)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX, Random Record Field of FCB Set
F_SIZE determines the virtual file size, which is the address of the record
immediately following the end of the file. The virtual size of a file corresponds to
the physical size if the file is written sequentially. If the file is written In random
mode, gaps might exist in the allocation, and the file might contain fewer records
than the Indicated size. For example, If a single record with record number
262,143, the Concurrent maximum, Is written to a file using F_WRITERAND, then the
virtual size of the file is 262.144 records even though only one data block is
actually allocated.
To compute file size, the calling process passes the address of an FCB with bytes
RO, Rl, and R2 present. F_SIZE sets the random record field of the FCB to the
Random Record Number + 1 of the last record in the file. If the R2 byte is set to
04H, and RO and R 1 are both zero, then the file contains the maximum record
count, 262, 144.
A process can append data to the end of an existing file by calling F_SIZE to set
the random record position to the end of file, and then performing a sequence of
random writes.
Note: The file need not be open in order to use F SIZE. However, if the file is open
In Locked mode and it has been extended by the - calling process, the file must be
closed before calling F SIZE. Otherwise, F SIZE returns an incorrect file size.
F_SIZE returns the correct size for files open in Unlocked mode and Read-Only
mode.
Upon return, F_SIZE returns a OOH in register AL if the file specified by the
referenced FCB is found, or a OFFH in register AL if the file is not found. Register
AH Is set to OOH in both cases.
6-102
Concurrent DOS 86 Programmer's Guide F SIZE
6-103
F SNEXT Concurrent DOS 86 Programmer's Guide
F SNEXT
Entry Parameters:
Register CL: 012H (18)
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_SNEXT Is identical to F_SFIRST except that the directory scan continues from the
last entry that was matched. F_SNEXT returns a directory code in register AL,
analogous to F_SFIRST.
Note: In execution sequence, an F_SNEXT call must follow either an F SFIRST or
another F_SNEXT with no other intervening BOOS file-access system calls.
6-104
Concurrent DOS 86 Programmer's Guide F TIMEDATE
F TIMEDATE
Entry Parameters:
Register CL: 066H (102)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register Al: Directory Code
AH: Physical Error
BX: Same as AX
F_TIMEDATE returns the time and date stamp information and password mode for
the specified file in byte 12 and bytes 24 through 31 of the specified FCB. The
calling process passes the address of an FCB in which the drive, filename, and type
fields have been defined.
If F_TIMEDATE is successful, it sets the following fields in the referenced FCB:
byte 12 password mode field
bit 7 - Read
bit 6 - Write
bit 5 - Delete
Byte 12 equal to 0 indicates the file has not been assigned a password.
byte 24 - 27 SFCB Create or Access time stamp field
byte 28 - 31 SFCB Update time stamp field
Upon return, F_TIMEDATE returns a directory code in register Al with the value
OOH if the operation is successful, or OFFH if the specified file is not found.
Register AH is set to OOH in both of these cases.
If a physical or extended error is encountered, F TIMEDATE performs different
actions depending on the BOOS Error mode (see F ERRMODE). If the BOOS is in
the default Error mode, Concurrent displays a message at the console identifying
the error and terminates the calling process. Otherwise, F_TIMEDATE returns to
the calling process with register AL set to OFFH and register AH set to one of the
following physical error codes:
01 H - Disk 1/0 Error : permanent error
04H - Invalid Drive : drive select error
09H - Illegal ? in FCB
6-105
F TRUNCATE Concurrent DOS 86 Programmer's Guide
F TRUNCATE
Truncate File
Entry Parameters:
Register CL: 063H (99)
Register DX: FCB Address - Offset
Returned Values:
Register AL: Directory Code
Register AH: Physical or Extended Error
Register BX: Same as AX
F TRUNCATE sots the last record of a file to the Random Record Number contained
In the referenced FCB. The calling program passes the address of the FCB in
register DX with byte 0 of the FCB specifying the drive, bytes 1 through 11
specifying the filename and filetype, and bytes 33 through 35 (RO, R 1, and R2)
specifying the last record of the file. The last record number is a 24-bit value,
stored with the least significant byte first (RO), the middle byte next (R 1), and the
high byte last (R2). This value can range from O to 262, 143 (03FFFFH)
If the file specified by the referenced FCB is password-protected, the correct
password must have been placed in the first eight bytes of the current OMA buffer,
or have been previously established as the default password (see F_PASSWD).
Interface attribute F5' specifies whether an extended file lock is to be maintained
after the F_TRUNCATE call, as shown below:
F5'• 0 Do not maintain an extended file lock (default)
F5'• 1 Maintain an extended file lock
If F5' is set and the referenced FCB specifies a file with an extended file lock. the
calling process maintains the lock on the file. Otherwise, the file becomes
avallable to other processes. Section 2.11 describes extended file locking in detail.
F_TRUNCATE requires that the Random Record Number field of the referenced FCB
specify a value less than the current file size. In addition, if the file is sparse, the
random record field must specify a region of the file where data exists.
A process can truncate a file that it currently has open if the file is opened In
Locked mode, and the file has not been extended during the open session.
However, the BOOS returns a checksum error If the process makes a subsequent
reference to the file with a BOOS system call requiring an open FCB. A process
cannot truncate files open in R/O or Unlocked mode.
6-106
Concurrent DOS 86 Programmer's Guide F TRUNCATE
6-107
F UNLOCK Concurrent DOS 86 Programmer's Guide
F UNLOCK
Entry Parameters:
Register CL: 02BH (43)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register Al: Error Code
AH: Physical Error
BX: Same as AX
6-108
Concurrent DOS 86 Programmer's Guide F UNLOCK
Upon return, F_UNLOCK sets register Al to OOH if the unlock operation was
successful. Otherwise, register AL contains one of the following error codes:
01 H - Reading unwritten data
03H - Cannot close current extent
04H - Seek to unwritten extent
06H - Random Record Number out of range
OAH - FCB Checksum Error
OCH - Process record Lock List limit exceeded
OOH - Invalid File ID
OEH - No room in system Lock List
OFFH - Physical error refer to register AH
F UNLOCK returns error code 01 H when it accesses a data block which has not
been previously written.
F_UNLOCK returns error code 03H when it cannot close the current extent prior to
moving to a new extent.
F UNLOCK returns error code 04H when it accesses an extent that has not been
created.
F UNLOCK returns error code 06H when byte 35 (r2) for a list of the referenced
FCB is greater than 3.
F UNLOCK returns error code OAH if the referenced FCB failed the FCB checksum
test.
F_UNLOCK returns error code OCH if performing the unlock request would require
that the process consume more than the maximum allowed number of system
Lock List entries.
F UNLOCK returns error code OOH when an invalid File ID is placed at the
beginning of the current OMA.
F_UNLOCK returns error code OEH when the system Lock List is full and performing
the unlock request would require at least one new entry.
F UNLOCK returns error code OFFH if a physical error was encountered and the
BOOS Error mode is one of the return modes (see F_ERRMODE). If the BOOS is in
the default Error mode, Concurrent displays a message at the console identifying
the physical error and terminates the calling process. When F_UNLOCK returns a
physical error to the calling process, it is identified by register AH as shown
below:
01H - Disk 1/0 Error: permanent error
04H - Invalid Drive : drive select error
6-109
F USERNUM Concurrent DOS 86 Programmer's Guide
F USERNUM
Entry Parameters:
Register CL: 020H (32)
DL: OFFH to GET User Number
User Number to SET
Returned Values:
Register AL: Current User Number if GET
BL: Same as AL
6-110
Concurrent DOS 86 Programmer's Guide F WRITE
F WRITE
Entry Parameters:
Register CL: 015H (21)
DX: FCB Address - Offset
DS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
F_WRITE writes 1 to 128, 128-byte data records beginning at the current OMA
address into the file named by the specified FCB. The BOOS Multisector Count
(see F_MULTISEC) determines the number of 128-byte records that are written.
The default is one record. An F_OPEN or F_MAKE call must have previously
activated the referenced FCB.
F_WRITE places the record into the file at the position indicated by the CR byte of
the FCB, and then automatically increments the CR byte to the next record
position. If the CR field overflows, F_WRITE automatically opens or creates the
next logical extent and resets the CR field to OOH in preparation for the next write
operation.
If F_WRITE is used to write to an existing file, then the newly written records
overlay those already existing in the file. The calling process must set the CR field
to OOH following an F_OPEN or F_MAKE call if the intent is to write sequentially
from the beginning of the file.
F WRITE makes an update date and time stamp for the file if the following
conditions are met: the referenced drive has a directory label that requests upda'te
date and time stamping. and the file has not already been stamped for update by a
previous F_MAKE or F_WRITE call.
Upon return, F WRITE sets register AL to OOH if the write operation is successful.
Otherwise, register AL contains an error code identifying the error as shown below:
OlH - No available directory space
02H - No available data block
08H - Record locked by another process
09H - Invalid FCB
OAH - FCB Checksum Error
OBH - Unlocked file verification error
OFFH - Physical error; refer to register AH
6-111
F WRITE Concurrent DOS 86 Programmer's Guide
F_WRITE returns error code OlH when it attempts to create a new extent that
requires a new directory entry, and no available directory entries exist on the
selected disk drive.
F_WRITE returns error code 02H when it attempts to allocate a new data block to
the flle, and no unallocated data blocks exist on the selected disk drive.
F_WRITE returns error code 08H if the calling process attempts to write to a record
locked by another process, or a record locked by the calling process in shared
mode. F_WRITE returns this error only for files open In Unlocked mode.
F_WRITE returns error coda 09H if the FCB Is invalidated by a previous F_CLOSE
system call that returned an error.
F_WRITE returns error code OAH if the referenced FCB fails the FCB checksum test.
F_WRITE returns error code OBH if the BOOS cannot locate the FCB's directory
entry when attempting to verify that the referenced FCB contains current
information. F_WRITE returns this error only for files open in Unlocked mode.
F_WRITE returns error code OFFH if a physical error was encountered and the BOOS
Is In Return Error mode or Return and Display Error mode (see F_ERRMODE). If the
BOOS Is in the default Error mode, Concurrent displays a message at the console
identifying the physical error and terminates the calling process. When F_WRITE
returns a physical error to the calling process, It is identified by register AH as
shown below:
OlH - Disk 1/0 Error : permanent error
02H - Read/Only Disk
03H - Read/Only File or
File Opened In Read/Only Mode or
File password protected in Write mode
04H - Invalid Drive : drive select error
On all error returns except for physical error r11turns (AL • 255), F_WRITE sets
register AH to the number of records successfully written before the error was
encountered. This value can range from 0 to 127, depending on the current BOOS
Multlsector Count. It is always set to zero when the Multisector Count Is equal to
one.
6-112
Concurrent DOS 86 Programmer's Guide F WRITERAND
F WRITERAND
Entry Parameters:
Register CL: 022H (34)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
6-113
F WRITERAND Concurrent DOS 86 Programmer's Guide
6-114
Concurrent DOS 86 Programmer's Guide F WRITERAND
On all error returns. except for physical error returns (Al =- 2SS), F_WRITERAND sets
register AH to the number of records successfully written before the error was
encountered. This value can range from 0 to 127 depending on the current BOOS
Multisector Count. It is always set to zero when the Multisector Count is equal to
one.
6-115
F WRITEXFCB Concurrent DOS 86 Programmer's Guide
F WRITEXFCB
Entry Parameters:
Register CL: 067H (103)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Directory Code
AH: Physical or Extended Error
BX: Same as AX
F_WRITEXFCB creates a new XFCB or updates the existing XFCB for the specified
file. The calling process passes the address of an FCB in which the drive, name,
type, and extent fields have been defined. The FCB extent field, if set, specifies the
password mode and whether a new password is to be assigned to the file. The
format of the extent field byte Is shown below:
FCB byte 12 (EX) XFCB password mode
6-116
Concurrent DOS 86 Programmer's Guide F WRITEXFCB
6-117
F WRITEZF Concurrent DOS 86 Programmer's Gulde
F WRITEZF
Write A Random Record To A Disk File
And Preflll New Data Blocks With Zeros
Entry Parameters:
Register CL: 028H (40)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AL: Error Code
AH: Physical Error
BX: Same as AX
F_WRITEZF is similar to F_WRITE RAND, with the exception that it fills a previously
unallocated data block with zeros (OOH) befon~ writing the record. If F_WRITEZF
has been used to create a file, records accessed by F_READRAND that contain all
zeros identify unwritten random records. Unwritten random records in allocated
data blocks of files created using F_WRITERAND contain uninitialized data.
6-118
Concurrent DOS 86 Programmer's Guide l ATTACH
l ATTACH
Entry Parameters:
Register CL: 09EH (158)
L_ATTACH attaches the default list device of the calling process. If the list device
is already attached to some other process. the calling process relinquishes the
CPU until the other process detaches from the list device. When the list device
becomes free, and the calling process is the highest priority process waiting for
the list device, the attach operation occurs.
6-119
Concurrent DOS 86 Programmer's Guide
L CATIACH
L CATIACH
Entry Parameters:
Register CL: OA1H (161)
Returned Values:
Register AX: 0 if attach 'OK'. OFFFFH on failure
BX: Same as AX
CX: Error Code
L_CATIACH attaches the default list device of the calling process only if the list
device is currently available.
If the list device is currently attached to another process, L_CATTACH returns a
value of OFFH. indicating that the list device could not be attached. L_CATIACH
returns a value of OOH to Indicate that either the list device is already attached to
the process. or that It was unattached, and a successful attach operation was
made.
Table 6-5 contains the list of error codes returned in CX.
6-120
Concurrent DOS 86 Programmer's Guide L DETACH
L DETACH
Entry Parameters:
Register CL: 09FH ( 159)
Returned Values:
Register AX: o if
detach 'OK', OFFFFH on failure
BX: Same as AX
L_DETACH detaches the default list device of the calling process. If the list device
is not currently attached, no action takes place.
6-121
L GET Concurrent DOS 86 Programmer's Guide
L GET
Entry Parameters:
Register CL: OA4H ( 164)
Returned Values:
Register AL: List Device Number
BL: Same as AL
L_GET returns the default list device number of the calling process.
6-122
Concurrent DOS 86 Programmer's Guide L SET
L SET
Entry Parameters:
Register CL: OAOH (160)
DL: List Device Number
Returned Values:
Register CX: Error Code
L_SET sets the default list device for the calling process.
Table 6-5 contains the list of error codes returned in CX.
6-123
L WRITE Concurrent DOS 86 Programmer's Guide
L WRITE
Entry Parameters:
Register CL: 05H (5)
DL: Character
L_WRITE writes the specified character to the default list device of the calling
process. Before writing the character, Concurrent calls L_ATTACH to verify that the
calling process owns its default list device.
6-124
Concurrent DOS 86 Programmer's Guide L WRITEBLK
L WRITEBLK
Entry Parameters:
Register CL: 070H (112)
Register DX: CHCB Address
L_WRITEBLK sends the character string specified in the Character Control Block
(CHCB) and addressed in register pair DX to the logical list device, LST:. The CHCB
format is:
bytes 0 - 1 Offset of character string
bytes 2 - 3 Segment of character string
bytes 4 - 5 Length of character string to print
6-125
Memory Call Data Structures Concurrent DOS 86 Programmer's Guide
+--------+----------+-----+
I BASE LENGTH I EXT I
+--------+----------+-----+
figure 6-7. MCB - Memory Control Block
Field Definition
6-126
Concurrent DOS 86 Programmer's Guide Memory Call Data Structures
,·*************************************************
,. *
,. * Memory Control Block Definition
., *
,•*************************************************
mcb base equ word ptr 0
mcb:=length equ word ptr mcb base + word
mcb ext equ byte ptr mcb:=length + word
Figure 6-8 shows the Memory Control Block. Table 6-15 defines its fields, and
listing 6-2 shows the programming equates for this data structure.
+------+------+------+------+------+
I START! MIN I MAX l*OOOOHl*OOOOHI
+------+------+------+------+------+
Field Description
6-127
Memory Call Data Structures Concurrent DOS 86 Programmer's Guide
,•*****************************************************
,. *
;* Memory Parameter Block Definition
.*
I
,·*****************************************************
mpb start equ word ptr 0
mpb=min equ word ptr mpb start + word
mpb_max equ word ptr mpb=:min + word
mpb_pdadr equ word ptr mpb_max + word
mpb_flags equ word ptr mpb_pdadr + word
mpb_flags definition
mf load equ OOOOlh
mf-share equ 00002h
mf-code equ 00004h
6-128
Concurrent DOS 86 Programmer's Guide M ALLOC
M ALLOC
Entry Parameters:
Register CL: 080H or 081 H (128, 129)
DX: MPS Address Offset
DS: MPS Address Segment
MPS filled in
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
MPS start filled in
6-129
M FREE Concurrent DOS 86 Programmer's Guide
M FREE
Entry Parameters:
Register CL: 082H (130)
DX: MFPB Address - Offset
OS: MFPB Address - Segment
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
The calling process passes the address of a Memory Free Parameter Block (MFPB)
as shown in the Figure 6-9.
+--------------------+
START I * OOOOH
+--------------------+
Figure 6-9. MFPB - M FREE Parameter Block
M _FREE releases memory starting at the START paragraph to the end of a single
previously allocated segment that contains the START paragraph. If the START
paragraph is the same as that returned in the MPB of a memory allocation call,
then M_FREE releases the whole memory segment. The * OOOOH field must be
initialized to zero.
Table 6-5 contains the list of error codes returned in CX.
6-130
Concurrent DOS 86 Programmer's Guide MC ABSALLOC
MC ABSALLOC
Entry Parameters:
Register CL: 038H (56)
DX: MCB Address - Offset
OS: MCB Address - Segment
Returned Values:
Register AL: O on success. OFFH on failure
BL: Same as AL
CX: Error Code
6-131
MC ABSMAX Concurrent DOS 86 Programmer's Guide
MC ABSMAX
Entry Parameters:
Register CL: 036H (54)
DX: MCB Address - Offset
DS: MCB Address - Segment
MCB _base filled in, MCB_length set to
max number of paragraphs wanted
Returned Values:
Register AL: 0 on success, OFFH on failure
BL: Same as AL
ex: Error Code
MCB_length set to actual number of paragraphs allocated
6-132
Concurrent DOS 86 Programmer's Guide MC ALLFREE
MC ALLFREE
Entry Parameters:
Register CL: OJAH: (58)
Under Concurrent, MC_ALLFREE releases all of the calling process's memory except
the User Data Area (UDA). It is useful for system processes and for subprocesses
that share the memory of another process.
Note: MC_ALLFREE should not be used by processes running programs loaded into
the Transient Program Areas (TPA).
6-133
MC ALLOC Concurrent DOS 86 Programmer's Guide
MC ALLOC
Entry Parameters:
Register CL: 037H (SS)
DX: MCB Address - Offset
OS: MCB Address - Segment
MCB_length filled in
Returned Values:
Register AL: 0 on success. OFFH on failure
BL: Same as AL
CX: Error Code
MCB base filled in
MC ALLOC allocates a memory area whose size Is the LENGTH field of the MCB.
MC-ALLOC returns the base paragraph address of the allocated region in the user's
MCB. Upon return, register AL contains a OOH if the request was successful. and a
OFFH If the memory could not be allocated.
Table 6-S contains the list of error codes returned in CX.
6-134
Concurrent DOS 86 Programmer's Guide MC FREE
MC FREE
Entry Parameters:
Register CL: 039H (57)
DX: MCB Address - Offset
OS: MCB Address - Segment
MCB_base, MCB_ext filled in
Returned Values:
Register AL: 0 if successful, OFFH on failure
BL: Same as AL
CX: Error Code
MC _FREE releases memory areas allocated to the process. The value of the EXT
field of the MCB controls the free operation. If EXT = OFFH. then MC _FREE releases
all memory areas allocated by the calling process. If the EXT field is OOH, then
MC_FREE releases the memory area beginning at the specified BASE and ending at
the end of the previously allocated memory segment.
Table 6-5 contains the list of error codes returned in CX.
6-135
MC MAX Concurrent DOS 86 Programmer's Guide
MC MAX
Entry Parameters:
Register CL: 035H (53)
DX: MCB Address - Offset
OS: MCB Address - Segment
(MCB _length contains maximum
number of paragraphs wanted)
Returned Values:
Register AL: 0 on success, OFFH on failure
BL: Same as AL
CX: Error Code
(MCB _base filled in, MCB_length set to
actual number of paragraphs allocated)
MC_MAX allocates the largest available memory region that is less than or equal to
the LENGTH field of the MCB in paragraphs. If the allocation is successful,
MC_MAX sets the BASE to the base paragraph address of the available area and
LENGTH to the paragraph length. Upon return, register AL has the value OFFH if no
memory is available, and OOH if the request was successful. MC_MAX sets the EXT
to 1 if there is additional memory for allocation, and 0 if no additional memory is
available.
Under CP/M-86, this call does not allocate memory, but under Concurrent it does
because other processes are competing for common memory. For compatibility
with CP/M-86, MC_ABSALLOC (system call 56) does not return an error if there is a
memory segment allocated at the absolute address.
Table 6-5 contains the llst of error codes returned in ex.
6-136
Concurrent DOS 86 Programmer's Guide P ABORT
P ABORT
Entry Parameters:
Register CL: 09DH (157)
DX: APB Address - Offset
DS: APB Address - Segment
APB filled in
Returned Values:
Register AX: 0 on success. OFFH on failure
BX: Same as AX
CX: Error Code
+------+------+------+------+------+------+
00 PD TERM CNS I *OOH I
!------+------+------+------+------+------+------+------+
06 I NAME I
+------+------+------+------+------+------+------+------+
Figure 6-10. APB - Abort Parameter Block
6-137
P ABORT Concurrent DOS 86 Programmer's Guide
Field Definition
6-138
Concurrent DOS 86 Programmer's Guide P CHAIN
P CHAIN
Entry Parameters:
Register CL: 02FH (47)
OMA Buffer: Command Line
Returned Values:
Register AX: OFFFFH - Could not find Command
P_CHAIN chains from one program to the next without user intervention. Although
P_CHAIN requires no passed parameter. the calling process must place a command
line terminated by a 0 byte in the default OMA buffer.
P_CHAIN releases the memory of the calling process before executing the
command. The command is processed in the same manner as the P_CLI call. If
the command warrants the loading of a CMD file and the memory released is large
enough for the new program, Concurrent loads the new program into the same
memory area as the old program. The new program is run by the same process
that ran the old program. The name of the process is changed to reflect the new
program being run.
Parameter passing between the old and new programs is accomplished through
the use of disk files, queues. or the command line. The command line is parsed
and placed in the Base Page of the new program as described in P_CU.
P CHAIN returns an error if no CMD file is found. If a CMD file is found. and an
error occurs after it is successfully opened, the calling process terminates. as its
memory has been released.
6-139
P CLI Concurrent DOS 86 Programmer's Guide
P CLI
Entry Parameters:
Register CL: 096H (150)
DX: CLBUF Address - Offset
OS: CLBUF Address - Segment
Returned Values:
Register AX: 0 on success, OFFFFH on error
CX: Error Code
P CU obtains an ASCII command from the Command Line Buffer (CLBUF) and then
executes It. Figure 6-11 shows the Command Line Buffer format and Table 6-17
lists the CLBUF field definitions.
0 1 2 3 128 129
+------+------+------+------+ +------+------+
I *OOH I COMMAND I *OOH I
+------+------+------+------+ +-------------+
Figure 6-11. CLI Command Line Buffer
Field Definition
If the calling process is attached to its default virtual console, P_CU assigns the
virtual console to either the newly created process. or to the Resident System
Process (ASP) that acts on the command. The calling process must reattach to Its
default virtual console before accessing it.
P_CU calls F_PARSE to parse the command line. If an error occurs in F_PARSE,
P_CU returns to the calling process with the error code set by F_PARSE.
6-140
Concurrent DOS 86 Programmer's Guide P CLI
If there is no disk specification for the command, P_CU tries to open a system
queue with the same name as the command. If the open operation is successful,
and the queue is an RSP-type queue, P_CLI then writes the command tail to the
RSP queue. If the queue is full. P_CU returns an error code to the calling process.
P_CLI also attempts to assign the calling process's virtual console to a process
with the same name as the RSP queue. If the RSP queue cannot be found, the
P CLI assumes the command is on disk and continues.
P_CLI opens a file with the filename being the command and the filetype being
CMD. If the command has an explicit disk specification, and the F_OPEN call fails,
P_CLI returns an error code to the calling process. If there is no disk specification
with the command, P_CLI attempts to open the command file on the system disk.
If the F_OPEN call succeeds, P_CLI checks the file to verify the SYSTEM attribute is
on. This search order is discussed in the U~.!!~Qui~. If this second F_OPEN fails
or if the DIR attribute is on, P_CU returns an error code to the calling process.
Once P_CLI succeeds in opening the command file. it calls P_LOAD to find and then
load the file into an appropriate memory space. If P_LOAD encounters any errors.
P_CU returns to the calling process with the error code set by P_LOAD.
A successful load operation establishes the command file in memory with its Base
Page partially initialized. P_CU then continues parsing the command tail to set up
the Base Page values from 050h to OFFH.
P_CLI initializes an unused Process Descriptor from the internal PD table, a UDA
(expanded UDA if 8087 processing is required) and a 96-byte stack area. The UDA
and stack are dynamically allocated from memory. P_CLI then calls P_CREATE.
If P_CU encounters an error in any of these steps, it releases all memory segments
allocated for the new command, as well as the Process Descriptor. and then
returns with the appropriate error code set.
Once P_CREATE returns successfully, P_CU assigns the calling process's default
virtual console to the new process and then returns.
The calling process should set its priority to less than 198, the value of the
Terminal Message Process TMP), if it wants to attach to the virtual console after
the created process releases it. Once the calling process has successfully
reattached, it should set its priority back to 200.
Table 6-5 contains the list of error codes returned in CX.
6-141
P CREATE Concurrent DOS 86 Programmer's Guide
P CREATE
Create A Process
Entry Parameters:
Register CL: 090H (144)
DX: PD Address - Offset
DS: PD Address - Segment
PD filled in
Returned Values:
Register AX: 0 on success. OFFFFH on failure
BX: Same as AX
CX: Error Code
P_CREATE creates a subprocess within a process's own memory area. The child
process shares all memory owned by the calling process at the time of the
P CREATE call. The calling process passes the address of a Process Descriptor
(PD). Figure 6-12 shows the Process Descriptor format and Table 6-18 lists the PD
field definitions.
Process Descriptors. as well as Queue Descriptors and Queue Buffers, are required
to be within the System Data Segment because they are linked together on various
system lists or are used by more than one process. Because of this, they cannot
be in the Transient Process Area (TPA). where they are unprotected, so Concurrent
copies all Process Descriptors into an internal PD table. P_CREATE returns an error
code if there are no more unused PDs in the table.
A single P_CREATE call can create more than one process if the PD's LINK field is
nonzero. In this case, it Is assumed to point to another PD within the same Data
Segment. After It creates the first process, P_CREATE checks the LINK field and if
non-zero, It follows the linked list to create multiple processes.
WARNING! P_CREATE does not check the validity of the PD addresses passed by
the calling process. If there Is no hardware memory protection on the system,
passing an invalid PD address can cause Concurrent to halt indefinitely requiring a
reboot.
Table 6-5 contains the list of error codes returned in CX.
6-142
Concurrent DOS 86 Programmer's Guide P CREATE
+------+------+------+------+------+------+------+------+
001 LINK THREAD I STAT I PRIORI FLAG
+------+------+------+------+------+------+------+------+
081 NAME
+------+------+------+------+------+------+------+------+
101 UDA I DISK I USER I RESERVED MEM
+------+------+------+------+------+------+------+------+
181 RESERVED PARENT
+------+------+------+------+------+------+------+------+
201 CNS I AUX I RESERVED I LIST I RSRVDI SF LAG
+------+------+------+------+------+------+------+------+
281 RESERVED
+------+------+------+------+------+------+------+------+
301 RESERVED P MPAR
+------+------+------+------+------+------+------+------+
381 RESERVED
+------+------+------+------+------+------+------+------+
Figure 6-12. PD - Process Descriptor
6-143
P CREATE Concurrent DOS 86 Programmer's Guide
Field Definition
6-144
Concurrent DOS 86 Programmer's Guide P CREATE
Field Definition
6-145
P CREATE Concurrent DOS 86 Programmer's Guide
Field Definition
NAME Process Name. Eight bytes. with all eight bits of each byte
used for matching process names.
UDA Segment address of this process's User Data Area. The
UDA can be anywhere in memory but must be on a
paragraph boundary. Initialized to be the number of
paragraphs from the beginning of the calling process's Data
Segment. The UDA contains process Information that is not
needed between processes. it also contains the System
Stack of each process. See Figure 6-13 and Table 6-19 for
more detailed information about the UDA.
DISK Current default disk
USER Current default user number
RESERVED Reserved for internal use. Must be initialized to zero (0).
MEM Root of linked list of Memory Segment Descriptors that are
owned by this process. Initialized to zero, except for
reentrant or shared code RSPs.
RESERVED Reserved for internal use. Must be initialized to zero (0).
PARENT Process that created this process. P CREATE sets this
value at process creation. The parent field is set to zero if
the parent terminates before the child.
CNS Current default console's number. Initialized to be the
default console number.
AUX This field contains the current default auxiliary device
number. Must be initialized to zero (OH) before calling
P CREATE.
RESERVED Reserved for internal use. Must be initialized to zero (0).
LIST Current default list device. Initialized to be the default list
device number.
RESERVED Reserved for internal use. Must be initialized to zero (0).
6-146
Concurrent DOS 86 Programmer's Guide P CREATE
Field Definition
6-147
P CREATE Concurrent DOS 86 Programmer's Guide
+------+------+------+------+------+------+------+------+
OOH RESERVED I OMA OFFSET RESERVED I
+------+------+------+------+------+------+------+------+
OBH RESERVED
+------+------+------+------+------+------+------+------+
lOH RESERVED
+------+------+------+------+------+------+------+------+
18H RESERVED I
+------+------+------+------+------+------+------+------+
20H AX BX ex DX
+------+------+------+------+------+------+------+------+
28H DI SI BP RESERVED
+------+------+------+------+------+------+------+------+
30H RESERVED SP RESERVED I
+------+------+------+------+------+------+------+------+
38H INT 0 INT 1
+------+------+------+------+------+------+------+------+
40H RESERVED INT 3
+------+------+------+------+------+------+------+------+
48H INT 4 RESERVED
+------+------+------+------+------+------+------+------+
50H cs DS ES SS
+------+------+------+------+------+------+------+------+
58H INT 224 INT 225
+------+------+------+------+------+------+------+------+
GOH RESERVED
+------+------+------+------+------+------+------+------+
68H
U S E R S Y S T E M S T A C K
FBH
+------+------+------+------+------+------+------+------+
lOOH cw SW RESERVED
+------+------+------+------+------+------+------+------+
I RESERVED I
+------+------+------+------+------+------+------+------+
RESERVED
+------+------+------+------+------+------+------+------+
RESERVED
+------+------+------+------+------+------+------+------+
158H RESERVED
+------+------+------+------+------+------+------+------+
Figure 6-13. UDA - User Data Area
Note: The UDA length Is 256 bytes, and it must begin on a paragraph boundary. If
the optional 96-byte 8087 processing extension is used, the length is 352 bytes.
6-148
Concurrent DOS 86 Programmer's Guide P CREATE
Field Definition
OMA OFFSET The initial DMA offset for the new process. The segment
address of the OMA is assumed to be the same as the
initial Data Segment (see OS below).
AX - BP The initial register values for the new process. These are
typically set to zero.
SP The initial stack pointer for the new process. The stack
pointer is relative to the initial Stack Segment (see SS
below). The new process's initial stack must be initialized
with the offset of the first instruction it is to execute. The
word that the stack pointer points to is the initial
instruction pointer (IP). Two words must follow the initial IP,
which is filled in with the initial Code Segment (see CS
below) and the initial flags. The initial flags are set to
0200H, which means that interrupts are on, and all other
flags are off. Concurrent starts a new process by executing
an Interrupt Return instruction with the initial stack.
Note: This stack area is distinct from the User System
Stack at the end of the UDA.
INT 0 - INT 4 The initial interrupt vectors for the first five interrupt types
can be set by filling in these fields. The first word of each
field is the Instruction Pointer (IP), and the second word is
the Code Segment (CS) for a list of the interrupt routines
that service these interrupts. Those fields that are zero are
initialized to be the same as the calling processes interrupt
vectors. These fields are typically initialized to be 0.
CS,DS,ES,SS The initial segment addresses for the new process are
taken from these fields. Those fields that are zero are
initialized to be the same as the calling process's Data
Segment.
6-149
P CREATE Concurrent DOS 86 Programmer's Guide
Field Definition
INT 224,225 Interrupts 224 and 225 are used to communicate with
Concurrent by typical programs. These interrupt vectors
are Initialized to be the same as the calling process if these
values are zero. The ability to change these values allows
a run-time system to intercept Concurrent calls that its
children make. The suggested protocol is to keep INT 225
pointing to the Concurrent entry point and changing INT
224 to point to an internal routine. When a child process
does an INT 224, the Internal routine can filter calls to
Concurrent using INT 225 for the actual Concurrent call.
RESERVED These fields are used internally and must be initialized to
zero.
USER SYSTEM STACK
This Is the stack area used by the process when it is in the
operating system. The SP variable in the UDA should not
point to this area.
cw Control Word for 8087 processing. RSPs (and other
processes bypassing the P_CU call) must set this word to
03FFH before system generation.
SW Status Word for 8087 processing. RSPs (and other
processes bypassing the P_CU call) must set this word to
OOOOH before system generation.
6-150
Concurrent DOS 86 Programmer's Guide P DELAY
P DELAY
Entry Parameters:
Register CL: OBDH ( 141)
DX: Number of System Ticks
P_DELAY delays execution of the calling process for a specific time interval, thus
allowing other processes to use the CPU resource while the calling process waits.
P_DELAY avoids the necessity of programmed delay loops.
The calling process specifies the delay interval as a number of system ticks. The
length of the system tick varies among installations. A typical system tick is 60Hz
(16.67 milliseconds). In Europe, it is likely to be 50Hz (20 milliseconds). The exact
length can be obtained by reading the TICKSPERSEC value from the System Data
Segment (see S_SVSDAT).
There is up to one tick of uncertainty in the exact amount of time delayed because
P_DELAY is called asynchronously from the actual time base. P_DELAY is
guaranteed to delay the calling process at least the number of ticks specified.
However, when the calling process is rescheduled to run, it might wait quite a bit
longer if there are higher priority processes waiting to run.
P_DELAY is useful for programs that need to wait specific amounts of time for 1/0
events to occur. Under these conditions. the calling process usually has a very
high priority level. If a process with a high priority calls P_DELAY the actual delay
is typically within a system tick of the amount of time wanted.
6-151
P DISPATCH Concurrent DOS 86 Programmer's Guide
P DISPATCH
Call Dispatcher
Entry Parameters:
Register CL: 08EH (142)
6-152
Concurrent DOS 86 Programmer's Guide P LOAD
P LOAD
Entry Parameters:
Register CL: 03BH (59)
DX: FCB Address - Offset
OS: FCB Address - Segment
Returned Values:
Register AX: Base Page Address, OFFFFH on error
BX: Same as AX
CX: Error Code
P_LOAD loads a disk CMD-type file into memory. Upon entry, register DX contains
the offset, relative to OS, of a successfully opened FCB that specifies the CMD file
to load. Upon return, register AX has the value OFFFFH if the program load failed.
Otherwise, AX contains the paragraph address of the Base Page belonging to the
loaded program. The paragraph address and length of each group loaded from the
CMD file, is found in the Base Page. See Sections 3.2 and 3.3.
Before calling P_LOAD, the calling process must establish the OMA address of
where the CMD file is to be loaded. This is accomplished with F_DMASEG and
F DMAOFF.
Note: Open the CMD file in Read-Only mode and close it once the load is
completed.
Table 6-5 contains the list of error codes returned in CX.
6-153
P PDADR Concurrent DOS 86 Programmer's Guide
P PDADR
Entry Parameters:
Register CL: 09CH (156)
Returned Values:
Register AX: PD Address - Offset
BX: Same as AX
ES: PD Address - Segment
P_PDADR obtains the address of the calling process's Process Descriptor. See
P_CREATE for a description the Process Descriptor format.
6-154
Concurrent DOS 86 Programmer's Guide P PRIORITY
P PRIORITY
Entry Parameters:
Register CL: 091H (145)
Dl: Priority
P_PRIORITV sets the priority of the calling process to the specified value.
P_PRIORITY is useful when a process needs to have a high priority during an
initialization phase, but afterwards can run at a lower priority.
The highest priority is OOH, while the lowest priority is OFFH. Transient processes
are initialized to run at CSH (200 decimal) by P_CU.
6-155
P RPL Concurrent DOS 86 Programmer's Guide
P RPL
Entry Parameters:
Register CL: 097H (151)
DX: CPB Address - Offset
DS: CPB Address - Segment
Returned Values:
Register AX: OlH if APL not found, RPL return parameter
BX: same as AX
CX: Error Code
ES: RPL return segment if addr
P_RPL permits a process to make system call from an optional Resident Procedure
Library (APL). The calling process passes the address of Call Parameter Block
(CPB). Figure 6-14 shows the Call Parameter Block format, and Table 6-20 lists the
CPB field definitions.
+------+------+------+------+------+------+------+------+
NAME
+------+------+------+------+------+------+------+------+
PARAM
+------+------+
Figure 6-14. CPB - Call Parameter Block
Field Definition
6-156
Concurrent DOS 86 Programmer's Guide P RPL
P_RPL reads a message from the queue containing the address of the specified
system call. It then places the PARAM field of the CPB in register DX, and places
the calling process's Data Segment address in register OS. P_RPL performs a Far
Call instruction to the address it obtains from the queue message. Upon return
from the RPL, P_RPL copies the BX register to the AX register and then returns to
the calling process.
Note: P RPL does not write the address of the Resident Procedure back to the
queue; the Resident Procedure itself must do this. If the Resident Procedure is to
be reentrant, it must write the message into the queue upon entry. If it is to be
serially reusable, the procedure must write the message just before returning.
Table 6-5 contains the list of error codes returned in CX.
6-157
P TERM Concurrent DOS 86 Programmer's Guide
P TERM
Entry Parameters:
Register CL: 08FH (143)
DL: Termination Code
Returned Values:
Register AX: O on success, OFFFFH on failure
BX: Same as AX
P_TERM terminates the calling process. If the Termination Code is not OFFH,
P_TERM can only terminate a user process; if the Termination Code is OFFH,
P_TERM can terminate the calling process even though the process's SYSTEM flag
is on. P_TERM cannot terminate a process with the KEEP flag on.
If the termination is successful, P_TERM releases the Mutual Exclusion queues
owned by the process. It also releases all memory segments owned by the
process, and returns the Process Descriptor to the PD table.
A process can own one or more of the following resources: memory segments,
consoles, printers, Mutual Exclusion messages, and system Lock List entries that
record open files and locked records. When a process terminates and releases its
resources, these resources become available to other processes on the system.
For example, if a terminating process releases a system console, the console is
usually given back to the console's TMP. This occurs when the TMP is the highest
priority process waiting for the console.
If P_TERM returns to the calling process, the call has failed for one of two reasons.
Either the process has the KEEP flag on, or it has the SYSTEM flag on, and the
Termination Code is not OFFH.
6-158
Concurrent DOS 86 Programmer's Guide P TERMCPM
P TERMCPM
Entry Parameters:
Register CL: OOH (0)
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
P_TERMCPM terminates the calling process, releasing all system resources owned
by the process. P_TERMCPM is implemented internally by calling P_TERM with the
Termination Code set to OOH.
Under CP/M-86, P_TERMCPM has an additional argument that allows a process not
to release its memory. This argument places a piece of code into memory that
becomes an interface for later programs. Concurrent does not include this option,
so memory segments are not recovered until all processes that own the memory
segment have released it.
Table 6-5 contains the list of returned error codes.
6-159
Queue Parameter Block Concurrent DOS 86 Programmer's Guide
Queue system calls under Concurrent use the Queue Parameter Block (QPB) data
structure to pass parameters to and from Concurrent. Figure 6-15 shows the
Queue Parameter Block format, and Table 6-21 lists the QPB field elements.
Listing 6-3 shows the programming equates for the Queue Parameter Block data
structure.
+------+------+------+------+------+------+------+------+
* OOOOH QUEUE ID * OOOOH BUFFER
+------+------+------+------+------+------+------+------+
NAME
+------+------+------+------+------+------+------+------+
Figure 6-15. QPB - Queue Parameter Block
Field Description
6-160
Concurrent DOS 86 Programmer's Guide Queue Parameter Block
,·*****************************************************
,. *
;* QPB - Queue Parameter Block Definition
,. *
,. *
,·* 00 OOOOH queue id OOOOH buffer
,. *
,. * 08 name
I
.*
,. *
I
.* queueid - Queue ID, address of QD
I
.* buffer - address to read/write into/from
,. * name - name of queue (for open only)
.*
I
·*****************************************************
I
6-161
Q CREAD Concurrent DOS 86 Programmer's Guide
Q CREAD
Entry Parameters:
Register CL: OBAH (138)
DX: OPB Address - Offset
DS: OPB Address - Segment
OPB_queueid filled in by previous O_OPEN
OPS_buffer set to message buffer offset
Returned Values:
Register AX: O on success, OFFFFH on failure
BX: Same as AX
ex: Error Code message in buffer
0 _CREAD is analogous to 0 _READ, but it returns an error code if there are not
enough messages to read, instead of waiting for another process to write to the
queue.
Table 6-5 contains the list of error codes returned in CX.
6-162
Concurrent DOS 86 Programmer's Guide Q CWRITE
Q CWRITE
Entry Parameters:
Register CL: 08CH (140)
DX: QPB Address - Offset
OS: QPB Address - Segment
QPB_queueid filled in by previous O_OPEN
OPB_buffer set to message buffer offset
message in current OMA buffer
Returned Values:
Register AX: 0 on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
6-163
Q DELETE Concurrent DOS 86 Programmer's Guide
Q DELETE
Entry Parameters:
Register CL: 088H (136)
DX: QPB Address - Offset
OS: QPB Address - Segment
QPB_queueid filled in by a previous O_OPEN call
Returned Values:
Register AX: O on success. OFFFFH on failure
BX: Same as AX
CX: Error Code
O_DELETE removes a system queue from the system, and returns an error code if
the queue cannot be deleted or if the queue has not been opened prior to the call.
Table 6-5 contains the list of error codes returned in CX.
6-164
Concurrent DOS 86 Programmer's Guide 0 MAKE
Q MAKE
Entry Parameters:
Register CL: 086H (134)
DX: OD Address - Offset
OS: OD Address - Segment
OD filled in
Returned Values:
Register AX: O on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
O_MAKE creates a system queue for the calling process by passing the address of
a Queue Descriptor (QD). Figure 6-16 shows the Queue Descriptor format, and
Table 6-22 lists the OD field elements.
+------+------+------+------+------+------+------+------+
* OOOOH * OOOOH FLAGS NAME •..
+------+------+------+------+------+------+------+------+
NAME MS GLEN
+------+------+------+------+------+------+------+------+
NM SGS * OOOOH * OOOOH * OOOOH
+------+------+------+------+------+------+------+------+
* OOOOH BUFFER
+------+------+------+------+
Figure 6-16. OD - Queue Descriptor
6-165
Q MAKE Concurrent DOS 86 Programmer's Guide
Field Definition
6-166
Concurrent DOS 86 Programmer's Guide Q MAKE
6-167
Q OPEN Concurrent DOS 86 Programmer's Guide
Q OPEN
Entry Parameters:
Register CL: 087H (135)
DX: QPB Address - Offset
OS: QPB Address - Segment
QPB name filled In
Returned Values:
Register AX: 0 on success. OFFFFH on failure
BX: Same as AX
CX: Error Code
OPB_queueid filled in
a OPEN opens a system queue by examining each existing system queue and
attempting to match the name in the OPB with the name of a system queue. All
eight bytes of the name must match for a successful open. All bits of each byte
are examined.
If the open operation is successful, Q OPEN modifies the Queue ID Field of the
OPB. Once the the queue is opened, - subsequent reads, writes, or a delete are
allowed.
Note: Under Concurrent, you must use Q_OPEN to explicitly open all system
queues before attempting a read, write, or delete operation.
Table 6-5 contains the list of error codes returned In CX.
6-168
Concurrent DOS 86 Programmer's Guide Q READ
Q READ
Entry Parameters:
Register CL: 089H (137)
DX: QPB Address - Offset
DS: QPB Address - Segment
QPB_queueid filled in by previous O_OPEN
QPB_buffer set to message buffer offset
Returned Values:
Register AX: 0 on success. OFFFFH on failure
BX: Same as AX
CX: Error Code message in buffer
Q_READ reads a message from a system queue that was previously opened by the
calling process. Q_READ returns an error code if the queue was not previously
opened or if the system queue has been deleted since the Q_OPEN call. If there
are not enough messages to read from the queue, the calling process waits until
another process writes into the queue before returning.
Table 6-5 contains the list of error codes returned in CX.
6-169
Q WRITE Concurrent DOS 86 Programmer's Guide
Q WRITE
Entry Parameters:
Register CL: 08BH ( 139)
DX: QPB Address - Offset
OS: QPB Address - Segment
QPB_queueid filled In by previous O_OPEN
QPB_buffer set to message buffer offset message in buffer
Returned Values:
Register AX: O on success, OFFFFH on failure
BX: Same as AX
CX: Error Code
a_WRITE writes a message to a system queue that was previously opened by the
calling process. 0 WRITE returns an error code if the queue was not previously
opened or If the system queue has been deleted since the Q_OPEN call. If there Is
not enough buffer space in the queue, the calling process waits until another
process reads from the queue before writing to the queue and returning.
Table 6-5 contains the list of error codes returned In CX.
6-170
Concurrent DOS 86 Programmer's Guide S BDOSVER
S BDOSVER
Entry Parameters:
Register CL: OCH ( 12)
Returned Values:
Register AX: BOOS Version Number
BX: Same as AX
S_BOOSVER returns the BOOS file system version number, allowing version-
independent programming. Register AX values are:
01432H - Version 3.2
01441H - Version 4.1
01450H - Version 5.0
6-171
S BIOS Concurrent DOS 86 Programmer's Guide
S BIOS
Entry Parameters:
Register CL: 032H (50)
DX: BIOS Descriptor Address - Offset
OS: BIOS Descriptor Address - Segment
Returned Values:
Register AX: BIOS Return
BX: Same as AX
S_BIOS provides compatibility for programs generated under CP/M-86 that use this
system call (Function 50). The calling process passes the address of a BIOS
Descriptor. Figure 6-17 shows the format.
+-------+-------+-------+-------+-------+
FUNC I ex DX
+-------+-------+-------+-------+-------+
Figure 6-17. BIOS Descriptor Format
Since Concurrent only supports routines that interface with character devices, the
arguments to character routines such as CONIN and UST must be converted to
those appropriate for Concurrent's XIOS. Refer to the System Guide for further
information about the XIOS.
Note: Calls to the XIOS Console Status, Input, and Output system calls do not go
to the XIOS if the referenced device is a virtual console.
6-172
Concurrent DOS 86 Programmer's Guide S OSVER
S OSVER
Entry Parameters:
Register CL: OA3H (163)
Returned Values:
AX: Version Number
BX: Same as AX
CX: Error Code
S_OSVER returns the version number of the operating system, allowing version-
independent programming. Register AX values are:
01432H - Version 3.2
01441H - Version 4.1
01450H - Version 5.0
Table 6-5 contains the list of error codes returned in CX.
6-173
S SERIAL Concurrent DOS 86 Programmer's Guide
S SERIAL
Entry Parameters:
Register CL: 06BH ( 107)
DX: SERIAL Address - Offset
DS: SERIAL Address - Segment
Returned Values:
SERIAL filled in
S_SERIAL returns the Concurrent DOS 86 serial number to the addressed, six-byte
SERIAL field as a six-byte ASCII numeral. Figure 6-18 shows the format of the
returned value.
+---+---+---+---+---+---+
I o I 1 I 2 I 3 I 4 I 5 I
+---+---+---+---+---+---+
Figure 6-18. SERIAL Number Format
6-174
Concurrent DOS 86 Programmer's Guide S SVSDAT
S SVSDAT
Entry Parameters:
Register CL: 09AH (154)
Returned Values:
AX: Sysdat Address - Offset
BX: Same as AX
ES: Sysdat Address - Segment
S_SYSDAT returns the address of the System Data Segment of the calling
process. The System Data Segment contains all Process Descriptors, Queue
Descriptors, the roots of system lists, and other internal data.
Figure 6-19 shows the SYSDAT Table, and Table 6-23 lists its fields.
6-175
S SVSDAT Concurrent DOS 86 Programmer's Guide
+------+------+------+------+------+------+------+------+
OOH SUP ENTRY RESERVED
+------+------+------+------+------+------+------+------+
08H
RESERVED
+------+------+------+------+------+------+------+------+
28H XIOS ENTRY XIOS INIT
+------+------+------+------+------+------+------+------+
30H RESERVED
+------+------+------+------+------+------+------+------+
38H DISPATCHER PD ISP
+------+------+------+------+------+------+------+------+
40H CCPMSEG RSPSEG ENDSEG I RSVD I NVCNSI
I I I
+------+------+------+------+------+------+------+------+
48H I NLCB I NCCB I N I SYS I MMP I RSVD I DAY I
I FLAGS I DISK I I FILE I
+------+------+------+------+------+------+------+------+
50H I TEMP !TICKS I LUL CCB FLAGS
I DISK I /SEC I
+------+------+------+------+------+------+------+------+
58H MOUL MFL PUL QUL
+------+------+------+------+------+------+------+------+
60H QMAU
+------+------+------+------+------+------+------+------+
68H RLR DLR DRL PLR
+------+------+------+------+------+------+------+------+
?OH RESERVED TH RD RT QLR MAL
+------+------+------+------+------+------+------+------+
78H VERSION VERNUM I CCPMVERNUM TOD DAY
+------+------+------+------+------+------+------+------+
80H I TOD I TOD I TOD I NCON I NLST I NCIO I LCB
I _HR I _MIN I _SEC I DEV I DEV I DEV I
+------+------+------+------+------+------+------+------+
88H I OPEN FILE ILOCK !OPEN I OWNER 8087 ACB
I - IMAX - IMAX - I -
+-----·-+------+------+------+------+------+------+------+
90H RESERVED
+------+------+------+------+------+------+------+------+
98H MWDR RESERVED I NACB I PSD IRSVD IXPCNS I
+------+------+------+------+------+------+------+------+
AOH I OFF_8087 SEG 8087 RESERVED
+------+------+------+------+------+------+------+------+
Figure 6-19. SVSDAT Table
6-176
Concurrent DOS 86 Programmer's Guide S SYSDAT
Field Definition
6-177
S SVSDAT Concurrent DOS 86 Programmer's Guide
Field Definition
6-178
Concurrent DOS 86 Programmer's Guide S SYSDAT
Field Definition
RLR Ready List Root. Linked list of PDs that are ready to run.
DLR Delay List Root. Linked list of PDs that are delaying for a
specified number of system ticks.
DRL Dispatcher Ready List. Temporary holding place for PDs
that have just been made ready to run.
PLR Poll List Root. Linked list of PDs that are polling on
devices.
THRDRT Thread List Root. Linked list of all current PDs on the
system. The list is threaded though the THREAD field of
the PD instead of the LINK field.
QLR Queue List Root. Linked list of all System ODs.
MAL Memory Allocation List. Linked list of active memory
allocation units. A MAU is created from one or more
memory partitions.
VERSION Address, relative to CCPMSEG, of ASCII version string.
VERN UM Concurrent file system version number (returned by
S_BDOSVER).
CCPMVERNUM
Concurrent version number (returned by S_OSVER).
TOD DAY Time-of-Day. Number of days since 1 Jan, 1978.
TOD_HR Time-of-Day. Hour of the day.
TOD_MIN Time-of-Day. Minute of the hour.
TOD SEC Time-of-Day. Second of the minute.
NCONDEV Number of XIOS consoles, copied from the XIOS Header by
GENCCPM.
NLSTDEV Number of XIOS list devices, copied from the XIOS Header
by GENCCPM.
NCIODEV Total number of character devices {NCONDEV + NLSTDEV).
LCB Offset of the List Control Block Table, copied from the XIOS
Header by GENCCPM.
OPEN FILE Open File Drive Vector. Designates drives with open files.
Each set bit of the word value represents a disk drive
containing open files; the least significant bit represents
Drive A. the most significant, Drive P.
6-179
S SVSDAT Concurrent DOS 86 Programmer's Guide
Field Definition
6-180
Concurrent DOS 86 Programmer's Guide T GET
T GET
Entry Parameters:
Register CL: 69H (105)
DX: TOD Address - Offset
OS: TOD Address - Segment
Returned Values:
AL: Seconds
TOD filled in
(Days, Hours and Minutes only)
T_GET obtains the system internal time and date. The calling process passes the
address of a four-byte Time of Day (TOD) data structure that receives the time
and date values. Figure 6-20 shows the Time of Day structure, and Table 6-24
lists the TOD field definitions.
+----+----+----+----+----+
DAY !HOURI MINI SECI
+----+----+----+----+----+
Field Definition
T_GET is equivalent to T_SECONDS, except that it does not return the SECONDS
field of the internal time.
6-181
T SECONDS Concurrent DOS 86 Programmer's Guide
T SECONDS
Entry Parameters:
Register CL: 09BH ( 155)
DX: TOD Address - Offset
OS: TOD Address - Segment
Returned Values:
TOD filled in
(Days, Hours, Minutes. and Seconds)
T _SECONDS returns the current encoded time and date (including seconds) in the
TOD structure passed by the calling process. See T_GET for the format of the TOD
structure.
6-182
Concurrent DOS 86 Programmer's Guide T SET
T SET
Entry Parameters:
Register CL: 068H (104)
DX: TOD Address - Offset
OS: TOD Address - Segment
T_SET sets the system internal time and date. The calling process passes the
address of a 4-byte TOD structure containing the time and date specification. See
T GET for the format of the TOD structure.
The date is represented as a 16-bit integer with day 1 corresponding to January 1,
1978. The time is represented as two bytes hours and minutes stored as two BCD
digits.
T_SET also sets the second field of the system time and date to OOH.
End of Section 6
6-183
SECTION 7
This section describes the interface that allows transient programs to emulate DOS
system functions under Concurrent. DOS system call error return codes are also
described in this section.
7.1 Introduction
The DOS system calls supported by Concurrent are divided into the following
categories:
7-1
7.1 Introduction Concurrent DOS 86 Programmer's Guide
01 Keyboard Input
02 Console Output
03 Auxiliary Input
04 Auxiliary Output
05 Printer Output
06 Direct Console 1/0
07 Direct Console Input
08 Console Input without Echo
09 Print String
QA Buffered Keyboard Input
OB Check Console Status
OC Character Input with Buffer Flush
33 Ctrl-Break Check
File Management
OD Disk Reset
OE Select Disk
OF Open File
1O Close File
11 Search for First Entry
12 Search for Next Entry
13 Delete File
14 Sequential Read
15 Sequential Write
16 Create File
17 Rename File
19 Current Disk
lA Set Disk Transfer Address
1B Allocation Table Address
lC Allocation Table for Specific Drive
21 Random Read
22 Random Write
23 File Size
24 Set Random Record Field
27 Random Block Read
28 Random Block Write
29 Parse File Name
7-2
Concurrent DOS 86 Programmer's Guide 7.1 Introduction
Directory Management
Miscellaneous
25 Set Vector
30 Get DOS Version Number
35 Get Vector
38 Get Country Dependent Information
7-3
7.1 Introduction Concurrent DOS 86 Programmer's Guide
Program Control
00 Program Terminate
26 Create a New Program Segment
31 Keep Process
Memory Management
48 Allocate Memory
49 Free Allocated Memory
4A Modify Allocated Memory Blocks (SETBLOCK)
Time
2A Get Date
28 Set Date
2C Get Time
2D Set Time
7-4
Concurrent DOS 86 Programmer's Guide 7.2 DOS System Call Parameters
7-5
7.2 DOS System Call Parameters Concurrent DOS 86 Programmer's Guide
When a DOS call operation is successful, most calls clear the carry flag. If there is
an error, these calls set the carry flag and return an error code in the AX register.
Table 7-4 lists the binary error codes returned in register AX.
Code Error
0 No error
Illegal function
2 File not found
3 Path not found
4 No file handles (too many open files)
5 Access denied
6 Illegal file handle
7 Memory control blocks destroyed
8 Insufficient memory
9 Illegal memory block address
10 Invalid environment
11 Illegal format
12 Invalid access code
13 Invalid data
15 Invalid drive specified
16 Removal of current directory attempted
17 Devices do not match
18 No more files
Table 7-5 lists the DOS system functions supported by Concurrent. The table
Includes the parameters a process must pass to the call and the values the call
returns to the process. Table 7-5 also lists the page references where each call is
described in detail. At the end of Table 7-5 is a list of conventions used in the
system call summary.
7-6
Concurrent DOS 86 Programmer's Guide 7.4 DOS System Call Summary
Input Returned
Hex Function Parameters Values Page
7-7
7.4 DOS System Call Summary Concurrent DOS 86 Programmer's Guide
7-8
Concurrent DOS 86 Programmer's Guide 7.4 DOS System Call Summary
Input Returned
Hex Function Parameters Values Page
7-9
7.4 DOS System Call Summary Concurrent DOS 86 Programmer's Guide
Input Returned
Hex Function Parameters Values Page
41 Delete a File
from a Directory DS:DX • .ASCllZ AX• Err Code 7-64
7-10
Concurrent DOS 86 Programmer's Guide 7.4 DOS System Call Summary
Input Returned
Hex Function Parameters Values Page
7-11
7.4 DOS System Call Summary Concurrent DOS 86 Programmer's Guide
Input Returned
Hex Function Parameters Values Page
7-12
Concurrent DOS 86 Programmer's Guide Keyboard Input (01 H)
Entry Parameters:
Register AH: 01 H
Returned Values:
Register AL: ASCII character or OOH
(First call to read extended ASCII code.)
Keyboard Input reads a character from the default input device of the calling
process, writes the character to the default console device, and then returns the
character in the AL register. If a character is not ready to be read, Keyboard Input
waits for one before returning to the calling process.
Keyboard Input executes an INT 23H when it reads Ctrl-Break. When the calling
process wants to read an extended ASCII code character, it must call Keyboard
Input twice. Keyboard Input returns OOH in register AL to indicate that a
subsequent call will return an extended ASCII code character.
7-13
Console Output (02H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 02H
DL: ASCII character
Console Output writes the character In DL to the calling process's default console
device. If DL contains a backspace character (08H). Console Output moves the
cursor left one position, writes a space at that location. and leaves the cursor
there.
As with the Keyboard Input system call, Console Output executes an INT 23H when
the user has entered Ctrl-Broak.
7-14
Concurrent DOS 86 Programmer's Guide Auxiliary Input (03H)
Entry Parameters:
Register AH: 03H
Returned Values:
Register AL: ASCII character
Auxiliary Input reads the next ASCII character from the default auxiliary device and
returns it in register AL.
7-15
Auxiliary Output (04H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 04H
DL: ASCII character
Auxiliary Output writes the ASCII character specified in register DL to the default
auxiliary device.
7-16
Concurrent DOS 86 Programmer's Guide Printer Output (OSH)
Entry Parameters:
Register AH: 05H
DL: ASCII character
Printer Output writes the ASCII character specified in register DL to the default
printer device.
7-17
Direct Console 1/0 (06H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 06H
DL: FFH (Input)
ASCII character (Output)
Returned Values:
Register AL: ASCII character or OOH
(First call to read extended ASCII code.)
When register DL contains FFH. the Direct Console 1/0 call reads a character from
the calllng process's default input device, clears the zero flag, and returns the
character in register AL. If a character is not ready from the input device, Direct
Console 1/0 sets the zero flag and returns OOH in AL.
If register DL contains anything other than FFH, Direct Console 1/0 assumes that
DL contains a valid character to be written to the default output device. Direct
Console 1/0 does not check for Ctrl-PrtSc or Ctrl-Break input from the console.
When the calling process wants to read or write an extended ASCII code character.
it must call Direct Console 1/0 twice. The first call returns OOH in register AL to
indicate that a subsequent call will return an extended ASCII code character.
Note: In a Concurrent environment, you should not use DL ~ OFFH if you want to
wait for a character; use Function 07H instead.
7-18
Concurrent DOS 86 Programmer's Guide Direct Console Input (07H)
Entry Parameters:
Register AH: 07H
Returned Values:
Register AL: ASCII character or OOH
(First call to read extended ASCII code.)
The Direct Console Input call reads a character from the default input device of the
calling process and returns the character in register AL. If a character is not ready
to be read from the input device, the call waits for one before returning to the
calling process.
When the calling process wants to read an extended ASCII code character, it must
make this call twice. Direct Console Input returns OOH in register AL to indicate
that a subsequent call will return an extended ASCII code character.
Direct Console Input does not check for Ctrl-PrtSc or Ctrl-Break input from the
console.
7-19
Console Input Without Echo (08H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 08H
Returned Values:
Register Al: ASCII character or OOH
(First call to read extended ASCII code.)
The Console Input without Echo call reads a character from the default input
device of the calling process and returns the character in register Al. If a
character is not ready to be read, the call waits for one before returning to the
calling process.
Console Input without Echo executes an INT 23H when it reads Ctrl-Break.
When the calling process wants to read an extended ASCII code character, it must
make this call twice. In this case, the call returns OOH in register AL to indicate
that the next call will return an extended ASCII code character.
7-20
Concurrent DOS 86 Programmer's Gulde Print String (09H)
Entry Parameters:
Register AH: 09H
OS: String address - Segment
DX: String address - Offset
Print String sends each character in the ASCII string addressed by DS:DX and
terminated by a $ character (24H) to the calling process's default console device.
If the string contains a backspace character (08H). Print String shifts the cursor left
one position and writes a space (destructive backspace).
As with the Display Output (02H) call, Print String executes an INT 23H when the
user enters Ctrl-Break after the string is written to the console.
7-21
Buffered Console Output (OAH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: OAH
OS: Buffer address - Segment
DX: Buffer address - Offset
Buffered Console Input reads characters from the calling process's default input
device and writes them to the input buffer addressed by registers DS:DX. Figure
7-1 shows the format of the input buffer.
0 1 2 MAX - 1
1-------+-------+-------+-------+-------+ - - - +-------1
I MAX I NCHARSI CHARACTERS ••• I I ODH I
1-------+-------+-------+-------+-------+ - - - +-------1
Figure 7-1. DOS Console Buffer Format
The first byte (MAX) specifies the number of characters the buffer can hold.
Concurrent sets the second byte (NCHARS) to the number of characters received.
This value does not include the terminator character, a carriage return (OOH).
Buffered Console Input writes the characters it reads from the input device into
the buffer beginning at the third byte. When the call reads a carriage return, its
stops writing to the buffer.
When the Input buffer contains MAX-1 characters, Buffered Console Input ignores
additional input and sounds the bell until it reads a carriage return.
7-22
Concurrent DOS 86 Programmer's Guide Check Console Status (OBH)
Entry Parameters:
Register AH: OBH
Returned Values:
Register AL: · FFH or OOH (No character available)
Check Console Status returns FFH in register AL when a character is available from
the calling process's default input device. If the call returns OOH in AL. a character
was not ready. Check Console Status executes an INT 23H when it detects a Ctrl-
Break character.
Note: In a Concurrent environment, you should not make a status call in a loop;
use Function OlH instead.
7-23
Character Input with Buffer Flush (OCH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: OCH
AL: Input function number
Returned Values:
Register AL: OOH (No input function performed)
The Character Input with Buffer Flush flushes the type-ahead buffer of the default
Input device and Invokes the Input call whose number Is entered in register AL.
The calling process can pass the following system call numbers:
OtH - Keyboard Input
06H - Direct Console 1/0
07H - Direct Console Input
OBH - Console Input without Echo
OAH - Buffered Console Input (see Function OAH for other parameters)
7-24
Concurrent DOS 86 Programmer's Guide Ctrl-Break Check (33H)
Entry Parameters:
Register AH: 33H
AL: OOH - Get Ctrl-Break State or
01 H - Set Ctrl-Break State
DL: OOH - Set Ctrl-Break Off
01H - Set Ctrl-Break On
Returned Values:
Register DL: OOH - Ctrl-Break Off
01 H - Ctrl-Break On
The Ctrl-Break Check call can get or set the current state of Ctrl-Break checking.
If register AL = OOH, Ctrl-Break Check returns the current state of the Ctrl-Break
checking mechanism in register DL.
If AL contains 01 H on entry, Ctr!-Break checking is set according to the value
passed in register DL.
7-25
DOS File Management Concurrent DOS 86 Programmer's Guide
DOS programs can use either a standard or an extended FCB. Section 7.5.1
describes the standard DOS FCB. Section 7.5.2 describes the extended FCB. The
attribute byte Is defined In Section 7.5.3. Section 7.5.4 describes the DOS Disk
Transfer Area (OTA).
+------+------+------+------+------+------+------+------+
OOH !DRIVE I FILENAME (8 bytes) or RESERVED DEVICE NAME
+------+------+------+------+------+------+------+------+
08H FILE EXTENSION !CURRENT BLOCKI RECORD SIZE I
+------+------+------+------+------+------+------+------+
lOH FILESIZE DATE RESERVED
+------+------+------+------+------+------+------+------+
18H RESERVED I
+------+------+------+------+------+------+------+------+
20H ICURRECI RAND REC
+------+------+------+------+------+
Figure 7-2. DOS Standard File Control Block
7-26
Concurrent DOS 86 Programmer's Guide DOS File Management
Field Definition
where:
mm is 1-12
dd is 1-31
VY is 0-119 (1980-2099)
7-27
DOS File Management Concurrent DOS 86 Programmer's Guide
Field Definition
An unopened FCB consists of the FCB prefix (for extended FCBs), the drive number,
and the filename and extension. An opened FCB is one in which the remaining
fields have been filled in by Create File or Open File calls.
-7 -6 -1 0
+-------+-------+-------+-------+-------+-------+-------+
FLAG I RESERVED I ATTR
+-------+-------+-------+-------+-------+-------+-------+
Figure 7-3. DOS Extended FCB Prefix
7-28
Concurrent DOS 86 Programmer's Guide DOS File Management
Field Definition
Value Meaning
7-29
DOS Fila Management Concurrent DOS 86 Programmer's Guide
You can use the Change File Mode call (43H) to change the read/only, hidden,
system, and archive attributes. A file can have any or all of these four attributes
in any combination. You cannot change the volume and subdirectory attributes
with Change File Mode.
The description of Search for First Entry (1 lH) contains an explanation of using the
attribute byte In file searches.
7-30
Concurrent DOS 86 Programmer's Guide Disk Reset (OOH)
Entry Parameters:
Register AH: OOH
Returned Values:
Register AX: Error code
Disk Reset flushes all file buffers, but does not correctly record disk directory
information for those files which were left open and have changed in size.
Your program does not need to call Disk Reset before a disk change when all files
written have been closed.
See Table 7-4 for error code definitions.
7-31
Select Disk (OEH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: OEH
DL: Drive vector
Returned Values:
Register AL: Number of drives
AX: Error code
Select Disk first determines whether the drive specified In DL is valid, then selects
it as the default drive, Drives are numbered starting with zero, where 0 is A, 1 is B,
and so forth.
Interrupt 1lH, BIOS Equipment Determination, can also be used to return the
number of physical drives; see Section 8. 1 "DOS Monitor Calls."
See Table 7-4 for error c;ode definitions.
7-32
Concurrent DOS 86 Programmer's Guide Open File (OFH)
Entry Parameters:
Register AH: OFH
OS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - on success
OFFH - on failure
The Open File call searches the current directory for a specified file. If it finds the
file, it opens it, filling in information in the FCB as described below.
On entry, registers DS:DX point to an unopened FCB. Open File searches the
current directory for the file named in the FCB, and returns OFFH In AL if the file is
not found. If it is found, Open File returns OOH in AL and fllls in appropriate fields
in the FCB.
If the drive field is 0, indicating the default drive, Open File changes this field to
the actual drive containing the file, where 1 Is A. 2 is B, and so forth. This allows
the default drive to be changed without interfering with subsequent operations on
this file.
Open File sets the current block field to zero. The file record size is set to 80H.
Open File sets the file size and date fields from information obtained from the
directory.
You should set certain fields in the FCB after Open File has returned but before
you request any disk operations. If the file has a record size different from 80H,
you must set the record size field (offset OEH in the FCB). Also, you must set the
current record (offset 20H) and/or random record (offset 21H) fields, depending on
whether you are doing sequential and/or random reads and writes.
For more detailed information about DOS FCBs, refer to Section 7.5.1, "Standard
DOS FCB."
7-33
Close File (1 OH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 10H
OS: Opened FCB Address - Segment
OX: Opened FCB Address - Offset
Returned Values:
Register AL: OOH - On success
OFFH - Directory not updated
The Close File call closes a file following a file write. You must call Close Fiie
when finished with the file.
On entry, OS:DX point to an opened FCB. Close Fila sets AL to OOH to indicate a
successful close. If the file is not found in the directory, Close File sets AL to
OFFH.
7-34
Concurrent DOS 86 Programmer's Guide Search for First Entry ( 11 H)
Entry Parameters:
Register AH: 1 lH
OS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - Match found
OFFH - No match found
The Search for First Entry call searches for the first filename that matches the
filename in the unopened FCB specified in DS:DX. Concurrent searches the current
disk directory for the first matching filename. The search includes those filenames
containing the question mark character, which matches any character in the same
position. If the call does not find a match, it returns OFFH in AL
If the call finds a match, it returns OOH in AL and returns information according to
whether the FCB pointed to on entry is a normal or extended FCB.
If the search FCB is a normal FCB, Search for First Entry sets the first byte in the
calling program's Disk Transfer Area (OTA) to the drive number of the drive
containing the matching FCB. where A is 1, B is 2, and so forth. Concurrent copies
the matching directory entry to the following 32 bytes in the OTA. On return, the
OTA contains an unopened, normal FCB.
If the search FCB is an extended FCB, Search for First Entry sets the first byte in
the calling program's OTA to FFH. It then sets the following five bytes to zero,
copies the attribute byte and drive code from the search FCB to the following two
bytes, then copies the matching directory entry into the following 32 bytes. On
return, the calling program's OTA contains an unopened, extended FCB with the
same attributes as the search FCB.
If the calling program points to an extended FCB, Search for First Entry bases its
search on the contents of the attribute byte in the FCB prefix. Extended FCBs are
discussed in Section 7.5.2.
Table 7-9 lists the bits within the DOS attribute byte.
Search for First Entry ( 11 H) Concurrent DOS 86 Programmer's Guide
Bit Attribute
0 Read/Only
1 Hidden
2 System
3 Volume Label
4 Subdirectory
5 Archive
If the attribute byte Is zero, the call finds only normal file entries, which are those
that have no attributes set, or have the read/only and/or archive attributes set.
Search for First Entry will not return entries for the volume label, subdirectories, or
hidden and system files.
If the attribute byte 1s set for hidden (bit 1 set) or system files (bit 2 set), or for
subdirectories (bit 4 set), Search for First Entry searches all normal entries plus all
entries matching the specified attributes. To look at all directory entries except
the volume label, set bits 1, 2, and 4 in the attribute byte.
If bit 3 is set, Search for First Entry searches only for a volume label.
Concurrent DOS 86 Programmer's Guide Search for Next Entry (12H)
Entry Parameters:
Register AH: 12H
OS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - Match found
OFFH - No match found
After Search for First Entry finds a match to an ambiguous filename, you can call
Search for Next Entry to look for the next match. An ambiguous filename is one
that contains question mark characters. The Entry parameters and returned values
are the same as those for Search for First Entry (1 lH).
Do not perform any disk operations with the search FCB between Search for First
and Search for Next calls, or between two Search for Next Calls, because
Concurrent stores information necessary to continue the search in the reserved
area of the search FCB. This information would be overwritten by a disk operation
that intervened between two search calls.
Delete File (13H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 13H
DS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - File deleted
OFFH - No matching directory entries
The Delete File call deletes all entries that match the specified filename in the
currant directory. On entry, DS:DX point to an unopened FCB. The question mark
character is allowed in the filename and extension. If no entries match, Delete File
returns OFFH in AL.
7-38
Concurrent DOS 86 Programmer's Guide Sequential Read (14H)
Entry Parameters:
Register AH: 14H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
Returned Values:
Register AL: OOH - On success
OlH - End-of-file encountered, no data in record
02H - Insufficient space in DTA to read a single record
03H - End-of-file encountered, partial record read, zero-filled
The Sequential Read call reads the record in the file pointed to by the current
block (offset OCH) and current record (offset 20H) fields in the file's FCB.
Sequential Read copies the record to the calling program's DTA, then increments
the current record field in the FCB. Concurrent determines the length of a file's
record from the record size field in the FCB (offset OEH).
Sequential Read and Sequential Write (15H) increment the FCB's current block field
when the current record number field overflows. The range of the current record
number field is 0-127. You must initialize the current record number to zero for a
read or write that starts from the beginning of the file. For more information on
the current block and current record number fields, see Section 7.5.1, "Standard
DOS FCB."
Sequential Read returns 01 H or 03H in AL if an end-of-file character is
encountered. A return of O1H indicates no data in the record; 03H indicates a
partial record was read and filled out with zeros.
Sequential Read returns 02H in AL if there was not enough space in the calling
program's OTA to read a single record and the read was ended. The call
determines this condition when the DTA offset plus the record length exceeds
FFFFH. OOH is returned in AL if the read was completed successfully.
7-39
Sequential Write (1 SH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 15H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
Returned Values:
Register AL: OOH - On success
01 H - Disk full
02H - Insufficient OTA space, operation canceled
The Sequential Write call writes data from the calling program's OTA to the
position in the flle pointed to by the current block and current record fields in the
FCB. After writing each record, Sequential Write increments the current record
field in the FCB.
Sequential Write determines the file's record length from the record size field in
the FCB. If the record size Is smaller than a single sector, Sequential Write buffers
data until a sector is filled out, at which time the write is performed.
Sequential Write returns OOH In AL if the write Is successfully completed. OlH in
AL Indicates that the destination disk is full. 02H indicates there is Insufficient
space in the calling program's OTA (OTA offset plus record length exceeds FFFFH)
to hold one record and the operation is ended.
7-40
Concurrent DOS 86 Programmer's Guide Create File (16H)
Entry Parameters:
Register AH: 16H
DS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - On open
OFFH - No directory entry available
Create File searches the current directory for an entry matching the FCB pointed to
by DS:DX. If a matching entry is found, it is reused. If no match is found, Create
File searches the directory for an empty entry. When Create File finds an empty
directory entry, it initializes the entry to a zero-length file, calls Open File (OFH),
and returns OOH in AL.
A file created with the Create File call can be assigned the hidden attribute by
using an extended FCB and setting the file's attribute byte to 02H. Section 7.5.3,
"DOS File Attribute Byte." describes the attribute byte.
7-41
Rename File (17H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 17H
OS: Modified FCB Address - Segment
DX: Modified FCB Address - Offset
Returned Values:
Register AL: OOH - Fiie renamed
OFFH - File not found, or new name already in use
On entry to Rename File, DS:DX point to a modified FCB. The modified FCB has a
drive code and filename in the normal position and a second filename starting six
bytes after the end of the normal filename field {DS:DX+11H) in what is normally a
reserved area.
Hename File changes every filename in the current directory that matches the first
filename to the second filename. If question mark characters appear In the second
filename, the corresponding positions in the original name are not changed.
Rename File returns OFFH in AL if no match is found for the first filename or if the
second filename is already in use. AL contains OOH if the operation is successful.
7-42
Concurrent DOS 86 Programmer's Guide Current Disk (19H)
Entry Parameters:
Register AH: 19H
Returned Values:
Register AL: Current drive number
Current Disk returns the number of the current default drive, where 0 is A, 1 is B.
and so forth.
7-43
Set OTA (1AH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: lAH
OS: Disk Transfer Area Address - Segment
DX: Disk Transfer Area Address - Offset
Returned Values:
None
The Set Disk Transfer Area Call sets the address of the Disk Transfer Area (OTA)
to the value specified in DS:DX. Concurrent does not allow disk transfers to wrap
around within the segment or overflow into the next segment.
The space between the offset and the end of the DTA's segment should be large
enough to accommodate your largest record. The DOS FCB read and write calls
(14H, 15H, 21H, 22H, 27H, and 28H) do not read or write data beyond the end of
the segment specified for the OTA. nor do they wrap to the segment's beginning.
If you do not !jet the OTA. Concurrent uses the default OTA, located at offset 80H
in the Program Segment Prefix (PSP). You can get the address of the OTA using
system call 2FH.
7-44
Concurrent DOS 86 Programmer's Guide Allocation Table Address (1 BH)
Entry Parameters:
Register AH: 1BH
Returned Values:
Register DS: FAT ID byte address - segment
BX: FAT ID byte address - offset
DX: Number of clusters
AL: Number of sectors per cluster
CX: Physical sector size
The Allocation Table Address call returns information about the default drive.
Upon return, registers DS:BX point to a byte containing the File Allocation Table
(FAT) identification byte for the default drive. DX contains the number of clusters
in the drive, AL contains the sectors per cluster. and CX contains the size of a
physical sector.
7-45
Allocation Table for Specific Drive (1 CH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: lCH
DL: Drive Number
Returned Values:
Register OS: FAT ID byte Address - Segment
BX: FAT ID byte Address - Offset
DX: Number of allocation units
AL: Number of sectors per allocation unit
ex: Size of a physical sector
This call is identical to call lBH, except that DL contains a specific drive number.
Drive numbers start with zero, where O is the default drive, 1 is A, 2 is B, and so
forth.
7-46
Concurrent DOS 86 Programmer's Guide Random Read (21 H)
Entry Parameters:
Register AH: 21H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
Returned Values:
Register AL: OOH - On success
O1H - End-of-file encountered, no data available
02H - Insufficient space in OTA. operation canceled
03H - End-of-file encountered, partial record read, zero-filled
Upon entry to Random Read, DS:DX point to an opened FCB. After Random Read
has set the current block (offset OCH) and current record fields (offset 20H) in the
FCB to correspond with the random record field (offset 21 H), it reads in the FCB to
correspond with the random record field (offset 21 H), it reads the indicated record
into the calling program's OTA.
Random Read returns OOH in AL when the read is successfully completed. If
Random Read encounters an end-of-file indicator, it returns 01 H in AL, indicating
no more data is available, or 03H, meaning a record was partially read and its
remainder filled out with zeros.
Random Read returns 02H in AL when there is not enough space in the OTA to
read one record (offset plus record length is greater than OFFFFH) and the
operation was ended.
7-47
Random Write (22H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 22H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
Returned Values:
Register Al: OOH - On success
O1H - Disk full, write canceled
02H - Insufficient space in OTA, operation canceled
Upon entry to Random Write, DS:DX point to an opened FCB. After Random Write
has set the current block (offset OCH) and current record fields {offset 20H) in the
FCB to correspond with the random record field (offset 21 H), it writes the indicated
record from the calling program's OTA.
Random Write returns OOH in Al when the write is successfully completed.
Random Write returns OlH In AL if the destination disk Is full and the operation
was canceled. Random Write returns 02H In AL when there is insufficient space in
the OTA (offset plus record length Is greater than OFFFFH) to write a single record
and the operation was canceled.
7-48
Concurrent DOS 86 Programmer's Guide File Size (23H)
Entry Parameters:
Register AH: 23H
DS: Unopened FCB Address - Segment
DX: Unopened FCB Address - Offset
Returned Values:
Register AL: OOH - On success
OFFH - No matching entry found
File Size searches the current directory for the first entry that matches the
specified FCB pointed to in DS:DX. To receive accurate information from File Size,
you must set the record size field (offset OEH) in the referenced FCB before your
program performs the call.
When a matching entry is found, File Size sets the random record field in the FCB
to the number of records in the file. File Size counts records in terms of the
length of record specified in the FCB's record size field, rounded up. If no
matching entry is found, File Size returns OFFH in AL.
7-49
Set Random Record Field (24H) Concurrent DOS 86 Programmer's Guida
Entry Parameters:
Register AH: 24H
OS: Opened FCB Address - Segment
OX: Opened FCB Address - Offset
Returned Values:
None
The Set Random Record Field call sets the random record field (offset 21H) to the
file address stored In the current block (offset OCH) and current record (offset 20H)
fields In the FCB.
7-50
Concurrent DOS 86 Programmer's Guide Random Block Read (27H)
Entry Parameters:
Register AH: 27H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
CX: Record count
Returned Values:
Register AL: OOH - On success
01 H - End-of-file encountered, no data available
02H - Insufficient space in OTA, operation canceled
03H - End-of-file encountered, partial record read, zero-filled
CX: Number of records read
The Random Block Read call reads the specified number of records from the point
in the file specified by the random record field into the calling program's disk
transfer area (OTA). Upon entry to Random Block Read, registers OS:OX point to
an opened FCB and CX contains a record count that must not be zero. Random
Block Read counts records In terms of the record length specified in the record
size field (offset OEH) in the FCB.
If the read was successfully completed, Random Block Read returns OOH in AL. If
an end-of-file indicator is reached before all records have been read, Random
Block Read returns either O1H or 03H in AL. O1H indicates that the last record is
complete; 03H indicates that the last record is a partial record and was filled out
with zeros.
Random Block Read reads records into the OTA until the OTA offset plus record
length exceeds OFFFFH. If not all of the specified records have been read, 02H is
returned in AL.
In any event, Random Block Read returns the actual number of records read in CX
and sets the random record, current block (offset OCH), and current record (offset
20H) fields to point to the next record in the file; that is, the first record not read.
7-51
Random Block Write (28H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 28H
OS: Opened FCB Address - Segment
DX: Opened FCB Address - Offset
CX: Record count
Returned Values:
Register AL: OOH - On success
OlH - Insufficient space on disk, no records written
02H - Insufficient space In OTA, operation canceled
CX: Number of records written
Random Block Write writes the specified number of records from the calling
program's OTA to the file address specified by the random record field in the
opened FCB specified In DS:DX.
Random Block Write returns OOH In AL If the write was successfully completed, or
OlH In AL when there Is Insufficient space on the destination disk and the
operation Is canceled.
Random Block Write returns 02H in AL when there is insufficient space In the
calling program's OTA (offset plus record length Is greater than OFFFFH) to hold
one record and the operation Is ended.
If CX Is zero upon entry, no records are written, but the file is set to the length
specified by the random record field. If the new file size is longer or shorter than
the file size specified In the FCB (at offset 10H), clusters are allocated or released
as appropriate.
7-52
Concurrent DOS 86 Programmer's Guide Parse Filename (29H}
Entry Parameters:
Register AH: 29H
OS: Pointer to command line - Segment
SI: Pointer to command line - Offset
ES: Unopened FCB Address - Segment
DI: Unopened FCB Address - Offset
Al: Bit map (See below)
Returned Values:
Register OS: Firstcharacter following parsed name - Segment
SI: Firstcharacter following parsed name - Offset
ES: Firstbyte of formatted FCB - Segment
DI: Firstbyte of formatted FCB - Offset
Al: OOH - No wildcard characters used
O1H - Wildcard character in filename or extension
OFFH - Invalid drive specifier
The Parse Filename call parses an ASCII file specification and prepares an FCB.
Upon entry, DS:SI point to a command line to parse and ES:DI point to a buffer to
be filled with an unopened FCB.
The command line is parsed for a file name of the form:
d:filename.ext
If found, Parse Filename creates an unopened FCB for the file at the address
pointed to by ES:DI. If no drive specifier is present. the default drive is assumed.
If no extension is present. Parse Filename assumes it to be all blanks. If the
asterisk (*) character appears in the filename or extension. Parse Filename replaces
the asterisk and any remaining characters in the filename or extension with
question marks.
The contents of the byte in Al upon entry determine how Parse Filename acts on
the specified command line. The bit map for this Al register entry parameter is as
follows:
If bit 0 is 1, Parse Filename scans leading separators off the target command line.
If bit O is 0, no scan-off is performed.
If bit 1 is 1, Parse Filename changes the drive field in the result FCB only if a drive
was specified in the command line.
7-53
Parse Filename (29H) Concurrent DOS 86 Programmer's Guide
If bit 2 Is 1, Parse Filename changes the filename field In the result FCB only if the
command line contains a filename.
If bit 3 Is l, Parse Filename changes the extension field In the result FCB only If
the command line contains an extension.
Parse Filename Ignores bits 4-7.
Filename separators include the following characters:
: colon
. period
; semicolon
, comma
•equal sign
+plus sign
Tab
Space
Filename terminators Include all of the separator characters plus:
backslash
< less than
> greater than
I vertical bar
I slash
quotation marks
left square bracket
right square bracket
Filename terminators also Include any control characters.
Parse Filename returns the segment and offset addresses of the first character
after the filename in OS and SI, respectively, and returns the address of the first
byte of the formatted FCB In ES:DI. If the target command llne does not contain a
valid filename, Parse Filename returns a blank at ES:Dl+l.
If the question mark or asterisk characters appear in the filename or extension,
Parse Filename returns OlH In AL. If no wildcard characters appear, AL contains
OOH. If the drive specifier Is Invalid, AL contains OFFH.
7-54
Concurrent DOS 86 Programmer's Guide Set/Reset Verify Switch (2EH)
Entry Parameters:
Register AH: 2EH
DL: OOH
AL: 01 H - Verify on
OOH - Verify off
Returned Values:
None
Concurrent ignores the setting of the Verify flag. This call is supported only for
DOS compatibility.
7-55
Get OTA (2FH) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 2FH
Returned Values:
Register ES: Current OTA - Segment
BX: Current OTA - Offset
Get Disk Transfer Address returns the address of the current Disk Transfer Area
(OTA) In ES:BX. You can set the Disk Transfer Area by calling Set Disk Transfer
Address (1AH). The OTA Is described in Section 7.5.4.
7-56
Concurrent DOS 86 Programmer's Guide Get Disk Free Space (36H)
Entry Parameters:
Register AH: 36H
DL: Drive Number
Returned Values:
Register AX: Number of sectors per cluster, OFFFFH - Invalid drive number
BX: Number of available clusters
DX: Number of clusters in drive
ex: Number of bytes per sector
Get Disk Free Space returns information about the free space on a specified drive.
Upon entry, DL contains a drive number, where 0 is the default drive, 1 is A, 2 is B,
and so forth.
Get Disk Free Space returns the number of available clusters in BX, the total
number of clusters in the drive in DX, the number of bytes per sector in CX, and
the number of sectors per cluster in AX.
7-57
Get Verify State (54H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 54H
Returned Values:
Register AL: OOH - Verify off
OtH - Verify on
Get Verify State returns the value of the verify flag. Get Verify State returns OtH
In AL if verify Is on, OOH If verify is off.
Note: Concurrent ignores the setting of the Verify flag. This call is supported only
for DOS compatibility.
7-58
Concurrent DOS 86 Programmer's Guide Create a File (03CH)
Entry Parameters:
Register AH: 3CH
DS: ASCllZ string Address - Segment
DX: ASCllZ string Address - Offset
ex: File attribute
Returned Values:
Register AX: 16-bit handle, if Carry flag clear
Create a File creates a new file or truncates an old file to zero length in
preparation for writing. If the file does not exist, this call creates a file in the
directory indicated in the ASCllZ string and gives the file the read/write attribute
(see Section 7.5.3, "DOS File Attribute Byte"). Create a File returns the file's handle
in AX.
If the carry flag is set, Create a File returns error code 3, 4, or 5 in AX. Error code
5. access denied. indicates that the specified directory is full or a file of the same
name exists and is marked read/only. See Table 7-4 for other error code
definitions.
Note that you can use Change File Mode (43H) to change the file's attribute.
7-59
Open a File Handle (03DH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: JOH
OS: ASCllZ string Address - Segment
DX: ASCllZ string Address - Offset
AL: Access code
Returned Values:
Register AX: Handle or error code
The Open a File Handle call opens any normal or hidden file whose name matches
the name and directory location specified in the ASCllZ string, but does not open
files whose names end with a colon.
On entry, the ASCllZ string contains the drive, path, and filename for the file to be
opened. AL contains one of the following access codes:
OOH - Open file for reading
OlH - Open file for writing
02H - Open file for reading and writing
If the carry flag Is set, this call returns error code 2, file not found; error code 4,
no file handles (too many open files); error code 5, access denied; or error code
12, Invalid access code. If the carry flag is not set, Open a File Handle returns a
16-blt flle handle that must be used for subsequent Input and output to the file.
Open a File Handle sets the read/write pointer to the first byte of the file and sets
the record size of the file to one byte. You can move the file pointer with the
Move File Pointer call (42H). You can obtain or change a file's attribute with the
Change File Mode call (43H). DOS file attributes are described In Section 7.5.3.
7-60
Concurrent DOS 86 Programmer's Guide Close a File Handle (03EH)
Entry Parameters:
Register AH: 3EH
BX: File handle returned by Open or Create a File
Returned Values:
Register AX: Error code, if Carry flag set
The Close a File Handle call closes the specified file handle, flushes all internal
buffers associated with the file, and updates the file's directory. If the carry flag is
set. Close a File Handle returns error code 6 in AX to indicate that an illegal file
handle was specified.
Note: You should always close a file as soon as you finish using it.
7-61
Reid from 1 File or Device (03FH) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 3FH
BX: Fiie handle
OS: OMA address - Segment
DX: OMA address - Offset
CX: Number of bytes to be read
Returned Values:
Register AX: Number of bytes read, If Carry flag not set
The Read from a Fiie or Device call transfers a number of bytes, specified In CX,
from a file into the OMA buffer addressed by DS:DX.
On return, if the carry flag Is set, AX contains error code 5 or 6. See Table 7-4 for
error code definitions.
If the carry flag Is not set, AX contains the number of bytes read. If this value is
zero, It Indicates an attempt to read from the end of the file. If the value in AX Is
greater than zero, but less than the value specified in ex. it indicates that the
program has read up to the end of the file.
Depending on the device being accessed, this call may not read the number of
bytes specified In CX. For example, from the keyboard, it reads at most, one line
at a time.
7-62
Concurrent DOS 86 Programmer's Guide Write to a File or Device (040H)
Entry Parameters:
Register AH: 40H
BX: File handle
OS: Address of data to write - Segment
DX: Address of data to write - Offset
CX: Number of bytes to write
Returned Values:
Register AX: Number of bytes written, if Carry flag not set
The Write to a File or Device call transfers the number of bytes specified in CX
from the buffer pointed to by DS:DX to the file indicated by the file handle in BX.
On return. if the carry flag is set, this call returns error code 5 or 6 in AX. Error
code 5 indicates access denied; error code 6 indicates an illegal file handle. If the
carry flag is not set, Write to a File or Device returns the actual number of bytes
written in AX. If register CX = 0, the file is truncated at the position of the current
file pointer.
Your program must compare the number of bytes returned in AX with the number
of bytes requested in CX. This call does not return an error if the two values do
not match. You should, however, consider this condition an error, since the
discrepancy is often caused by a full disk.
7-63
Erase a File from Directory (041H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 41 H
OS: ASCllZ string Address -. Segment
DX: ASCllZ string Address - Offset
Returned Values:
Register AX: Error code, If Carry flag set
This call removes a directory entry associated with a filename. The question mark
and asterisk wlldcard characters are not allowed In any part of the ASCllZ string
pointed to In DS:DX.
This call does not delete read/only files. To delete a read/only file, you must first
use the Change Fiie Mode call (43H) to change the file's attribute. On return, If the
carry flag Is set, this call returns 2 or 5 In AX to Indicate file not found or access
denied, respectively.
7-64
Concurrent DOS 86 Programmer's Guide Move File Read/Write Pointer (042H)
Entry Parameters:
Register AH: 42H
CX: Offset to move, in bytes (most significant portion)
DX: Offset to move, in bytes (least significant portion)
Al: Move from:
O - beginning of file
1 - current location
2 - end-of-file
Returned Values:
Register DX: New pointer location - Segment, if Carry flag not set
AX: New pointer location - Offset, if Carry flag not set
This call moves the read/write pointer according to the location specified by the
value passed in Al. On entry, CX:DX contains the distance to move the pointer.
On return, if the carry flag is not set, DX:AX contains the new pointer location. DX
contains the most significant part of the value.
If the carry flag is set, this call returns 1 or 6 in AX (see Section 7.3, "DOS System
Call Error Return Codes").
Set register AL to one of the following values:
7-65
Change File Mode (043H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 43H
OS: Address of ASCllZ Pathname - Segment
DX: Address of ASCllZ Pathname - Offset
CX: File attribute
AL: 1 - set attribute to ex
0 - return attribute
Returned Values:
Register AX: None. if Carry flag not set
CX: File's current attribute, if Carry flag not set
and AL contains zero on entry
The Change File Mode call changes or returns the file attribute of a file specified
by a pointer to an ASCllZ string. On entry, If AL contains 1, Change File Mode
changes the file's attribute to the one specified In ex.
On return, If AL contains zero and the carry flag Is not set, this call returns the
file's current attribute In CX. The DOS file attribute byte Is described in Section
7.5.4.
If the carry flag Is set, this call returns 2, 3, or 5 In AX (see Section 7.3, "DOS
System Call Error Return Codes.").
7-66
Concurrent DOS 86 Programmer's Guide Duplicate a File Handle (045H)
Entry Parameters:
Register AH: 45H
BX: File handle
Returned Values:
Register AX: New file handle, if Carry flag not set
This call returns a duplicate of the file handle contained in BX on entry. The
duplicate handle refers to the same file in the same directory. If you move the
read/write pointer of either handle with the Read (3FH), Write (40H), or Move
Pointer (42H) calls, the pointer for the other handle is also moved.
On return, if the carry flag is set, this call returns error code 4 or 6 in AX. Error
code 4, no file handles, indicates that the number of open files exceeds system
limits; error code 6 indicates an illegal file handle.
7-67
Force a Duplicate Fiie Handle (046H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 46H
BX: Existing file handle
CX: Second file handle
Returned Values:
Register AX: Error code, if carry flag set
This call forces the file handle In ex to refer to the same input stream as the
handle contained in BX. If the existing file handle passed in ex refers to an open
file, this call closes the file before forcing duplication. If you move the read/write
pointer of either handle with the Read (JFH), Write (40H), or Move Pointer (42H)
calls, the pointer for the other handle is also moved.
On return, if the carry flag Is set, this call returns error code 6 In AX to indicate
that an Invalid handle has been specified.
7-68
Concurrent DOS 86 Programmer's Guide Find First Matching File (04EH)
Entry Parameters:
Register AH: 4EH
DS: ASCllZ string Address - Segment
DX: ASCllZ string· Address - Offset
ex: File attribute
Returned Values:
Register AX: None, if Carry flag not set
The Find First Matching File call finds the first filename that matches the filename
in the ASCllZ string pointed to in DS:DX on entry. The ASCllZ string contains the
drive, path, and filename of the file to be matched. Wildcard characters are
allowed in the filename portion of the ASCllZ string.
This call searches for files according to the attribute contained in CX on entry.
The description of Search for First Entry ( 11 H) contains an explanation of how the
attribute byte is used for searches.
If a matching file is found, Find First Matching File fills in the calling program's
Disk Transfer Area (DTA) as follows:
21 bytes Reserved for use with subsequent Find Next Matching File
(4FH) calls.
1 byte attribute of matching file
2 bytes matching file's time of creation
2 bytes matching file's date of creation
2 bytes low word of matching file's size
2 bytes high word of matching file's size
13 bytes matching file's filename and extension, followed by a byte
of zeros. This call removes all blanks from the filename
and extension. If the extension is present, it is preceded by
a period. The filename returned appears just as you would
enter it as a command parameter.
On return, if the carry flag is set, AX contains error code 2 or 18. Error code 2
indicates that the file was not found. Error code 18 indicates that no matching
files could be found.
7-69
Find Next Matching File (04FH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 4FH
Returned Values:
Register AX: None, If Carry flag not set
The Find Next Matching Fiie call finds the next directory entry matching the
filename specified in the previous Find First Matching File (4EH) call. On entry, the
OTA must contain the information supplied by a previous Find First File (4EH) call.
If a matching file is found, this call sets the calling program's Disk Transfer Area
(OTA) as described under Find First Matching File, above. If no additional matching
files are found, this call returns error code 18, no more matching files, in AX.
7-70
Concurrent DOS 86 Programmer's Guide Rename a File (056H)
Entry Parameters:
Register AH: 56H
OS: ASCllZ string Address - ,Segment
DX: ASCllZ string Address - Offset
ES: ASCllZ string Address - Segment
DI: ASCllZ string Address - Offset
Returned Values:
Register AX: Error code, if Carry flag is set
The Rename a File call renames the file specified using the ASCllZ string pointed
to by DS:DX, which contains the drive, path, and name. The ASCllZ string passed
in EX:DI contains the path and new filename.
If a drive is specified in the second ASCllZ string, it must be the same as that
specified In the first string.
On return, if the carry flag is set, AX may contain error code 3, 5, or 17. See
Section 7.3, for error code definitions.
7-71
Get/Set Time and Date Stamps (057H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 57H
AL: OOH - Get date/time
OlH - Set date/time
BX: File handle
CX: Time to be set If AL • OlH
DX: Date to be set if AL• OlH
Returned Values:
Register DX: If getting date, date from handle's Internal handle
CX: If getting time, time from handle's internal handle
This call obtains or sets a file's date and time of creation. If AL contains OlH on
entry, this call sets a file's time and date to the values contained In CX and DX. If
AL contains zero on entry, this call returns a file's time and date in CX and DX.
Date and time formats are the same as the formats for a DOS directory entry,
except that when passed In registers. the bytes are reversed. This means that DH
contains the low order byte of the date, DL the high order byte. The DOS file time
and date formats are shown in Figures 7-4 and 7-5, respectively.
7-72
Concurrent DOS 86 Programmer's Guide Get/Set Time and Date Stamps (057H)
7-73
Create a Subdirectory (039H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 39H
OS: ASCllZ string Address - Segment
DX: ASCllZ string Address - Offset
Returned Values:
Register AX: Error code, if Carry flag is set
The ASCllZ string addressed by registers DS:DX specifies a drive number and
directory path name. MKOIR returns to the calling process with a new directory
created at the end of the specified path.
MKDIR does not add the new directory to the directory structure If any member of
the specified path does not exist. MKDIR returns error code 3 or 5 in register AX.
See Table 7-4 for error code definitions.
7-74
Concurrent DOS 86 Programmer's Guide Remove a Directory (03AH)
Entry Parameters:
Register AH: 3AH
OS: ASCllZ string Address - Segment
DX: ASCllZ string Address - Offset
Returned Values:
Register AX: Error code, if Carry flag is set
RMDIR removes the directory specified in the ASCllZ string addressed by registers
DS:DX from the directory structure. RMDIR will not remove the current directory.
RMDIR returns error code 5 if the directory to be removed is not empty, or is
being accessed by any process. RMDIR returns error code 3 if the ASCllZ string
specifies an invalld path.
7-75
Change Current Directory (03BH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 3BH
OS: ASCllZ string Address - Segment
DX: ASCllZ string Address - Offset
Returned Values:
Register AX: Error code, If Carry flag Is set
CHOIR sets the current directory as specified in the ASCllZ string addressed by
registers DS:DX.
You can also change floating drives with an ASCllZ string such as:
n:=c:\subdirectory
Note: Do not use such a string if DOS compatlblllty Is required.
If any member of the specified path does not exist, CHOIR sets the carry flag and
returns error code 3 (Path not found) In register AX.
7-76
Concurrent DOS 86 Programmer's Guide Get Current Directory (047H)
Entry Parameters:
Register AH: 47H
DL: Drive number
OS: Path name Address - Segment
SI: Path name Address - Offset
Returned Values:
Register AX: Error code, it Carry flag is set
The Get Current Directory call writes the full path name of the current directory for
the drive specified in DL to the 64-byte area of user memory pointed to by DS:Si.
Get Current Directory does not include the drive letter or a leading backslash in
the path name. and terminates the path name string with OOH.
If DL does not contain a legal drive number, Get Current Directory sets the carry
flag and returns error code 15 {Invalid drive specified) in register AX.
7-77
Set Vector (025H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 25H
OS: Interrupt routine Address - Segment
DX: Interrupt routine Address - Offset
AL: Interrupt number (Hex)
The Set Vector call sets the Interrupt vector table for the interrupt number passed
by the calling process In AL to the address In DS:DX.
Use Get Vector (35H) to obtain the contents of the interrupt vector.
7-78
Concurrent DOS 86 Programmer's Guide Get DOS Version Number (030H)
Entry Parameters:
Register AH: 30H
Returned Values:
Register AL: Major version number
AH: Minor version number
BX: OOH
ex: OOH
The Get DOS Version Number call returns the high part of the Concurrent version
number in register AL and the low part in AH. For Concurrent DOS 86 version 5.0,
Al equals 02H and AH equals OAH. Registers BX and CX are set to OOH.
Get Vector (035H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 35H
AL: Interrupt number (Hex)
Returned Values:
Register ES: Interrupt routine Address - Segment
BX: Interrupt routine Address - Offset
The Get Vector call returns the CS:IP Interrupt routine address in registers ES:BX
for the Interrupt number specified In AL.
Use the Set Vector (25H) call to set Interrupt vectors.
Concurrent DOS 86 Programmer's Guide Get Country Dependent Info (038H)
Entry Parameters:
Register AH: 38H
OS: Block Address - Segment
DX: Block Address - Offset
AL: OOH
Returned Values:
Register AX: Error code
This call returns the country dependent information shown in Figure 7-7 to the
block of memory addressed in registers DS:DX.
The Date format is:
0 M D Y - USA Standard
1 D M Y - European Standard
2 Y M D - Japanese Standard
The Currency format is:
Bit O = 0 if currency symbol precedes value
= 1 if currency symbol follows value
Bit 1 = 0 for 0 spaces between currency symbol and value
= 1 for 1 space between currency symbol and value
7-81
Get Country Dependent Info (038H) Concurrent DOS 86 Programmer's Guide
Offset
00 +-------------------------------+
I Date Format
02 +-------------------------------+
I Currency Symbol(s)
+-------------------------------+
I Zero Byte(s) (null terminator) I
07 +-------------------------------+
I Thousands Separator
+-------------------------------+
I Zero Byte (null terminator)
09 +-------------------------------+
I Decimal Separator
+-------------------------------+
I Zero Byte (null terminator)
OB +-------------------------------+
I Date Separator
+-------------------------------+
I Zero Byte (null terminator)
OD +-------------------------------+
I Time Separator
+-------------------------------+
I Zero Byte (null terminator)
OF +-------------------------------+
I Currency Format
10 +-------------------------------+
I Sig. Digits in Currency
11 +-------------------------------+
I Time Format
12 +-------------------------------+
I Case Map call far address
16 +-------------------------------+
I Data List Separator
+-------------------------------+
I Zero Byte (null terminator)
18 +-------------------------------+
I Reserved
+-------------------------------+
Figure 7-7. Country Dependent Dita Return Block
7-A?
Concurrent DOS 86 Programmer's Guide Program Terminate (OOH)
Entry Parameters:
Register AH: OOH
The Program Terminate call returns the terminate, Ctrl-Break, and critical error exit
addresses to the values saved in the Program Segment Prefix (PSP). These are the
values saved on entry to the terminating program. See Figure 7-11 for a
description of the PSP control block.
Program Terminate flushes all file buffers and transfers control to the terminate
address. Note that Concurrent does not properly record the directory information
for files that have changed in length and were not previously closed.
Ensure that the CS register contains the segment address of the calling program's
PSP before invoking Program Terminate.
Note: You should not use this call in new programs; it is provided only to support
DOS pre-version 2.0 programs. The preferred call for this function is EXIT (4CH).
7-83
Create a New Program Segment (026H) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 26H
OX: Segment number
The Create New Program Segment call copies the entire 100H area from location 0
in the current segment of the calling program Into location 0 of the segment
whose number is passed In register OX.
This call updates the memory size field (offset 06H) and saves the terminate, Ctrl-
Break, and critical error exit addresses for Interrupts 22H, 23H, and 24H in the new
Program Segment Prefix (PSP) starting at offset OAH. These addresses are
restored from the PSP when the currant program terminates.
See the EXEC (4BH) call for a description of the PSP.
Note: You should not use this call in new programs; It Is provided only to support
DOS pre-version 2.0 programs. The preferred call for this function Is EXEC (4BH).
7-84
Concurrent DOS 86 Programmer's Guide Keep Process (031 H)
Entry Parameters:
Register AH: 31 H
AL: Exit code
DX: Memory value - Paragraphs
The Keep Process call terminates the calling process but keeps the number of
paragraphs of memory designated by DX. The memory is retained above the start
of the current Program Segment Prefix (PSP).
The binary error (or exit) code passed in register AL can be retrieved by the parent
process through Get Subprocess Return Code (4DH).
Note: This call should not be used In a Concurrent environment; use a device
driver or an RSP instead.
7-85
Execute a Program (04BH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 4BH
AL: OOH - Load and execute program or 03H - Load overlay
OS: ASCllZ string address - Segment
DX: ASCllZ string address - Offset
ES: load parameter block Address - Segment
BX: Load parameter block Address - Offset
Returned Values:
Register AX: Error code, if Carry flag is set
The ASCllZ string addressed by DS:DX must Include the name and filetype of the
file to be loaded. The drive and path name are optional.
Because Concurrent has previously allocated all available memory to the current
program, you must free enough memory for the file to be loaded. Before calling
EXEC, use SETBLOCK (4AH) to reduce the allocated memory to the minimum
required by the current program.
The format of the Load Parameter Block (LPB) pointed to by ES:BX is dependent
upon the type of EXEC call being made. See Figures 7-8 and 7-10.
If EXEC returns with the carry flag set. register AX contains one of the following
error codes: 1, 2, 7, 8, 10, or 11. See Table 7-4 for error code definitions.
7-86
Concurrent DOS 86 Programmer's Guide Execute a Program (04BH)
4. Set AL to OOH.
5. Call offset 50H in the Program Segment Prefix with AH equal to 4CH.
When control returns to the process that called EXEC (except through call 4CH),
ensure that register CS contains the segment address of the Program Segment
Prefix. Interrupt vectors 22H, 23H, and 24H are restored from the values in the
terminate address, Ctrl-Break address, and critical error exit address fields of the
Program Segment Prefix.
Concurrent duplicates the parent process's open files for the child created after a
Load and Execute EXEC call. The new process inherits the standard input, output,
printer, and auxiliary device definitions from the calling process. The child process
also inherits a block of text strings or "environment" from the calling process. If
the value of the Environment String Address field in the Load Parameter Block is
OOOOH, the child process inherits the environment unchanged. Note that the
environment must always be located on a paragraph boundary.
+--------------------+
00 : Environment String :
Address
+--------------------+
02 Command Line
+--------------------+
06 1st FCB
+--------------------+
OA 2nd FCB
+--------------------+
AL = OOH
Figure 7-7. EXEC Load and Execute Parameter Block
7-87
Execute a Program (04BH) Concurrent DOS 86 Programmer's Guide
Field Definition
+----------------+
ASCI IZ 1
+----------------+
ASCI IZ 2
32K Max.
ASCIIZ n
+----------------+
Zero Byte
+----------------+
Figure 7-8. DOS Environment String Format
7-88
Concurrent DOS 86 Programmer's Guide Execute a Program (04BH)
+--------------------+
00 Overlay Segment
+--------------------+
02 Relocation Factor :
+--------------------+
AL = 03H
Load Overlay
Figure 7-9. EXEC Load Overlay Parameter Block
Field Definition
Overlay Segment
Word address of segment in which to load file.
Relocation Factor
Fix-up segment to be applied to the image.
7-89
Execute a Program (04BH) Concurrent DOS 86 Programmer's Gulde
OOH
+------+------+------+------+------+------+------+------+
INT 20H ITop of Memory! ReserlDsptchl Dispatch I
Instruction !Segment Addr I -ved IOpcodel Offset I
08H
------+------+------+------+------+------+------+------!
Dispatch I Terminate Address I Ctrl-Break I
Segment I I Exit Addr IP
lOH
------+------+------+------+------+------+------+------
Ctrl-Break I Critical Error Exitl Reserved
Exit Addr CSI Address I
18H
------+------+------+------+------+------+------+------
Reserved
20H
------+------+------+------+------+------+------+------
Reserved
28H
------+------+------+------+------+------+------+------
Reserved I Environment I Reserved
I Segment Addrl
30H
------+------+------+------+------+------+------+------
Reserved
50H
------+------+------+------+------+------+------+------
INT 21 I RetFar I Reserved
58H
------+------+------+------+------+------+------+------
Reserved First FCB Area
60H
------+------+------+------+------+------+------+------
First FCB Area (cont'd)
68H
------+------+------+------+------+------+------+------
First FCB Area (cont'd) Second FCB Area
70H
------+------+------+------+------+------+------+------
Second FCB Area (cont'd)
78H
------+------+------+------+------+------+------+------
Second FCB Area (cont'd) Reserved
80H
------+------+------+------+------+------+------+------
Param I Command
Size I Parameters
------+------+------+------+------+------+------+------
F8H
------+------+------+------+------+------+------+------
+------+------+------+------+------+------+------+------+
Figure 7-10. DOS Program Segment Prefix
7-90
Concurrent DOS 86 Programmer's Guide Terminate a Process (04CH)
Entry Parameters:
Register AH: 4CH
AL: Return code
The Terminate Process call terminates the current process and returns control to
the process that invoked EXEC (4BH). EXIT also closes any handles opened by the
current process.
The calling process can place a binary return code in register AL before invoking
EXIT. This code can then be retrieved by the parent process through Get
Subprocess Return Code (4DH).
7-91
Get Subprocess Return Code (04DH) Concurrent ODS 86 Programmer's Guide
Entry Parameters:
Register AH: 4DH
Returned Values:
Register AX: Exit code
The Get Subprocess Return Code call returns the binary exit or completion code
specified by another process with the Keep Process (31H) or EXIT (4CH) calls. The
low byte of register AX contains the exit code specified by the terminating
process; the high byte can return one of the following values:
OOH - normal termination
01 H - Ctrl-Break termination
02H - critical device error
03H - Keep Process (31 H) termination
7-92
Concurrent DOS 86 Programmer's Guide Allocate Memory (048H)
Entry Parameters:
Register AH: 48H
BX: Number of paragraphs
Returned Values:
Register AX: Address of block or
AX: Error code, if Carry flag set
BX: Largest available block (on failure)
7-93
Free Allocated Memory (049H) Concurrent DOS 86 Programmer's Gulde
Entry Parameters:
Register AH: 49H
ES: Block· segment
Returned Values:
Register AX: Error code, If Carry flag is set
The Free Allocated Memory call releases the specified memory for reallocation. On
entry, ES contains the segment address of the block to be freed.
There are no return parameters. If the carry flag is set, Free Allocated Memory
returns error code 7 or 9 In AX (see Section 7.3, "DOS System Call Error Return
Codes").
7-94
Concurrent DOS 86 Programmer's Guide Modify Allocated Memory (04AH)
Entry Parameters:
Register AH: 4AH
BX: Number of paragraphs
ES: Block segment
Returned Values:
Register AX: Error code, if Car,Y flag is set
BX: Largest available block (On failure), if Carry flag is set
This call modifies an allocated memory block to contain a specified block size. On
entry, ES contains the segment address of the allocated memory block, and BX
contains the new requested block size, in paragraphs. Concurrent attempts to
increase or decrease the allocated block according to the contents of BX.
If Concurrent cannot increase the size of the allocated block, SETBLOCK returns the
maximum possible block size in BX. If the carry flag is set, SETBLOCK returns
error code 7, 8, or 9 in AX. See Table 7-4 for error code definitions.
7-95
Get Date (02AH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 2AH
Returned Values:
Register AL: Day of the week
O•Sunday, l•Monday, 2•Tuesday, 3•Wednesday, etc.
CX: Year (1980-2099)
DH: Month (1-12)
DL: Day (1-31)
The Get Date call returns the day of the week, year, month, and day as recorded
by the system clock.
Get Date returns the year In CX, the month in OH, and the day in DL. All returned
values are in binary. If the time-of-day clock rolls over to the next day,
Concurrent advances the date, taking into account the number of days in each
month and leap years.
7-96
Concurrent DOS 86 Programmer's Guide Set Date (02BH)
Entry Parameters:
Register AH: 2BH
CX: Year (1980-2099)
DH: Month (1-12)
DL: Day (1-31)
Returned Values:
Register AL: OOH Date was valid
OFFH Date was invalid
The Set Date call sets the system date. On entry, CX must contain a valid year,
DH a valid month, and DL a valid day.
Set Date returns OOH in AL if the date is valid and the set operation is successful,
or OFFH if the date is not valid.
7-97
Get Time (02CH) Concurrent DOS 86 Programmer's Guide
Entry Parameters:
Register AH: 2CH
Returned Values:
Register CH: Hours (0-23)
CL: Minutes (0-59)
DH: Seconds (0-59)
DL: Hundredths (0-99)
The Get Time call returns the system time in hours, minutes, seconds, and
hundredths of a second.
Get Time returns the time in four 8-bit quantities. You can easily convert Get
Time's returned values to a printable form or use these values In calculations, such
as subtracting one value from another.
7-98
Concurrent DOS 86 Programmer's Guide Set Time (02DH)
Entry Parameters:
Register AH: 2DH
CH: Hours (0-23)
CL: Minutes (0-59)
DH: Seconds (0-59)
DL: Hundredths (0-99)
Returned Values:
Register AL: OOH Time is valid
OFFH Time is invalid
The Set Time sets the system time. On entry, CH contains the hours. CL the
minutes, DH the seconds, and DL the hundredths of a second.
If any component of the time is invalid, the set operation is terminated and Set
Time returns OFFH in AL. If the time is valid and the time is successfully set, Set
Time returns OOH in AL.
End of Section 7
7-99
SECTION 8
Table 8-1 lists the PC DOS BIOS functions that are available through the PC Read
Only Storage (ROS) interrupts emulated by Concurrent.
Note: These interrupts are available only in the version of Concurrent called
Co_n~~uJre~11t ~C_
QO_S which has an XIOS written by Digital Research to be
compatible with IBM PC DOS. They may not be available in other implementations
of Concurrent.
10 VIDEO 10
11 EQUIPMENT
12 MEMORY SIZE DETERMINE
13 DISKETTE IQ
16 KEYBOARD 10
17 PRINTER 10
8-1
INT 20H-23H Concurrent DOS 86 Programmer's Guide
8-2
Concurrent DOS 86 Programmer's Guide INT 24H
AH Bit Meaning
0 0 Read operation
1 Write operation
Concurrent sets all registers to retry the operation and passes an error code in the
low-order byte of register DI. The high-order byte of DI is undefined. Table 8-4
lists these error codes.
8-3
INT 24H Concurrent DOS 86 Programmer's Guide
Value of DI
(Low-order) Error
Concurrent places the Information shown In Figure 8-1 on the user stack.
+-------------------------+
IP System registers
CS from
FLAGS INT 24H I
-------------------------!
AX User registers I
BX I
ex from I
DX I
SI original I
DI I
BP INT 21H I
DS I
ES request I
-------------------------!
IP Original INT 21H I
CS from user I
FLAGS to System I
~~~~~~~~~~~~'
Figure 8-1. User Stack at DOS INT 24H
8-4
Concurrent DOS 86 Programmer's Guide INT 25H
Entry Parameters:
Register AL: Drive number
CX: Number of sectors to read
DX: Beginning logical sector number
OS: OMA address - Segment
BX: OMA address - Offset
Returned Values:
Register AX: Error code, If Carry flag • 1
INT 25H transfers data from memory to disk using the entry parameters. Obtain
the logical sector number by numbering each sector sequentially beginning from
track 0, head 0, sector 1 (this is logical sector 0) and continuing along the same
head, then to the next head until the last sector on the last head of the track is
counted.
For example, logical sector 1 is track 0, head 0, sector 2; logical sector 2 is track 0,
head 0, sector 3. Numbering continues with sector 1 on head 0 of the next track.
Although the sectors are numbered sequentially, they may not be juxtaposed on
the disk because of interleaving.
Only the segment registers are preserved by this interrupt call. Concurrent returns
to the caller with a Far Return instruction so the original flags remain Ori the stack
and must be explicitly popped off.
Note that if the transfer was successful. the carry flag equals zero. If the carry
flag is equal to 1, AX will contain an error code. The error codes returned in AL
are the same as those returned in DI by DOS INT 24H. These are listed in Table
8-4, above. The error codes returned in AH are listed in Table 8-5.
8-5
INT 26H Concurrent DOS 86 Programmer's Gulde
AH Value Error
Entry Parameters:
Register AL: Drive number
CX: Number of sectors to write
DX: Beginning logical sector number
OS: OMA address - Segment
BX: OMA address - Offset
Returned Values:
Register AX: Error code, If Carry flag • 1
Absolute Disk Write Is essentially the same as DOS INT 25H, above, except that It
transfers data from memory to disk according to the entry parameters. See DOS
INT 25H, Absolute Disk Read, for error code definitions. .,
End of Section 8
8-6
SECTION 9
This section describes Concurrent's support for DOS device drivers for fixed disks.
Including Winchester disks, virtual drives in memory (RAM disks). and expanded
memory cards. Section 9.1 offers guidelines for writing a DOS fixed-disk driver.
Section 9.2 explains how to install DOS drivers under Concurrent.
This subsection presents guidelines for writing a DOS device driver that is
installable under Concurrent. Because Concurrent supports a subset of DOS-
compatlble devices, this section omits certain Information on writing drivers that
are not applicable to Concurrent.
9-1
9.1 Writing a DOS Driver Concurrent DOS 86 Programmer's Gulde
+--------------+--------------+
0
+ NEXTDH +
2
+--------------+--------------+
4 ATTRIBUTE
+--------------+--------------+
6 STRATEGY
+--------------+--------------+
8 INTERRUPT
+--------------+--------------+
A
c
UNIT
E
10
+--------------+--------------+
Figure 9-1. DOS Device Header
Field Description
9-2
Concurrent DOS 86 Programmer's Guide 9.1 Writing a DOS Driver
Field Description
9-3
9.1 Writing a DOS Driver Concurrent DOS 86 Programmer's Guide
+--------------+--------------+
0 RP LENGTH UNIT
+--------------+--------------+
2 CMDCODE I STATUS(byte2)1
+--------------+--------------+
4 I STATUS(bytel)I RESERVED I
+--------------+--------------+
6
+ +
8 RESERVED
+ +
A
+--------------+--------------+
c RESERVED
+--------------+----DATA------+
9-4
Concurrent DOS 86 Programmer's Guide 9.1 Writing a DOS Driver
Field Description
0 INIT
1 MEDIA CHECK (block devices only)
2 BUILD BPB (block devices only)
3 not used
4 INPUT
5 NON-DESTRUCTIVE INPUT, NO WAIT
(character devices only)
6 INPUT STATUS (character devices only)
7 INPUT FLUSH (character devices only)
8 OUTPUT
9 OUTPUT WITH VERIFY
1O OUTPUT STATUS (character devices only)
11 OUTPUT FLUSH (character devices only)
12 not used
STATUS This word-length field contains the return codes for driver
function calls. It is set to zero on entry to the interrupt
routine, which sets the field on return to Concurrent. This
word is stored in memory, low-order byte first. The status
word is a bit map with the following values:
Bit 15 1 - Error
O - No error
9-5
9.1 Writing a DOS Driver Concurrent DOS 86 Programmer's Gulde
Fie Id Description
The following subsection defines the parameter blocks for each function.
9-6
Concurrent DOS 86 Programmer's Guide INIT
INIT
Command Code: O
+--------------+
D NBRUNITS
+--------------+--------------+
E ENDADDR offset
+-----------------------------+
10 ENDADDR segment
+-----------------------------+
12 BPBPTR offset
+-----------------------------+
16 BPBPTR segment
+--------------+--------------+
Table 9-3 defines the parameter block fields.
Field Definition
9-7
INIT Concurrent DOS 86 Programmer's Gulde
0
+------------+------------+------------+------------+
SECSIZE I SECCLUSTER I RESSEC
4
+------------+------------+------------+------------+
RESS EC NBRFATS NBRDIR
8
+------------+------------+------------+------------+
NBRSECS MOB FATSEC
C
+------------+------------+------------+------------+
FATSEC
+------------+
Figure 9-3. BIOS Parameter Block
9-8
Concurrent DOS 86 Programmer's Guide INIT
Field Description
SEC SIZE Contains the number of bytes per sector, a value that must
be a multiple of 32.
SECCLUSTER Contains the number of sectors per cluster, a value that
must be a power of two.
RESS EC Contains the number of sectors reserved for the boot
loader.
NBRFATS Contains the number of FATs on the disk.
NBRDIR Contains the number of directory entries available in the
root directory of the disk.
NBRSEC Contains the total number of sectors on the disk, including
reserved sectors.
MOB Contains the Media Descriptor Byte, which corresponds to
the identification byte at the start of the FAT table. The
MOB is a bit map that can have the following values:
Bit 0 1 two-sided
O not two-sided
Bit 2 1 removable
0 not removable
9-9
MEDIA CHECK Concurrent DOS 86 Programmer's Guide
Concurrent calls INIT only at Installation time. Place the code for INIT on the high
end of the file so that It can be discarded when hardware and software
Initialization Is complete. Concurrent reuses INIT's space by overlaying the next
Installable DOS driver onto the end of the previous driver, starting at the address
specified In the ENDAODR field in INIT's parameter block.
Concurrent allows one driver within a single driver tile. A single driver can have
multlple units.
The number of units returned by a disk driver determines the logical names for
each drive. Concurrent's method of assigning drive letters is explained In Section
9.2.1, "Drive Assignment.• The number of units returned by INIT overrides the
value In the UNIT field In the Device Header.
MEDIA CHECK
Command Code:
D
+--------------+
MOB
E
+--------------+--------------+
RETURN
+--------------+
MEDIA CHECK must test the current drive to determine whether the media has
been changed since the last disk 1/0 call. MOB Is the current Media Descriptor
Byte as passed from Concurrent. In the RETURN field, MEDIA CHECK returns one
of the following three results:
-1 Media has been changed.
0 Unsure whether media has been changed.
1 Madia has not been changed.
9-10
Concurrent DOS 86 Programmer's Guide BUILD BPB
Command Code: 2
+--------------+
D MOB
+--------------+--------------+
E TRFADDR offset
+--------------+--------------+
10 TRFADDR segment
+--------------+--------------+
12 BPBPTR offset
+--------------+--------------+
14 BPBPTR segment
+--------------+--------------+
The MOB field, above, is the MOB obtained from Concurrent. TRFADDR is a
double-word pointer to a buffer. The setting of the attribute field in the Device
Header determines the way the buffer is used. If the disk Is IBM format-
compatible, the buffer contains the first sector of the FAT table, including the MOB,
on the disk. In this case, the driver must not alter the buffer. If the disk is not
IBM format-compatible, the buffer specified by TRFADDR can be used as a scratch
area.
BPBPTR is a double-word pointer to the BPB returned by the driver after it has
determined the density of the disk.
Concurrent calls BUILD BPB under either of the following two conditions:
INPUT or OUTPUT
All driver Input and output functions use the same parameter block, Illustrated in
Figure 9-4.
D
+--------------+
MOB
E
+--------------+--------------+
+ BUFADDR +
10
12
+--------------+--------------+
COUNT
14
+--------------+--------------+
STARTSEC
+--------------+--------------+
Figure 9-4. Input and Output Parameter Block
Field Description
MOB This field contains the Media Descriptor Byte for the disk.
The driver uses the contents of this field to determine the
disk's format.
BUFADDR This double-word pointer indicates the area of memory that
contains the string or sectors If the requested operation Is
one of the three output functions. If the request Is for 1
either of the Input functions, BUFADDR is a pointer to the
destination area.
COUNT Contains the number of bytes or sectors to be transferred.
STARTSEC Contains the starting sector to read or write.
Concurrent DOS 86 Programmer's Guide INPUT or OUTPUT
The following is a brief description of each of the input and output functions:
A program using DOS function calls cannot request an input or output operation of
more than FFFFH bytes. For this reason, a wrap around in the transfer buffer
(pointed to by BUFADDR in the 1/0 parameter block, above) cannot occur. You can
ignore bytes that would have wrapped around in the buffer.
DOS Driver Functions Concurrent DOS 86 Programmer's Guide
Command Code: 5
D
+------------+
CHARAC
+------------+
CHARAC Is a single byte returned from the device. If bit 9, the busy bit, in the
status word of the Request Header is set, then the value in CHARAC is
meaningless.
The character returned In CHARAC Is not removed from the Input buffer. This
allows Concurrent to look ahead one Input character.
STATUS
There Is no parameter block for either STATUS call. These functions pass their
Information back In bit 9, the busy bit, In the status word of the Request Header.
STATUS INPUT sets the busy bit to Indicate that there Is no character In the Input
buffer. STATUS OUTPUT sets the busy bit to show that the device is not ready for
output.
FLUSH
1
These calls have no Input or output parameters. The FLUSH functions tell the
driver to terminate all pending requests of which It has knowledge.
The FLUSH functions apply to character devices only.
Concurrent DOS 86 Programmer's Gulde Installing a DOS Driver
Concurrent loads DOS drivers from disk at boot time in response to commands
contained in the ASCII file, CCONFIG.SYS. Concurrent's interface to DOS drivers is
contained In the command file named CONFIDD.CMD, (CONFIDD is an acronym for
Concurrent Field-Installable Device Drivers).
The syntax for a command in CCONFIG.SYS is:
FIXED-DEVICE = dvrfil.com
DEVICE = drvfile.com
EMM = drvfile.com
where dvrfil.com is a file containing the appropriate device driver. FIXED-DEVICE
is a fixed (hard) disk. DEVICE is a removable block device, or any character device
other than the standard DOS logical names: CON. AUX, PRN, or CLOCK. EMM is an
expanded memory hardware device that uses the Intel/Lotus or AST specification.
Note: In the absence of a drive specifier, the device driver file must reside on the
drive from which Concurrent boots.
When Concurrent boots, TMPO (Terminal Message Process for screen 0) searches
for the file CCONFIG.SYS. If found, TMPO then executes the command file
CONFIDD.CMO, which installs each device driver named in CCONFIG.SYS, and then
returns control to the system console.
1. Run the SETUP utility and select F2, the "Reserve System Space• menu.
n_1c.
Drive Assignment Concurrent DOS 86 Programmer's Guide
For example, on a machine with one permanent floppy disk and one permanent
hard disk drive with two partitions, Concurrent assigns drive letters as follows:
A: floppy drive
C: DOS partition on hard disk
D: Concurrent partition on hard disk
In Initializing a DOS driver with four units, Concurrent assigns the units starting
with the first available drive, drive B, then skips to the next available drives, E, F,
and G, for the remaining three units. Additional DOS drivers in CONFIG.SYS would
be assigned drive letters starting with H.
To determine the number of units in a driver, Concurrent uses the value returned
by the driver's INIT function, not the value In the UNIT field of the Device Header.
Concurrent's method of loading DOS drivers allows each driver's drives to be
completely installed before the next driver Is loaded. Concurrent can then access
and load the next DOS driver from the previous driver's drives.
End of Section 9
9-16
SECTION 10
WINDOW MANAGEMENT
This section describes how an application ,program can perform efficient console
output while working within Concurrent's windows and su~marizes the use of
Concurrent's window management primitives for the IBM Personal Computer,
PC/XT, and PC/AT. Concurrent's window management primitives are implemented
in the hardware-specific XIOS. Also described in this section are the Concurrent
window management escape sequences.
10-1
10.2 Virtual Console Output Concurrent DOS 86 Programmer's Guide
1. Call the C_GET BOOS function to find your default virtual console number:
vc number ~BDOS(Ox99,0x0);
2. Make a special XIOS call to find the address of the virtual console screen
buffer that corresponds to your default virtual console:
WM_PK(O,vc_number,VS_VC~SEG,&vc_segment);
3. Make an XIOS call (10 _SWITCH) to ensure that what is currently on the
physical console is synchronized with your virtual console screen buffer. The
contents of the buffer and the physical console might not correspond if
another program has sent output directly to the physical console or if the
virtual console window is full screen, on top (switched in), and positioned at
1, 1 on the physical console:
WORD ax,bx,cx,dx; /* (declaration) */
ax = 7; I* IO SWITCH (7H) */
bx = ex = O;
dx .. vc number;
IO_CALL(&ax,&bx,&cx,&dx); I* C entry in WWCALL.A86 */
4. Make a special XIOS call to gain ownership of an internal mutual exclusion
queue (semaphore) that protects virtual console buffers from being updated
by another process:
WM_MXQ(O);
5. You can now update your virtual console buffer directly. After updating the
buffer, immediately make a special XIOS call that frees the internal virtual
console SE1maphore. No other XIOS window management functions that
involve your virtual console can occur whlle you have the semaphore that
protects your virtual console. The following call frees the semaphore:
WM_MXQ(l);
6. Use the following series of special XIOS calls to update the physical console
with the current contents of the virtual console:
WORD ax,bx,ex,dx; /* (declaration) */
WM PK(O,ve number,2, &ex); /* top left */
WM-PK(O,vc-number,4, &bx); /* bottom right */
ax-= 20; - I* WW_NEW_WINDOW (14H) */
bx = ve number;
IO_CALL(&ax,&bx,&ex,&dx); /* C entry in WWCALL.A86 */
WM_PK, IO_CALL, and WM_MXO are contained in WWCALL.A86. WM PK is the
window manager peek/poke routine (0 • peek, 1 • poke). 10 CALL is the C
language interlace routine. WM MXO obtains or releases the - internal virtual
console semaphore (0 • get, 1 ., release). See Section 4, "Console 1/0 Functions,"
in the Svs!EllT.1 Q_!,J)g~ for a description of the 10_SWITCH (07H) XIOS call.
10-2
Concurrent DOS 86 Programmer's Guide 10.2 Virtual Console Output
In addition to handling console output so that it works within windows, you can
control the placement, size. scrolling, tracking, and ordering (what is on top) of the
windows. This direct interaction with the window management primitives can be
very useful, but it is also very XIOS-dependent and. therefore, not portable.
This section briefly describes the XIOS window management calls and summarizes
their entry parameters and return values. Also described in this section are two
important window management data structures: the Virtual Console Structure
and the Window Data Block.
Note that the window management escape sequences described in Section 10.4
provide a subset of the XIOS window management functions. These escape
sequences do not require applications to link with assembly language routines in
order to make XIOS window management calls.
There are nine XIOS window management calls. Their names and functions are
listed in Table 10-1.
10-3
10.3 XIOS Window Management Calls Concurrent DOS 86 Programmer's Guide
Routine Function
The XIOS routines listed in Table 10-1 are non-standard or "backdoor" in the sense
that they cannot be called using the standard Function 50 XIOS calling convention.
10-4
Concurrent DOS 86 Programmer's Guide 10.3 XIOS Window Management Calls
These routines ere celled through a fer cell to the XIOS entry point using the
standard XIOS segment register conventions, specifically: DS • SYSDAT and ES "'
UDA.
At entry, each routine Is called with a function code In AL, and various parameters
in BX, CX, and DX. Table 10-2 summarizes the XIOS window management calls in
terms of register content at entry and exit. For more complete Information about
the XIOS window management calls, see Section 4 of the Syste_rn.__Guide.
WW POINTER AL • lOH
DL • vc number AX "' .vc struct
DL • FF for window info AX • .window data blk
10-5
10.3 XIOS Window Management Calls Concurrent DOS 86 Programmer's Guide
Concurrent maintains a virtual console data structure for each virtual console in
the system. WW_POINTER returns a pointer to the virtual console data structure
that corresponds with the virtual console number passed as an entry parameter.
Structure members Include cursor position, window position, tracking mode, and
console buffer segment. Table 10-3 describes the virtual console data structure,
which Is returned by WW_POINTER when DL • vc number.
10-6
Concurrent DOS 86 Programmer's Guide 10.3 XIOS Window Management Calls
10-7
10.3 XIOS Window Management Calls Concurrent DOS 86 Programmer's Guide
When DL • FFH on entry to WW _POINTER, the call returns a pointer to the Window
Data Block. This structure is described In Table 10-4.
Windows are specified by their inside corners. Rows are from 0 to 23, columns
from 0 to 79. If the new size is the same as the the old size, then the physical
Image is updated from the virtual screen buffer. This ensures that changes to the
virtual screen butter are correctly displayed on the physical console.
10-8
Concurrent DOS 86 Programmer's Guide 10.4 Escape Sequences
10-9
10.4 Escape Sequences Concurrent DOS 86 Programmer's Guide
The escape sequences use a parameter list of registers to access the XIOS calls
described in Table 10-5. There are always ten bytes in the escape sequence. The
first two bytes contain the terminal-oriented escape code. The last eight bytes
must contain the values the registers are to contain before an XIOS call. The
exact escape sequence format is as follows:
ESC al ah bl bh cl ch dl dh
Note: If you use these escape sequences in an application, you sacrifice
portability for the ability to use windows.
End of Section 10
10-10
Appendix A
This appendix contains the code listing for the Resident System Process, ECHO.
DEFINITIONS
CODE SEGMENT
CSEG
org 0
A-1
A.O Concurrent DOS 86 Programmer's Guide
A-2
Concurrent DOS 86 Programmer's Guide A.O
endcmd:
mov byte ptr [bx],13
mov byte ptr l[bx],10
mov byte ptr 2[bx],'$'
DATA SEGMENT
DSEG
org rsp_top
sdatseg dw 0,0,0
dw 0,0,0
dw 0,0
org rsp_pd
pd dw 0,0 link,thread
db ps_run status
db 190 priority
dw pf _keep flags
db 'ECHO name
dw offset uda/lOh uda seg
db 0,0 disk, user
db 0,0 load dsk,usr
dw 0 mem
dw 0,0 dvract,wait
A-3
A.O Concurrent DOS 86 Programmer's Gulde
A-4
Concurrent DOS 86 Programmer's Guide A.O
console db 0
;disk db 0
;user db 0
;list db 0
end
End of Appendix A
A-5
Appendix B
6. At this point, you might want to modify the 8087 environment image saved in
step 2 above.
7. Before enabling the 8086 interrupts, restore the 8087 environment with its
status word's interrupt request bit cleared. If the environment is not restored
before 8086 interrupts are enabled, and an interrupt occurs {like a tick), a
different 8087 process can gain control of the 8087 and swap in its 8087
context. On a second interrupt. or on an IRET instruction, the 8086-running
process that happened to be executing the exception handler code is brought
back Into 8086 context and writes over the new 8087 context.
The user program, which uses its own exception handler, must replace the
system's Interrupt vector with its own. Once this is done, Concurrent swaps this
vector into memory every time the program comes back into 8087 context. The
address of the interrupt vector is in the SYSDAT table at offset AOH.
The default exception handler aborts those 8087 programs that have enabled 8087
interrupts and that generate a severe error (such as stack underrun, divide by zero,
and so forth). Any other errors are ignored by the default exception handler.
B-1
B.O Concurrent DOS 86 Programmer's Gulde
;m••••=i
ndpint: ; 8087 interrupt routine
;··=···
This exception handler is non-specific and
is meant as an example
default. It is assumed that if the 8087
programmer has enabled 8087
interrupts and has specified exception flags
in the control word, then
the programmer has also included an
exception handler to take
specific actions within the program
before continuing in the 8087.
This handler will ignore non-severe
errors (overflow,etc) and will
terminate processes with severe errors
(divide by zero,stack violation).
push ds SAVE CURRENT DATA SEGMENT
mov ds,sysdat GET XIOS DATA SEGMENT
mov ndp ssreg,ss DO STACK SWITCH FOR 8086 ENV
mov ndp-spreg,sp SAVE
mov ss,sysdat
mov sp,offset ndp tos SAVE THE 8086 REGISTERS
push axl push bx -
push ex! push dx
push di! push si
push bp! push es
mov es,sysdat NOW SAVE THE 8087 ENV
FNSTENV env 8087 SAVE 8087 PROCESS INFO
FWAIT -
FNCLEX CLEAR ITS INT REQUEST BIT
xor ax,ax WAIT
FNDISI DISABLE ITS INTERRUPTS
mov al,020h SEND 2 INTERRUPT ACKNOWLEDGES,
out 060h,al 1 FOR MASTER PIC, l FOR SLAVE
mov al,020h
out 058h,al
call in_B087 IN 8087 CHECKS THE 8087 ERROR ;
CONDITION. IF ERROR IS SEVERE,
IT WILL ABORT, ELSE IT WILL
RETURN WITH NO CHANGES.
B-2
Concurrent DOS 86 Programmer's Guide B.O
in 8087:
:-------
entry: OS = SYSDAT
Only user-specified error conditions generate
interrupts from the 8087.
End of Appendix B
B-3
Index
lndex-1
Byte count for a file, 2-33 Conditional disk drive reset,
2-34. 2-36
Conditional queue operations,
c 1-6
Conditionally attaching a device,
C(onsotes) option - SYSTAT 6-20. 6-33
utlllty, 1-16 CONFIDD.CMD command flle,
Call Parameter Block (CPB) 9-15
(Figure 6-14), 6-156 CONOUT: (logical console), 6-47
Carriage return character Console Buffer Format (Figure
(CTRL-M), 6-42 6-9). 6-41
Carriage return/line feed at Console Control Block (CCB).
end-of-file, 2-8 1-11
CCONFIG.SYS configuration file, Console Mode, 6-47
9-15 Console Mode definition. 6-37
CCPM.SYS - Concurrent DOS 86 Console number. 6-44
system file, 5-1, 5-9 Console output byte bucket,
CCPM.SYS system file, 6-176 6-37
CCPMSEG, 6-179 Console status, 6-38
Chain to another program, Control Word (In UDA), 6-150
6-139 CP/M-86 compatibility, 6-172
Character Control Block (CHCB), CP/M-86 memory allocation
1-11. 6-24, 6-29, 6-47, scheme, 6-126
6-125, 6-145, 6-178 Create stamp (in directory
Character 1/0 (CIO) module, label), 2-17, 6-84
1-11 Create stamp (In SFCB), 2-22,
CHSET utility, 3-2, 3-7 8-99, 6-101, 6-105
CLOCK process, 1-2, 1-7 CSEG directive (RASM-86), 4-3
CMD file header, 3-2. 4-1, 5-2, CTRL-\ 8-42
5-9 CTRL-A. 6-42
CMD file header format (Figure CTRL-C, 3-1, 5-7, 6-37, 6-38,
3-1), 3-2 6-40, 6-45, 6-147
CMD filetype, 1-13, 2-27, 3-1, CTRL-0, 6-42
5-1, 6-139, 6-141, 6-153 CTRL-E, 6-42
Command Line Buffer format CTRL-F, 6-42
(Figure 6-11), 6-140 CTRL-G, 6-42
Command Line Interpreter (CLI), CTRL-H, 6-42
1-13, 3-1 CTRL-1, 6-40, 6-47, 6-90
Compact Model transient CTRL-J, 6-42, 6-90
program, 1-13, 3-4, 4-1, CTRL-K. 6-42
4-4 CTRL-M, 6-42, 6-90
Compatibility Attribute CTRL-0 (with virtual console),
Fl'. 6-70 1-13
F2'. 2-27, 6-70 CTRL-0, 6-38
F3'. 2-29, 6-70 CTRL-P (with virtual console),
F4'. 2-29, 6-70 1-13
Compatibility attribute CTRL-P, 6-37, 6-38
definitions (Table 2-12), CTRL-Q (with virtual console),
2-27 1-13
Concurrent file access, 2-30 CTRL-0. 6-37, 6-42
CTRL-R, 6-43
lndex-2
CTRL-S, 6-37, 6-38, 6-42 BOOS Multisector Count, 2-30
CTRL-T, 6-42 Console Mode, 6-37
CTRL-U, 6-42 compatibilty attribute, 2-27
CTRL -V, 6-42 directory code, 2-42
CTRL-W, 6-42 directory label, 2-17
CTRL-X, 6-42 error flag, 2-42
CTRL-Y, 6-42 exclusive file lock, 2-31
CTRL-Z at end-of-file. 2-8 Extended File Control Block
Current extent number {In FCB), (XFCB), 2-18
2-9 extended file locking, 2-26
Current output delimiter. 6-34 file attribute. 2-13
Current record number (in FCB), File Control Block (FCB), 2-8
2-9, 2-33, 3-7, 6-93, File ID, 2-9
6-95, 6-111 file open mode, 2-22
Current user number, 2-16, interface attribute, 2-15
6-146 Lock List, 2-24
logical file lock, 2-31
Login Vector. 6-62
D mutual exclusion queue, 1-6
priority dispatching, 1-5
Data area of logical drive, 2-1 process dispatching, 1-4
Data block size, 2-6 Random Record Number, 2-7
Data space allocation, 2-1 Ready List. 1-4
Date and time stamping for ready process, 1-4
files, 2-17, 2-21, 6-66, record blocking/deblocking,
6-101, 6-105 2-33
DATE utility, 2-22 running process. 1-4
Day file option. 6-178 shared file lock, 2-31
Default BOOS Error Mode, 2-37, source file, 2-8
6-79 sparse file. 2-7
Default console, 6-32, 6-33. Special File Control Block
6-35, 6-36, 6-38, 6-40, (SFCB), 2-21
6-44, 6-45, 6-46, 6-137, suspended process, 1-4
6-146 Terminal Message Process,
Default disk, 6-54, 6-146 1-13
Default OMA buffer, 3-7 transient program, 1-13
Default drive, 3-5, 6-60, 6-65 virtual file size, 6-102
Default file open mode (Locked), Delay List, 1-4, 1-5. 1-7, 6-143
2-22 Delay List Root, 6-179
Default list device, 1-13, 6-119, Delete (password protection
6-120, 6-121, 6-122, mode), 2-19, 6-83. 6-105
6-123, 6-124, 6-146 Detaching a console, 6-35
Default output delimiter. 6-34 Detaching a device, 6-21
Default password, 2-20, 6-91, Determining disk media type,
6-106 2-13
Default system disk, 6-178 Device polling, 6-49, 6-143
Default temporary disk, 6-178 DIR utility, 2-1. 2-14
Default user number, 6-110 Direct character 1/0, 3-7
Definition of Direct Memory Address (OMA),
attribute bit, 2-13 3-1. 3-5, 3-7, 5-6, 5-7,
BOOS Error Mode, 2-37 6-54, 6-66, 6-69, 6-70,
lndex-3
6-76, 6-77, 6-78, 6-83, DOS BIOS Parameter Block
6-84, 6-91, 6-93, 6-95, (BPB) format (Figure 9-3),
6-97, 6-99, 6-101, 6-106, 9-7
6-108, 6-111, 6-113, DOS console buffer format
6-116, 6-139, 6-148, (Figure 7-1), 7-22
6-153, 7-30, 7-56 DOS Country Dependent Data
Direct video mapping, 3-7 Return Block (Figure 7-7),
Directory area of loglcal drive. 7-82
2-1 DOS critical error codes (Table
Directory area on a disk, 2-7 8-4), 8-3
Directory code, 6-1O1 DOS critical error exit address,
Directory code definition, 2-42 7-83, 7-84. 8-3
Directory entry, 6-83 DOS CTRL-Break, 7-18, 7-19,
Directory hashing, 6-176 7-20, 7-21, 7-23, 7-83,
Directory label, 6-99, 6-100, 7-84, 7-87, 7-92
6-111 DOS CTRL-Break address, 8-2
Directory label data byte, 2-17, DOS CTRL-PrtSc, 7-18, 7-19
2-18, 6-61, 6-66 DOS default auxiliary device,
Directory label definition, 2-17 7-15, 7-16
Directory Label Format (Figure DOS default console, 7-21
2-4), 2-17 DOS default disk drive, 7-43,
Directory label time stamp, 2-22 7-53
Directory record with SFCB DOS default Input device, 7-13,
(Figure 2-6), 2-21 7-18, 7-19, 7-20. 7-22,
Directory space allocation, 2-1 7-23, 7-24
Diak data buffers, 6-176 DOS default output device, 7-14
Diak drive capacity (Table 2-4), DOS default printer device, 7-17
2-6 DOS device driver error codes,
Disk drive organization. 2-6 9-6
Disk drive reset, 2-34, 6-57, DOS device driver format, 9-1
6-63, 6-68, 6-147 DOS device driver function
Disk Free Space Field format Build BPB, 9-11
(Figure 6-5), 6-69 FLUSH, 9-14
Disk media change, 2-26, 2-34, INIT, 9-7, 9-16
2-36, 6-57, 6-64, 9-10 MEDIA CHECK. 9-10
Disk Parameter Block (DPB) NONDESTRUCTIVE INPUT, 9-14
format (Figure 6-4), 6-55 STATUS, 9-14
Disk Parameter Block (DPB), DOS device driver header
1-12. 2-34, 6-55 (Figure 9-1), 9-1
Dispatcher (code In RTM). 1-4 DOS device driver installation,
Dispatcher entry point, 6-176 9-15
Dispatcher Ready list, 6-179 DOS device driver Request
DOS absolute disk read/write Header format (Figure
error codes (Table 8-5), 9-2), 9-4
8-6 DOS directory-related
DOS ASCllZ string, 7-4, 7-59, operations, 2-11
7-60, 7-66, 7-69, 7-70, DOS disk drive assignment,
7-71. 7-74, 7-75, 7-76, 9-15
7-86, 7-87 DOS Disk Transfer Area (OTA),
7-30. 7-35, 7-40, 7-56,
7-69, 7-70
lndex-4
DOS Extended File Control Block DOS Program Segment Prefix
format (Figure 7-3), 7-28 (PSP). 7-28, 7-30, 7-83,
DOS File Allocation Table (FAT), 7-84. 7-87
7-45 DOS program terminate, 8-2
DOS file and device handle, 7-5 DOS read/write pointer, 7-65,
DOS File Attribute Byte (Table 7-67, 7-68
7-8). 7-29 DOS standard device handles
DOS file attribute bits (Table (Table 7-3), 7-5
7-9). 7-35 DOS standard File Control Block
DOS file date format (Figure format (Figure 7-2). 7-26
7-5). 7-72 DOS system call
DOS file time format (Figure OOH (Program Terminate).
7-4). 7-72 7-83. 8-2
DOS filename separators, 7-54 OlH (Keyboard Input), 7-13
DOS filename terminators. 7-54 02H (Console Output). 7-14
DOS 1/0 Parameter Block format 03AH (Remove a
(Figure 9-4), 9-12 Subdirectory), 7-75
DOS INT 20H (Program 03H (Auxiliary Input), 7-15
Terminate), 8-2 04H (Auxiliary Output), 7-16
DOS INT 21H {Invoke a DOS 05H (Printer Output), 7-17
Cail), 8-2 06H (Direct Console 1/0). 7-18
DOS INT 22H (Terminate 07H (Direct Console 1/0). 7-19
Address). 7-84, 7-87, 8-2 08H (DOS Console Input
DOS INT 23H (CTRL-Break Without Echo). 7-20
Address), 7-13. 7-20, 09H (Print String), 7-21, 8-2
7-21. 7-23, 7-84, 7-87. OAH (Buffered Console Input),
8-2. 8-3 8-2. 7-22
DOS INT 24H (Critical Error Exit OBH (Check Console Status).
Address). 7-84, 7-87, 8-2. 7-23
8-3 OCH {Character Input with
DOS INT 24H disk error Buffer Flush), 7-24
Indicators {Table 8-3). OOH (Disk Reset), 7-31
8-3 OEH (Select Disk), 7-32
DOS INT 25H {Absolute Disk OFH (Open Fiie). 7-28, 7-33
Read), 8-3. 8-5 lOH (Close File), 7-34, 8-2
DOS INT 26H {Absolute Disk 11 H (Search for First Entry),
Write), 8-3, 8-6 7-30, 7-35. 7-69
DOS interrupts supported by 12H (Search for Next Entry),
Concurrent (Table 8-2), 7-37
8-1 13H (Delete File), 7-38
DOS Load and Execute 14H (Sequential Read). 7-39
Parameter Block format 15H (Sequential Write), 7-40
(Figure 7-7), 7-87 16H (Create File), 7-41
DOS Load Overlay Parameter 17H (Rename File). 7-42
Block format (Figure 7-9). 19H (Current Disk), 7-43
7-89 lAH (Set Disk Transfer
DOS media file. 2-11, 6-99 Address). 7-30
DOS monitor call Interrupts 1AH (Set OTA), 7-44
{Table 8-1), 8-1 lBH (Allocation Table
DOS Program Segment Prefix Address). 7-45, 7-57
(PSP) (Figura 7-10), 7-89
lndex-5
lCH (Alloc. Table for Specific 43H (Change File Mode). 7-30,
Drive), 7-46 7-59. 7-60, 7-64, 7-66
21H (Random Read), 7-47 45H (Duplicate a File Handle).
22H (Random Write), 7-48 7-67
23H (Fiie Size). 7-49 46H (Force a Duplicate of a
24H (Set Random Record Handle). 7-68
Field), 7-50 47H (Get Current Directory).
25H (Set Vector). 7-78. 7-80 7-77
26H (Create New Program 48H (Allocate Memory), 7-86,
Segment), 7-84 7-93
27H (Random Block Read), 49H (Free Allocated Memory).
7-51 7-94
28H (Random Block Write), 4AH (Modify Allocated Memory
7-52 Blocks). 7-86, 7-95
29H (Parse Filename). 7-53 4BH (Execute a Program).
2AH (Get Date), 7-96 7-84, 7-86, 7-91, 8-2
2BH (Set Date). 7-97 4CH (Terminate a Process),
2CH (Get Time), 7-98 7-92
2DH (Set Time). 7-99 4CH (Terminate a ProcessO.
2EH (Set/Reset Verify Switch), 7-91
7-55 4DH (Get Subprocess Return
2FH (Get Disk Transfer Code). 7-85, 7-91, 7-92
Address). 7-30 4EH (Find First Matching File),
2FH (Get OTA). 7-56 7-69, 7-70
30H (Get DOS Version 4FH (Find Next Matching File),
Number), 7-79 7-70
31H (Keep Process), 7-85, 54H (Get Verify State). 7-55,
7-92, 8-2 7-58
33H (CTRL-Break Check). 7-25 56H (Rename a File). 7-71
35H (Get Vector). 7-78, 7-80 57H (Get/Set Time and Date
36H (Get Disk Free Space). Stamps). 7-72
7-57 DOS system call categories
38H (Get Country Dependent (Table 7-1), 7-1
Information), 7-81 DOS system call error codes
39H (Create a Subdirectory). (Table 7-4), 7-6
7-74 DOS system call summary
3BH (Change Current (Table 7-5), 7-6
Directory), 7-76 Drive specifier (In a flle
3CH (Create a File), 7-59 specification), 2-4
3DH (Open a File Handle). Drive Vector structure (Figure
7-60, 7-29 6-3). 6-52
3EH (Close a File Handle), DSEG directive (RASM-86), 4-3
7-61, 8-2
3FH (Read from a File or
Device), 7-62, 7-67, 7-68 E
40H (Write to a File or Device).
7-63, 7-67, 7-68 E(xlt) option - SYSTAT utility,
41 H (Erase a File from 1-16
Directory - UNLINK), 7-64 ECHO RSP, 5-1. 5-3, 5-7, 5-9
42H (Move Fiie Read/Write End-of-flle, 6-96
Pointer), 7-65, 7-67, 7-68
lndex-6
Error codes returned by system File ID, 2-23, 2-31. 6-80, 6-84,
calls, 1-14 6-87. 6-108
Error flag definition, 2-42 File ID definition, 2-9
Escape sequence format for File logging information, 6-178
XIOS window calls. 10-9 File open mode definition, 2-22
Exclusive file lock, 2-31, 6-80, File password, 2-17, 2-19, 2-38,
6-94, 6-96 3-5
Expanded Memory Management File security, 2-24
(EMM), 1-7, 6-128 File size (maximum), 2-6
Extended File Control Block File specification, 2-4
(XFCB), 6-83, 6-84, 6-116 Filename (In a file specification),
Extended file lock, 6-97, 6-106 2-4
Extended file locking, 2-26, Filename delimiters (Table 2-2),
6-70, 6-72 2-4
Extended 1/0 System entry Filename delimiters, 6-89
point, 6-176 Filetype (In a file specification),
Extended 1/0 System (XIOS), 2-4
1-13, 10-1 Filetype conventions (Table
2-3), 2-5
Flag 1 - tick flag, 1-7
F Flag 2 - one second flag, 1-7
Flag Table address, 6-178
F PASSWD system call, 6-70 Flags (initial), 6-148
Far Jump Instruction, 6-176 Floating drive, 2-12
Far Return instruction, 3-1, 4-2 Flushing buffers, 2-34, 6-58
FCB checksum. 2-9, 2-1 O. 2-16, Foreground process, 3-7, 6-147
2-24, 2-25, 2-26, 2-29, Free memory partitions, 6-178
2-34, 2-36, 2-38, 6-57, Free space on a disk drive,
6-59, 6-72. 6-73, 6-84, 6-53, 6-69
6-87, 6-94, 6-96, 6-97, FSET utility, 2-20, 2-27, 2-29
6-106, 6-114, 6-112
FCB Disk Map values for DOS G
media files (Table 2-6),
2-12 GENCCPM utility, 2-25, 2-27,
FCB lnltlailzation, 2-10, 3-7, 2-32, 5-1, 5-2, 5-3. 5-9,
6-84, 6-89 6-176
FCB lnltlallzatlon for DOS media Group Descriptor types (Table
files, 2-11 3-1), 3-3
FCB time/date fields for DOS Group Descriptor fields (Table
media files (Figure 2-3), 3-2). 3-4
2-13 Group Descriptor format (Figure
File attribute definitions (Table 3-2), 3-3
2-7), 2-14
File backup procedure, 2-14
File byte count. 2-33, 6-70, H
6-86
File Control Block (FCB) H(elp) option - SYSTAT utility,
definition, 2-8 1-15
File Control Block (FCB) format Hardware Initialization, 6-176
(Figure 2-1), 2-8
File header (CMD). 3-2
lndex-7
K
lndex-8
Maximum number of queue p
messages, 6-165
Maximum storage capacity per P(rocesses) option - SYSTAT
disk drive, 6-55 utility, 1-16
Media change on drive with Paged memory, 1-7
open files, 2-26, 2-36 Parameter passing, 6-139
Media Descriptor Byte, 9-8. Parent/child process
9-11 relationships, 3-7, 5-9,
Memory (MEM) module, 1-7 6-110, 6-146, 7-87
Memory allocation unit, 6-179 Parse Filename Control Block
Memory Control Block (MCB) (PFCB) (Figure 6-6), 6-88
(Figure 6-7), 6-126 Password (in a file
Memory Descriptor (MD). 6-178 specification). 2-4
Memory expansion hardware, Password (in directory label),
1-7 2-17
Memory Parameter Block (MPB) Password (in XFCB), 2-18
(Figure 6-8), 6-127 Password encryption, 2-20
Memory protection, 6-142 Password for a drive, 6-B3
Memory Segment Descriptors, Password for a file, 2-17, 2-19,
6-146 2-38, 3-5. 6-70, 6-89.
MP/M-86 memory allocation 6-97
scheme, 6-126 Password mode (in XFCB). 2-18,
Multl-sector 1/0, 2-30 6-83, 6-84, 6-101, 6-105
Multiple copies of an RSP. 5-2 Password protection mode
MX (mutual exclusion) queue, (Table 2-11), 2-19
1-6 Permanent disk drive, 2-34
MXdlsk - system mutual Physical console, 10-1
exclusion queue, 1-6 Physical INput process (PIN),
1-12. 6-38
PIP utility, 2-14, 2-30
N Poll List. 6-143
Poll List Root, 6-179
Nonlnterrupt-drlven device, Polling devices at dispatch time,
6-49 6-49, 6-143
Null character. 6-90 Printer echo, 6-37
Number of character devices, Priority driven scheduling, 6-152
6-179 Priority of a transient process,
Number of physical consoles, 5-4, 5-6. 6-141, 6-145,
6-180 6-151, 6-155
Number of XIOS consoles, Privileged process, 5-8
6-179 Process definition, 1-2
Number of XIOS list devices, Process Descriptor (PD) (Figure
6-179 6-12). 6-142
Process Descriptor (PD), 1-4,
5-1. 5-3, 6-137, 6-141,
0 6-142, 6-154, 6-158,
6-175, 6-178
O(vervlew) option - SYSTAT Process dispatching, 1-3. 6-152
utility, 1-16 Process Initialization. 3-1
Open Fiie Drive Vector. 6-179 Process Keep Flag, 1-12
Output delimiter, 6-34 Process scheduling, 6-145
lndex-9
Program Flag (In CMD file Read-Only Attribute - Tl'. 2-14,
header), 3-2 2-22. 2-38, 6-70, 6-86
Reading multiple records, 2-30
Ready List. 1-4, 1-7, 6-143
Q Ready List Root, 6-179
Ready process, 1-4
Q(ueues) option - SYSTAT Real-time Monitor (RTM)
utility, 1-16 module, 1-3
Queue Buffer (QB), 1-5, 5-8. Reentrant code, 6-146, 6-157
6-142, 6-165, 6-167 Reentrant RSP, 5-3
Queue Buffer Memory Allocation Register CX error codes, 1-14
Unit, 6-178 Register Initialization, 5-7
Queue Descriptor (QO) (Figure Register Initialization for system
6-16), 6-165 calls, 1-13
Queue Descriptor (QO), 1-5, 5-8, Registers used by system calls
6-142. 6-143, 6-175, (Tabla 1-1), 1-13
6-178 Releasing memory, 6-135,
Queue flags, 6-165 6-158
Queue List Root, 6-179 Removeable disk drive, 2-34,
Queue management. 1-5 3-1, 6-54, 6-57
Queue Message Buffer, 6-160 Request Packet (for a DOS
Queue message length, 6-165 device driver), 9-4
Queue name, 1-6 Resetting a disk drive, 2-34
Queue Parameter Block (QPB) Resident Procedure Library
(Figure 6-15), 6-160 (RPL), 6-156
Queue Parameter Block (QPB). Resident System Process (RSP),
5-9, 6-168 3-1. 5-1. 6-140
Command Queue, 5-4, 5-8
Command Queue Message
R (Figure 5-3), 5-4
Initialization, 5-4
Random Record Number, 2-8, Process Descriptor, 5-6
2-9, 2-31, 2-32, 2-33. stack, 5-8
3-7, 6-80, 6-92. 6-95, User Data Area, 5-7
6-102, 6-106, 6-108, RETF Instruction, 3-1. 4-2,
6-113 6-176
Random Record Number Return and Display (BOOS Error
definition, 2-7 mode), 6-79
Raw console output, 6-37, 6-38 Return Error (BOOS Error mode),
Read (password protection 6-79
mode), 2-19, 6-83, 6-105 Round-robin scheduling, 6-152
Read Queue List, 6-143 RSP Data Segment, 6-176
Read-Only (file open mode), RSP Header Format (Figure 5-2),
2-23, 2-27. 2-30, 6-80, 5-3
6-86, 6-102, 6-106, Running process, 1-4
6-108
Read-Only (R/0) Vector, 6-64
Read-Only (R/0) Vector s
structure (Figure 6-3),
6-52 Saving registers during system
calls, 1-14
lndex-10
Security of files, 2-24 A DETACH. 6-21
Segment address, 6-148 A-GET, 6-22
Segment register Initialization, A-READ, 6-19, 6-23
4-1 A-READBLK, 6-19, 6-24
Serial number (of Concurrent), A-SET, 6-25
6-174 A-STATIN, 6-26
SERIAL Number Format (Figure A-STATOUT, 6-27
6-18), 6-174 A-WRITE, 6-19, 6-28
Setting a file's byte count, 2-33 A-WRITEBLK, 6-19, 6-29
Shared (file open mode), 6-114 C-ASSIGN, 6-30
Shared code, 3-1 C-ATTACH, 6-30, 6-32, 6-40
Shared Code List, 3-2 C-CATTACH, 6-33
Shared code RSP, 5-3, 6-146 C-DELIMIT, 6-34, 6-48
Shared file lock, 2-31. 6-80 C-DETACH, 6-30, 6-35
SID-86 debugger, 5-9 C-GET, 6-36, 10-2
Small Memory Model RSP, 5-2, C-MODE, 1-13, 3-1, 6-37,
5-3 - 6-45
Small Model transient program, C RAWIO, 1-13, 6-38, 6-45
1-13, 3-4, 4-1, 4-3 C-READ, 6-40, 6-41, 6-46
Sparse file, 6-106 C-READSTR, 1-12, 6-41
Sparse file definition, 2-7 C-SET, 6-44
Special File Control Block C-STAT, 6-37, 6-45
(SFCB), 6-66, 6-101 C-WRITE, 6-37, 6-46
Special File Control Block C-WRITEBLK, 6-37, 6-47
(SFCB) definition, 2-21 C-WRITESTR, 6-34, 6-37, 6-48
Spacial Fila Control Block DEV POLL, 1-13, 6-49
(SFCB) subfields (Figure DEV-SETFLAG, 6-50, 6-51,
2-7), 2-21 -6-176
Stack pointer, 6-148 DEV WAITFLAG, 1-7, 6-50,
Stack Segment, 6-148 -6-51
Status line of physical console, ORV ACCESS, 2-34, 2-36, 6-52
10-3 DRV-ALLOCVEC, 6-53
Status Word (In UDA), 6-150 DRV-ALLRESET, 2-34, 3-1,
String dellmlter, 6-48 -6-54, 6-68, 6-77
Supervisor (SUP) module, 1-3 ORV DPB, 6-55
Supervisor Coda Segment, ORV-FLUSH, 6-58
6-176 ORV-FREE, 2-26, 2-34, 2-36,
Supervisor entry point, 6-176 -6-59
Suspended process, 1-4 ORV GET, 6-60
Switching virtual consoles, 1-13 DRV-GETLABEL, 2-18, 6-61
SYSDAT (System Data DRV-LOGINVEC, 6-62
Segment), 2-22, 5-2, 5-6. ORV-RESET, 1-12, 2-34, 3-1,
5-8, 5-9 -6-63, 6-68
SYSDAT Table (Figure 6-19), ORV ROVEC, 6-54, 6-64
6-175 ORV-SET, 6-65
SYSTAT utility, 1-14 DRV-SETLABEL, 2-18, 6-66
System Attribute - T2', 2-14, DRV-SETRO, 6-54, 6-64, 6-68
2-16, 2-38, 6-70, 6-86 ORV-SPACE, 6-53, 6-69, 6-76
System call F AfrRIB, 2-13, 2-26, 2-33,
A ATTACH, 6-19 - 6- 70, 6-86, 6-97
A=CATTACH, 6-20 F_CLOSE, 2-27, 6-72
lndex-11
F DELETE, 2-26, 6-74, 6-83 M ALLOC, 6-129
F-DMAGET, 6-76 M-FREE, 6-129, 6-130
F-DMAOFF, 5-6. 6-76, 6-78, MC ABSALLOC. 6-131
- 6-153 MC-ABSMAX, 6-132
F DMASEG, 5-6, 6-77, 6-78, MC-ALLFREE, 6-133
- 6-153 MC-ALLOC, 6-134
F ERRMODE, 2-25, 2-42, 6-79 MC-FREE. 6-135
F-FLUSH. 2-34 MC-MAX, 6-136
F-LOCK. 2-23, 2-31, 2-32, P ABORT, 1-12, 6-137
- 6-80, 6-85 P-CHAIN, 2-16, 6-139
F MAKE, 2-8, 2-13, 2-19, 2-23, P-CLI, 2-4, 2-5, 2-16, 2-30,
- 2-33. 6-80, 6-83, 6-93, - 3-1. 3-4, 3-7, 4-2. 4-3,
6-111 4-4. 5-4, 5-5. 6-40, 6-77.
F MULTISEC, 2-30, 6-85, 6-93, 6-85, 6-139, 6-140,
- 6-95, 6-111 6-155, 6-178
F OPEN, 2-8, 2-13, 2-22, 2-23, P CREATE, 3-1, 5-1, 5-3, 5-7,
- 6-70, 6-80. 6-86, 6-93, - 5-9. 6-141, 6-142, 6-146,
6-108, 6-111, 6-141 6-154
F PARSE, 2-4, 2-5, 3-1, 6-88, P DELAY. 1-7, 6-151
- 6-140 P-DISPATCH, 6-152
F PASSWD, 2-20. 6-66, 6-91, P-LOAD, 1-3, 3-4, 4-1, 6-141,
- 6-97, 6-106 - 6-153
F RANDREC. 6-92 P PDADR, 5-4, 6-154
F-READ, 6-93 P-PRIORITY, 5-6, 6-155
F-READRAND, 6-95 P-RPL 6-156
F-RENAME, 2-9, 2-26, 6-97 P-TERM, 3-1, 4-2, 6-40, 6-137,
F-SETDATE, 6-99 - 6-158, 6-159
F-SFIRST, 2-13, 2-14, 2-18, P TERMCPM, 4-2, 6-159
- 2-20, 2-22. 6-70, 6-74, a-CREAD, 5-4, 6-162
6-100 a-CWRITE, 5-4, 6-163
F SIZE. 2-33, 6-102 0-DELETE, 5-8, 6-164
F-SNEXT, 2-13, 2-14, 2-18, a-MAKE, 1-6, 5-8, 6-165
- 2-20. 2-22. 6-70, 6-74, a-OPEN, 5-5, 6-156, 6-160,
6-100, 6-104 - 6-167, 6-168, 6-169,
F TIMEDATE, 2-22, 6-105 6-170
F-TRUNCATE, 2-26, 6-106 Q READ, 5-4, 6-162, 6-169
F-UNLOCK, 2-23, 2-31, 2-32, a-READ (unconditional), 1-6
- 6-85, 6-108 a-WRITE, 5-4, 6-163, 6-170
F USERNUM, 2-16, 6-110 S-BDOSVER. 6-171, 6-179
F-WRITE, 6-111 S-BIOS, 6-172
F-WRITERAND, 6-93, 6-102, S-OSVER, 6-173, 6-179
- 6-113 $-SERIAL, 6-174
F WRITEXFCB, 2-19, 6-116 S-SYSDAT, 5-6, 6-175
F-WRITEZF, 6-93, 6-118 T-GET, 2-22, 6-181
L-ATTACH, 6-119, 6-124 T-SECONDS, 6-182
L-CATTACH, 6-120 T-SET, 6-183
L-DETACH, 6-121 System call calling conventions,
L-GET, 6-122 1-14
L-SET, 6-123 System call register
L-WRITE, 6-124 initialization, 1-13
L=WRITEBLK, 6-125
lndex-12
System clock tick, 1-5, 6-151. u
6-152
System Data Segment, 6-167, U(ser Processes) option -
6-175 SYSTAT utility, 1-16
System disk, 6-141 Unconditional queue operations,
System tiles - user 0, 2-14, 1-6
2-16, 2-23, 2-27. 2-29, Unlocked (file open mode).
6-86 2-23, 2-31, 6-80, 6-83,
SYSTEM flag, 6-158, 6-178 6-86, 6-94, 6-106, 6-108,
System generation, 5-1 6-112, 6-114, 6-96
System Lock list, 6-178 Unused Process Descriptor,
System process, 6-145 6-178
System ticks per second, 6-178 Unused Queue Descriptor,
System timing functions, 1-7 6-178
System tracks reserved tor boot Unusued Memory Descriptor,
loader, 2-6 6-178
Update stamp (In directory
label), 2-17, 6-84
T Update stamp (In SFCB), 2-22.
6-101, 6-105, 6-111
Tab expansion, 6-37, 6-40, User Data Area (UDA) (Figure
6-46, 6-47, 6-48 6-13), 6-147
Temporary disk, 6-178 User Data Area (UDA), 1-4, 3-1.
Terminal Message Process 3-2, 5-1. 5-3, 5-6, 6-133,
(TMP), 1-12, 1-13, 2-16, 6-141. 6-146
3-1, 5-3, 5-4. 5-8. 6-110, User number (Independent
6-141, 6-158 directory), 2-1
Termination Code. 6-137, 6-145, User number conventions. 2-16
6-158, 6-159 User System Stack, 6-148,
THREAD field, 6-179 6-150
Thread List, 6-137, 6-143 User-zero system file, 2-14
Thread List Root, 6-179
Tick flag, 1-7
Tick Interrupt handler (in XIOS), v
1-7
Tick length, 1-7, 6-151, 6-152 Version number of Concurrent.
Time stamp (In directory label), 6-179
2-22 Version string address, 6-179
TOD - Time-of-Day Structure Virtual console, 6-172, 6-178
(Figure 6-20), 6-181 Virtual Console Input Queue
Transient Process Area (TPA). (VINO), 1-12
6-142 Virtual console screen buffer,
Transient processs, 1-3 10-2
Transient program definition, Virtual console screen
3-1 management, 1-12, 6-38,
TYPE utility, 2-8 10-1
Virtual console structure
definition (Table 10-3),
10-6
Virtual console switching, 1-13,
10-1, 10-3
lndex-13
Virtual file size definition, 6-102
Virtual/physical environments
(Figure 1-1), 1-1
w
Window data block definition
(Table 10-4), 10-8
Window management, 10-1
Window management escape
sequences, 10-9
Window size specification, 10-8
Write (file open mode), 2-38
Write {password protection
mode), 2-19, 6-83. 6-105
Write Queue List, 6-143
Writing multiple records, 2-30
x
XFCB - Extended Fiie Control
Block (Figure 2-5), 2-18
XIOS backdoor entry points,
10-5
XIOS Header, 6-178
XIOS lnitlallzatlon entry point,
6-176
XIOS non-standard calling
convention, 10-5
XIOS window management call
WW CURSOR VIEW. 10-3
WW-FULL WINDOW, 10-3
WW-IM HERE. 10-3
WW-KEV, 10-3
WW-NEW WINDOW, 10-3
WW-POINTER, 10-3
WW-STATLINE, 10-3
WW-SWITCH DISPLAY, 10-3
ww:wRAP_COLUMN. 10-3
lndex-14