OS-9 Operating System System Programmer’S Manual OS-9 Operating System: System Programmer’S Manual Copyright © 1980, 1982 by Microware Systems Corporation
Total Page:16
File Type:pdf, Size:1020Kb
OS-9 Operating System System Programmer’s Manual OS-9 Operating System: System Programmer’s Manual Copyright © 1980, 1982 by Microware Systems Corporation All rights reserved. This manual, the OS-9 Program, and any information contained herein is the copyrighted property of Microware Systems Corporation. Reproduction of this manual in part or whole by any means, electrical or otherwise, is prohibited, except by written permission from Microware Systems Corporation. The information contained herein is believed to be accurate as of the date of publication. However, Microware will not be liable for any damages, including indirect or consequential, related to use of the OS-9 Operating System or of this documentation. The information contained herein is subject to change without notice. Revision History Revision F-1 January 1983 Original Microware edition Revision G January 2003 Updated to reflect OS-9 Level 1 Version 1.2 Table of Contents 1. Introduction .......................................................................................................................1 History And Design Philosophy................................................................................1 System Hardware Requirements ...............................................................................2 2. Basic System Organization .............................................................................................3 3. Basic Functions of the Kernel.........................................................................................5 Kernel Service Request Processing ............................................................................5 Kernel Memory Management Functions..................................................................5 Memory Utilization......................................................................................................6 Overview of Multiprogramming ...............................................................................7 Process Creation ...........................................................................................................7 Process States ................................................................................................................8 The Active State ..................................................................................................8 The Wait State......................................................................................................8 The Sleeping State...............................................................................................8 Execution Scheduling ..................................................................................................8 Signals ............................................................................................................................9 Interrupt Processing...................................................................................................10 Physical Interrupt Processing .........................................................................10 Logical Interrupt Polling System....................................................................11 4. Memory Modules............................................................................................................13 Memory Module Structure .......................................................................................13 Module Header Definitions......................................................................................13 Type/Language Byte........................................................................................14 Executable Memory Module Format.......................................................................15 ROMed Memory Modules........................................................................................16 5. The OS-9 Unified Input/Output System ....................................................................17 The Input/Output Manager (IOMAN)...................................................................17 File Managers..............................................................................................................17 Device Driver Modules .............................................................................................18 Device Descriptor Modules ......................................................................................18 Path Descriptors .........................................................................................................20 6. Random Block File Manager ........................................................................................21 Logical and Physical Disk Organization.................................................................21 Identification Sector..........................................................................................21 Disk Allocation Map Sector ............................................................................22 File Descriptor Sectors .....................................................................................22 Directory Files ...................................................................................................23 RBFMAN Definitions of the Path Descriptor. ........................................................23 RBF Device Descriptor Modules..............................................................................24 RBF-type Device Drivers...........................................................................................25 RBFMAN Device Drivers..........................................................................................28 NAME: INIT......................................................................................................28 NAME: READ ...................................................................................................29 NAME: WRITE..................................................................................................29 NAME: GETSTA PUTSTA...............................................................................30 NAME: TERM ...................................................................................................31 NAME: IRQ SERVICE ROUTINE ..................................................................31 NAME: BOOT (Bootstrap Module)................................................................31 7. Sequential Character File Manager.............................................................................33 SCFMAN Line Editing Functions............................................................................33 SCFMAN Definitions of The Path Descriptor........................................................34 SCF Device Descriptor Modules ..............................................................................35 SCF Device Driver Storage Definitions...................................................................36 SCFMAN Device Driver Subroutines .....................................................................38 NAME: INIT......................................................................................................38 iii NAME: READ ...................................................................................................38 NAME: WRITE..................................................................................................39 NAME: GETSTA/SETSTA ..............................................................................39 NAME. TERM ...................................................................................................40 NAME: IRQ SERVICE ROUTINE ..................................................................40 8. Assembly Language Programming Techniques .......................................................43 How to Write Position-Independent Code.............................................................43 Addressing Variables and Data Structures.............................................................43 Stack Requirements....................................................................................................44 Interrupt Masks ..........................................................................................................44 Writing Interrupt-driven Device Drivers................................................................44 Using Standard I/O Paths ........................................................................................44 A Sample Program .....................................................................................................45 9. Adapting OS-9 to a New System .................................................................................47 Adapting OS-9 to Disk-based Systems ...................................................................47 Using OS-9 in ROM-based Systems ........................................................................47 Adapting the Initialization Module.........................................................................48 Adapting the SYSGO Module ..................................................................................49 10. OS-9 Service Request Descriptions...........................................................................51 F$AllBit - Set bits in an allocation bit map .............................................................51 F$Chain - Load and execute a new primary module............................................52 F$CmpNam - Compare two names.........................................................................53 F$CRC