
.op
.sp 15
.ce 100
.sh
CP/M-8000 \ 
.sp
.sh
Operating System
.sp
.sh
System Guide
.qs
.cs 5
.sp 10
Copyright \ \ 1983
.sp
Digital Research
P.O. Box 579
167 Central Avenue
Pacific Grove, CA 93950
(408) 649-3896
TWX 910 360 5001
.sp 4
All Rights Reserved
.ce 0
.bp
.po 17
.ll 50
.ce
COPYRIGHT
.sp
Copyright   1983 by Digital Research.  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, Post Office Box 579, Pacific
Grove, California, 93950.
.sp 4
.mb 4
.fm 1
.ce
DISCLAIMER
.sp
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.
.sp 4
.ce
TRADEMARKS
.sp
CP/M and CP/M-86 are registered trademarks of Digital Research.  CP/M-80,
CP/M-8000, DDT, and MP/M are trademarks of Digital Research.  Z80 and
Z8000 are trademarks of Zilog, Inc.  VAX/VMS is 
a trademark of Digital Equipment Corporation.  UNIX is a trademark of 
Bell Laboratories.  
.sp 6
The \c
.ul
CP/M-8000 Operating System System Guide \c
.qu  
was prepared using the Digital Research TEX Text Formatter and printed
in the United States of America.
.sp 2
.ce 3
********************************
*  First Edition:  March 1983  *
********************************
.in 0
.bp
.fi
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he 
.ft                            iii
.ce
.sh
FOREWORD
.sp 2
.fi
.pp 5
CP/M-8000 \ \ is a single-user general purpose operating system.  
It is designed for use with any disk-based computer using a Zilog Z8000 or 
compatible processor.  CP/M-8000 is modular in design, and can be modified to 
suit the needs of a particular installation.  
.pp
The hardware interface for a particular hardware environment is supported by 
the OEM or CP/M-8000 distributer.  Digital Research supports the user 
interface to CP/M-8000 as documented in the \c
.ul
CP/M-8000 Operating System User's Guide.\c
.qu
\  Digital Research does not support any additions or modifications made to 
CP/M-8000 by the OEM or distributer.
.sp 2
.sh
Purpose and Audience
.pp
This manual is intended to provide the information needed by a
systems programmer in adapting CP/M-8000 to a particular hardware
environment.   A substantial degree of programming expertise is
assumed on the part of the reader, and it is not expected that
typical users of CP/M-8000 will need or want to read this manual.
.sp 2
.sh
Prerequisites and Related Publications
.pp
In addition to this manual, the reader should be familiar with the
architecture of the Zilog Z8000 as described in the \c
.ul
Zilog 16-Bit Microprocessor User's Manual
.qu
(third edition), the \c
.ul
CP/M-8000 User's and Programmer's Guides,
.qu
and, of course, the details of the hardware environment where CP/M-8000 is 
to be implemented.
.sp 2
.sh
How This Book is Organized
.pp
Section 1 presents an overview of CP/M-8000 and describes its major 
components.  Section 2 discusses the adaptation of CP/M-8000 for your specific 
hardware system.  Section 3 discusses bootstrap procedures and related 
information.  Section 4 describes each BIOS function including entry 
parameters and return values.  Section 5 describes the process of creating a 
BIOS for a custom hardware interface.  Section 6 discusses approaches to 
debugging your BIOS.  Section 7 provides information on using the distributed 
version of CP/M-8000 if you have a ===???===   system.
.pp
Appendix A describes the contents of the CP/M-8000 distribution disks. 
Appendixes B, C, and D are listings of various BIOSes.  Appendix E 
contains a listing of the PUTBOOT utility program.  
.bp
.ft                                 iv
.sp 50
.bp
.cs 5
.mt 5
.mb 6
.pl 66
.ll 65
.po 10
.hm 2
.fm 2
.he 
.ft                                  v 
.nf
.bp
.ce
.sh
Table of Contents
.sp 3
.nf
.sh
1  System Overview  
.qs

		=== PAGE NUMBERS ARE TOTAL GARBAGE ===

   1.1  Introduction  . . . . . . . . . . . . . . . . . . . .   1 

   1.2  CP/M-8000 Organization . . . . . . . . . . . . . . . .   3 

   1.3  Memory Layout . . . . . . . . . . . . . . . . . . . .   3 

   1.4  Console Command Processor . . . . . . . . . . . . . .   4 

   1.5  Basic Disk Operating System (BDOS)  . . . . . . . . .   5 

   1.6  Basic I/O System (BIOS) . . . . . . . . . . . . . . .   5 

   1.7  I/O Devices . . . . . . . . . . . . . . . . . . . . .   5 

        1.7.1  Character Devices  . . . . . . . . . . . . . .   5 
        1.7.2  Character Devices  . . . . . . . . . . . . . .   5 

   1.8  System Generation and Cold Start Operation  . . . . .   6 
.sp 2
.sh
2  System Generation
.qs

   2.1  Overview  . . . . . . . . . . . . . . . . . . . . . .   7 

   2.2  Creating CPM.SYS  . . . . . . . . . . . . . . . . . .   7 

   2.3  Relocating Utilities  . . . . . . . . . . . . . . . .   8 
.sp 2
.sh
3  Bootstrap Procedures
.qs

   3.1  Bootstrapping Overview  . . . . . . . . . . . . . . .   9 

   3.2  Creating the Cold Boot Loader . . . . . . . . . . . .  10 

        3.2.1  Writing a Loader BIOS  . . . . . . . . . . . .  10 
        3.2.2  Building CPMLDR.SYS  . . . . . . . . . . . . .  11 
.sp 2
.sh
4  BIOS Functions 
.qs

   4.1  Introduction  . . . . . . . . . . . . . . . . . . . .  13 
   4.2	Memory Management Functions . . . . . . . . . . . . .  ??
.bp
.ft                                 vi
.ce 2
.sh
Table of Contents
.sp
.sh
(continued)
.qs
.sp 3
.sh
5  Creating a BIOS  
.qs

   5.1  Overview  . . . . . . . . . . . . . . . . . . . . . .  39 

   5.2  Disk Definition Tables  . . . . . . . . . . . . . . .  39 

        5.2.1  Disk Parameter Header  . . . . . . . . . . . .  40 
        5.2.2  Sector Translate Table . . . . . . . . . . . .  41 
        5.2.3  Disk Parameter Block . . . . . . . . . . . . .  42 

   5.3  Disk Blocking Guide . . . . . . . . . . . . . . . . .  45 

        5.3.1  A Simple Approach  . . . . . . . . . . . . . .  46
        5.3.2  Some Refinements . . . . . . . . . . . . . . .  46 
        5.3.3  Track Buffering  . . . . . . . . . . . . . . .  47 
        5.3.4  LRU Replacement  . . . . . . . . . . . . . . .  47 
        5.3.5  The New Block Flag . . . . . . . . . . . . . .  48 

   5.4  Memory Management Guide . . . . . . . . . . . . . . .  ??

.sp 2
.sh
6  Installing and Adapting the Distributed BIOS and CP/M-8000   
.qs

   6.1  Overview  . . . . . . . . . . . . . . . . . . . . . .  49 

   6.2  Booting on an ===???===  . . . . . . . . . . . . . . .  49 

   6.3  Bringing up CP/M-8000 Using ===???=== . . . . . .  50 
.sp 2
.sh
7  Cold Boot Automatic Command Execution  
.qs

   7.1  Overview  . . . . . . . . . . . . . . . . . . . . . .  51 

   7.2  Setting up Cold Boot Automatic Command Execution  . .  51
.sp 2
.sh
8  The PUTBOOT Utility  
.qs

   8.1  PUTBOOT Operation . . . . . . . . . . . . . . . . . .  53 

   8.2  Invoking PUTBOOT  . . . . . . . . . . . . . . . . . .  53 
.bp
.ft                                 vii
.ce
.sh
Appendixes
.qs
.sp 3
.sh
A  \c
.qs
Contents of Distribution Disks . . . . . . . . . . . . . .  55 
.sp 2
.sh
B  \c
.qs
Sample BIOS Written in C . . . . . . . . .  59
.sp 2
.sh
C  \c
.qs
Dual-Processor Z8001 BIOS written in C  . . . . .  67
.sp 2
.sh
D  \c
.qs
Dual-Processor Z8002 BIOS Written in C . . . . . . . . . . . . . . . .  73
.sp 2
.sh
E  \c
.qs
PUTBOOT Utility Assembly Language Source . . . . . . . . . 101
.sp 2
.sh
F  \c
.qs
CP/M-8000 Error Messages  . . . . . . . . . . . . . . . . . 109 
.bp
.ft                                viii
.ce
.sh
Tables and Figures
.qs
.sp 3
.sh
Tables
.qs
.sp
     1-1.  CP/M-8000 Terms . . . . . . . . . . . . . . . . . .   1
.sp
     4-1.  BIOS Register Usage  . . . . . . . . . . . . . . .  14
     4-2.  BIOS Functions . . . . . . . . . . . . . . . . . .  14
     4-3.  CP/M-8000 Logical Device Characteristics  . . . . .  33
     4-4.  I/O Byte Field Definitions . . . . . . . . . . . .  34
.sp
     5-1.  Disk Parameter Header Elements . . . . . . . . . .  40
     5-2.  Disk Parameter Block Fields  . . . . . . . . . . .  42
     5-3.  BSH and BLM Values . . . . . . . . . . . . . . . .  44
     5-4.  EXM Values . . . . . . . . . . . . . . . . . . . .  45
.sp
     A-1.  Distribution Disk Contents . . . . . . . . . . . .  55
.sp
     F-1.  CP/M-8000 Error Messages  . . . . . . . . . . . . . 109
.sp 2
.sh
Figures
.qs
.sp
     1-1.  CP/M-8000 Interfaces  . . . . . . . . . . . . . . .   3
     1-2.  Typical CP/M-8000 Memory Layout . . . . . . . . . .   4
.sp
     4-1.  Memory Region Table Format . . . . . . . . . . . .  32
     4-2.  I/O Byte Fields  . . . . . . . . . . . . . . . . .  34
.sp  
     5-1.  Disk Parameter Header  . . . . . . . . . . . . . .  40
     5-2.  Sample Sector Translate Table  . . . . . . . . . .  42
     5-3.  Disk Parameter Block . . . . . . . . . . . . . . .  42
.fi
.nx one

