Programmer's Reference Guide COPYRIGHT
Total Page:16
File Type:pdf, Size:1020Kb
DIGITAL RESEARCHTM Concurrent CP/MTM Operating System Programmer's Reference Guide COPYRIGHT Copyright @1984 by Digital Research Inc. All righm r~serv~l. No part of this publication may be relXOduced, transmitted, wan~'ribed, stored in a retrieval system, or translated into any language or compumr language, in any form or by any means, electronic, rneclmrfical, magnetic, optical,chemical, mama] or oclm'wi~, without the prior writtenpermission of Digital Research, Post Office Box 579, PacificOrove, California,93950. DISCLAIMER Digital Research maims no mprmontations or warrantieswith respectto the contentshereof and specificallydisclaims any implied wm'rantiesof nmchantsbility or fimess for any par- ficttlar pm'pu~. Furth~, Digital Re~trch mmrvm the right to mvi~ this publication and to maim changm from time to time in the content horror without obligation of Digital Research to notify any person of such mvkion or changes. TRADEMARKS CP/M and CP/M-86 am mgismmd trademarks of Digital ~h. ASM-$6, Concurrent CP/M, DDT, DDT-86, MP/M, MP/M-86, and PL/I am wglcmarks of Digital Research. Intel and MCS am regis~vd tmdemar~ of Intcl Corporation. ISIS-H is a trademark of Intel Corporation. IBM is a registered trademark of International Business Machines. The Concurrent CPIM Operatin8 System Programmer's Reference Guide was printed in the United States of America. First Edition: January 1984 Foreword Concurrent CP/M~ is a multi- or single-user operating system targeted specifically for the Intel® 8086/8088180186 family of microprocessors. It supports multiple CP/M program- ming environments each implemented on a virtual console. A different task runs concurrently in each environment. This manual describes the invariant programming interface to Concurrent CP/M. It sup- ports the applications programmer who must create applications programs that run in the Concurrent CP/M environment. Section 1 offers an overview of the entire operating system. Section 2 describes the structure of the Concurrent CP/M file system. Section 3 explains the format, structure, and uses of transient commands in the Concurrent CP/lVI environment. Section 4 explains the creation of transient command files in the Concurrent CP/M envi- ronment. Section 5 documents the structur¢ and creation of resident system processes or resident command files permanently installed in the Concurrent CP/M environment. Section 6 describes all the Concurrent CP/M system calls. Concurrent CP/M is supported and documented through four manuals: • The Concurrent CPIM Operating System User's Guide (hereinafter cited as Concurrent CPIM User's Guide) documents the user's interface to Concurrent CP/M, explaining the various features used to execute applications programs and Digital Research utility programs. • The Concurrent CPIM Operating System Programmer's Reference Guide (hereinafter cited as Concurrent CPIM Programmer's Reference Guide) documents the applications programmer's interface to Concurrent CP/M, explaining the internal file structure and system entry points, information that is essential for creating applications pro- grams that run in the Concurrent CP/M environment. fd • The Concurrent CP/M Operating System Programmer's Utilities Guide (he~ cited u Progmmmer'a Utilities Guide) documents the Digital Research utility prv- grm~ that ~ use to write, debug, and verify applications progrants written for the Concurrent CP/M environment. • The Concurrent CP/M Operating 5~ystem System Guide (hereinafter cited as Concur- rent CP/M System Guide) documents the internal, hardware-d~pendent structures of Concurrent CP/M. iv Table of Contents Concurrent CP/M System Overview 1.1 Introduction ............................................................... 1-1 1.2 Supervisor (SUP) ........................................................ 1-5 1.3 Real-time Monitor (RTM) ................................................ 1-5 1.3.1 Process Dispatching .............................................. 1-5 1.3.2 Queue Management ............................................... I-7 1.3.3 System Timing Functions ......................................... 1-8 1.4 Memory Module (MEM) ................................................. 1-9 1.5 Basic Disk Operating System (BDOS) .................................... 1-9 1.6 Character I/O Module (CIO) .............................................. 1-10 1.7 Virtual Console Screen Management ..................................... 1-10 1.8 Extended Input/Output System (XIOS) ................................... 1-11 1.9 Terminal Message Processes (TMP) ...................................... 1-12 1.10 Transient Programs ....................................................... 1-12 1.11 System Call Calling Conventions ......................................... 1-12 1.12 SYSTAT: System Status .................................................. 1-13 2 The Concurrent CP/M File System 2.1 File System Overview .................................................... 2-I 2.1. I File-access System Calls .......................................... 2-2 2.1.2 Drive-related System Calls ....................................... 2-3 2.2 File Naming Conventions ................................................. 2-5 2.3 Disk Drive and File Organization ......................................... 2-8 2.4 File Control Block Definition ............................................. 2-9 2.4.1 FCB Initialization mid Usage ..................................... 2-12 2.4.2 File Attributes .................................................... 2-14 2.4.3 Interface Attributes ............................................... 2-16 2.5 User Number Conventions ................................................ 2-17 2.6 Directory Labels and XFCBs ............................................. 2-18 2.7 File Passwords ............................................................ 2-22 2.8 File Date and Time Stamps: $FCBs ...................................... 2-24 2.9 File Open Modes ......................................................... 2-26 2.10 File Security .............................................................. 2-27 2.11 Extended File Locking .................................................... 2-30 2.12 Compatibility Attributes .................................................. 2-31 2.13 Multisector lYO ........................................................... 2-34 Table of Contents (continued) 2.14 Concurrent File Access ................................................... 2-35 2.15 File Byte Counts ......................................................... 2-37 2.16 Record Blocking and Deblocking ......................................... 2-38 2.17 Reset. Access. and Free Drive ........................................... 2-39 2.18 BDOS Error Handling .................................................... 2-43 Trami~t Comman,h 3.1 ]~ansient Program Load and Exit ......................................... 3-I 3.1.1 Shared Code ...................................................... 3-2 3.1.2 8087 Support ..................................................... 3-2 3.1.3 8087 Exception Handling ......................................... 3-3 3.2 Command File Format .................................................... 3-3 3.3 Base Page Initialization ................................................... 3-5 3.4 Parent/Child Relationships ................................................ 3-8 3.5 Direct Video Mapping .................................................... 3-8 4 Comrmmd File ~ 4. I "/l'zmaicnt ~cm Mocl~ .............................................. 4--1 4.1.1 The 8080 Memory Model ........................................ 4--2 4.1.2 The Small Memory Model ....................................... 4..4 4.1.3 The Compact Memory Model .................................... 4..5 4.2 GENCMD ................................................................ 4-6 4.3 Intel Hexadecimal lrde Format ........................................... 4-9 Resident System Proceg Generation 5.1 Introduction to RSPs ..................................................... 5-1 5.2 RSP Memory Models ..................................................... 5-1 5.2. I 8080 Model RSP ................................................. 5-2 5.2.2 Small Model RSP ................................................ 5-2 5.3 Multiple Copies of P,SPs ................................................. 5-3 5.3.1 8080 Model ....................................................... 5-3 5.3.2 Small Model ...................................................... 5-4 5.3.3 Small Model with Shared Code ................................... 5-4 5.4 Creating end Initializing an RSP .......................................... 5-4 5.4.1 The RSP Header .................................................. 5-7 vi Table of Contents (continued) 5.4.2 The RSP Process Descriptor ...................................... 5-8 5.4.3 The RSP User Data Area ......................................... 5-9 5.4.4 The RSP Stack ................................................... 5-9 5.4.5 The.RSP Command Queue ....................................... 5-9 5.4.6 Multiple Processes within an RSP ................................ 5-10 5.5 Developing and Debugging an RSP ...................................... 5-I 1 System Calls 6, I System Call Summary .................................................... 6-13 6.2 Concurrent CP/M System Calls ........................................... 6-20 6.2.1 Console I/O System Calls ........................................ 6-21 6.2.2 Device System Calls .............................................