SIEMENS. Betriebssystem. Systembeschreibung. ^n HL Ofc - PDF

Please download to get full document.

View again

of 36
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report
Category:

Resumes & CVs

Published:

Views: 40 | Pages: 36

Extension: PDF | Download: 0

Share
Related documents
Description
SIEMENS Betriebssystem Systembeschreibung ^n HL Ofc Cr/ M - OD (System Guide) COPYRIGHT Copyright 1981 by Digital Research. All rights reserved. No oart of this publication mav be reproduced, transmitted,
Transcript
SIEMENS Betriebssystem Systembeschreibung ^n HL Ofc Cr/ M - OD (System Guide) COPYRIGHT Copyright 1981 by Digital Research. All rights reserved. No oart of this publication mav 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, Post Office Box 579, Pacific Grove, California, This manual is, however, tutorial in nature. Thus, the reader is granted permission to include the example programs, either in whole or in part, in his own programs. DISCLAIMER Digital Research 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 reserves the right to revise this publication and to make changes from time to time in the content hereof without obligation of Digital Research to notify any person of such revision or changes. TRADEMARKS CP/M, CP/M-86, and CP/NET are registered trademarks of Digital Research. ASM-86, CP/M-80, DDT-86, LINK- 80, MP/M, and TEX-80 are trademarks of Digital Research. The CP/M-86 System Guide was prepared using the Digital Research TEX-SO Text Formatter and printed in the United States of America by Commercial Press/ Monterey. * Second Printing: June 1981 * Foreword The CP/M-86 System Guide presents the system programming aspects of CP/M-86, a single-user operating system for the Intel 8086 and bit microprocessors. The discussion assumes the reader is famil iar with ~P/M the Digital Research 8-bit operating system. To clarify soecific differences with CP/M-86, this document refers to the 8-bit version of CP/M as rp/m-80. Elements common to both systems are simply calued rp/m features. CP/M-80 and CP/M-86 are equivalent at the user interface level and thus the Diqital Research documents: An Introduction to CP/M Features and ^acii ities ED: A Context Editor for the CP/M Disk System CP/M 2 User's Guide are shipped with the CP/M-86 package. Also included is the CP/M-86 Programmer's Guide, which describes ASM-86 TM and DDT-86, Digital Research's 8086 assembler and interactive debugger. This System Guide presents an overview of the CP/M-86 programming interface conventions. Tt also describes orocedures for adaoting CP/M-86 to a custom hardware enviornment. This information parallels that presented in the CP/M 2 Interface Guide and the CP/M 2 Alteration Guide. Section 1 gives an overview of CP/M-86 and summarizes its differences with CP/M-80. Section 2 describes the general execution environment while Section 3 tells how to generate command files. Sections 4 and 5 respectively define the programming interfaces to the Basic Disk Operating System and the Basic Incut/Output System. Section 6 discusses alteration of the BIOS to support custom disk configurations, and Section 7 describes the loading operation and the organization of the CP/M-86 system file. ill Table of Contents 1 CP/M-86 System Overview 1.1 CP/M-86 General Characteristics CP/M-80 and CP/M-86 Differences 3 2 Command Setup and Execution Under CP/M CCP Built-in and Transient Commands Transient Proqram Execution Models The B080 Memory Model The Small Memory Model The Compact Memory Model Base Page Initialization Transient Program Load and Exit 14 3 Command (CMD) File Generation 3.1 Intel. Hex File Format Operation of GENCMD Operation of LMCMD Command (CMD) File Format 20 4 Basic Disk Operating System (BDOS) Functions 4.1 BDOS Parameters and Function Codes Simple BDOS Calls BDOS Pile Operations BDOS Memory Management and Load Basic I/O System (BIOS) Organization 5.1 Organization of the BIOS The BIOS Jump Vector Simple Peripheral Devices BIOS Subroutine Entry Points 60 6 BIOS Disk Definition Tables 6.1 Disk Parameter Table Format Table Generation Using GENDEF GENDEF Output CP/M-86 Bootstrap and Adaptation Procedures 7.1 The Cold Start Load Operation Organization of CPM.SYS 84 Appendixes A Blocking and Deblocking Algorithms B7 B Random Access Sample Program 95 C Listing of the Boot Rom 103 D LDBIOS Listing 113 E BIOS Listing 121 P CBIOS Listing 137 vi Section 1 CP/M-86 System Overview 1.1 CP/M-86 General Characteristics CP/M-86 contains all facilities of CP/M-80 with additional features to account for increased processor address space of up to a megabyte (1,048,576) of main memory. Further, CP/M-86 maintains file compatibility with all previous versions of CP/M. The file structure of version 2 of CP/M is used, allowing as many as sixteen drives with up to eight megabytes on each drive. Thus, CP/M-80 and CP/M-86 systems may exchange files without modifying the file format. CP/M-86 resides in the file CPM.SYS, which is loaded into memory by a cold start loader during system initialization. The cold start loader resides on the first two tracks of the system disk. CPM.SYS contains three program modules: the Console Command Processor (CCP), the Basic Disk Operating System (BDOS), and the user-configurable Basic I/O System (BIOS). The CCP and BDOS portions occupy approximately 10K bytes, while the size of the BIOS varies with the implementation. The operating system executes in any portion of memorv above the reserved interrupt locations, while the remainder of the address space is partitioned into as many as eight non-contiguous regions, as defined in a BIOS table. Unlike CP/M-80, the CCP area cannot be used as a data area subsequent to transient program load; all CP/M-86 modules remain in memory at all times, and are not reloaded at a warm start. Similar to CP/M-80, CP/M-86 loads and executes memory image files from disk. Memory image files are preceded by a header record, defined in this document, which provides information required for proper program loading and execution. Memory image files under CP/M-86 are identified by a CMD file tvpe. Unlike CP/M-80, CP/M-86 does not use absolute locations for system entry or default variables. The BDOS entry takes place through a reserved software interrupt, while entry to the BIOS is provided by a new BDOS call. Two variables maintained in low memory under CP/M-80, the default disk number and I/O Byte, are placed in the CCP and BIOS, respectively. Dependence upon absolute addresses is minimized in CP/M-86 by maintaining initial base page values, such as the default FCB and default command buffer, in the transient program data area. Utility programs such as ED, PIP, STAT and SUBMIT operate in the same manner under CP/M-86 and CP/M-80. In its ooeration, DDT-86 resembles DDT supplied with CP/M-80. It allows interactive debugging of 8086 and 8088 machine code. Similarly, ASM-86 allows assembly language programming and development for the 8086 and 8088 using Intel-like mnemonics. CP/M-86 System Guide 1.1 CP/M-86 General Characteristics The GENCMD (Generate CMD) utility replaces the LOAD program of CP/M-80, and converts the hex files produced by ASM-86 or Intel utilities into memory image format suitable for execution under CP/M-86. Further, the LDCOPY (Loader Copy) program replaces SYSGEN, and is used to copy the cold start loader from a system disk for replication. In addition, a variation of GENCMD, called LMCMD, converts output from the Intel LOC86 utility into CMD format. Finally, GENDEF (Generate DISKDEF) is orovided as an aid in producing custom disk parameter tables. ASM-86, GENCMD, LMCMD, and GENDEF are also supplied in COM file format for cross-development under CP/M-80. Several terms used throughout this manual are defined in Table 1-1 below: Term Table 1-1. CP/M-86 Terms Meaning Nibble Byte Word Double Word Paragraph Paragraph Boundary Segment Segment Register Offset Group Address 4-bit half-byte 8-bit value 16-bit value 32-bit value 16 contiguous bytes An address divisible evenly by 16 (low order nibble 0) Up to 64K contiguous bytes One of CS, DS, ES, or SS 16-bit displacement from a segment register A segment-register-relative relocatable program unit The effective memory address derived from the composition of a segment register value with an offset value A group consists of segments that are loaded into memory as a single unit. Since a group may consist of more than 64K bytes, it is the responsibility of the application program to manage segment registers when code or data beyond the first 64K segment is accessed. 2 CP/M-86 System Guide 1.1 CP/M-86 General Characteristics CP/M-86 supports eiqht program groups: the code, data, stack and extra groups as well as four auxiliary groups. When a code, data, stack or extra group is loaded, CP/M-86 sets the respective segment register (CS, DS, SS or ES) to the base of the group. CP/M- 86 can also load four auxiliary groups. A transient program manages the location of the auxiliary groups using values stored by CP/M-86 in the user's base page. 1.2 CP/M-80 and CP/M-86 Differences The structure of CP/M-86 is as close to CP/w-80 as possible in order to provide a familiar programming environment which allows application programs to be transported to the 8086 and 8088 processors with minimum effort. This section points out the specific differences between CP/M-80 and CP/M-86 in order to reduce your time in scanning this manual if you are already familiar with CP/M-80. The terms and concepts presented in this section are explained in detail throughout this manual, so you will need to refer to the Table of Contents to find relevant sections which provide specific definitions and information. Due to the nature of the 8086 processor, the fundamental difference between CP/M-80 and CP/M-86 is found in the management of the various relocatable groups. Although CP/M-80 references absolute memory locations by necessity, CP/M-86 takes advantage of the static relocation inherent in the 8086 processor. The operating system itself is usuallv loaded directly above the interrupt locations, at location 0400H, and relocatable transient programs load in the best fit memory region. However, you can load CP/M-86 into any portion of memory without changing the operating system (thus, there is no MOVCPM utility with CP/M-86), and transient programs will load and run in any non-reserved region. Three general memory models are presented below, but if you are converting 8080 programs to CP/M-86, you can use either the 8080 Model or Small Model and leave the Compact Model for later when your addressing needs increase. You'll use GENCMD, described in Section 3.2, to produce an executable program file from a hex file. GENCMn parameters allow you to specify which memory model your program requires. CP/M-86 itself is constructed as an 8080 Model. This means that all the segment registers are placed at the base of CP/M-86, and your customized BIOS is identical, in most respects, to that of CP/M-80 (with changes in instruction mnemonics, of course). In fact, the only additions are found in the SETDMAB, GETSEGB, SETIOB, and GETIOB entry points in the BIOS. Your warm start subroutine is simpler since you are not required to reload the CCP and BDOS under CP/M-86. One other point: if you implement the IOBYTE facility, you'll have to define the variable in your BIOS. Taking these changes into account, you need only perform a simple translation of your CP/M-80 BIOS into 8086 code in order to implement your 8086 BIOS. 3 CP/M-86 System Guide 1.2 CP/M-80 and CP/M-86 Differences If you've implemented CP/M-80 Version 2, you already have disk definition tables which will operate properly with CP/M-86. You may wish to attach different disk drives, or experiment with sector skew factors to increase performance. If so, you can use the new GENDEF utility which performs the same function as the DTSKDEF macro used by MAC under CP/M-80. You'll find, however, that GENDEF provides you with more information and checks error conditions better than the DISKDEF macro. Although generating a CP/M-86 system is generally easier than generating a CP/M-80 system, complications arise if you are using single-density floppy disks. CP/M-86 is too large to fit in the two-track system area of a single-density disk, so the bootstrap operation must perform two steps to load CP/M-86: first the bootstrap must load the cold start loader, then the cold start loader loads CP/M-86 from a system file. The cold start loader includes a LDBIOS which is identical to your CP/M-86 BIOS with the exception of the INIT entry point. You can simplify the LDBIOS if you wish because the loader need not write to the disk. If you have a double-density disk or reserve enough tracks on a single-density disk, you can load CP/M-86 without a two-step boot. To make a BDOS system call, use the reserved software interrupt #244. The -jump to the BDOS at location 0005 found in CP/M-80 is not present in CP/M-86. However, the address field at offset 0006 is present so that programs which size available memory using this word value will operate without change. CP/M-80 BDOS functions use certain 8080 registers for entry parameters and returned values. CP/M-86 BDOS functions use a table of corresponding 8086 registers. For example, the 8086 registers CH and CL correspond to the 8080 registers B and C. Look through the list of BDOS function numbers in Table 4-2. and you'll find that functions 0, 27, and 31 have changed slightly. Several new functions have been added, but they do not affect existing programs. One major philosophical difference is that in CP/M-80, all addresses sent to the BDOS are simply 16-bit values in the range OOOOH to OFFFFH. In CP/M-86, however, the addresses are really just 16-bit offsets from the DS (Data Segment) register which is set to the base of your data area. If you translate an existing CP/M-80 program to the CP/M-86 environment, your data segment will be less than 64K bytes. In this case, the DS register need not be changed following initial load, and thus all CP/M-80 addresses become simple DS-relative offsets in CP/M-86. Under CP/M-80, programs terminate in one of three ways: by returning directly to the CCP, by calling BDOS function 0, or by transferring control to absolute location OOOOH. CP/M-86, however, supports only the first two methods of program termination. This has the side effect of not providing the automatic disk system reset following the jump to OOOOH which, instead, is accomplished by entering a CONTROL-C at the CCP level. 4 CP/M-86 System Guide 1.2 CP/M-80 and CP/M-86 Differences You'll find many new facilities in CP/M-86 that will simplify your programming and expand your application programming capability. But, we've designed CP/M-86 to make it easy to get started: in short, if you are converting from CP/M-80 to CP/M-86, there will be no major changes beyond the translation to 8086 machine code. Further, programs you design for CP/M-86 are upward compatible with MP/M-86, our multitasking operating system, as well as CP/NET-86 which provides a distributed operating system in a network environment. All Information Presented Here is Proprietary 5 to Digital Research Section 2 Command Setup and Execution Under CP/M-86 This section discusses the operation of the Console Command Processor (CCP), the format of transient programs, CP/M-86 memory models, and memory image formats. 2.1 CCP Built-in and Transient Commands The operation of the CP/M-86 CCP is similar to that of CP/M-80. Upon initial cold start, the CP/M sign-on message is printed, drive A is automatically logged in, and the standard prompt is issued at the console. CP/M-86 then waits for inout command lines from the console, which may include one of the built-in commands DIR ERA REN TYPE USER (note that SAVE is not supported under CP/M-86 since the equivalent function is performed by DDT-86). Alternatively, the command line may begin with the name of a transient program with the assumed file type CMD denoting a command file. The CMD file type differentiates transient command files used under CP/M-86 from COM files which operate under CP/M-80. The CCP allows multiple programs to reside in memory, providing facilities for background tasks. A transient program such as a debugger may load additional programs for execution under its own control. Thus, for example, a background printer spooler could first be loaded, followed by an execution of DDT-86. DDT-86 may, in turn, load a test program for a debugging session and transfer control to the test program between breakpoints. CP/M-86 keeps account of the order in which programs are loaded and, upon encountering a CONTROL-C, discontinues execution of the most recent program activated at the CCP level. A CONTROL-C at the DDT-86 command level aborts DDT-86 and its test program. A second CONTROL- C at the CCP level aborts the background printer spooler. A third CONTROL-C resets the disk system. Note that program abort due to CONTROL-C does not reset the disk system, as is the case in CP/M-80. A disk reset does not occur unless the CONTROL-C occurs at the CCP command input level with no programs residing in memory. When CP/M-86 receives a request to load a transient program from the CCP or another transient program, it checks the program's memory requirements. If sufficient memorv is available, CP/M-86 assigns the required amount of memory to the program and loads the program. Once loaded, the program can request additional memory from the BDOS for buffer space. When the program is terminated, CP/M-86 frees both the program memory area and any additional buffer space. 7 CP/M-86 System Guide 2.2 Transient Program Execution Models 2.2 Transient Program Execution Models The initial values of the segment registers are determined by one of three memory models used by the transient program, and described in the CMD file header. The three memory models are summarized in Table 2-1 below. Model Table 2-1. CP/M-86 Memory Models Group Relationships 8080 Model Smal] Model Compact Model Code and Data Grouos Overlap Independent Code and Data Groups Three or More Independent Groups The 8080 Model supports orograms which are directly translated from CP/M-80 when code and data areas are intermixed. The 8080 model consists of one group which contains 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 application program during execution so that multiple segments within the code group can be addressed. The Small Model is similar to that defined by Intel, where the program consists of an independent code group and a data group. The Small Model is suitable for use by programs taken from CP/M-80 where code and data is easily separated. Note again that 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 program. Each group mav consist of one or more segments, but if any group exceeds one segment in size, or if auxiliary groups are present, then the application program must manage its own segment registers during execution in order to address all code and data areas. The three models differ primarily in the manner in which segment registers are initialized upon transient program loading. The operating system program load function determines the memory model used by a transient program by examining the program group usage, as described in the following sections. 8 CP/M-86 -System Guide 2.3 The 8080 Memory Model 2.3 The 8080 Memory Model The 8080 Model is assumed when the transient program contains only a code group. In this case, the CS, DS, and ES registers are initialized to the beginning of the code group, while the SS and SP registers remain set to a 96-byte stack area in the CCP. The Instruction Pointer Register (IP) is set to 100H, similar to CP/M- 80, thus allowing base page values
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks