Mercurial > hg > Members > kono > nitros9-code
comparison docs/os9sysprog/os9sysprog.docbook @ 20:364868eddbc7
Changed literallayout to tables a few places
Chapter 10 has an extra level
Changed a lot of places where commas ended senctences.
author | roug |
---|---|
date | Fri, 05 Apr 2002 23:55:08 +0000 |
parents | 2caf0658040d |
children | 39077ffa964d |
comparison
equal
deleted
inserted
replaced
19:2caf0658040d | 20:364868eddbc7 |
---|---|
17 herein is the copyrighted property of Microware Systems Corporation. | 17 herein is the copyrighted property of Microware Systems Corporation. |
18 Reproduction of this manual in part or whole by any means, electrical | 18 Reproduction of this manual in part or whole by any means, electrical |
19 or otherwise, is prohibited, ecept by written permission from | 19 or otherwise, is prohibited, ecept by written permission from |
20 Microware Systems Corporation.</para> | 20 Microware Systems Corporation.</para> |
21 <para>The information contained herein is believed to be accurate as of | 21 <para>The information contained herein is believed to be accurate as of |
22 the date of publication, however, Microware will not be liable for | 22 the date of publication. however, Microware will not be liable for |
23 any damages, including indirect or consequential, related to use of | 23 any damages, including indirect or consequential, related to use of |
24 the OS-9 Operating System or of this documentation. The information | 24 the OS-9 Operating System or of this documentation. The information |
25 contained herein is subject to change without notice.</para> | 25 contained herein is subject to change without notice.</para> |
26 </legalnotice> | 26 </legalnotice> |
27 <revhistory> | 27 <revhistory> |
62 required to support BASIC09 and similar high- performance 6809 | 62 required to support BASIC09 and similar high- performance 6809 |
63 software, OS-9's design was modeled after Bell Telephone | 63 software, OS-9's design was modeled after Bell Telephone |
64 Laboratories' "UNIX" operating system, which is becoming | 64 Laboratories' "UNIX" operating system, which is becoming |
65 widely recognized as a standard for mini and micro multiprogramming | 65 widely recognized as a standard for mini and micro multiprogramming |
66 operating systems because of its versatility and relatively simple, | 66 operating systems because of its versatility and relatively simple, |
67 yet elegant structure, Even though a "clone" of UNIX for | 67 yet elegant structure. Even though a "clone" of UNIX for |
68 the 6809 is relatively easy to implement, there are a number of | 68 the 6809 is relatively easy to implement, there are a number of |
69 problems with this approach, UNIX was designed for fairly large-scale | 69 problems with this approach, UNIX was designed for fairly large-scale |
70 minicomputers (such as large PDP-11s) that have high CPU throughput, | 70 minicomputers (such as large PDP-11s) that have high CPU throughput, |
71 large fast disk storage devices and a static I/O environment, Also, | 71 large fast disk storage devices and a static I/O environment. Also, |
72 UNIX is not particularly time or disk-storage efficient, especially | 72 UNIX is not particularly time or disk-storage efficient, especially |
73 when used with low-cost disk drives.</para> | 73 when used with low-cost disk drives.</para> |
74 <para>For these reasons, OS-9 was designed to retain the overall concept | 74 <para>For these reasons, OS-9 was designed to retain the overall concept |
75 and user interface of UNIX, but its implementation is considerably | 75 and user interface of UNIX, but its implementation is considerably |
76 different, OS-Vs design is tailored to typical microcomputer | 76 different. OS-Vs design is tailored to typical microcomputer |
77 performance ranges and operational environments, As an example, OS-9, | 77 performance ranges and operational environments. As an example, OS-9, |
78 unlike UNIX, does not dynamically swap running programs on and off | 78 unlike UNIX, does not dynamically swap running programs on and off |
79 disk This is because floppy disks and many lower-cost Winchester-type | 79 disk This is because floppy disks and many lower-cost Winchester-type |
80 hard disks are simply too slow to do this efficiently. Instead, OS-9 | 80 hard disks are simply too slow to do this efficiently. Instead, OS-9 |
81 always keeps running programs in memory and emphasizes more efficient | 81 always keeps running programs in memory and emphasizes more efficient |
82 use of available ROM or RAM</para> | 82 use of available ROM or RAM</para> |
85 microprocessors, such as support of reentrant, position- independent | 85 microprocessors, such as support of reentrant, position- independent |
86 software that can be shared by several users simultaneously to reduce | 86 software that can be shared by several users simultaneously to reduce |
87 overall memory requirements</para> | 87 overall memory requirements</para> |
88 <para>Perhaps the most innovative part of OS-9 is its "memory | 88 <para>Perhaps the most innovative part of OS-9 is its "memory |
89 module" management system, which provides extensive support for | 89 module" management system, which provides extensive support for |
90 modular Software, particularly ROMed software, This will play an | 90 modular Software, particularly ROMed software. This will play an |
91 increasingly important role in the future as a method of reducing | 91 increasingly important role in the future as a method of reducing |
92 software costs, The memory module" and LINE capabilities of OS- | 92 software costs. The memory module" and LINE capabilities of OS- |
93 9 permit modules to be automatically identified, linked together, | 93 9 permit modules to be automatically identified, linked together, |
94 shared, updated or repaired, Individual modules in ROM which are | 94 shared, updated or repaired. Individual modules in ROM which are |
95 defective may be repaired (without reprogramming the ROM) by placing | 95 defective may be repaired (without reprogramming the ROM) by placing |
96 a "fixed module,with the same name, but a higher revision number | 96 a "fixed module,with the same name, but a higher revision number |
97 into memory. Memory modules have many other advantages, for example, | 97 into memory. Memory modules have many other advantages, for example, |
98 OS-9 can allow several programs to share a common math subroutine | 98 OS-9 can allow several programs to share a common math subroutine |
99 module, The same module could automatically be replaced with a module | 99 module. The same module could automatically be replaced with a module |
100 containing drivers for a hardware arithmetic processor without any | 100 containing drivers for a hardware arithmetic processor without any |
101 change to the programs which call. the module</para> | 101 change to the programs which call. the module</para> |
102 <para>Users experienced with UNIX should have little difficulty adapting | 102 <para>Users experienced with UNIX should have little difficulty adapting |
103 to OS-9. Here are some of the main differences between the two | 103 to OS-9. Here are some of the main differences between the two |
104 systems: | 104 systems: |
105 </para> | 105 </para> |
106 <orderedlist numeration="arabic"> | 106 <orderedlist numeration="arabic"> |
107 <listitem><para>OS-9 is written in 6809 assembly language, not C, This | 107 <listitem><para>OS-9 is written in 6809 assembly language, not C. This |
108 improves program size and speed characteristics</para></listitem> | 108 improves program size and speed characteristics</para></listitem> |
109 <listitem><para>OS-9 was designed for a mixed RAM/ROM microcomputer memory | 109 <listitem><para>OS-9 was designed for a mixed RAM/ROM microcomputer memory |
110 environment and more effectively supports reentrant, | 110 environment and more effectively supports reentrant, |
111 position-independent code.</para></listitem> | 111 position-independent code.</para></listitem> |
112 <listitem><para>OS-9 introduces the "memory module" concept for | 112 <listitem><para>OS-9 introduces the "memory module" concept for |
123 <para>The OS-9 Operating system consists of building blocks called | 123 <para>The OS-9 Operating system consists of building blocks called |
124 memory modules, which are automatically located and linked together | 124 memory modules, which are automatically located and linked together |
125 when the system starts up. This makes it extremely easy to | 125 when the system starts up. This makes it extremely easy to |
126 reconfigure the system. For example, reconfiguring the system to | 126 reconfigure the system. For example, reconfiguring the system to |
127 handle additional devices is simply a matter of placing the | 127 handle additional devices is simply a matter of placing the |
128 corresponding modules into memory, Because OS-9 is so flexible, the | 128 corresponding modules into memory. Because OS-9 is so flexible, the |
129 minimum hardware requirements are difficult to define, A bare-bones | 129 minimum hardware requirements are difficult to define. A bare-bones |
130 LEVEL I system requires 4K of ROM and 25 of RAM, which may be | 130 LEVEL I system requires 4K of ROM and 25 of RAM, which may be |
131 expanded to 56K RAM</para> | 131 expanded to 56K RAM</para> |
132 <para>Shown below are the requirements for a typical OS-9 software | 132 <para>Shown below are the requirements for a typical OS-9 software |
133 development system. Actual hardware requirements may vary depending | 133 development system. Actual hardware requirements may vary depending |
134 upon the particular application.</para> | 134 upon the particular application.</para> |
147 <listitem><para>Optional printer using serial or parallel interface.</para></listitem> | 147 <listitem><para>Optional printer using serial or parallel interface.</para></listitem> |
148 <listitem><para>Optional real-time clock hardware.</para></listitem> | 148 <listitem><para>Optional real-time clock hardware.</para></listitem> |
149 </itemizedlist> | 149 </itemizedlist> |
150 <para>I/O device controller addresses can be located anywhere in the | 150 <para>I/O device controller addresses can be located anywhere in the |
151 memory space, however it is good practice to place them as high as | 151 memory space, however it is good practice to place them as high as |
152 possible to maximize RAM expansion capability, Standard | 152 possible to maximize RAM expansion capability. Standard |
153 Microware-supplied OS-9 packages for computers made by popular | 153 Microware-supplied OS-9 packages for computers made by popular |
154 manufacturers usually conform to the system's customary memory map</para> | 154 manufacturers usually conform to the system's customary memory map</para> |
155 </sect1> | 155 </sect1> |
156 </chapter> | 156 </chapter> |
157 <chapter> | 157 <chapter> |
158 <title>BASIC SYSTEM ORGANIZATION</title> | 158 <title>BASIC SYSTEM ORGANIZATION</title> |
159 <para>OS-9 is composed of a group of modules, each of which provides | 159 <para>OS-9 is composed of a group of modules, each of which provides |
160 specific functions, When OS-9 is configured for a specific system | 160 specific functions. When OS-9 is configured for a specific system |
161 various modules are selected to provide a given level of | 161 various modules are selected to provide a given level of |
162 functionality, For example, a small. control computer without a disk | 162 functionality. For example, a small. control computer without a disk |
163 does not need the disk-related OS-9 modules, Most examples in this | 163 does not need the disk-related OS-9 modules. Most examples in this |
164 manual describe a fully-configured OS-9 system.</para> | 164 manual describe a fully-configured OS-9 system.</para> |
165 <para>OS-9 COMPONENT MODULE ORGANIZATION</para> | 165 <para>OS-9 COMPONENT MODULE ORGANIZATION</para> |
166 <para>(Figure here)</para> | 166 <para>(Figure here)</para> |
167 <para>RBF Device Descriptors SCF Device Descriptors</para> | 167 <para>RBF Device Descriptors SCF Device Descriptors</para> |
168 <para>Notice that the diagram on the previous page indicates a | 168 <para>Notice that the diagram on the previous page indicates a |
169 multilevel organization.</para> | 169 multilevel organization.</para> |
170 <para>The first level is the KERNEL and the CLOCK MODULE, The kernel | 170 <para>The first level is the KERNEL and the CLOCK MODULE. The kernel |
171 provide basic system services such as multitasking, memory | 171 provide basic system services such as multitasking, memory |
172 management, and links all other system modules, The CLOCK module is a | 172 management, and links all other system modules. The CLOCK module is a |
173 software handler for the specific real-time-clock hardware, INIT is | 173 software handler for the specific real-time-clock hardware. INIT is |
174 an initialization table used by the kernel during system startup. It | 174 an initialization table used by the kernel during system startup. It |
175 specifies initial table sizes, initial system device names, etc.</para> | 175 specifies initial table sizes, initial system device names, etc.</para> |
176 <para>The second level. is the Input/Output Manager. If provides common | 176 <para>The second level. is the Input/Output Manager. If provides common |
177 processing all I/o operations. It is required if any OS-supported I/O | 177 processing all I/o operations. It is required if any OS-supported I/O |
178 is to be performed.</para> | 178 is to be performed.</para> |
179 <para>The third level. is the rile Manager level, File managers perform | 179 <para>The third level. is the rile Manager level. File managers perform |
180 I/o request processing for similar classes of I/O devices, The Random | 180 I/o request processing for similar classes of I/O devices. The Random |
181 Block File Manager (R.BFMAN) processes all disk-type device | 181 Block File Manager (R.BFMAN) processes all disk-type device |
182 functions, and the Sequential Character File Manager (SCFMAN) handles | 182 functions, and the Sequential Character File Manager (SCFMAN) handles |
183 all non-mass storage devices that basically operate a character at a | 183 all non-mass storage devices that basically operate a character at a |
184 time, such as terminals and printers, The user can add additional. | 184 time, such as terminals and printers. The user can add additional. |
185 File Managers to handle classes of devices not covered by SCFMAN or | 185 File Managers to handle classes of devices not covered by SCFMAN or |
186 RBFMAN.</para> | 186 RBFMAN.</para> |
187 <para>The fourth level is the Device Driver Level, Device drivers handle | 187 <para>The fourth level is the Device Driver Level. Device drivers handle |
188 basic physical I/O functions for specific I/O controller hardware, | 188 basic physical I/O functions for specific I/O controller hardware, |
189 Standard OS-9 systems are typically supplied with a disk driver, a | 189 Standard OS-9 systems are typically supplied with a disk driver, a |
190 ACIA driver for terminals and serial printers, and a PIA driver for | 190 ACIA driver for terminals and serial printers, and a PIA driver for |
191 parallel printers, Many users add customized drivers of their own | 191 parallel printers. Many users add customized drivers of their own |
192 design or purchased from a hardware vendor.</para> | 192 design or purchased from a hardware vendor.</para> |
193 <para>The fifth level is the Device Descriptor Level, These modules are | 193 <para>The fifth level is the Device Descriptor Level. These modules are |
194 small tables that are associate specific I/O ports with their logical | 194 small tables that are associate specific I/O ports with their logical |
195 names, and the port's device driver and file manager, They also | 195 names, and the port's device driver and file manager. They also |
196 contain the physical. address of the port and initialization data. By | 196 contain the physical. address of the port and initialization data. By |
197 use of device descriptors, only one copy of each driver is required | 197 use of device descriptors, only one copy of each driver is required |
198 for each specific type of I/O controller regardless of how many | 198 for each specific type of I/O controller regardless of how many |
199 controllers the system uses.</para> | 199 controllers the system uses.</para> |
200 <para>One important component not shown is the Shell., which is the | 200 <para>One important component not shown is the Shell., which is the |
201 command interpreter, It is technically a program and not part of the | 201 command interpreter. It is technically a program and not part of the |
202 operating system itself, and is described fully in the OS-9 Users | 202 operating system itself, and is described fully in the OS-9 Users |
203 Manual.</para> | 203 Manual.</para> |
204 <para>Even though all modules can be resident in ROM, generally only the | 204 <para>Even though all modules can be resident in ROM, generally only the |
205 KERNEL and INIT modules are ROMed in disk-based systems, All. other | 205 KERNEL and INIT modules are ROMed in disk-based systems. All. other |
206 modules are loaded into RAM during system Startup by a disk bootstrap | 206 modules are loaded into RAM during system Startup by a disk bootstrap |
207 module (not shown on diagram) which is also resident in ROM.</para> | 207 module (not shown on diagram) which is also resident in ROM.</para> |
208 </chapter> | 208 </chapter> |
209 <chapter> | 209 <chapter> |
210 <title>BASIC FUNCTIONS OF THE KERNEL</title> | 210 <title>BASIC FUNCTIONS OF THE KERNEL</title> |
234 table sizes and system device names.</para> | 234 table sizes and system device names.</para> |
235 <sect1> | 235 <sect1> |
236 <title>KERNEL SERVICE REQUEST PROCESSING</title> | 236 <title>KERNEL SERVICE REQUEST PROCESSING</title> |
237 <para>Service requests (system calls) are used to communicate between | 237 <para>Service requests (system calls) are used to communicate between |
238 OS-9 and assembly-language-level. programs for such things as | 238 OS-9 and assembly-language-level. programs for such things as |
239 allocating memory, creating new processes, etc, System calls use the | 239 allocating memory, creating new processes, etc. System calls use the |
240 SWI2 instruction followed by a constant byte representing the code, | 240 SWI2 instruction followed by a constant byte representing the code, |
241 Parameters for system calls are usually passed in MPU registers, | 241 Parameters for system calls are usually passed in MPU registers, |
242 ...In addition to I/O and memory management functions, there are | 242 ...In addition to I/O and memory management functions, there are |
243 other service request functions including interprocess control and | 243 other service request functions including interprocess control and |
244 timekeeping.</para> | 244 timekeeping.</para> |
245 <para>A system-wide assembly la;guaqe equate file called OS9Defs defines | 245 <para>A system-wide assembly la;guaqe equate file called OS9Defs defines |
246 symbolic names for all. service requests, This file is included when | 246 symbolic names for all. service requests. This file is included when |
247 assembling hand-written or compiler-generated code. The OS-9 | 247 assembling hand-written or compiler-generated code. The OS-9 |
248 Assembler has a built-in macro to generate system calls, for example:</para> | 248 Assembler has a built-in macro to generate system calls, for example:</para> |
249 <para>OSS I$READ | 249 <para>OSS I$READ |
250 </para> | 250 </para> |
251 <para>is recongnized and assembled as the equivalent to:</para> | 251 <para>is recongnized and assembled as the equivalent to:</para> |
253 </para> | 253 </para> |
254 <para>FCB I$READ | 254 <para>FCB I$READ |
255 </para> | 255 </para> |
256 <para>Service requests are divided into two categories:</para> | 256 <para>Service requests are divided into two categories:</para> |
257 <para>I/O REQUESTS perform various input/output functions. Requests of | 257 <para>I/O REQUESTS perform various input/output functions. Requests of |
258 this type are passed by the kernel ot 1014AM for processing, The | 258 this type are passed by the kernel ot 1014AM for processing. The |
259 Symbolic names for this category have a "I$ prefix, for example, | 259 Symbolic names for this category have a "I$ prefix, for example, |
260 the "read service request is called "I$READ".</para> | 260 the "read service request is called "I$READ".</para> |
261 <para>FUNCTION REQUESTS perform memory management, multiprogramming, and | 261 <para>FUNCTION REQUESTS perform memory management, multiprogramming, and |
262 miscellaneous functions, Most are processed by the kernel. The | 262 miscellaneous functions. Most are processed by the kernel. The |
263 symbolic names for this category begins with "F$. | 263 symbolic names for this category begins with "F$. |
264 </para> | 264 </para> |
265 </sect1> | 265 </sect1> |
266 <sect1> | 266 <sect1> |
267 <title>KERNEL MEMORY MANAGEMENT FUNCTIONS</title> | 267 <title>KERNEL MEMORY MANAGEMENT FUNCTIONS</title> |
270 the logical contents of memory, by using entities called "memory | 270 the logical contents of memory, by using entities called "memory |
271 modules". All programs are loaded in memory module format, | 271 modules". All programs are loaded in memory module format, |
272 allowing OS-9 to maintain a directory which contains the name, | 272 allowing OS-9 to maintain a directory which contains the name, |
273 address, and other related information about each module in memory, | 273 address, and other related information about each module in memory, |
274 These structures are the foundation of OS-9's modular software | 274 These structures are the foundation of OS-9's modular software |
275 environment, Some of its advantages are: automatic run-time "linking" | 275 environment. Some of its advantages are: automatic run-time "linking" |
276 of programs to libraries of utility modules; automatic "sharing" | 276 of programs to libraries of utility modules; automatic "sharing" |
277 of reentrant programs; replacement of small sections of large | 277 of reentrant programs; replacement of small sections of large |
278 programs for update or correction (even when in ROM); etc</para> | 278 programs for update or correction (even when in ROM); etc</para> |
279 </sect1> | 279 </sect1> |
280 <sect1> | 280 <sect1> |
281 <title>MEMORY UTILIZATION</title> | 281 <title>MEMORY UTILIZATION</title> |
282 <para>All usable RAM memory must be contiguous from address 0 upward, | 282 <para>All usable RAM memory must be contiguous from address 0 upward, |
283 During the OS-9 start-up sequence the upper bound of RAM is detemined | 283 During the OS-9 start-up sequence the upper bound of RAM is detemined |
284 by an automatic search, or from the configuration module, Some RAM is | 284 by an automatic search, or from the configuration module. Some RAM is |
285 reserved by OS-9 for its own data structures at the top and bottom of | 285 reserved by OS-9 for its own data structures at the top and bottom of |
286 memory, The exact amount depends on the sizes of system tables that | 286 memory. The exact amount depends on the sizes of system tables that |
287 are specified in the configuration module</para> | 287 are specified in the configuration module</para> |
288 <para>All other RAM memory is pooled into a "free memory" | 288 <para>All other RAM memory is pooled into a "free memory" |
289 space. Memory space is dynamically taken from and returned to this | 289 space. Memory space is dynamically taken from and returned to this |
290 pool as it is allocated or deallocated for various purposes. The | 290 pool as it is allocated or deallocated for various purposes. The |
291 basic unit of memory allocation is the 256-byte page , Memory is | 291 basic unit of memory allocation is the 256-byte page . Memory is |
292 always allocated in whole numbers of pages</para> | 292 always allocated in whole numbers of pages</para> |
293 <para>The data structure used to keep track of memory allocation is a | 293 <para>The data structure used to keep track of memory allocation is a |
294 32-byte bit-map located at addresses $0100 - $OIIF. Each bit in this | 294 32-byte bit-map located at addresses $0100 - $OIIF. Each bit in this |
295 table is associated with a specific page of memory, Bits are cleared | 295 table is associated with a specific page of memory. Bits are cleared |
296 to indicate that the page is free and available for assignment, or | 296 to indicate that the page is free and available for assignment, or |
297 set to indicate that the page is in use or that no RAM memory is | 297 set to indicate that the page is in use or that no RAM memory is |
298 present at that address</para> | 298 present at that address</para> |
299 <para>Automatic memory allocation occurs when: | 299 <para>Automatic memory allocation occurs when: |
300 </para> | 300 </para> |
301 <para>1, Program modules are loaded into RAM</para> | 301 <para>1. Program modules are loaded into RAM</para> |
302 <para>2, Processes are created</para> | 302 <para>2. Processes are created</para> |
303 <para>3. Processes request additional RAM</para> | 303 <para>3. Processes request additional RAM</para> |
304 <para>4, OS-9 needs I/O buffers, larger tables, etc</para> | 304 <para>4. OS-9 needs I/O buffers, larger tables, etc</para> |
305 <para>All of the above usually have inverse functions that cause | 305 <para>All of the above usually have inverse functions that cause |
306 previously allocated memory to be deallocated and returned to the | 306 previously allocated memory to be deallocated and returned to the |
307 tree memory pool</para> | 307 tree memory pool</para> |
308 <para>In general, memory is allocated for program modules and buffers | 308 <para>In general, memory is allocated for program modules and buffers |
309 frotr high addresses downward, and for process data areas from lower | 309 frotr high addresses downward, and for process data areas from lower |
350 AND DIRECT RAGE | 350 AND DIRECT RAGE |
351 $0000 BEGINNING OF RAM | 351 $0000 BEGINNING OF RAM |
352 MEMORY | 352 MEMORY |
353 </literallayout> | 353 </literallayout> |
354 <para> | 354 <para> |
355 The map above is for a "typical system, Actual memory | 355 The map above is for a "typical system. Actual memory |
356 sizes and addresses may vary depending on the exact system | 356 sizes and addresses may vary depending on the exact system |
357 configuration.</para> | 357 configuration.</para> |
358 </sect1> | 358 </sect1> |
359 <sect1> | 359 <sect1> |
360 <title>OVERVIEW OF MULTIPROGRAMMING</title> | 360 <title>OVERVIEW OF MULTIPROGRAMMING</title> |
361 <para>OS-9 is a multiprogramming operating system, which allows several | 361 <para>OS-9 is a multiprogramming operating system, which allows several |
362 independent programs called "processes" can be executed | 362 independent programs called "processes" can be executed |
363 simultaneously. Each process can have access to any system resource | 363 simultaneously. Each process can have access to any system resource |
364 by issuing appropriate service requests to OS-9, Multiprogramming | 364 by issuing appropriate service requests to OS-9. Multiprogramming |
365 functions use a hardware real-time clock that generates interrupts at | 365 functions use a hardware real-time clock that generates interrupts at |
366 a regular rate of about 10 times per second, MPU time is therefore | 366 a regular rate of about 10 times per second. MPU time is therefore |
367 divided into periods typically 100 milliseconds in duration, This | 367 divided into periods typically 100 milliseconds in duration. This |
368 basic time unit is called a tick , Processes that are "active | 368 basic time unit is called a tick . Processes that are "active |
369 (meaning not waiting for some event) are run for a specific | 369 (meaning not waiting for some event) are run for a specific |
370 system-assigned period called a "time slice", The duration of | 370 system-assigned period called a "time slice". The duration of |
371 the time slice depends on a process's priority value relative to the | 371 the time slice depends on a process's priority value relative to the |
372 priority of all other active processes, Many OS-9 service requests | 372 priority of all other active processes. Many OS-9 service requests |
373 are available to create, terminate, and control processes</para> | 373 are available to create, terminate, and control processes</para> |
374 </sect1> | 374 </sect1> |
375 <sect1> | 375 <sect1> |
376 <title>PROCESS CREATION</title> | 376 <title>PROCESS CREATION</title> |
377 <para>New processes are created when an existing process executes a fork | 377 <para>New processes are created when an existing process executes a fork |
378 service request, Its main argument is the name of the program module | 378 service request. Its main argument is the name of the program module |
379 (called the "primary module ) that the new process is to | 379 (called the "primary module ) that the new process is to |
380 initially execute, OS-9 first attempts to find the module in the | 380 initially execute. OS-9 first attempts to find the module in the |
381 "module directory , which includes the names of all program | 381 "module directory , which includes the names of all program |
382 modules already present in memory, If the module cannot be found | 382 modules already present in memory. If the module cannot be found |
383 there, OS-9 usually attempts to load into memory a mass-storage file | 383 there. OS-9 usually attempts to load into memory a mass-storage file |
384 using the requested module name as a file name</para> | 384 using the requested module name as a file name</para> |
385 <para>Once the module has been located, a data structure called a | 385 <para>Once the module has been located, a data structure called a |
386 "process descriptor is assigned to the new process, The process | 386 "process descriptor is assigned to the new process. The process |
387 descriptor is a 64-byte package that contains information about the | 387 descriptor is a 64-byte package that contains information about the |
388 process, its state, memory allocations, priority, queue pointers, | 388 process, its state, memory allocations, priority, queue pointers, |
389 etc. The process descriptor is automatically initialized and | 389 etc. The process descriptor is automatically initialized and |
390 maintained by OS-9, The process itself has no need, and is not | 390 maintained by OS-9. The process itself has no need, and is not |
391 permitted to access the descriptor</para> | 391 permitted to access the descriptor</para> |
392 <para>The next step in the creation of a new process is allocation of | 392 <para>The next step in the creation of a new process is allocation of |
393 data storace (RAM) memory for the process, The primary module's | 393 data storace (RAM) memory for the process. The primary module's |
394 header contains a storage size value that is used unless the "fork | 394 header contains a storage size value that is used unless the "fork |
395 system call requested an optionally larger size. OS-9 then attempts | 395 system call requested an optionally larger size. OS-9 then attempts |
396 to allocate a CONTIGUOUS memory area of this size from the free | 396 to allocate a CONTIGUOUS memory area of this size from the free |
397 memory space</para> | 397 memory space</para> |
398 <para>If any of the previous steps cannot be performed, creation of the | 398 <para>If any of the previous steps cannot be performed, creation of the |
399 new process is aborted, and the process that originated the "fork | 399 new process is aborted, and the process that originated the "fork |
400 is informed of the error, Otherwise, the new process is added to the | 400 is informed of the error. Otherwise, the new process is added to the |
401 active process queue for execution scheduling</para> | 401 active process queue for execution scheduling</para> |
402 <para>The new process is also assigned a unique number called a "process | 402 <para>The new process is also assigned a unique number called a "process |
403 ID which is used as its identifier, Other processes can | 403 ID which is used as its identifier. Other processes can |
404 </para> | 404 </para> |
405 <para>commnunciate with it by referring to its ID in various system | 405 <para>commnunciate with it by referring to its ID in various system |
406 calls, The process also has associated with it a "user ID which | 406 calls. The process also has associated with it a "user ID which |
407 is used to identify all. processes and files belonging to a | 407 is used to identify all. processes and files belonging to a |
408 particular user, The user ID is inherited from the parent process,</para> | 408 particular user. The user ID is inherited from the parent process,</para> |
409 <para>Processes terminate when they execute an "EXIT system service | 409 <para>Processes terminate when they execute an "EXIT system service |
410 request, or when they receive fatal signals, The process termination | 410 request, or when they receive fatal signals. The process termination |
411 closes any open paths, deallocates its memory, and unlinks its | 411 closes any open paths, deallocates its memory, and unlinks its |
412 primary module.</para> | 412 primary module.</para> |
413 </sect1> | 413 </sect1> |
414 <sect1> | 414 <sect1> |
415 <title>PROCESS STATES</title> | 415 <title>PROCESS STATES</title> |
416 <para>At any instant, a process can be in one of three states:</para> | 416 <para>At any instant, a process can be in one of three states:</para> |
417 <para>ACTIVE - The process is active and ready for execution, | 417 <para>ACTIVE - The process is active and ready for execution. |
418 </para> | 418 </para> |
419 <para>WAITING - The process is suspended until a child process | 419 <para>WAITING - The process is suspended until a child process |
420 terminates or a signal is received, | 420 terminates or a signal is received. |
421 </para> | 421 </para> |
422 <para>SLEEPING - The process is suspended for a specific period of time | 422 <para>SLEEPING - The process is suspended for a specific period of time |
423 or until. a signal is received, | 423 or until. a signal is received. |
424 </para> | 424 </para> |
425 <para>There is a queue for each process state, The queue is a linked | 425 <para>There is a queue for each process state. The queue is a linked |
426 list of the "process descriptors of processes in the | 426 list of the "process descriptors of processes in the |
427 corresponding state, State changes are performed by moving a process | 427 corresponding state. State changes are performed by moving a process |
428 descriptor to another queue.</para> | 428 descriptor to another queue.</para> |
429 <sect2> | 429 <sect2> |
430 <title>The Active State</title> | 430 <title>The Active State</title> |
431 <para>This state includes all "runnabl.e processes, which are given | 431 <para>This state includes all "runnabl.e processes, which are given |
432 time slices for execution according to their relative priority with | 432 time slices for execution according to their relative priority with |
433 respect to all other active processes, The scheduler uses a | 433 respect to all other active processes. The scheduler uses a |
434 pseudo-round-robin scheme that gives all active processes some CPU | 434 pseudo-round-robin scheme that gives all active processes some CPU |
435 time, even if they have a very low relative priority.</para> | 435 time, even if they have a very low relative priority.</para> |
436 </sect2> | 436 </sect2> |
437 <sect2> | 437 <sect2> |
438 <title>The Wait State</title> | 438 <title>The Wait State</title> |
442 </sect2> | 442 </sect2> |
443 <sect2> | 443 <sect2> |
444 <title>The Sleeping State</title> | 444 <title>The Sleeping State</title> |
445 <para>This state is entered when a process executes a SLEEP service | 445 <para>This state is entered when a process executes a SLEEP service |
446 request, which specifies a time interval. (a specific number of | 446 request, which specifies a time interval. (a specific number of |
447 ticks) for which the process is to remain suspended, The process | 447 ticks) for which the process is to remain suspended. The process |
448 remains asleep until the specified time has elapsed, or until. a | 448 remains asleep until the specified time has elapsed, or until. a |
449 signal is received.</para> | 449 signal is received.</para> |
450 </sect2> | 450 </sect2> |
451 </sect1> | 451 </sect1> |
452 <sect1> | 452 <sect1> |
453 <title>EXECUTION SCHEDULING</title> | 453 <title>EXECUTION SCHEDULING</title> |
454 <para>The kernel contains a scheduler that is responsible for allocation | 454 <para>The kernel contains a scheduler that is responsible for allocation |
455 of CPU time to active processes, OS-9 uses a Scheduling algorithm | 455 of CPU time to active processes. OS-9 uses a Scheduling algorithm |
456 that ensures all processes get some execution time</para> | 456 that ensures all processes get some execution time</para> |
457 <para>All active processes are members of the active process queue , | 457 <para>All active processes are members of the active process queue , |
458 which is kept sorted by process "age", Age is a count of | 458 which is kept sorted by process "age". Age is a count of |
459 how many process svitches have occurred since the process' last time | 459 how many process svitches have occurred since the process' last time |
460 slice, When a process is moved to the active process queue from | 460 slice. When a process is moved to the active process queue from |
461 another queue, its "age" is initialized by setting it to | 461 another queue, its "age" is initialized by setting it to |
462 the process' assigned priority, i.e., processes having relatively | 462 the process' assigned priority, i.e., processes having relatively |
463 higher priority are placed in the queue with an artificially higher | 463 higher priority are placed in the queue with an artificially higher |
464 age, Also, whenever a new process is activated, the ages of all other | 464 age. Also, whenever a new process is activated, the ages of all other |
465 processes are incremented</para> | 465 processes are incremented</para> |
466 <para>Upon conclusion of the currently executing process' time slice, | 466 <para>Upon conclusion of the currently executing process' time slice, |
467 the scheduler selects the process having the highest age to be | 467 the scheduler selects the process having the highest age to be |
468 executed next, Because the queue is kept sorted by age, this process | 468 executed next. Because the queue is kept sorted by age, this process |
469 will be St the bead of the queue, At this time the ages of a12. other | 469 will be St the bead of the queue. At this time the ages of a12. other |
470 active Processes are incremented (ages are never incremented beyond | 470 active Processes are incremented (ages are never incremented beyond |
471 255)</para> | 471 255)</para> |
472 <para>An exception is newly-active processes that were previously | 472 <para>An exception is newly-active processes that were previously |
473 deactivated while they were in the system state, These processes are | 473 deactivated while they were in the system state. These processes are |
474 noted and given higher priority than others because they are usually | 474 noted and given higher priority than others because they are usually |
475 executing critical routines that affect shared system resources and | 475 executing critical routines that affect shared system resources and |
476 therefore could be blocking other Unrelated processes</para> | 476 therefore could be blocking other Unrelated processes</para> |
477 <para>When there are no active processes, the kernel will. set itself up | 477 <para>When there are no active processes, the kernel will. set itself up |
478 to handle the next interrupt and then execute a CWAI instruction, | 478 to handle the next interrupt and then execute a CWAI instruction, |
479 which decreases interrupt latency time</para> | 479 which decreases interrupt latency time</para> |
480 </sect1> | 480 </sect1> |
481 <sect1> | 481 <sect1> |
482 <title>SIGNALS</title> | 482 <title>SIGNALS</title> |
483 <para>"Signals" are an asynchronous control mechanism used for | 483 <para>"Signals" are an asynchronous control mechanism used for |
484 interprocess communication and control, A signal behaves like a | 484 interprocess communication and control. A signal behaves like a |
485 software interrupt in that it can cause a process to suspend a | 485 software interrupt in that it can cause a process to suspend a |
486 program, execute a specific routine, and afterward return to the | 486 program, execute a specific routine, and afterward return to the |
487 interrupted program, Signals can be sent from one process to another | 487 interrupted program. Signals can be sent from one process to another |
488 process (by means of the SEND service request), or they can be sent | 488 process (by means of the SEND service request), or they can be sent |
489 from OS-9 system routines to a process</para> | 489 from OS-9 system routines to a process</para> |
490 <para>Status information can be conveyed by the signal in the form of a | 490 <para>Status information can be conveyed by the signal in the form of a |
491 one-byte numeric value, Some of the signal "codes" (values) | 491 one-byte numeric value. Some of the signal "codes" (values) |
492 have predefined meanings, but all the rest are user-defined, The | 492 have predefined meanings, but all the rest are user-defined. The |
493 defined signal codes are: | 493 defined signal codes are: |
494 </para> | 494 </para> |
495 <para>0 = KILL (non-interceptable process abort) | 495 <para>0 = KILL (non-interceptable process abort) |
496 </para> | 496 </para> |
497 <para>1 = WAKEUP - wake up sleeping process | 497 <para>1 = WAKEUP - wake up sleeping process |
501 <para>3 = KEYBOARD INTERRUPT | 501 <para>3 = KEYBOARD INTERRUPT |
502 </para> | 502 </para> |
503 <para>4 - 255 USER DEFINED | 503 <para>4 - 255 USER DEFINED |
504 </para> | 504 </para> |
505 <para>When a signal is sent to a process, the signal. is noted and saved | 505 <para>When a signal is sent to a process, the signal. is noted and saved |
506 in the process descriptor, If the process is in the sleeping or | 506 in the process descriptor. If the process is in the sleeping or |
507 waiting state, it is changed to the active state, It then becomes | 507 waiting state, it is changed to the active state. It then becomes |
508 eligible for execution according to the usual MPU scheduler criteria, | 508 eligible for execution according to the usual MPU scheduler criteria, |
509 When it gets its next time slice, the signal is processed</para> | 509 When it gets its next time slice, the signal is processed</para> |
510 <para>What happens next depends on whether or not the process had | 510 <para>What happens next depends on whether or not the process had |
511 previously set up a "signal. trap (signal service routine) by | 511 previously set up a "signal. trap (signal service routine) by |
512 executing an INTERCEPT service request. If it had not, the process is | 512 executing an INTERCEPT service request. If it had not, the process is |
513 immediately aborted, It is also aborted if the signal code is zero, | 513 immediately aborted. It is also aborted if the signal code is zero, |
514 The abort will be deferred if the process is in system mode: the | 514 The abort will be deferred if the process is in system mode: the |
515 process dies upon its return to user state</para> | 515 process dies upon its return to user state</para> |
516 <para>If a signal intercept trap has been set up, the process resumes | 516 <para>If a signal intercept trap has been set up, the process resumes |
517 execution at the address given in the INTERCEPT service request. The | 517 execution at the address given in the INTERCEPT service request. The |
518 signal code is passed to this routine, which should terminate with an | 518 signal code is passed to this routine, which should terminate with an |
532 <para>Interrupt processing is another important function of the kernel, | 532 <para>Interrupt processing is another important function of the kernel, |
533 All hardware interrupts are vectored to specific processing routines, | 533 All hardware interrupts are vectored to specific processing routines, |
534 IRQ interrupts are handled by a prioritized polling system (actually | 534 IRQ interrupts are handled by a prioritized polling system (actually |
535 part of IOMAN) which automatically identifies the source of the | 535 part of IOMAN) which automatically identifies the source of the |
536 interrupt and dispatches to the associated user or system defined | 536 interrupt and dispatches to the associated user or system defined |
537 service routine, The real-time clock will generate IRQ interrupts, | 537 service routine. The real-time clock will generate IRQ interrupts, |
538 SWI, SWI2, and SWI3 interrupts are vectored to 4ser-definable | 538 SWI, SWI2, and SWI3 interrupts are vectored to 4ser-definable |
539 addresses which are "local. to each procedure, except that SWI2 | 539 addresses which are "local. to each procedure, except that SWI2 |
540 is normally used for OS-9 service requests calls, The NMI and FIRQ | 540 is normally used for OS-9 service requests calls. The NMI and FIRQ |
541 interrupts are not normally used and are vectored through a. RAM | 541 interrupts are not normally used and are vectored through a. RAM |
542 address to sri RTI instruction</para> | 542 address to sri RTI instruction</para> |
543 <sect2> | 543 <sect2> |
544 <title>PHYSIcAL, INTERRUPT PROCESSING</title> | 544 <title>PHYSICAL INTERRUPT PROCESSING</title> |
545 <para>The OS-9 kernel. ROMs contain the hardware vectors required by the | 545 <para>The OS-9 kernel. ROMs contain the hardware vectors required by the |
546 £809 MPU at addresses $FFIO through $FFFF, These vectors each | 546 6809 MPU at addresses $FFIO through $FFFF. These vectors each |
547 point to jump-extended-indirect instruction which vector the MPU to | 547 point to jump-extended-indirect instruction which vector the MPU to |
548 the actual interrupt service routine, A RAM vector table in page zero | 548 the actual interrupt service routine. A RAM vector table in page zero |
549 of memory contains the target addresses of the jump instructions as | 549 of memory contains the target addresses of the jump instructions as |
550 follows; | 550 follows; |
551 </para> | 551 </para> |
552 <informaltable frame="none"> | 552 <informaltable frame="none"> |
553 <tgroup cols="2"> | 553 <tgroup cols="2"> |
584 </row> | 584 </row> |
585 </tbody> | 585 </tbody> |
586 </tgroup> | 586 </tgroup> |
587 </informaltable> | 587 </informaltable> |
588 <para>OS-9 initializes each of these locations after reset to point to a | 588 <para>OS-9 initializes each of these locations after reset to point to a |
589 specific service routine in the kernel, The SWI, SWI2, and SWI3 | 589 specific service routine in the kernel. The SWI, SWI2, and SWI3 |
590 vectors point to specific routines which in turn read the | 590 vectors point to specific routines which in turn read the |
591 corresponding pseudo vector from the process' process descriptor and | 591 corresponding pseudo vector from the process' process descriptor and |
592 dispatch to it, This is why the F$SSWI service request to be local to | 592 dispatch to it. This is why the F$SSWI service request to be local to |
593 a process since it only changes a pseudo vector in the process | 593 a process since it only changes a pseudo vector in the process |
594 descriptor. The IRQ routine points directly to the IRQ polling | 594 descriptor. The IRQ routine points directly to the IRQ polling |
595 system, or to it indirectly via the real-time clock device service | 595 system, or to it indirectly via the real-time clock device service |
596 routine, The FIRQ and Nfl. vectors are not normally used by OS-9 and | 596 routine. The FIRQ and Nfl. vectors are not normally used by OS-9 and |
597 point to RTI instructions</para> | 597 point to RTI instructions</para> |
598 <para>A secondary vector table located at $FFEO contains the addresses | 598 <para>A secondary vector table located at $FFEO contains the addresses |
599 of the routines that the RAM vectors are initialized to, They may be | 599 of the routines that the RAM vectors are initialized to. They may be |
600 used when it is necessary to restore the original service routines | 600 used when it is necessary to restore the original service routines |
601 after altering the RAM vectors, On the next page are the definitions | 601 after altering the RAM vectors. On the next page are the definitions |
602 of both the actual. hardware interrupt vector table, and the | 602 of both the actual. hardware interrupt vector table, and the |
603 secondary vector table: | 603 secondary vector table: |
604 </para> | 604 </para> |
605 <literallayout> | 605 <literallayout> |
606 VECTOR ADDRESS | 606 VECTOR ADDRESS |
625 SWI | 625 SWI |
626 NMI $FFFC | 626 NMI $FFFC |
627 RESTART $FFFE | 627 RESTART $FFFE |
628 </literallayout> | 628 </literallayout> |
629 <para>If it is necessary to alter the RAM vectors use the secondary | 629 <para>If it is necessary to alter the RAM vectors use the secondary |
630 vector table to exit the substitute routine, The technique of | 630 vector table to exit the substitute routine. The technique of |
631 altering the IRQ pointer is usually used by the clock service | 631 altering the IRQ pointer is usually used by the clock service |
632 routines to reduce latency time of this frequent interrupt source.</para> | 632 routines to reduce latency time of this frequent interrupt source.</para> |
633 </sect2> | 633 </sect2> |
634 <sect2> | 634 <sect2> |
635 <title>LOGICAL INTERRUPT POLLING SYSTEM</title> | 635 <title>LOGICAL INTERRUPT POLLING SYSTEM</title> |
636 <para>In OS-9 systems, most I/O devices use IRQ-type interrupts, so OS-9 | 636 <para>In OS-9 systems, most I/O devices use IRQ-type interrupts, so OS-9 |
637 includes a sophisticated polling system that automatically identifies | 637 includes a sophisticated polling system that automatically identifies |
638 the source of the interrupt and dispatches to its associated | 638 the source of the interrupt and dispatches to its associated |
639 user-defined service routine, The information required for IRQ | 639 user-defined service routine. The information required for IRQ |
640 polling is maintained in a data structure called the "IRQ | 640 polling is maintained in a data structure called the "IRQ |
641 polling table", The table has a 9-byte entry for each possible | 641 polling table". The table has a 9-byte entry for each possible |
642 IRQ-generatinq device, The table size is static and defined by an | 642 IRQ-generatinq device. The table size is static and defined by an |
643 initialization constant in the System Configuration Module</para> | 643 initialization constant in the System Configuration Module</para> |
644 <para>The polling system is prioritized so devices having a relatively | 644 <para>The polling system is prioritized so devices having a relatively |
645 greater importance (i.e., interrupt frequency) are polled before | 645 greater importance (i.e., interrupt frequency) are polled before |
646 those of lesser priority, This is accomplished by keeping the entries | 646 those of lesser priority. This is accomplished by keeping the entries |
647 sorted by priority, which is a number between 0 (lowest) and 255 | 647 sorted by priority, which is a number between 0 (lowest) and 255 |
648 (highest), Each entry in the table has 6 variables: | 648 (highest). Each entry in the table has 6 variables: |
649 </para> | 649 </para> |
650 <orderedlist numeration="arabic"> | 650 <orderedlist numeration="arabic"> |
651 <listitem><para>POLLING ADDRESS: The address of the device's status register, | 651 <listitem><para>POLLING ADDRESS: The address of the device's status register, |
652 which must have a bit or bits that indicate it is the source of an | 652 which must have a bit or bits that indicate it is the source of an |
653 interrupt</para></listitem> | 653 interrupt</para></listitem> |
654 <listitem><para>MASK BYTE; This byte selects one or more bits within the | 654 <listitem><para>MASK BYTE; This byte selects one or more bits within the |
655 device status register that are interrupt request flag(s), A set bit | 655 device status register that are interrupt request flag(s). A set bit |
656 identifies the active bit(s)</para></listitem> | 656 identifies the active bit(s)</para></listitem> |
657 <listitem><para>FLIP BYTE: This byte selects whether the bits in the device | 657 <listitem><para>FLIP BYTE: This byte selects whether the bits in the device |
658 status register are true when set or true when cleared, Cleared bits | 658 status register are true when set or true when cleared. Cleared bits |
659 indicate active when set</para></listitem> | 659 indicate active when set</para></listitem> |
660 <listitem><para>SERVICE ROUTINE ADDRESS: The user-supplied address of the | 660 <listitem><para>SERVICE ROUTINE ADDRESS: The user-supplied address of the |
661 device's interrupt service routine</para></listitem> | 661 device's interrupt service routine</para></listitem> |
662 <listitem><para>STATIC STORAGE ADDRESS; a user-supplied ter to the permanent | 662 <listitem><para>STATIC STORAGE ADDRESS; a user-supplied ter to the permanent |
663 storage required by the device service routine</para></listitem> | 663 storage required by the device service routine</para></listitem> |
664 <listitem><para>PRIORITY; The device priority number: 0 to 255. This value | 664 <listitem><para>PRIORITY; The device priority number: 0 to 255. This value |
665 determines the order in which the devices in the polling table will | 665 determines the order in which the devices in the polling table will |
666 be polled, Note; this is not the same as a process priority which is | 666 be polled. Note; this is not the same as a process priority which is |
667 used by the execution scheduler to decide which process gets the | 667 used by the execution scheduler to decide which process gets the |
668 next time slice for MPU execution</para></listitem> | 668 next time slice for MPU execution</para></listitem> |
669 </orderedlist> | 669 </orderedlist> |
670 <para>When an IRQ interrupt occurs, the polling system is entered via | 670 <para>When an IRQ interrupt occurs, the polling system is entered via |
671 the corresponding RAM interrupt vector, It starts polling the | 671 the corresponding RAM interrupt vector. It starts polling the |
672 devices, using the entries in the polling table in priority order, | 672 devices, using the entries in the polling table in priority order, |
673 For each entry, the status register address is loaded into | 673 For each entry, the status register address is loaded into |
674 accumulator A using the device address from the table, An | 674 accumulator A using the device address from the table. An |
675 exclusive-or operation using the flip-byte is executed, followed by a | 675 exclusive-or operation using the flip-byte is executed, followed by a |
676 logical-and operation using the mask byte, If the result is non-zero, | 676 logical-and operation using the mask byte. If the result is non-zero, |
677 the device is assumed to be the cause of the interrupt</para> | 677 the device is assumed to be the cause of the interrupt</para> |
678 <para>The device's static storage address and service routine address is | 678 <para>The device's static storage address and service routine address is |
679 read from the table and executed</para> | 679 read from the table and executed</para> |
680 <para>--> NOTE: The interrupt service routine should terminate with | 680 <para>--> NOTE: The interrupt service routine should terminate with |
681 an an RTS, not an RTI instruction</para> | 681 an an RTS, not an RTI instruction</para> |
682 <para>Entries can be made to the IRQ polling table by use of a special. | 682 <para>Entries can be made to the IRQ polling table by use of a special. |
683 os-i service request called "F$IRQ", This is a priviledged | 683 os-i service request called "F$IRQ". This is a priviledged |
684 service request that can be executed only when OS-9 is in System Mode | 684 service request that can be executed only when OS-9 is in System Mode |
685 (which is the case when device drivers are executed)</para> | 685 (which is the case when device drivers are executed)</para> |
686 <para>--> NOTE; The actual. code for the interrupt polling system is | 686 <para>--> NOTE; The actual. code for the interrupt polling system is |
687 </para> | 687 </para> |
688 <para>located in the IOMAN module, The kernel P1 and P2 modules contain | 688 <para>located in the IOMAN module. The kernel P1 and P2 modules contain |
689 the physical. interrupt processing routines.</para> | 689 the physical. interrupt processing routines.</para> |
690 </sect2> | 690 </sect2> |
691 </sect1> | 691 </sect1> |
692 </chapter> | 692 </chapter> |
693 <chapter> | 693 <chapter> |
694 <title>MEMORY MODULES</title> | 694 <title>MEMORY MODULES</title> |
695 <para>Any object to be loaded into the memory of an OS-9 system must use | 695 <para>Any object to be loaded into the memory of an OS-9 system must use |
696 the memory module format and conventions, The memory module concept | 696 the memory module format and conventions. The memory module concept |
697 allows OS-9 to manage the logical contents as well. as the physical | 697 allows OS-9 to manage the logical contents as well. as the physical |
698 contents of memory. The basic idea is that all programs are | 698 contents of memory. The basic idea is that all programs are |
699 individual., named objects</para> | 699 individual., named objects</para> |
700 <para>The operating system keeps track of modules which are in memory at | 700 <para>The operating system keeps track of modules which are in memory at |
701 all times by use of a module directory , It contains the addresses | 701 all times by use of a module directory . It contains the addresses |
702 and a count of bow many processes are using each module, When modules | 702 and a count of bow many processes are using each module. When modules |
703 are loaded into memory, they are added to the directory, When they | 703 are loaded into memory, they are added to the directory. When they |
704 are no longer needed, their memory is deallocated and their name | 704 are no longer needed, their memory is deallocated and their name |
705 removed from the directory (except ROMs, which are discussed later). | 705 removed from the directory (except ROMs, which are discussed later). |
706 In many respects, modules and memory in general, are managed just | 706 In many respects, modules and memory in general, are managed just |
707 like a disk, In fact, the disk and memory management sections of OS-9 | 707 like a disk. In fact, the disk and memory management sections of OS-9 |
708 share many subroutines</para> | 708 share many subroutines</para> |
709 <para>Each module bts three parts; a module header, module body and a | 709 <para>Each module bts three parts; a module header, module body and a |
710 cyclic-redundancy-check (CRC) value, The header contains information | 710 cyclic-redundancy-check (CRC) value. The header contains information |
711 that describes the module and its use, This information includes; the | 711 that describes the module and its use. This information includes; the |
712 modules size, its type (machine language, BASIC09 compiled code, | 712 modules size, its type (machine language. BASIC09 compiled code, |
713 etc); attributes (executable, reentrant, etc), data storage memory | 713 etc); attributes (executable, reentrant, etc), data storage memory |
714 requirements, execution starting address, etc. The CRC value is used | 714 requirements, execution starting address, etc. The CRC value is used |
715 to ver±f the integrity of a module</para> | 715 to ver±f the integrity of a module</para> |
716 <para>There are several different kinds of modules, each type having a | 716 <para>There are several different kinds of modules, each type having a |
717 different usage and function, Modules do not have to be complete | 717 different usage and function. Modules do not have to be complete |
718 programs, or even 6809 machine language, They may contain BASIC09 | 718 programs, or even 6809 machine language. They may contain BASIC09 |
719 I-code , constants, single subroutines, subroutine packages, etc. The | 719 I-code , constants, single subroutines, subroutine packages, etc. The |
720 main requirements are that modules do not modify themselves arid that | 720 main requirements are that modules do not modify themselves arid that |
721 they be position-independent so OS-9 can load or relocate them | 721 they be position-independent so OS-9 can load or relocate them |
722 wherever memory space is available, In this respect, the module | 722 wherever memory space is available. In this respect, the module |
723 format is the OS-9 equivalent of "load records used in | 723 format is the OS-9 equivalent of "load records used in |
724 older-style operating systems.</para> | 724 older-style operating systems.</para> |
725 <sect1> | 725 <sect1> |
726 <title>MEMORY MODULE STRUCTURE</title> | 726 <title>MEMORY MODULE STRUCTURE</title> |
727 <para>At the beginning (lowest address) of the module is the module | 727 <para>At the beginning (lowest address) of the module is the module |
728 header, which can have several. forms depending on the module's | 728 header, which can have several. forms depending on the module's |
729 usage, OS-9 family software such as BASIC09, Pascal, C, the | 729 usage. OS-9 family software such as BASIC09, Pascal, C, the |
730 assembler, and many utility programs automatically generate modules | 730 assembler, and many utility programs automatically generate modules |
731 and headers, Following the header is the program/constant section | 731 and headers. Following the header is the program/constant section |
732 which is usually pure code, The module name string is included | 732 which is usually pure code. The module name string is included |
733 somewhere in this area, The last three bytes of the module are a | 733 somewhere in this area. The last three bytes of the module are a |
734 three-byte Cyclic Redundancy Check (CRC) value used to verify the | 734 three-byte Cyclic Redundancy Check (CRC) value used to verify the |
735 integrity of the module.</para> | 735 integrity of the module.</para> |
736 <literallayout> | 736 <table> |
737 MODULE FORMAT | 737 <title>MODULE FORMAT</title> |
738 | 738 <tgroup cols="1"> |
739 MODULE HEADER | 739 <tbody> |
740 | 740 <row> |
741 | 741 <entry>MODULE HEADER</entry> |
742 | 742 </row> |
743 I PROGRAM I | 743 <row> |
744 OR CONSTANT$ I | 744 <entry>PROGRAM OR CONSTANTS</entry> |
745 </literallayout> | 745 </row> |
746 <para>I CRC</para> | 746 <row> |
747 <entry>CRC</entry> | |
748 </row> | |
749 </tbody> | |
750 </tgroup> | |
751 </table> | |
747 <para>The 24-bit CRC is performed over the entire module from the first | 752 <para>The 24-bit CRC is performed over the entire module from the first |
748 byte of the module header to the byte just before the CRC itself, The | 753 byte of the module header to the byte just before the CRC itself. The |
749 CRC polynomial. used is $800FE3.</para> | 754 CRC polynomial. used is $800FE3.</para> |
750 <para>Because most OS-9 family software (such as the assembler) | 755 <para>Because most OS-9 family software (such as the assembler) |
751 automatically generate the module header and CRC values, the | 756 automatically generate the module header and CRC values, the |
752 programner usually does not have to be concerned with writing | 757 programner usually does not have to be concerned with writing |
753 routines to generate them.</para> | 758 routines to generate them.</para> |
754 </sect1> | 759 </sect1> |
755 <sect1> | 760 <sect1> |
756 <title>MODULE HEADER DEFINITIONS</title> | 761 <title>MODULE HEADER DEFINITIONS</title> |
757 <para>The first nine bytes of all module headers are identical: | 762 <para>The first nine bytes of all module headers are identical: |
758 </para> | 763 </para> |
759 <literallayout> | 764 |
760 | 765 <informaltable frame="none"> |
761 MODULE | 766 <tgroup cols="2"> |
762 DESCRIPTION | 767 <thead> |
763 OFFSET | 768 <row> |
764 </literallayout> | 769 <entry>MODULE OFFSET</entry> |
765 <para>- Sync Bytes ($87,$CD), These two constant bytes are used to | 770 <entry>DESCRIPTION</entry> |
766 locate modules, | 771 </row> |
767 </para> | 772 </thead> |
768 <para>- Module Size, The overall size of the module in bytes (includes | 773 <tbody> |
769 CRC), | 774 <row> |
770 </para> | 775 <entry>$0,$1</entry> |
771 <para>- Offset to Module Name, The address of the module name string | 776 <entry>Sync Bytes ($87,$CD). These two constant bytes are used to |
772 relative to the start (first sync byte) of the module, The name | 777 locate modules.</entry> |
778 </row> | |
779 | |
780 <row> | |
781 <entry>$2,$3</entry> | |
782 <entry>Module Size. The overall size of the module in bytes (includes | |
783 CRC).</entry> | |
784 </row> | |
785 | |
786 <row> | |
787 <entry>$4,$5</entry> | |
788 <entry>Offset to Module Name. The address of the module name string | |
789 relative to the start (first sync byte) of the module. The name | |
773 string can be located anywhere in the module and consists of a string | 790 string can be located anywhere in the module and consists of a string |
774 of ASCII characters having the sign bit set on the last character, | 791 of ASCII characters having the sign bit set on the last character. |
775 </para> | 792 </entry> |
776 <para>$6 - Module Type/Language Type, See text. | 793 </row> |
777 </para> | 794 |
778 <para>$7 - Attributes/Revision Level, See text, | 795 <row> |
779 </para> | 796 <entry>$6</entry> |
780 <para>$8 - Header Check, The one's compliment of the vertical. parity | 797 <entry>Module Type/Language Type. See text. |
781 (exclusive OR) of the previous eight bytes</para> | 798 </entry> |
799 </row> | |
800 | |
801 <row> | |
802 <entry>$7</entry> | |
803 <entry>Attributes/Revision Level. See text. | |
804 </entry> | |
805 </row> | |
806 | |
807 <row> | |
808 <entry>$8</entry> | |
809 <entry>Header Check. The one's compliment of the vertical. parity | |
810 (exclusive OR) of the previous eight bytes</entry> | |
811 </row> | |
812 | |
813 </tbody> | |
814 </tgroup> | |
815 </informaltable> | |
816 | |
782 <sect2> | 817 <sect2> |
783 <title>Type/Language Byte</title> | 818 <title>Type/Language Byte</title> |
784 <para>The module type is coded into the tour most significant bits of | 819 <para>The module type is coded into the tour most significant bits of |
785 byte 6 of the module header, Eight types are pre-defined by | 820 byte 6 of the module header. Eight types are pre-defined by |
786 convention, some of which are for OS-9's internal use only, The type | 821 convention, some of which are for OS-9's internal use only. The type |
787 codes are:</para> | 822 codes are:</para> |
788 <informaltable frame="none"> | 823 <informaltable frame="none"> |
789 <tgroup cols="2"> | 824 <tgroup cols="2"> |
790 <thead> | 825 <thead> |
791 <row> | 826 <row> |
831 <entry>NOTE: 0 is not a legal type code</entry> | 866 <entry>NOTE: 0 is not a legal type code</entry> |
832 </row> | 867 </row> |
833 </tbody> | 868 </tbody> |
834 </tgroup> | 869 </tgroup> |
835 </informaltable> | 870 </informaltable> |
836 <para> "user-defined types having type codes of 0 through 9, They | 871 <para> "user-defined types having type codes of 0 through 9. They |
837 have six more bytes in their headers defined as follows: | 872 have six more bytes in their headers defined as follows: |
838 </para> | 873 </para> |
839 <informaltable frame="none"> | 874 <informaltable frame="none"> |
840 <tgroup cols="2"> | 875 <tgroup cols="2"> |
841 <thead> | 876 <thead> |
845 </row> | 880 </row> |
846 </thead> | 881 </thead> |
847 <tbody> | 882 <tbody> |
848 <row> | 883 <row> |
849 <entry>$9,$A =</entry> | 884 <entry>$9,$A =</entry> |
850 <entry>Execution Offset, The program or subroutine's starting | 885 <entry>Execution Offset. The program or subroutine's starting |
851 address, relative to the first byte of the sync code, Modules | 886 address, relative to the first byte of the sync code. Modules |
852 having multiple entry points (cold start, warm start, etc.) may | 887 having multiple entry points (cold start, warm start, etc.) may |
853 have a branch table starting at this address.</entry> | 888 have a branch table starting at this address.</entry> |
854 </row> | 889 </row> |
855 <row> | 890 <row> |
856 <entry>$B,$C =</entry> | 891 <entry>$B,$C =</entry> |
857 <entry>Permanent Storage Requirement. This is the minimum number of | 892 <entry>Permanent Storage Requirement. This is the minimum number of |
858 bytes of data storage required to run, This is the number used by | 893 bytes of data storage required to run. This is the number used by |
859 FORK and CHAIN to allocate a process' data area.</entry> | 894 FORK and CHAIN to allocate a process' data area.</entry> |
860 <entry>If the module will not be directly executed by a CHAIN or FORK | 895 <entry>If the module will not be directly executed by a CHAIN or FORK |
861 service request (for instance a subroutine package), this entry | 896 service request (for instance a subroutine package), this entry |
862 is not used by OS-9. It is commonly used to specify the maximum | 897 is not used by OS-9. It is commonly used to specify the maximum |
863 stack size required by reentrant subroutine modules, The calling | 898 stack size required by reentrant subroutine modules. The calling |
864 program can check this value to determine if the subroutine has | 899 program can check this value to determine if the subroutine has |
865 enough stack space</entry> | 900 enough stack space</entry> |
866 </row> | 901 </row> |
867 </tbody> | 902 </tbody> |
868 </tgroup> | 903 </tgroup> |
872 <sect1> | 907 <sect1> |
873 <title>EXECUTABLE MEMORY MODULE FORMAT</title> | 908 <title>EXECUTABLE MEMORY MODULE FORMAT</title> |
874 <literallayout> | 909 <literallayout> |
875 Relative Usage Check Range | 910 Relative Usage Check Range |
876 Address | 911 Address |
877 4- aa......n...a4, | 912 4- aa......n...a4. |
878 4... | 913 4... |
879 $00 I I I | 914 $00 I I I |
880 Sync Bytes ($87CD) "-4 1 | 915 Sync Bytes ($87CD) "-4 1 |
881 $01 I I I | 916 $01 I I I |
882 I | 917 I |
918 I object code, constants, etc, 1 | 953 I object code, constants, etc, 1 |
919 1 | 954 1 |
920 I I I | 955 I I I |
921 1 1 , 1 | 956 1 1 , 1 |
922 1 1 I | 957 1 1 I |
923 4.-- a-4, I | 958 4.-- a-4. I |
924 I ORC Cheek Value | 959 I ORC Cheek Value |
925 1 | 960 1 |
926 4,m. a.a4, | 961 4,m. a.a4, |
927 </literallayout> | 962 </literallayout> |
928 </sect1> | 963 </sect1> |
929 <sect1> | 964 <sect1> |
930 <title>ROMED MEMORY MODULES</title> | 965 <title>ROMED MEMORY MODULES</title> |
931 <para>When OS-9 starts after a system reset, it searches the entire | 966 <para>When OS-9 starts after a system reset, it searches the entire |
932 memory space for HOMed modules, It detects them by looking for the | 967 memory space for HOMed modules. It detects them by looking for the |
933 module header sync code ($87,$CD) which are unused 6809 opcodes, When | 968 module header sync code ($87,$CD) which are unused 6809 opcodes. When |
934 this byte pattern is detected, the header check is performed to | 969 this byte pattern is detected, the header check is performed to |
935 verify a correct header, If this test succeeds, the module size is | 970 verify a correct header. If this test succeeds, the module size is |
936 obtained from the header and a 24-bit CRC is performed over the | 971 obtained from the header and a 24-bit CRC is performed over the |
937 entire module, If the CRC matches correctly, the module is considered | 972 entire module. If the CRC matches correctly, the module is considered |
938 valid, and it is entered into the module directory, The chances of | 973 valid, and it is entered into the module directory. The chances of |
939 detecting a "false module" are virtually nil</para> | 974 detecting a "false module" are virtually nil</para> |
940 <para>In this manner all ROMed modules present in the system at startup | 975 <para>In this manner all ROMed modules present in the system at startup |
941 are automatically included in the system module directory, Some of | 976 are automatically included in the system module directory. Some of |
942 the modules found initially are various parts of OS-9: file managers, | 977 the modules found initially are various parts of OS-9: file managers, |
943 device driver, the configuration module, etc</para> | 978 device driver, the configuration module, etc</para> |
944 <para>After the module search OS-9 links to whichever of its component | 979 <para>After the module search OS-9 links to whichever of its component |
945 modules that it found, This is the secret of OS-9 s extraordinary | 980 modules that it found. This is the secret of OS-9 s extraordinary |
946 adaptability to almost any 6809 computer; it automatically locates | 981 adaptability to almost any 6809 computer; it automatically locates |
947 its required and optional. component modules, wherever they are, and | 982 its required and optional. component modules, wherever they are, and |
948 rebuilds the system each time that it is started</para> | 983 rebuilds the system each time that it is started</para> |
949 <para>ROMe containing non-system modules are also searched so any | 984 <para>ROMe containing non-system modules are also searched so any |
950 user-supplied software is located during the start-up process and | 985 user-supplied software is located during the start-up process and |
969 </para> | 1004 </para> |
970 <literallayout> | 1005 <literallayout> |
971 (IOMAN) | 1006 (IOMAN) |
972 +fleanana | 1007 +fleanana |
973 I I | 1008 I I |
974 I Disk File Manager I Char, Pile Manager I | 1009 I Disk File Manager I Char. Pile Manager I |
975 More | 1010 More |
976 (RSPMAN) (SCFMAN) I -> opt | 1011 (RSPMAN) (SCFMAN) I -> opt |
977 I I I I | 1012 I I I I |
978 I I I | 1013 I I I |
979 | 1014 |
980 I £1 I I I I I | 1015 I 1 I I I I I |
981 Disk! I Disk! I ACIA | 1016 Disk! I Disk! I ACIA |
982 II PtA I More | 1017 II PtA I More |
983 I Driver I I Driver I I Driver I I Driver -> | 1018 I Driver I I Driver I I Driver I I Driver -> |
984 Opt | 1019 Opt |
985 I I I I I I! I | 1020 I I I I I I! I |
986 + + stfl.+ | 1021 + + stfl.+ |
987 I I I I I I I I | 1022 I I I I I I I I |
988 I I I I I I | 1023 I I I I I I |
989 £ £ | 1024 |
990 IDQ I ID]. I ID2 1 1D3 I IT]. I IT2 £ IP1 I | 1025 IDQ I ID]. I ID2 1 1D3 I IT]. I IT2 |
991 IP2 I-> More | 1026 IP2 I-> More |
992 4--+ +--+ i~a~+ +---f 4e+ ~ +---+ 4~--+ opt | 1027 4--+ +--+ i~a~+ +---f 4e+ ~ +---+ 4~--+ opt |
993 RBF | 1028 RBF |
994 Device Descriptors scr Device Descriptors | 1029 Device Descriptors scr Device Descriptors |
995 </literallayout> | 1030 </literallayout> |
1024 </para> | 1059 </para> |
1025 <para>The file managers are reentrant and one file manager may be used | 1060 <para>The file managers are reentrant and one file manager may be used |
1026 for an entire class of devices having similar operational | 1061 for an entire class of devices having similar operational |
1027 ctiaracteristics. The two standard OS-9 file managers are: | 1062 ctiaracteristics. The two standard OS-9 file managers are: |
1028 </para> | 1063 </para> |
1029 <para>REFMAN: The Random Block File Manager hi operates random-access, | 1064 <para>RBFMAN: The Random Block File Manager hi operates random-access, |
1030 block-structured devices such | 1065 block-structured devices such |
1031 </para> | 1066 </para> |
1032 <para>as disk systems, bubble memories, etc.</para> | 1067 <para>as disk systems, bubble memories, etc.</para> |
1033 <para>SCFMAN: Sequential Character Pile Manager which is used with | 1068 <para>SCFMAN: Sequential Character Pile Manager which is used with |
1034 single-character-oriented devices such as | 1069 single-character-oriented devices such as |
1074 logical name, hardware controller address(es), device driver name, | 1109 logical name, hardware controller address(es), device driver name, |
1075 file manager name, and initialization paramaters</para> | 1110 file manager name, and initialization paramaters</para> |
1076 <para>Recall that device drivers and file managers both operate on | 1111 <para>Recall that device drivers and file managers both operate on |
1077 general classes of devices, not specific I/O ports. The | 1112 general classes of devices, not specific I/O ports. The |
1078 device descriptor modules tailor their functions to a specific I/O | 1113 device descriptor modules tailor their functions to a specific I/O |
1079 device, One device descriptor module must exist for each I/O device | 1114 device. One device descriptor module must exist for each I/O device |
1080 in the system</para> | 1115 in the system</para> |
1081 <para>The name of the module is the name the device is known by to the | 1116 <para>The name of the module is the name the device is known by to the |
1082 system and user (i.e. it is the device name given in pathlists}. Its | 1117 system and user (i.e. it is the device name given in pathlists}. Its |
1083 format consists of a standard module header that has a type "device | 1118 format consists of a standard module header that has a type "device |
1084 descriptor" (code $F). The rest of the device descriptor header | 1119 descriptor" (code $F). The rest of the device descriptor header |
1092 </para> | 1127 </para> |
1093 <para>$11 = Number of bytes ( "n" bytes in intialization | 1128 <para>$11 = Number of bytes ( "n" bytes in intialization |
1094 table)</para> | 1129 table)</para> |
1095 <para>$l2,$l2+n = Initialization table</para> | 1130 <para>$l2,$l2+n = Initialization table</para> |
1096 <para>The initialization table is copied into the "option section" | 1131 <para>The initialization table is copied into the "option section" |
1097 of the path descriptor when a path to the device is opened, The | 1132 of the path descriptor when a path to the device is opened. The |
1098 values in this table may be used to define the operating parameters | 1133 values in this table may be used to define the operating parameters |
1099 that are changeable by the OS9 I$GSTT and I$SSTT service requests. | 1134 that are changeable by the OS9 I$GSTT and I$SSTT service requests. |
1100 For example, a terminal's initialization parameters define which | 1135 For example, a terminal's initialization parameters define which |
1101 control characters are used for backspace, delete, etc. The maximum | 1136 control characters are used for backspace, delete, etc. The maximum |
1102 size of initialization table which may be used is 32 bytes, If the | 1137 size of initialization table which may be used is 32 bytes. If the |
1103 table is less than 32 bytes long, the remaining values in the path | 1138 table is less than 32 bytes long, the remaining values in the path |
1104 descriptor will be set to zero</para> | 1139 descriptor will be set to zero</para> |
1105 <para>You may wish to add additional devices to your system, If a | 1140 <para>You may wish to add additional devices to your system. If a |
1106 similar device controller already exists, all you need to do is add | 1141 similar device controller already exists, all you need to do is add |
1107 the new hardware and load another device descriptor, Device | 1142 the new hardware and load another device descriptor. Device |
1108 descriptors can be in ROM or loaded into RAM from mass-storage files | 1143 descriptors can be in ROM or loaded into RAM from mass-storage files |
1109 while the system is running</para> | 1144 while the system is running</para> |
1110 <para>The diagram on the next page illustrates the device descriptor | 1145 <para>The diagram on the next page illustrates the device descriptor |
1111 module format</para> | 1146 module format</para> |
1112 </sect1> | 1147 </sect1> |
1134 I SF (TYPE) I | 1169 I SF (TYPE) I |
1135 $1 (LANG) 1 I I | 1170 $1 (LANG) 1 I I |
1136 I I | 1171 I I |
1137 $7 I Atributes I Revision I I I | 1172 $7 I Atributes I Revision I I I |
1138 $8 I | 1173 $8 I |
1139 Header Parity Check £ I | 1174 Header Parity Check |
1140 I | 1175 I |
1141 $9 I | 1176 $9 I |
1142 4-- Offset to | 1177 4-- Offset to |
1143 Pile Manager --+ 1 | 1178 Pile Manager --+ 1 |
1144 I Name String I module | 1179 I Name String I module |
1147 1 | 1182 1 |
1148 4.-- Offset to Device Driver --+ I | 1183 4.-- Offset to Device Driver --+ I |
1149 Name String I | 1184 Name String I |
1150 I | 1185 I |
1151 .s.....a...e.4. 1 | 1186 .s.....a...e.4. 1 |
1152 SD I ModeByte £ | 1187 SD I ModeByte |
1153 1 | 1188 1 |
1154 SE I I | 1189 SE I I |
1155 4.-- | 1190 4.-- |
1156 Device Controller --+ I | 1191 Device Controller --+ I |
1157 I absolute Physical Address I | 1192 I absolute Physical Address I |
1158 4-- (24 | 1193 4-- (24 |
1159 bit) --4 I | 1194 bit) --4 I |
1160 510 1 1 | 1195 510 1 1 |
1161 $11 1 Initialization Table Size 1 | 1196 $11 1 Initialization Table Size 1 |
1162 £ | 1197 |
1163 I | 1198 I |
1164 $l2,$l2+N 1 1 | 1199 $l2,$l2+N 1 1 |
1165 1 (Initialization Table) I I | 1200 1 (Initialization Table) I I |
1166 1 1 | 1201 1 1 |
1167 £ | 1202 |
1168 4..,. ~ I | 1203 4..,. ~ I |
1169 1 £ 1 | 1204 1 |
1170 1 (Name Strings etc) £ | 1205 1 (Name Strings etc) |
1171 1 | 1206 1 |
1172 I £ I | |
1173 I | 1207 I |
1174 I CRC Check Value I I | 1208 I CRC Check Value I I |
1175 4- aaaaa | 1209 4- aaaaa |
1176 </literallayout> | 1210 </literallayout> |
1177 </sect1> | 1211 </sect1> |
1178 <sect1> | 1212 <sect1> |
1179 <title>PATH DESCRIPTORS</title> | 1213 <title>PATH DESCRIPTORS</title> |
1180 <para>Every open path is represented by a data structure called a path | 1214 <para>Every open path is represented by a data structure called a path |
1181 descriptor ("PD"), It contains the information required by | 1215 descriptor ("PD"). It contains the information required by |
1182 the file managers and device drivers to perform I/O functions. Path | 1216 the file managers and device drivers to perform I/O functions. Path |
1183 descriptors are exactly 64 bytes long and are dynamically allocated | 1217 descriptors are exactly 64 bytes long and are dynamically allocated |
1184 and deallocated by IOMAN as paths are opened and closed</para> | 1218 and deallocated by IOMAN as paths are opened and closed</para> |
1185 <para>PDs are INTERNAL data structures that are not normally referenced | 1219 <para>PDs are INTERNAL data structures that are not normally referenced |
1186 from user or applications programs. In fact, it is almost impossible | 1220 from user or applications programs. In fact, it is almost impossible |
1187 to locate a path's PD when OS-9 is in user mode, The description of | 1221 to locate a path's PD when OS-9 is in user mode. The description of |
1188 PDs is mostly of interest to, and presented here for those | 1222 PDs is mostly of interest to, and presented here for those |
1189 programmers who need to write custom file managers,, device drivers, | 1223 programmers who need to write custom file managers,, device drivers, |
1190 or other extensions to OS-9</para> | 1224 or other extensions to OS-9</para> |
1191 <para>FDa have three sections: the first 10-byte section is defined | 1225 <para>FDa have three sections: the first 10-byte section is defined |
1192 universally for all file managers and device drivers, as shown below</para> | 1226 universally for all file managers and device drivers, as shown below</para> |
1213 <para>The 22-byte section called "PD.FST" is reserved for and | 1247 <para>The 22-byte section called "PD.FST" is reserved for and |
1214 defined by each type of file manager for file pointers, permanent | 1248 defined by each type of file manager for file pointers, permanent |
1215 variables, etc</para> | 1249 variables, etc</para> |
1216 <para>The 32-byte section called "PD.OPT" is used as an | 1250 <para>The 32-byte section called "PD.OPT" is used as an |
1217 "option" area for dynamically-alterable operating | 1251 "option" area for dynamically-alterable operating |
1218 parameters for the file or device, These variables are initialized at | 1252 parameters for the file or device. These variables are initialized at |
1219 the time the path is opened by copying the initialization table | 1253 the time the path is opened by copying the initialization table |
1220 contained in the device descriptor module, and can be altered later | 1254 contained in the device descriptor module, and can be altered later |
1221 by user programs by means of the GETSTAT and SETSTAT System calls</para> | 1255 by user programs by means of the GETSTAT and SETSTAT System calls</para> |
1222 <para>These two sections are defined each file manager's in the assembly | 1256 <para>These two sections are defined each file manager's in the assembly |
1223 lanuuage equate file (SCFDef a for SCFMAN and RBFDef a for RBFMAN)</para> | 1257 lanuuage equate file (SCFDef a for SCFMAN and RBFDef a for RBFMAN)</para> |
1233 for I/O service requests to random-access devices. It is responsible | 1267 for I/O service requests to random-access devices. It is responsible |
1234 for maintaining the logical and physical file structures | 1268 for maintaining the logical and physical file structures |
1235 </para> | 1269 </para> |
1236 <para>Th the course of normal operation, RBFMAN requests allocation and | 1270 <para>Th the course of normal operation, RBFMAN requests allocation and |
1237 deallocation of 256-byte data buffers; usually one is required for | 1271 deallocation of 256-byte data buffers; usually one is required for |
1238 each open file, When physical I/O functions are necessary, RBFMAN | 1272 each open file. When physical I/O functions are necessary, RBFMAN |
1239 directly calls the subroutines in the associated device drivers, All | 1273 directly calls the subroutines in the associated device drivers. All |
1240 data transfers are performed using 256-byte data blocks, RRFMAN does | 1274 data transfers are performed using 256-byte data blocks. RRFMAN does |
1241 not directly deal with physical addresses such as tracks, cylinders, | 1275 not directly deal with physical addresses such as tracks, cylinders, |
1242 etc Instead, it passes to device driver modules address parameters | 1276 etc Instead, it passes to device driver modules address parameters |
1243 using a standard address called a logical sector number, | 1277 using a standard address called a logical sector number, |
1244 or WLSNU LSNs ate integers in the range of 0 to n-l, where n is the | 1278 or WLSNU LSNs ate integers in the range of 0 to n-l, where n is the |
1245 maximum number of sectors on the media, The driver is responsible for | 1279 maximum number of sectors on the media. The driver is responsible for |
1246 translating the logical sector number to actual cylinder/track/sector | 1280 translating the logical sector number to actual cylinder/track/sector |
1247 values</para> | 1281 values</para> |
1248 <para>Because RBFMAN is designed to support a wide range of devices | 1282 <para>Because RBFMAN is designed to support a wide range of devices |
1249 having different performance and storage capacity, it is highly | 1283 having different performance and storage capacity, it is highly |
1250 parameter-driven, The physical parameters it uses are stored on the | 1284 parameter-driven. The physical parameters it uses are stored on the |
1251 media itselfe On disk systems, this information is written on the | 1285 media itselfe On disk systems, this information is written on the |
1252 first few sectors of track number zero. The device drivers also use | 1286 first few sectors of track number zero. The device drivers also use |
1253 this information, particularly the physical parameters stored on | 1287 this information, particularly the physical parameters stored on |
1254 sector 0, These parameters are written by the *formatrn program that | 1288 sector 0. These parameters are written by the *formatrn program that |
1255 initializes and tests the media.</para> | 1289 initializes and tests the media.</para> |
1256 <sect1> | 1290 <sect1> |
1257 <title>LOGICAL AND PHYSICAL DISK ORGANIZATION</title> | 1291 <title>LOGICAL AND PHYSICAL DISK ORGANIZATION</title> |
1258 <para>All mass storage volumes (disk media) used by 06-9 utilize the | 1292 <para>All mass storage volumes (disk media) used by 0S-9 utilize the |
1259 first few sectors of the volume to store basic identification, | 1293 first few sectors of the volume to store basic identification, |
1260 structure, and storage allocation information,</para> | 1294 structure, and storage allocation information,</para> |
1261 <para>Logical sector zero (LSN 0) is called the | 1295 <para>Logical sector zero (LSN 0) is called the |
1262 <emphasis>Identification Sector</emphasis> which contains description of the | 1296 <emphasis>Identification Sector</emphasis> which contains description of the |
1263 physical and logical format of the volume.</para> | 1297 physical and logical format of the volume.</para> |
1268 <sect2> | 1302 <sect2> |
1269 <title>Identification Sector</title> | 1303 <title>Identification Sector</title> |
1270 <para>Logical sector number zero contains a description of the physical | 1304 <para>Logical sector number zero contains a description of the physical |
1271 and logical characteristics of the volume These are established by | 1305 and logical characteristics of the volume These are established by |
1272 the tmformattm command program when the media is initialized, the | 1306 the tmformattm command program when the media is initialized, the |
1273 table below gives the 06-9 mnemonic name, byte address, size, and | 1307 table below gives the 0S-9 mnemonic name, byte address, size, and |
1274 description of each value stored in this sector. | 1308 description of each value stored in this sector. |
1275 </para> | 1309 </para> |
1276 <literallayout> | 1310 <informaltable frame="none"> |
1277 name addr size | 1311 <tgroup cols="4"> |
1278 descr ption | 1312 <colspec colwidth="1.2in"> |
1279 DD.TOT $00 3 Total number of sectors on media | 1313 <colspec colwidth="1in"> |
1280 DD.TKS | 1314 <colspec colwidth="1in"> |
1281 $03 1 Number of sectors per track | 1315 <thead> |
1282 DD.MAP $04 2 Number of bytes in | 1316 <row rowsep="1"> |
1283 allocation map | 1317 <entry>Name</entry> |
1284 DD.BIT $06 2 Number of sectors per cluster | 1318 <entry>Addr</entry> |
1285 DD.DIR | 1319 <entry>Size</entry> |
1286 $08 3 Starting sector of root directory | 1320 <entry>Description</entry> |
1287 DD.OWN $05 2 Owner's user | 1321 </row> |
1288 number | 1322 </thead> |
1289 DD.ATT SOD 1 Disk attributes | 1323 <tbody> |
1290 DD.D$K $05 2 Disk | 1324 <row> |
1291 identification (for internal use) | 1325 <entry>DD.TOT</entry> |
1292 DD.FMT $10 1 Disk format: | 1326 <entry>$00</entry> |
1293 density, number of sides | 1327 <entry>3</entry> |
1294 DD.SPT $11 2 Number of sectors per | 1328 <entry>Total number of sectors on media</entry> |
1295 track | 1329 </row> |
1296 DD.REs $13 2 Reserved for future use | 1330 <row> |
1297 DD.BT $15 3 Starting | 1331 <entry>DD.TKS</entry> |
1298 sector of bootstrap file | 1332 <entry>$03</entry> |
1299 DD.BSZ $18 2 Size of bootstrap file (in | 1333 <entry>1</entry> |
1300 bytes) | 1334 <entry>Number of sectors per track</entry> |
1301 DD.DAT $lA 5 Time of creation; Y:M:D:H;M | 1335 </row> |
1302 DD.NAM S1F 32 | 1336 <row> |
1303 Volume name: last char has sign bit set | 1337 <entry>DD.MAP</entry> |
1304 </literallayout> | 1338 <entry>$04</entry> |
1339 <entry>2</entry> | |
1340 <entry>Number of bytes in allocation map</entry> | |
1341 </row> | |
1342 <row> | |
1343 <entry>DD.BIT</entry> | |
1344 <entry>$06</entry> | |
1345 <entry>2</entry> | |
1346 <entry>Number of sectors per cluster</entry> | |
1347 </row> | |
1348 <row> | |
1349 <entry>DD.DIR</entry> | |
1350 <entry>$08</entry> | |
1351 <entry>3</entry> | |
1352 <entry>Starting sector of root directory</entry> | |
1353 </row> | |
1354 <row> | |
1355 <entry>DD.OWN</entry> | |
1356 <entry>$0B</entry> | |
1357 <entry>2</entry> | |
1358 <entry>Owner's user number</entry> | |
1359 </row> | |
1360 <row> | |
1361 <entry>DD.ATT</entry> | |
1362 <entry>$OD</entry> | |
1363 <entry>1</entry> | |
1364 <entry>Disk attributes</entry> | |
1365 </row> | |
1366 <row> | |
1367 <entry>DD.DSK</entry> | |
1368 <entry>$05</entry> | |
1369 <entry>2</entry> | |
1370 <entry>Disk identification (for internal use)</entry> | |
1371 </row> | |
1372 <row> | |
1373 <entry>DD.FMT</entry> | |
1374 <entry>$10</entry> | |
1375 <entry>1</entry> | |
1376 <entry>Disk format: density, number of sides</entry> | |
1377 </row> | |
1378 <row> | |
1379 <entry>DD.SPT</entry> | |
1380 <entry>$11</entry> | |
1381 <entry>2</entry> | |
1382 <entry>Number of sectors per track</entry> | |
1383 </row> | |
1384 <row> | |
1385 <entry>DD.RES</entry> | |
1386 <entry>$13</entry> | |
1387 <entry>2</entry> | |
1388 <entry>Reserved for future use</entry> | |
1389 </row> | |
1390 <row> | |
1391 <entry>DD.BT</entry> | |
1392 <entry>$15</entry> | |
1393 <entry>3</entry> | |
1394 <entry>Starting sector of bootstrap file</entry> | |
1395 </row> | |
1396 <row> | |
1397 <entry>DD.BSZ</entry> | |
1398 <entry>$18</entry> | |
1399 <entry>2</entry> | |
1400 <entry>Size of bootstrap file (in bytes)</entry> | |
1401 </row> | |
1402 <row> | |
1403 <entry>DD.DAT</entry> | |
1404 <entry>$1A</entry> | |
1405 <entry>5</entry> | |
1406 <entry>Time of creation; Y:M:D:H;M</entry> | |
1407 </row> | |
1408 <row> | |
1409 <entry>DD.NAM</entry> | |
1410 <entry>$1F</entry> | |
1411 <entry>32</entry> | |
1412 <entry>Volume name: last char has sign bit set</entry> | |
1413 </row> | |
1414 </tbody> | |
1415 </tgroup> | |
1416 </informaltable> | |
1305 </sect2> | 1417 </sect2> |
1306 <sect2> | 1418 <sect2> |
1307 <title>Disk Allocation Map Sector</title> | 1419 <title>Disk Allocation Map Sector</title> |
1308 <para>One sector (usually LSN 1) of the disk is used for the "disk | 1420 <para>One sector (usually LSN 1) of the disk is used for the "disk |
1309 allocation map" that specifies which clusters on the disk are | 1421 allocation map" that specifies which clusters on the disk are |
1310 available for allocation of file storage space The address of this | 1422 available for allocation of file storage space The address of this |
1311 sector is always assigned logical sector 1 by the format proqram | 1423 sector is always assigned logical sector 1 by the format proqram |
1312 DD,MAP specifies the number of bytes in this sector which are | 1424 DD.MAP specifies the number of bytes in this sector which are |
1313 actually used in the map.</para> | 1425 actually used in the map.</para> |
1314 <para>Each bit in the map corresponds to a cluster of sectors on the | 1426 <para>Each bit in the map corresponds to a cluster of sectors on the |
1315 disk, The number of sectors per cluster is specified by the "DD.BIT" | 1427 disk. The number of sectors per cluster is specified by the "DD.BIT" |
1316 variable in the identification sector, and is always an integral | 1428 variable in the identification sector, and is always an integral |
1317 power of two, i,e., 1, 2, 4, 8, 16, etc, There are a maximum of 4096 | 1429 power of two, i,e., 1, 2, 4, 8, 16, etc. There are a maximum of 4096 |
1318 bits in the map, so media such as double-density double-sided floppy | 1430 bits in the map, so media such as double-density double-sided floppy |
1319 disks and hard disks will use a cluster size of two or more sectors, | 1431 disks and hard disks will use a cluster size of two or more sectors, |
1320 Each bit is cleared if the corresponding cluster is available for | 1432 Each bit is cleared if the corresponding cluster is available for |
1321 allocation, or set if the sector is already allocated, non-existent, | 1433 allocation, or set if the sector is already allocated, non-existent, |
1322 or physically defective, The bitmap is initially created by the | 1434 or physically defective. The bitmap is initially created by the |
1323 "format" utility program</para> | 1435 "format" utility program</para> |
1324 </sect2> | 1436 </sect2> |
1325 <sect2> | 1437 <sect2> |
1326 <title>File Descriptor Sectors</title> | 1438 <title>File Descriptor Sectors</title> |
1327 <para>The first sector of every file is called a "file descriptor", | 1439 <para>The first sector of every file is called a "file descriptor", |
1328 which contains the logical and physical description of the file.. The | 1440 which contains the logical and physical description of the file.. The |
1329 table below describes the contents of the descriptor</para> | 1441 table below describes the contents of the descriptor</para> |
1330 <literallayout> | 1442 <literallayout> |
1331 name addr size description | 1443 name addr size description |
1332 * - . . * | 1444 * - . . * |
1333 FD,APT $0 1 File | 1445 FD.APT $0 1 File |
1334 Attributes: D S PS PW PR LW R | 1446 Attributes: D S PS PW PR LW R |
1335 FD,OWN $1 2 Owner's User ID | 1447 FD.OWN $1 2 Owner's User ID |
1336 rD,DAT | 1448 rD,DAT |
1337 $3 5 Date Last Modified; Y M D H M | 1449 $3 5 Date Last Modified; Y M D H M |
1338 FD,LNK $8 1 Link Count | 1450 FD.LNK $8 1 Link Count |
1339 FD.5tZ | 1451 FD.5tZ |
1340 $9 4 File Size (number of bytes) | 1452 $9 4 File Size (number of bytes) |
1341 FD,DCR $D 3 Date Created; Y N | 1453 FD.DCR $D 3 Date Created; Y N |
1342 U | 1454 U |
1343 FD.SEG $10 240 Segment List: see below | 1455 FD.SEG $10 240 Segment List: see below |
1344 </literallayout> | 1456 </literallayout> |
1345 <para>The attribute byte contains the file permission bits, Bit 7 is set | 1457 <para>The attribute byte contains the file permission bits. Bit 7 is set |
1346 to indicate a directory file, bit 6 indicates a "sharable" | 1458 to indicate a directory file, bit 6 indicates a "sharable" |
1347 file, bit 5 is public execute, bit 4 is public write, etc</para> | 1459 file, bit 5 is public execute, bit 4 is public write, etc</para> |
1348 <para>The segment list consists of up to 48 five-byte entries that have | 1460 <para>The segment list consists of up to 48 five-byte entries that have |
1349 the size and address of each block of storage that comprise the file | 1461 the size and address of each block of storage that comprise the file |
1350 in logical order, Each entry has a three-byte logical sector number | 1462 in logical order. Each entry has a three-byte logical sector number |
1351 of the block, and a two-byte block size (in Sectors), The entry | 1463 of the block, and a two-byte block size (in Sectors). The entry |
1352 following the last segment will be zero</para> | 1464 following the last segment will be zero</para> |
1353 <para>When a file is created, it initially has no data segments | 1465 <para>When a file is created, it initially has no data segments |
1354 allocated to it, Write operations past the current end-of-file (the | 1466 allocated to it. Write operations past the current end-of-file (the |
1355 first write is always past the end-of-file) cause additional sectors | 1467 first write is always past the end-of-file) cause additional sectors |
1356 to be allocated to the file, If the file has no segments, it is given | 1468 to be allocated to the file. If the file has no segments, it is given |
1357 an initial segment having the number of sectors specified by the | 1469 an initial segment having the number of sectors specified by the |
1358 minimum allocation entry in the device descriptor, or the number of | 1470 minimum allocation entry in the device descriptor, or the number of |
1359 sectors requested if greater than the minimum, Subsequent expansions | 1471 sectors requested if greater than the minimum. Subsequent expansions |
1360 of the file are also generally made in minimum allocation increments, | 1472 of the file are also generally made in minimum allocation increments, |
1361 An attempt is made to expand the last segment wherever possible | 1473 An attempt is made to expand the last segment wherever possible |
1362 rather than adding a new segment, When the file is closed, unused | 1474 rather than adding a new segment. When the file is closed, unused |
1363 sectors in the last segment are truncated</para> | 1475 sectors in the last segment are truncated</para> |
1364 <para>A note about disk allocation: OS-9 attempts to minimize the number | 1476 <para>A note about disk allocation: OS-9 attempts to minimize the number |
1365 of storage segments used in a file, In fact, many files will only | 1477 of storage segments used in a file. In fact, many files will only |
1366 have one segment in which case no extra read operations ate needed to | 1478 have one segment in which case no extra read operations ate needed to |
1367 randomly access any byte on the file, Files can have multiple | 1479 randomly access any byte on the file. Files can have multiple |
1368 segments if the free space of the disk becomes very fragmented, or if | 1480 segments if the free space of the disk becomes very fragmented, or if |
1369 a file is repeatedly closed, then opened and expanded at some later | 1481 a file is repeatedly closed, then opened and expanded at some later |
1370 time, This can be avoided by writing a byte at the highest address to | 1482 time. This can be avoided by writing a byte at the highest address to |
1371 be used on a file before writing any other data</para> | 1483 be used on a file before writing any other data</para> |
1372 </sect2> | 1484 </sect2> |
1373 <sect2> | 1485 <sect2> |
1374 <title>Directory Files</title> | 1486 <title>Directory Files</title> |
1375 <para>Disk directories are files that have the "D" attribute | 1487 <para>Disk directories are files that have the "D" attribute |
1376 set. Directory files contain an integral number of directory entries | 1488 set. Directory files contain an integral number of directory entries |
1377 each of which can bold the name and LSN of a single regular or | 1489 each of which can bold the name and LSN of a single regular or |
1378 directory file,</para> | 1490 directory file,</para> |
1379 <para>Each directory entry is 32 b,ytes long, consisting of 29 bytes for | 1491 <para>Each directory entry is 32 b,ytes long, consisting of 29 bytes for |
1380 the file name followed by a three byte logical sector number of the | 1492 the file name followed by a three byte logical sector number of the |
1381 file's descriptor sector, The file name is left-justified in the | 1493 file's descriptor sector. The file name is left-justified in the |
1382 field with the sign bit of the last character set. Unused entries | 1494 field with the sign bit of the last character set. Unused entries |
1383 have a zero byte in the first file name character position.</para> | 1495 have a zero byte in the first file name character position.</para> |
1384 <para>Every mass-storage media must have a master directory called the | 1496 <para>Every mass-storage media must have a master directory called the |
1385 "root directory". The beginning logical sector number of | 1497 "root directory". The beginning logical sector number of |
1386 this directory is stored in the identification sector, as previously | 1498 this directory is stored in the identification sector, as previously |
1389 </sect1> | 1501 </sect1> |
1390 <sect1> | 1502 <sect1> |
1391 <title>RBFMAN Definitions of the Path Descriptor</title> | 1503 <title>RBFMAN Definitions of the Path Descriptor</title> |
1392 <para>The table below describes the usage of the file-manager- reserved | 1504 <para>The table below describes the usage of the file-manager- reserved |
1393 section of path descriptors used by RBFMAN.</para> | 1505 section of path descriptors used by RBFMAN.</para> |
1506 <informaltable frame="none"> | |
1507 <tgroup cols="4"> | |
1508 <colspec colwidth="1in" colname="c1"> | |
1509 <colspec colwidth="1in"> | |
1510 <colspec colwidth="0.8in"> | |
1511 <colspec colwidth="4in" colname="c4"> | |
1512 <spanspec spanname="all" namest="c1" nameend="c4"> | |
1513 <thead> | |
1514 <row rowsep="1"> | |
1515 <entry>Name</entry> | |
1516 <entry>Addr</entry> | |
1517 <entry>Size</entry> | |
1518 <entry>Description</entry> | |
1519 </row> | |
1520 </thead> | |
1521 <tbody> | |
1522 <row> | |
1523 <entry spanname="all">Universal Section (same for all file managers)</entry> | |
1524 </row> | |
1525 <row> | |
1526 <entry>PD.PD</entry> | |
1527 <entry>$00</entry> | |
1528 <entry>1</entry> | |
1529 <entry>Path number</entry> | |
1530 </row> | |
1531 <row> | |
1532 <entry>PD.NOD</entry> | |
1533 <entry>$01</entry> | |
1534 <entry>1</entry> | |
1535 <entry>Mode (read/write/update)</entry> | |
1536 </row> | |
1537 <row> | |
1538 <entry>PD.CNT</entry> | |
1539 <entry>$02</entry> | |
1540 <entry>1</entry> | |
1541 <entry>Number of open images</entry> | |
1542 </row> | |
1543 <row> | |
1544 <entry>PD.DEV</entry> | |
1545 <entry>$03</entry> | |
1546 <entry>2</entry> | |
1547 <entry>Address of device table entry</entry> | |
1548 </row> | |
1549 <row> | |
1550 <entry>PD.CPR</entry> | |
1551 <entry>$05</entry> | |
1552 <entry>1</entry> | |
1553 <entry>Current process ID</entry> | |
1554 </row> | |
1555 <row> | |
1556 <entry>PD.RGS</entry> | |
1557 <entry>$06</entry> | |
1558 <entry>2</entry> | |
1559 <entry>Address of callers register stack</entry> | |
1560 </row> | |
1561 <row> | |
1562 <entry>PD.BUF</entry> | |
1563 <entry>$08</entry> | |
1564 <entry>2</entry> | |
1565 <entry>Buffer address</entry> | |
1566 </row> | |
1567 <row> | |
1568 <entry spanname="all">RBFMAN Path Descriptor Definitions</entry> | |
1569 </row> | |
1570 <row> | |
1571 <entry>PD.SMF</entry> | |
1572 <entry>$OA</entry> | |
1573 <entry>1</entry> | |
1574 <entry>State flags (see next page)</entry> | |
1575 </row> | |
1576 <row> | |
1577 <entry>PD.CP</entry> | |
1578 <entry>$OB</entry> | |
1579 <entry>4</entry> | |
1580 <entry>Current logical file position (byte addr)</entry> | |
1581 </row> | |
1582 <row> | |
1583 <entry>PD.SIZ</entry> | |
1584 <entry>$OF</entry> | |
1585 <entry>4</entry> | |
1586 <entry>File size</entry> | |
1587 </row> | |
1588 <row> | |
1589 <entry>PD.SBL</entry> | |
1590 <entry>$13</entry> | |
1591 <entry>3</entry> | |
1592 <entry>Segment beginning logical sector number</entry> | |
1593 </row> | |
1594 <row> | |
1595 <entry>PD.SBP</entry> | |
1596 <entry>$16</entry> | |
1597 <entry>3</entry> | |
1598 <entry>Segment beginning physical sector number</entry> | |
1599 </row> | |
1600 <row> | |
1601 <entry>PD.SSZ</entry> | |
1602 <entry>$19</entry> | |
1603 <entry>2</entry> | |
1604 <entry>Segment size</entry> | |
1605 </row> | |
1606 <row> | |
1607 <entry>PD.DSK</entry> | |
1608 <entry>$15</entry> | |
1609 <entry>2</entry> | |
1610 <entry>Disk ID (for internal use only)</entry> | |
1611 </row> | |
1612 <row> | |
1613 <entry>PD.DTB</entry> | |
1614 <entry>$lD</entry> | |
1615 <entry>2</entry> | |
1616 <entry>Address of drive table</entry> | |
1617 </row> | |
1618 <row> | |
1619 <entry spanname="all">RBFMAN Option Section Definitions (Copied from dev descriptor)</entry> | |
1620 </row> | |
1621 <row> | |
1622 <entry></entry> | |
1623 <entry>$20</entry> | |
1624 <entry>1</entry> | |
1625 <entry>Device class 0= SCF 1=NSF 2=PIPE 3=SBF</entry> | |
1626 </row> | |
1627 <row> | |
1628 <entry>PD.DRV</entry> | |
1629 <entry>$21</entry> | |
1630 <entry>1</entry> | |
1631 <entry>Drive number (0,,N)</entry> | |
1632 </row> | |
1633 <row> | |
1634 <entry>PD.STP</entry> | |
1635 <entry>$22</entry> | |
1636 <entry>1</entry> | |
1637 <entry>Step rate</entry> | |
1638 </row> | |
1639 <row> | |
1640 <entry>PD.TYV</entry> | |
1641 <entry>$23</entry> | |
1642 <entry>1</entry> | |
1643 <entry>Device type</entry> | |
1644 </row> | |
1645 <row> | |
1646 <entry>PD.UNS</entry> | |
1647 <entry>$24</entry> | |
1648 <entry>1</entry> | |
1649 <entry>Density capability</entry> | |
1650 </row> | |
1651 <row> | |
1652 <entry>PD.CYL</entry> | |
1653 <entry>$25</entry> | |
1654 <entry>2</entry> | |
1655 <entry>Number of cylinders (tracks)</entry> | |
1656 </row> | |
1657 <row> | |
1658 <entry>PD.SID</entry> | |
1659 <entry>$27</entry> | |
1660 <entry>1</entry> | |
1661 <entry>Number of sides (surfaces)</entry> | |
1662 </row> | |
1663 <row> | |
1664 <entry>PD.VFY</entry> | |
1665 <entry>$28</entry> | |
1666 <entry>1</entry> | |
1667 <entry>0 = verify disk writes</entry> | |
1668 </row> | |
1669 <row> | |
1670 <entry>PD.SCT</entry> | |
1671 <entry>$29</entry> | |
1672 <entry>2</entry> | |
1673 <entry>Default number of sectors/track</entry> | |
1674 </row> | |
1675 <row> | |
1676 <entry>PD.TOS</entry> | |
1677 <entry>$2B</entry> | |
1678 <entry>2</entry> | |
1679 <entry>Default number of sectors/track (track 0)</entry> | |
1680 </row> | |
1681 <row> | |
1682 <entry>PD.ILV</entry> | |
1683 <entry>$2D</entry> | |
1684 <entry>1</entry> | |
1685 <entry>Sector interleave factor</entry> | |
1686 </row> | |
1687 <row> | |
1688 <entry>PD.SAS</entry> | |
1689 <entry>$2E</entry> | |
1690 <entry>1</entry> | |
1691 <entry>Segment allocation size</entry> | |
1692 </row> | |
1693 <row> | |
1694 <entry spanname="all">(the following values are NOT copied from the device descriptor)</entry> | |
1695 </row> | |
1696 <row> | |
1697 <entry>PD.ATT</entry> | |
1698 <entry>$33</entry> | |
1699 <entry>1</entry> | |
1700 <entry>File attributes (U S PE PW PR LW N)</entry> | |
1701 </row> | |
1702 <row> | |
1703 <entry>PD.FD</entry> | |
1704 <entry>$34</entry> | |
1705 <entry>3</entry> | |
1706 <entry>File descriptor PSN (physical sector 1)</entry> | |
1707 </row> | |
1708 <row> | |
1709 <entry>PIXDFD</entry> | |
1710 <entry>$37</entry> | |
1711 <entry>3</entry> | |
1712 <entry>Directory file descriptor PEN</entry> | |
1713 </row> | |
1714 <row> | |
1715 <entry>PD.DCP</entry> | |
1716 <entry>$3A</entry> | |
1717 <entry>4</entry> | |
1718 <entry>File's directory entry pointer</entry> | |
1719 </row> | |
1720 <row> | |
1721 <entry>PD.DVT</entry> | |
1722 <entry>$3E</entry> | |
1723 <entry>2</entry> | |
1724 <entry>Address of device table entry</entry> | |
1725 </row> | |
1726 </tbody> | |
1727 </tgroup> | |
1728 </informaltable> | |
1729 <para> | |
1730 State Flag (PD.SMF): the bits of this byte are defined as: | |
1731 </para> | |
1394 <literallayout> | 1732 <literallayout> |
1395 Name Addr Size | 1733 bit 0 - set if current buffer has been altered |
1396 Description | 1734 bit 1 - set if current sector is in buffer |
1397 Universal Section (same for all file managers) | 1735 bit 2 - set if descriptor sector in buffer |
1398 PD.PD $00 1 Path | |
1399 number | |
1400 PD.NOD $01 1 Mode (read/write/update) | |
1401 PD.CNT $02 1 | |
1402 Number of open images | |
1403 PD.DEV $03 2 Address of device table | |
1404 entry | |
1405 PD.CPR $05 1 Current process ID | |
1406 PD.RGS $06 2 Address of | |
1407 callers register stack | |
1408 PD.BUF $08 2 Buffer address | |
1409 RBFMAN Path Descriptor Definitions | |
1410 PD.SN2P $OA 1 State flags | |
1411 PD.CP $OB 4 Current logical file position (byte | |
1412 addr) | |
1413 PD.SIZ $OF 4 File size | |
1414 PD.SBL $13 3 Segment beginning | |
1415 logical sector number | |
1416 PD.SBP $16 3 Segment beginning physical | |
1417 sector number | |
1418 PD.SSZ $19 2 Segment size | |
1419 PD.DSK $15 2 Disk ID | |
1420 (for internal use only) | |
1421 PD.DTB $lD 2 Address of drive table | |
1422 RBFMAN Option Section Definitions (Copied from dev ez | |
1423 riptor) | |
1424 $20 1 Device class 0. SCF 1-NSF 2-PIPE $-SBF | |
1425 PD.DRV $21 | |
1426 1 Drive number (0,,N) | |
1427 PD.STP $22 1 Step rate | |
1428 PD.TYV $23 1 | |
1429 .Device type | |
1430 PD.UNS $24 1 Density capability | |
1431 PD.CYL $25 2 | |
1432 Number of cylinders (tracks) | |
1433 PD.SID $27 1 Number of sides | |
1434 (surfaces) | |
1435 PD.VFY $28 1 0 verify disk writes | |
1436 PD.SCT $29 2 | |
1437 Default number of sectors/track | |
1438 PD.TOS $213 2 Default number of | |
1439 sectors/track (track 0) | |
1440 PD.ILV $2D 1 Sector interleave | |
1441 factor | |
1442 PD.SAS $2E 1 Segment allocation size | |
1443 (the following values are NOT copied from the device descriptor) | |
1444 PD.ATT $33 1 File attributes (U S PE PW PR LW N) | |
1445 PD.FD | |
1446 $34 3 File descriptor PSN (physical sector 1) | |
1447 PIXDFD $37 3 | |
1448 Directory file descriptor PEN | |
1449 PD.DCP $3A 4 Filers directory entry | |
1450 pointer | |
1451 PD.DVT $3E 2 Address of device table entry | |
1452 State Flag (PD.SMF): the bits of this byte are defined as: | |
1453 </literallayout> | 1736 </literallayout> |
1454 <para>bit 0 - set if current buffer has been altered bit 1 - set if | |
1455 current sector is in buffer | |
1456 </para> | |
1457 <para>bit 2 - set if descriptor sector in buffer | |
1458 </para> | |
1459 <para>The first section of the path descriptor is universal for all file | 1737 <para>The first section of the path descriptor is universal for all file |
1460 managers, the second and third sections are defined by RBFMAN and | 1738 managers, the second and third sections are defined by RBFMAN and |
1461 RBFMAN-type device drivers, The option section of the path descriptor | 1739 RBFMAN-type device drivers. The option section of the path descriptor |
1462 contains many device operating parameters which may be read and/or | 1740 contains many device operating parameters which may be read and/or |
1463 written by the OS9 I$GSTT and I$SSTT service requests. This section | 1741 written by the OS9 I$GSTT and I$SSTT service requests. This section |
1464 is initialized by IOMAN which copies the initialization table of the | 1742 is initialized by IOMAN which copies the initialization table of the |
1465 device descriptor into the option section of the path descriptor when | 1743 device descriptor into the option section of the path descriptor when |
1466 a path to a device is opened, Any values not determined by this table | 1744 a path to a device is opened. Any values not determined by this table |
1467 will default to zero</para> | 1745 will default to zero</para> |
1468 </sect1> | 1746 </sect1> |
1469 <sect1> | 1747 <sect1> |
1470 <title>RBF DEVICE DESCRIPTOR MODULES</title> | 1748 <title>RBF DEVICE DESCRIPTOR MODULES</title> |
1471 <para>This section describes the definitions and use of the | 1749 <para>This section describes the definitions and use of the |
1474 <literallayout> | 1752 <literallayout> |
1475 MODULE | 1753 MODULE |
1476 OFFSET | 1754 OFFSET |
1477 0-$11 Standard Device Descriptor Nodule | 1755 0-$11 Standard Device Descriptor Nodule |
1478 Header | 1756 Header |
1479 $12 IT.DTP RNB 1 DEVICE TYPE (0-SCF 1-REF 2-PIPE 3SBF) | 1757 $12 IT.DTP RNB 1 DEVICE TYPE (0-SCF 1-RBF 2-PIPE 3SBF) |
1480 $13 | 1758 $13 |
1481 IT.DRV RMB 1 DRIVE NU,MBER | 1759 IT.DRV RMB 1 DRIVE NU,MBER |
1482 $14 IT.STP NMB 1 STEP RATE | 1760 $14 IT.STP NMB 1 STEP RATE |
1483 $15 | 1761 $15 |
1484 IT.TYP RMB 1 DEVICE TYPE (See RBFMAN path descriptor) | 1762 IT.TYP RMB 1 DEVICE TYPE (See RBFMAN path descriptor) |
1497 $20 IT.SAS lIMB 1 | 1775 $20 IT.SAS lIMB 1 |
1498 SEGMENT ALLOcATION SIZE | 1776 SEGMENT ALLOcATION SIZE |
1499 </literallayout> | 1777 </literallayout> |
1500 <para> | 1778 <para> |
1501 IT.DRV - This location is used to associate a one byte integer | 1779 IT.DRV - This location is used to associate a one byte integer |
1502 with each drive that a controller will handle, The drives for each | 1780 with each drive that a controller will handle. The drives for each |
1503 controller Should be numbered 0 to n-i, where n is the maximum number | 1781 controller Should be numbered 0 to n-i, where n is the maximum number |
1504 of drives the controller can handle,</para> | 1782 of drives the controller can handle,</para> |
1505 <para>IT.STP - (Floppy disks) This location sets the head stepping rate | 1783 <para>IT.STP - (Floppy disks) This location sets the head stepping rate |
1506 that will be used with a drive, The step rate should be set to the | 1784 that will be used with a drive. The step rate should be set to the |
1507 fastest value that the drive is capable of to reduce access time, The | 1785 fastest value that the drive is capable of to reduce access time. The |
1508 actual values stored depended on the specific disk controller and | 1786 actual values stored depended on the specific disk controller and |
1509 disk driver module used, Below are the values which are used by the | 1787 disk driver module used. Below are the values which are used by the |
1510 popular Western Digital floppy disk controller IC: | 1788 popular Western Digital floppy disk controller IC: |
1511 </para> | 1789 </para> |
1512 <literallayout> | 1790 <literallayout> |
1513 FDl77l FD179X Family | 1791 FDl77l FD179X Family |
1514 STEP | 1792 STEP |
1548 </sect1> | 1826 </sect1> |
1549 <sect1> | 1827 <sect1> |
1550 <title>RBF-TYPE DEVICE DRIVERS</title> | 1828 <title>RBF-TYPE DEVICE DRIVERS</title> |
1551 <para>An RBF type device driver module contains a package of subroutines | 1829 <para>An RBF type device driver module contains a package of subroutines |
1552 that perform sector oriented I/O to or from a specific hardware | 1830 that perform sector oriented I/O to or from a specific hardware |
1553 controller, These modules are usually reentrant so that one copy of | 1831 controller. These modules are usually reentrant so that one copy of |
1554 the module can simultaneously run several different devices that use | 1832 the module can simultaneously run several different devices that use |
1555 identical I/O controllers, IOMAN will allocate a static storage area | 1833 identical I/O controllers. IOMAN will allocate a static storage area |
1556 for each device (which may control Several drives), The size of the | 1834 for each device (which may control Several drives). The size of the |
1557 storage area is given in the device driver module header, Some of | 1835 storage area is given in the device driver module header. Some of |
1558 this storage area will be used by IOMAN and RBFMAN, the device driver | 1836 this storage area will be used by IOMAN and RBFMAN, the device driver |
1559 is free to use the remainder in any manner, This static sto.rage is | 1837 is free to use the remainder in any manner. This static sto.rage is |
1560 used as follows: | 1838 used as follows: |
1561 </para> | 1839 </para> |
1562 <para>Static Storage Definitions | 1840 <para>Static Storage Definitions |
1563 </para> | 1841 </para> |
1564 <literallayout> | 1842 <literallayout> |
1582 | 1860 |
1583 | 1861 |
1584 | 1862 |
1585 </literallayout> | 1863 </literallayout> |
1586 <para>NOTE: V.PAGE through V.USER are predefined in the OS9DEFS file. | 1864 <para>NOTE: V.PAGE through V.USER are predefined in the OS9DEFS file. |
1587 V.NDRV. DRVBEG, DRVMEM are predefined in the RBFDEFS file.</para> | 1865 V.NDRV. DRVBEG. DRVMEM are predefined in the RBFDEFS file.</para> |
1588 <para>V.PAGE, V.PORT These three bytes are defined by IOMAN as the 24- | 1866 <para>V.PAGE, V.PORT These three bytes are defined by IOMAN as the 24- |
1589 bit device address.</para> | 1867 bit device address.</para> |
1590 <para>V.LPRC This location contains the process ID of the last process | 1868 <para>V.LPRC This location contains the process ID of the last process |
1591 to use the device, Not used by REF-type device drivers</para> | 1869 to use the device. Not used by RBF-type device drivers</para> |
1592 <para>V.BUSY This location contains the process ID of the process | 1870 <para>V.BUSY This location contains the process ID of the process |
1593 currently using the device, Defined by RBFMAN.</para> | 1871 currently using the device. Defined by RBFMAN.</para> |
1594 <para>V.WAKE This location contains the process-ID of any process that | 1872 <para>V.WAKE This location contains the process-ID of any process that |
1595 is waiting for the device to complete I/O (0 = NO PROCESS WAITING), | 1873 is waiting for the device to complete I/O (0 = NO PROCESS WAITING), |
1596 Defined by device driver</para> | 1874 Defined by device driver</para> |
1597 <para>V.NDRV This location contains the number of drives that the | 1875 <para>V.NDRV This location contains the number of drives that the |
1598 controller can use, Defined by the device driver as the maximum | 1876 controller can use. Defined by the device driver as the maximum |
1599 number of drives that the controller can work with, RBFMAN will | 1877 number of drives that the controller can work with. RBFMAN will |
1600 assume that there Is a drive table for each drive, Also see the | 1878 assume that there Is a drive table for each drive. Also see the |
1601 driver INIT routine in this section,</para> | 1879 driver INIT routine in this section,</para> |
1602 <para>TABLES This area contains one table for each drive that the | 1880 <para>TABLES This area contains one table for each drive that the |
1603 controller will handle (RBFMAN will assume that there are as many | 1881 controller will handle (RBFMAN will assume that there are as many |
1604 tables as indicated by V.NDRV), Some time after the driver INIT | 1882 tables as indicated by V.NDRV). Some time after the driver INIT |
1605 routine has been called, RBFMAN will issue a request for the driver | 1883 routine has been called. RBFMAN will issue a request for the driver |
1606 to read the identification sector (logical sector zero) from a drive, | 1884 to read the identification sector (logical sector zero) from a drive, |
1607 At this time the driver will initialize the corresponding drive table | 1885 At this time the driver will initialize the corresponding drive table |
1608 by, copying the first part of the identification sector (up to | 1886 by, copying the first part of the identification sector (up to |
1609 DD,SIZ) into it, Also see the Identification Sector" section of | 1887 DD.SIZ) into it, Also see the Identification Sector" section of |
1610 this manual, The format of each drive table is as given below:</para> | 1888 this manual. The format of each drive table is as given below:</para> |
1611 <literallayout> | 1889 <literallayout> |
1612 OFFSET ORG 0 | 1890 OFFSET ORG 0 |
1613 $00 DD.TOT lIMB 3 TOTAL NUMBER OF SECTORS | 1891 $00 DD.TOT lIMB 3 TOTAL NUMBER OF SECTORS |
1614 $03 | 1892 $03 |
1615 DD,TKS RMB 1 TRACK SIZE ( IN SECTORS ) | 1893 DD.TKS RMB 1 TRACK SIZE ( IN SECTORS ) |
1616 $04 DD,MAP RMB 2 $ BYTES IN | 1894 $04 DD.MAP RMB 2 $ BYTES IN |
1617 ALLOcATION BIT NAP | 1895 ALLOcATION BIT NAP |
1618 $06 DD,BIT RMB 2 NUMBER OF SECTORS PER BIT | 1896 $06 DD.BIT RMB 2 NUMBER OF SECTORS PER BIT |
1619 (CLUSTER SIZE) | 1897 (CLUSTER SIZE) |
1620 $08 DD,DIR lIMB 3 ADDRESS OF ROOT DIRECTORY | 1898 $08 DD.DIR lIMB 3 ADDRESS OF ROOT DIRECTORY |
1621 $013 | 1899 $013 |
1622 DD,OWN RMB 2 .NER.S USER NUMBER | 1900 DD.OWN RMB 2 .NER.S USER NUMBER |
1623 SOD DD,ATT lIMB 1 DISK | 1901 SOD DD.ATT lIMB 1 DISK |
1624 ATTRIBUTES | 1902 ATTRIBUTES |
1625 $OE DD,DSK RMI3 2 DISK ID | 1903 $OE DD.DSK RMI3 2 DISK ID |
1626 $10 DD.FMT RMB 1 MEDIA | 1904 $10 DD.FMT RMB 1 MEDIA |
1627 FORMAT | 1905 FORMAT |
1628 $11 DD.SPT RMB 2 SECTORS/TRACK | 1906 $11 DD.SPT RMB 2 SECTORS/TRACK |
1629 $15 DD,RES RMB 2 RESERVED | 1907 $15 DD.RES RMB 2 RESERVED |
1630 FOR FUTURE USE | 1908 FOR FUTURE USE |
1631 DD,SIZ LOU | 1909 DD.SIZ LOU |
1632 $15 V. TRAE RMB 2 CURRENT TRACK | 1910 $15 V. TRAE RMB 2 CURRENT TRACK |
1633 NUMBER | 1911 NUMBER |
1634 $17 V.13MB RMB I BIT-MAP USE FLAG | 1912 $17 V.13MB RMB I BIT-MAP USE FLAG |
1635 $18 DRVMEM SQU SIZE OF EACH DRIVE TABLE | 1913 $18 DRVMEM SQU SIZE OF EACH DRIVE TABLE |
1636 </literallayout> | 1914 </literallayout> |
1637 <para>DD.TOT This location contains the total number of | 1915 <para>DD.TOT This location contains the total number of |
1638 sectors | 1916 sectors |
1639 contained on the disk,</para> | 1917 contained on the disk,</para> |
1640 <para>DD,TKS This location contains | 1918 <para>DD.TKS This location contains |
1641 the track size (in sectors),</para> | 1919 the track size (in sectors),</para> |
1642 <para>DD,MAP This location contains the | 1920 <para>DD.MAP This location contains the |
1643 number of bytes in the disk allocation bit map,</para> | 1921 number of bytes in the disk allocation bit map,</para> |
1644 <para>DD.BIT This location contains the number of sectors that each bit | 1922 <para>DD.BIT This location contains the number of sectors that each bit |
1645 represents in the disk allocation bit map, DD,DIR This location | 1923 represents in the disk allocation bit map, DD.DIR This location |
1646 contains the logical sector number of the disk root directory, DD,OWN | 1924 contains the logical sector number of the disk root directory. DD.OWN |
1647 This location contains the disk owner's user number, DD,APT This | 1925 This location contains the disk owner's user number. DD.APT This |
1648 location contains the disk access permission attributes as defined | 1926 location contains the disk access permission attributes as defined |
1649 below: | 1927 below: |
1650 </para> | 1928 </para> |
1651 <literallayout> | 1929 <literallayout> |
1652 BIT 7 - U (DIRECTORY IF SET) | 1930 BIT 7 - U (DIRECTORY IF SET) |
1676 1 - DOUBLE DENSITY | 1954 1 - DOUBLE DENSITY |
1677 | 1955 |
1678 BIT 132 - TRACK DENSITY | 1956 BIT 132 - TRACK DENSITY |
1679 O - SINGLE (48 TFI) 1-DOUBLE (6 ) | 1957 O - SINGLE (48 TFI) 1-DOUBLE (6 ) |
1680 </literallayout> | 1958 </literallayout> |
1681 <para>DD,SPT Number of sectors per track (track zero may use a different | 1959 <para>DD.SPT Number of sectors per track (track zero may use a different |
1682 value, specified by IT.TOS in the device descriptor), DD,RES RESERVED | 1960 value, specified by IT.TOS in the device descriptor). DD.RES RESERVED |
1683 FOR FUTURE USE</para> | 1961 FOR FUTURE USE</para> |
1684 <para>V.TRAE This location contains the current track which the head is | 1962 <para>V.TRAE This location contains the current track which the head is |
1685 on and is updated by the driver,</para> | 1963 on and is updated by the driver,</para> |
1686 <para>V.3MB This location is used by RBFMAN to indicate whether or not | 1964 <para>V.3MB This location is used by RBFMAN to indicate whether or not |
1687 the disk allocation bit map is currently in use (0 - not in use). The | 1965 the disk allocation bit map is currently in use (0 - not in use). The |
1688 disk driver routines must not alter this location.</para> | 1966 disk driver routines must not alter this location.</para> |
1689 </sect1> | 1967 </sect1> |
1690 <sect1> | 1968 <sect1> |
1691 <title>RBFMAN DEVICE DRIVERS</title> | 1969 <title>RBFMAN DEVICE DRIVERS</title> |
1692 <para>As with all device drivers, REFMAN-type device drivers use a | 1970 <para>As with all device drivers, RBFMAN-type device drivers use a |
1693 standard executable memory module format with a module type of | 1971 standard executable memory module format with a module type of |
1694 "device driver" (CODE $E). The execution offset address in | 1972 "device driver" (CODE $E). The execution offset address in |
1695 the module header points to a branch table that has six three byte | 1973 the module header points to a branch table that has six three byte |
1696 entries, Each entry is typically a LENA to the corresponding | 1974 entries. Each entry is typically a LENA to the corresponding |
1697 subroutine, The branch table is defined as follows: | 1975 subroutine. The branch table is defined as follows: |
1698 </para> | 1976 </para> |
1699 <literallayout> | 1977 <literallayout> |
1700 ENTRY LENA | 1978 ENTRY LENA |
1701 XNIT INITIALIZE DRIVE | 1979 XNIT INITIALIZE DRIVE |
1702 LBRA READ READ SECTOR | 1980 LBRA READ READ SECTOR |
1706 LENA SETSTA SET STATUS | 1984 LENA SETSTA SET STATUS |
1707 LENA | 1985 LENA |
1708 TERM TERMINATE DEVICE | 1986 TERM TERMINATE DEVICE |
1709 </literallayout> | 1987 </literallayout> |
1710 <para>Each subroutine should exit with the condition code register C bit | 1988 <para>Each subroutine should exit with the condition code register C bit |
1711 cleared if no error occurred, Otherwise the C bit should be set and | 1989 cleared if no error occurred. Otherwise the C bit should be set and |
1712 an appropriate error code returned in the B register, Below is a | 1990 an appropriate error code returned in the B register. Below is a |
1713 description of each subroutine, its input parameters, and its output | 1991 description of each subroutine, its input parameters, and its output |
1714 pa eters.</para> | 1992 pa eters.</para> |
1715 <sect2> | 1993 <sect2> |
1716 <title>NAME: INIT</title> | 1994 <title>NAME: INIT</title> |
1717 <para>INPUT: (U) - ADDRESS OF DEVICE STATIC STORAGE (Y) - ADDRESS OF THE | 1995 <para>INPUT: (U) - ADDRESS OF DEVICE STATIC STORAGE (Y) - ADDRESS OF THE |
1724 </para> | 2002 </para> |
1725 <orderedlist numeration="arabic"> | 2003 <orderedlist numeration="arabic"> |
1726 <listitem><para>If disk writes are verified, use the F$SRQM service, request | 2004 <listitem><para>If disk writes are verified, use the F$SRQM service, request |
1727 to allocate a 256 byte buffer area where a sector may be read back | 2005 to allocate a 256 byte buffer area where a sector may be read back |
1728 and verified after a write,</para></listitem> | 2006 and verified after a write,</para></listitem> |
1729 <listitem><para>Initialize the device permanent storage, For floppy disk | 2007 <listitem><para>Initialize the device permanent storage. For floppy disk |
1730 controller typically this consists of initializing V.NDRV to the | 2008 controller typically this consists of initializing V.NDRV to the |
1731 number of drives that the controller will work with, initializing | 2009 number of drives that the controller will work with, initializing |
1732 DD,TOT in the drive table to a non-zero value so that sector zero | 2010 DD.TOT in the drive table to a non-zero value so that sector zero |
1733 may be read or written to, and initializing V.TRAK to $FF so that | 2011 may be read or written to, and initializing V.TRAK to $FF so that |
1734 the first seek will find track zero,</para></listitem> | 2012 the first seek will find track zero,</para></listitem> |
1735 <listitem><para>Place the IRQ service routine on the IRQ polling list by | 2013 <listitem><para>Place the IRQ service routine on the IRQ polling list by |
1736 using the OS9 F$IRQ service request,</para></listitem> | 2014 using the OS9 F$IRQ service request,</para></listitem> |
1737 <listitem><para>Initialize the device c ntro registers (enable interrupts if | 2015 <listitem><para>Initialize the device c ntro registers (enable interrupts if |
1738 necessary)</para></listitem> | 2016 necessary)</para></listitem> |
1739 </orderedlist> | 2017 </orderedlist> |
1740 <para>NOTE: Prior to being called, the device permanent storage will be | 2018 <para>NOTE: Prior to being called, the device permanent storage will be |
1741 cleared (set to zero) except for V.PAGE and V.PORT which will contain | 2019 cleared (set to zero) except for V.PAGE and V.PORT which will contain |
1742 the 24 bit device address, The driver should initialize each drive | 2020 the 24 bit device address. The driver should initialize each drive |
1743 table appropriately for the type of disk the driver expects to be | 2021 table appropriately for the type of disk the driver expects to be |
1744 used on the corresponding drive.</para> | 2022 used on the corresponding drive.</para> |
1745 </sect2> | 2023 </sect2> |
1746 <sect2> | 2024 <sect2> |
1747 <title>NAME: READ</title> | 2025 <title>NAME: READ</title> |
1759 <para> | 2037 <para> |
1760 FUNCTION: READ A 256 BYTE SECTOR</para> | 2038 FUNCTION: READ A 256 BYTE SECTOR</para> |
1761 <para> | 2039 <para> |
1762 Read a sector from the disk and place it in the sector buffer | 2040 Read a sector from the disk and place it in the sector buffer |
1763 (256 byte). Below are the things that the disk driver must do:</para> | 2041 (256 byte). Below are the things that the disk driver must do:</para> |
1764 <para>1, Get the sector buffer address from PD.BUF in the path | 2042 <para>1. Get the sector buffer address from PD.BUF in the path |
1765 descriptor,</para> | 2043 descriptor,</para> |
1766 <para>2. Get the drive number from PD.,DRV in the path descriptor.</para> | 2044 <para>2. Get the drive number from PD.,DRV in the path descriptor.</para> |
1767 <para>3, Compute the physical disk address from the logical Sector</para> | 2045 <para>3. Compute the physical disk address from the logical Sector</para> |
1768 <para>number,</para> | 2046 <para>number,</para> |
1769 <para>4, Initiate the read operation,</para> | 2047 <para>4. Initiate the read operation,</para> |
1770 <para>5. Copy V.BUSY to V.WAKE, then go to sleep and wait for the I/O to | 2048 <para>5. Copy V.BUSY to V.WAKE, then go to sleep and wait for the I/O to |
1771 complete (the IRQ service routine is responsible for sending a wake | 2049 complete (the IRQ service routine is responsible for sending a wake |
1772 up signal), After awakening, test V.WAKE to see if it is clear, if | 2050 up signal). After awakening, test V.WAKE to see if it is clear, if |
1773 not, go back to sleep,</para> | 2051 not, go back to sleep,</para> |
1774 <para>If the disk controller can not be interrupt driven it will be | 2052 <para>If the disk controller can not be interrupt driven it will be |
1775 necessary to perform programmed I/O.</para> | 2053 necessary to perform programmed I/O.</para> |
1776 <para> | 2054 <para> |
1777 NOTE 1: Whenever logical sector zero is read, the first part | 2055 NOTE 1: Whenever logical sector zero is read, the first part |
1804 <para>(CC) = C bit set.</para> | 2082 <para>(CC) = C bit set.</para> |
1805 <para>(B) = Appropriate error code.</para> | 2083 <para>(B) = Appropriate error code.</para> |
1806 <para> | 2084 <para> |
1807 FUNCTION. WRITE A SECTOR</para> | 2085 FUNCTION. WRITE A SECTOR</para> |
1808 <para> | 2086 <para> |
1809 Wtite the sector buffer (256 bytes) to the disk, Below are the | 2087 Wtite the sector buffer (256 bytes) to the disk. Below are the |
1810 things that a disk driver must do:</para> | 2088 things that a disk driver must do:</para> |
1811 <para>1, Get the sector buffer address from PD.BUF in the path | 2089 <para>1. Get the sector buffer address from PD.BUF in the path |
1812 descriptor,</para> | 2090 descriptor,</para> |
1813 <para>2. Get the drive number from PD.DRV in the path descriptor,</para> | 2091 <para>2. Get the drive number from PD.DRV in the path descriptor,</para> |
1814 <para>3. Compute the physical disk address from the logical Sector</para> | 2092 <para>3. Compute the physical disk address from the logical Sector</para> |
1815 <para>fl4mber,</para> | 2093 <para>fl4mber,</para> |
1816 <para>4. Initiate the write operation,</para> | 2094 <para>4. Initiate the write operation,</para> |
1817 <para>5, Copy V.BtjSy to V.WAKE, then go to. sleep and wait for the I/O | 2095 <para>5. Copy V.BtjSy to V.WAKE, then go to. sleep and wait for the I/O |
1818 to complete (the IRQ service routine is responsible for sending the | 2096 to complete (the IRQ service routine is responsible for sending the |
1819 wakeup signal), After awakening, test V.WAXE to see if it is clear, | 2097 wakeup signal). After awakening, test V.WAXE to see if it is clear, |
1820 if it is not, then go back to sleep, If the disk controller can not | 2098 if it is not, then go back to sleep. If the disk controller can not |
1821 be interrupt-driven, it will be necessary to perform a programmed I/O | 2099 be interrupt-driven, it will be necessary to perform a programmed I/O |
1822 transfer,</para> | 2100 transfer,</para> |
1823 <para>6, If PD.VFY in the path descriptor is equal to zero, read the | 2101 <para>6. If PD.VFY in the path descriptor is equal to zero, read the |
1824 sector back in and verify that it was written correctly, This usually | 2102 sector back in and verify that it was written correctly. This usually |
1825 does not involve a compare of the data,</para> | 2103 does not involve a compare of the data,</para> |
1826 <para>NOTE 1: If disk writes are to be verified, the INIT routine must | 2104 <para>NOTE 1: If disk writes are to be verified, the INIT routine must |
1827 request the buffer where the sector may be placed when it is read | 2105 request the buffer where the sector may be placed when it is read |
1828 back in, Do not copy sector zero into the drive table when it is read | 2106 back in. Do not copy sector zero into the drive table when it is read |
1829 back to be verified,</para> | 2107 back to be verified,</para> |
1830 <para>NOTE 2: Use the drive number (PD.DRV) to compute the offset to the | 2108 <para>NOTE 2: Use the drive number (PD.DRV) to compute the offset to the |
1831 corresponding drive table as shown for the READ routine.</para> | 2109 corresponding drive table as shown for the READ routine.</para> |
1832 </sect2> | 2110 </sect2> |
1833 <sect2> | 2111 <sect2> |
1851 <para>These routines are wild card calls used to get (set) the device's | 2129 <para>These routines are wild card calls used to get (set) the device's |
1852 operating parameters as specified for the OS9 I$GSTT and I$SSTT | 2130 operating parameters as specified for the OS9 I$GSTT and I$SSTT |
1853 service requests,</para> | 2131 service requests,</para> |
1854 <para>It may be necessary to examine or change the register stack which | 2132 <para>It may be necessary to examine or change the register stack which |
1855 contains the values of MPU registers at the time of the I$GSTT or | 2133 contains the values of MPU registers at the time of the I$GSTT or |
1856 I$SSTT service request, The address of the register stack may be | 2134 I$SSTT service request. The address of the register stack may be |
1857 found in PD.RGS, which is located in the path descriptor, , The | 2135 found in PD.RGS, which is located in the path descriptor, . The |
1858 following offsets may be used to access any particular value in the | 2136 following offsets may be used to access any particular value in the |
1859 register stack: | 2137 register stack: |
1860 OFFSET MNEMONIC MPG REGISTER | 2138 OFFSET MNEMONIC MPG REGISTER |
1861 $0 NSCC RMB I | 2139 $0 NSCC RMB I |
1862 CONDITION CODE REGISTER | 2140 CONDITION CODE REGISTER |
1882 <para>(CC) = C bit set.</para> | 2160 <para>(CC) = C bit set.</para> |
1883 <para>(B) = Appropriate error code.</para> | 2161 <para>(B) = Appropriate error code.</para> |
1884 <para>FUNCTION: TERMINATE DEVICE</para> | 2162 <para>FUNCTION: TERMINATE DEVICE</para> |
1885 <para>This routine is called when a device is no longer in use in the | 2163 <para>This routine is called when a device is no longer in use in the |
1886 system, which is defined to be when the link count of~ its device | 2164 system, which is defined to be when the link count of~ its device |
1887 descriptor module becomes zero), The TERM routine must:</para> | 2165 descriptor module becomes zero). The TERM routine must:</para> |
1888 <para>1. Wait until any pending I/O has completed,</para> | 2166 <para>1. Wait until any pending I/O has completed,</para> |
1889 <para>2. Disable the device interrupts,</para> | 2167 <para>2. Disable the device interrupts,</para> |
1890 <para>3. Remove the device from the IRQ polling list,</para> | 2168 <para>3. Remove the device from the IRQ polling list,</para> |
1891 <para>4. If ,tbe INIT routine reserved a 256 byte buffer for verifying | 2169 <para>4. If ,tbe INIT routine reserved a 256 byte buffer for verifying |
1892 disk writes, return the memory with the F$MEM service request.</para> | 2170 disk writes, return the memory with the F$MEM service request.</para> |
1896 <para>FUNCTION: SERVICE DEVICE INTERRUPTs | 2174 <para>FUNCTION: SERVICE DEVICE INTERRUPTs |
1897 </para> | 2175 </para> |
1898 <para> | 2176 <para> |
1899 Although this routine is not included in the device driver | 2177 Although this routine is not included in the device driver |
1900 module branch table and is not called directly by RBFMAN, it is an | 2178 module branch table and is not called directly by RBFMAN, it is an |
1901 key routine in interrupt-driven device drivers, Its function is to:</para> | 2179 key routine in interrupt-driven device drivers. Its function is to:</para> |
1902 <para>1. Service device interrupts,</para> | 2180 <para>1. Service device interrupts,</para> |
1903 <para>2. When the I/O is complete, the IRQ service routine should send</para> | 2181 <para>2. When the I/O is complete, the IRQ service routine should send</para> |
1904 <para>a wake up signal to the process whose process ID is in V.WAKE</para> | 2182 <para>a wake up signal to the process whose process ID is in V.WAKE</para> |
1905 <para>Also clear V.WAKE as a flag to the mainline program that the IRQ</para> | 2183 <para>Also clear V.WAKE as a flag to the mainline program that the IRQ</para> |
1906 <para>has indeed occurred. | 2184 <para>has indeed occurred. |
1924 <para>FUNCTION. LOAD TEE BOOT FILE I 0 ORY FROM MASS-STORAGE | 2202 <para>FUNCTION. LOAD TEE BOOT FILE I 0 ORY FROM MASS-STORAGE |
1925 | 2203 |
1926 | 2204 |
1927 | 2205 |
1928 </para> | 2206 </para> |
1929 <para>NOTE: The BOOT module is ncit~ part of the disk driver, It is a | 2207 <para>NOTE: The BOOT module is ncit~ part of the disk driver. It is a |
1930 separate module which is normally co-resident with the uOS9P2w module | 2208 separate module which is normally co-resident with the uOS9P2w module |
1931 in the system firmware,</para> | 2209 in the system firmware,</para> |
1932 <para> | 2210 <para> |
1933 The bootstrap module contains one subroutine that loads the | 2211 The bootstrap module contains one subroutine that loads the |
1934 bootstrap file and Some related information into memory, it uses the | 2212 bootstrap file and Some related information into memory, it uses the |
1935 standard executable module format with a module type of "system" | 2213 standard executable module format with a module type of "system" |
1936 (code $C). The execution offset in the module header contains the | 2214 (code $C). The execution offset in the module header contains the |
1937 offset to the entry point of this subroutine,</para> | 2215 offset to the entry point of this subroutine,</para> |
1938 <para>It obtains the starting sector number and size of the "OS9Boot" | 2216 <para>It obtains the starting sector number and size of the "OS9Boot" |
1939 file from the identifIcation sector (LSN 0), OS-9 is called to | 2217 file from the identifIcation sector (LSN 0). OS-9 is called to |
1940 allocate a memory area large enough for the boot file, and then it | 2218 allocate a memory area large enough for the boot file, and then it |
1941 loads the boot file into this memory area,</para> | 2219 loads the boot file into this memory area,</para> |
1942 <para>1. Read the identification sector (sector zero) from the disk. | 2220 <para>1. Read the identification sector (sector zero) from the disk. |
1943 BOOT must pick its own buffer area, The identification sector | 2221 BOOT must pick its own buffer area. The identification sector |
1944 contains the values for DD.BT (the 24 bit logical sector number of | 2222 contains the values for DD.BT (the 24 bit logical sector number of |
1945 the bootstrap file), and PP.552 (the size of the bootstrap file in | 2223 the bootstrap file), and PP.552 (the size of the bootstrap file in |
1946 bytes). For a full description of the identification sector, | 2224 bytes). For a full description of the identification sector, |
1947 See | 2225 See |
1948 6.1,1,</para> | 2226 6.1,1,</para> |
1949 <para>2. After reading the identification sector into the buffer, get | 2227 <para>2. After reading the identification sector into the buffer, get |
1950 the 24 bit logical sector number of the bootstrap file from DD,BT.</para> | 2228 the 24 bit logical sector number of the bootstrap file from DD.BT.</para> |
1951 <para>3. Get the size (in bytes) of the bootstrap file from PP.1352, The | 2229 <para>3. Get the size (in bytes) of the bootstrap file from PP.1352. The |
1952 boot is contained in one logically contiguous block beginning at the | 2230 boot is contained in one logically contiguous block beginning at the |
1953 logical sector specified in DD,BT and extending for (PP.1352/256+1) | 2231 logical sector specified in DD.BT and extending for (PP.1352/256+1) |
1954 sectors,</para> | 2232 sectors,</para> |
1955 <para>4, Use the OS9 F$SRQM service request to request the memory area | 2233 <para>4. Use the OS9 F$SRQM service request to request the memory area |
1956 where the boot file will be loaded into.</para> | 2234 where the boot file will be loaded into.</para> |
1957 <para>5, Read the boot file into this memory area,</para> | 2235 <para>5. Read the boot file into this memory area,</para> |
1958 <para>6. Return the size of the boot file and its location.</para> | 2236 <para>6. Return the size of the boot file and its location.</para> |
1959 </sect2> | 2237 </sect2> |
1960 </sect1> | 2238 </sect1> |
1961 </chapter> | 2239 </chapter> |
1962 <chapter> | 2240 <chapter> |
1963 <title>SEQUENTIAL CHARACTER FILE MANAGER</title> | 2241 <title>SEQUENTIAL CHARACTER FILE MANAGER</title> |
1964 <para>The Sequential Character File Manager (SCFMAN) is the OS-9 file | 2242 <para>The Sequential Character File Manager (SCFMAN) is the OS-9 file |
1965 manager module that supports devices that operate on a character- | 2243 manager module that supports devices that operate on a character- |
1966 by-character basis, such as terminals, printers, modems, etc. SCFMAN | 2244 by-character basis, such as terminals, printers, modems, etc. SCFMAN |
1967 can handle any number or type of such devices, It is a reentrant | 2245 can handle any number or type of such devices. It is a reentrant |
1968 subroutine package called by XOMAN for I/O service requests to | 2246 subroutine package called by XOMAN for I/O service requests to |
1969 sequentia~ character ~oriented devices, It includes the extensive | 2247 sequentia~ character ~oriented devices. It includes the extensive |
1970 input and output e~diting functions typical of line- oriented | 2248 input and output e~diting functions typical of line- oriented |
1971 operat~.on such as: backspace, line delete, repeat line, auto line | 2249 operat~.on such as: backspace, line delete, repeat line, auto line |
1972 feed, Screen pause, return delay padding, etc</para> | 2250 feed. Screen pause, return delay padding, etc</para> |
1973 <para>Standard OS-9 systems are supplied with SCFMAN and two SCF-type | 2251 <para>Standard OS-9 systems are supplied with SCFMAN and two SCF-type |
1974 device driver modules: ACIA, which run 6830 serial interfaces, and | 2252 device driver modules: ACIA, which run 6830 serial interfaces, and |
1975 PIA, which drives a 682l-type parallel interface for printers</para> | 2253 PIA, which drives a 682l-type parallel interface for printers</para> |
1976 <sect1> | 2254 <sect1> |
1977 <title>SCFMAN LINE EDITING FUNCTIONS</title> | 2255 <title>SCFMAN LINE EDITING FUNCTIONS</title> |
1984 automatically followed by line feeds or nulls, and the high order | 2262 automatically followed by line feeds or nulls, and the high order |
1985 bits are passed as sent/received</para> | 2263 bits are passed as sent/received</para> |
1986 <para>I$RDLN and I$WRLN service requests (which correspond to BasicQ9 | 2264 <para>I$RDLN and I$WRLN service requests (which correspond to BasicQ9 |
1987 INPUT, PRINT, READ and WRITE statements) to SCFMAN-type devices | 2265 INPUT, PRINT, READ and WRITE statements) to SCFMAN-type devices |
1988 perform full line editing of all functions enabled for the paYticular | 2266 perform full line editing of all functions enabled for the paYticular |
1989 device, These functions are initialized when the device is first used | 2267 device. These functions are initialized when the device is first used |
1990 by copying the option table from the device descriptor table | 2268 by copying the option table from the device descriptor table |
1991 associated with the specific device, They may be altered anytime | 2269 associated with the specific device. They may be altered anytime |
1992 afterwards from assembly language programs using the I$SSTT and | 2270 afterwards from assembly language programs using the I$SSTT and |
1993 I$GSST service requests, or from the keyboard using the T~CDE | 2271 I$GSST service requests, or from the keyboard using the T~CDE |
1994 command, Also, all bytes transfered in this mode will have the high | 2272 command. Also, all bytes transfered in this mode will have the high |
1995 order bit cleared</para> | 2273 order bit cleared</para> |
1996 <para>The following path descriptor values control the line editing | 2274 <para>The following path descriptor values control the line editing |
1997 functions: | 2275 functions: |
1998 </para> | 2276 </para> |
1999 <para>If PD.UPC <> 0 bytes input or output in the range ~ are made | 2277 <para>If PD.UPC <> 0 bytes input or output in the range ~ are made |
2013 character) if PD.BSo 0, or PD.BSE, space, PD~8SE if PD.BSQ K> 0</para> | 2291 character) if PD.BSo 0, or PD.BSE, space, PD~8SE if PD.BSQ K> 0</para> |
2014 <para>If PD.DEL <> 0, SCF will. recognize PD.DEL the delete line | 2292 <para>If PD.DEL <> 0, SCF will. recognize PD.DEL the delete line |
2015 character (on input), and echo the backspace sequence over the entire | 2293 character (on input), and echo the backspace sequence over the entire |
2016 line if PD.DLO 0, or echo CR/LF it PD.DLO <> 0 | 2294 line if PD.DLO 0, or echo CR/LF it PD.DLO <> 0 |
2017 </para> | 2295 </para> |
2018 <para>PD.EOR defines the end of record character, This is the last | 2296 <para>PD.EOR defines the end of record character. This is the last |
2019 character an each line entered (I$RDLN), and terminates the output | 2297 character an each line entered (I$RDLN), and terminates the output |
2020 </para> | 2298 </para> |
2021 <para>(I$WRLN) when this character is sent, Normally PD.EOR will be set | 2299 <para>(I$WRLN) when this character is sent. Normally PD.EOR will be set |
2022 to $OD, If it is set to zero, SCF's READLN will NEVER terminate, | 2300 to $OD. If it is set to zero, SCF's READLN will NEVER terminate, |
2023 unless an EOF occurs,</para> | 2301 unless an EOF occurs,</para> |
2024 <para>It PD.EOF <> 0. it defines the end of file character, SCFMAN | 2302 <para>It PD.EOF <> 0. it defines the end of file character. SCFMAN |
2025 will return an end-of-file error on I$READ or I$RDLN if this is the | 2303 will return an end-of-file error on I$READ or I$RDLN if this is the |
2026 first (and only) character input, It can be disabled by setting its | 2304 first (and only) character input. It can be disabled by setting its |
2027 value to zero,</para> | 2305 value to zero,</para> |
2028 <para>If PD.RPR <> 0. SCF (I$RDLN) will, upon receipt of this | 2306 <para>If PD.RPR <> 0. SCF (I$RDLN) will, upon receipt of this |
2029 character, echo a carriage return (optional line feedl, and then | 2307 character, echo a carriage return (optional line feedl, and then |
2030 reprint the current la~ne,</para> | 2308 reprint the current la~ne,</para> |
2031 <para>It PD.DUP <> 0, SCF (I$RDLN) will duplicate whatever js in | 2309 <para>It PD.DUP <> 0, SCF (I$RDLN) will duplicate whatever js in |
2032 the input buffer through the first PD.EOH~ character,</para> | 2310 the input buffer through the first PD.EOH~ character,</para> |
2033 <para>It PD.PSC <> 0, output is suspended before the next "PD.EOR" | 2311 <para>It PD.PSC <> 0, output is suspended before the next "PD.EOR" |
2034 character when this character is input, This will also delete any | 2312 character when this character is input. This will also delete any |
2035 type abead~ input for I$RDLN,</para> | 2313 type abead~ input for I$RDLN,</para> |
2036 <para>If PD.INT <> 0, and is received on input, a keyboard | 2314 <para>If PD.INT <> 0, and is received on input, a keyboard |
2037 interrupt signal is sent to the last user of tbrs path, Also it will | 2315 interrupt signal is sent to the last user of tbrs path. Also it will |
2038 terminate the current I/O request (it any) with an error identical to | 2316 terminate the current I/O request (it any) with an error identical to |
2039 the keyboard interrupt signal code, This location normally is set to | 2317 the keyboard interrupt signal code. This location normally is set to |
2040 a control-C character,</para> | 2318 a control-C character,</para> |
2041 <para>If PD.QUT <> 0. and is received on input, a keyboard abort | 2319 <para>If PD.QUT <> 0. and is received on input, a keyboard abort |
2042 signal is sent to the last user of this path, Also it will terminate | 2320 signal is sent to the last user of this path. Also it will terminate |
2043 the current I/O request (if any) with an error code identical to the | 2321 the current I/O request (if any) with an error code identical to the |
2044 keyboard interrrupt signal code, This location is normally set to a | 2322 keyboard interrrupt signal code. This location is normally set to a |
2045 control-Q character,</para> | 2323 control-Q character,</para> |
2046 <para>It PD.OVF <> 0, It is echoed when I$RDLN has satisfied its | 2324 <para>It PD.OVF <> 0, It is echoed when I$RDLN has satisfied its |
2047 input byte count without finding a wPD.EOR~ character,</para> | 2325 input byte count without finding a wPD.EOR~ character,</para> |
2048 <para> | 2326 <para> |
2049 | 2327 |
2050 | 2328 |
2051 </para> | 2329 </para> |
2052 <para>NOTE: It is possible to disable most of these special editing | 2330 <para>NOTE: It is possible to disable most of these special editing |
2053 functions by setting the corresponding control character in the path | 2331 functions by setting the corresponding control character in the path |
2054 descriptor to zero by using the I$SSTT service request, or by running | 2332 descriptor to zero by using the I$SSTT service request, or by running |
2055 the TMODE utility, A more permanent solution may be had by setting | 2333 the TMODE utility. A more permanent solution may be had by setting |
2056 the corresponding control character value in the device descriptor | 2334 the corresponding control character value in the device descriptor |
2057 module to zero,</para> | 2335 module to zero,</para> |
2058 <para> | 2336 <para> |
2059 Device descriptors may be inspected to determine the default | 2337 Device descriptors may be inspected to determine the default |
2060 settings for these values for specific devices.</para> | 2338 settings for these values for specific devices.</para> |
2117 PD.RPR $2D I Reprint line | 2395 PD.RPR $2D I Reprint line |
2118 character | 2396 character |
2119 PD.DUP $25 1 Duplicate last line character | 2397 PD.DUP $25 1 Duplicate last line character |
2120 PD.PSC $2F | 2398 PD.PSC $2F |
2121 I Pause character | 2399 I Pause character |
2122 PD,INT $30 I Meyboard interrupt character (CTL | 2400 PD.INT $30 I Meyboard interrupt character (CTL |
2123 C) | 2401 C) |
2124 PD.QUT $31 1 Eeyboard abort character (CTL 0) | 2402 PD.QUT $31 1 Eeyboard abort character (CTL 0) |
2125 PD.BSE $32 1 | 2403 PD.BSE $32 1 |
2126 Backspace echo character (BSE) | 2404 Backspace echo character (BSE) |
2127 PD.OVF $33 1 Line overflow | 2405 PD.OVF $33 1 Line overflow |
2138 | 2416 |
2139 | 2417 |
2140 </para> | 2418 </para> |
2141 <para>The first section is universal for all file managers, the second | 2419 <para>The first section is universal for all file managers, the second |
2142 and third section are specific~for SCFMAN and SCFMAN-type device | 2420 and third section are specific~for SCFMAN and SCFMAN-type device |
2143 drivers, The option section of the path descriptor contains many | 2421 drivers. The option section of the path descriptor contains many |
2144 device operating parameters whicb may be read or written by the OS9 | 2422 device operating parameters whicb may be read or written by the OS9 |
2145 I$GSTT or I$SSTT service requests, IOMAN initializes this section | 2423 I$GSTT or I$SSTT service requests. IOMAN initializes this section |
2146 when a path is opened to a device by copying the corresponding device | 2424 when a path is opened to a device by copying the corresponding device |
2147 descriptor initialization table, Any values not determined by this | 2425 descriptor initialization table. Any values not determined by this |
2148 table will default to zero | 2426 table will default to zero |
2149 </para> | 2427 </para> |
2150 <para>Special editing functions may be disabled by setting the | 2428 <para>Special editing functions may be disabled by setting the |
2151 corresponding control character value to zero</para> | 2429 corresponding control character value to zero</para> |
2152 </sect1> | 2430 </sect1> |
2202 OFPSET TO STATUS ROUTINE | 2480 OFPSET TO STATUS ROUTINE |
2203 320 IT.ERR RItE 1 INITIAL ERROR STATUS</para> | 2481 320 IT.ERR RItE 1 INITIAL ERROR STATUS</para> |
2204 <para> | 2482 <para> |
2205 NOTES:</para> | 2483 NOTES:</para> |
2206 <para>8012 editing functions will be ~turned off~ if the corresponding | 2484 <para>8012 editing functions will be ~turned off~ if the corresponding |
2207 special character is a zero, For example, it IT.EOF was a zero, there | 2485 special character is a zero. For example, it IT.EOF was a zero, there |
2208 would be no end of file character,</para> | 2486 would be no end of file character,</para> |
2209 <para>IT.PAR is typically used to intitialize the device s control | 2487 <para>IT.PAR is typically used to intitialize the device s control |
2210 register when a path is opened to it.</para> | 2488 register when a path is opened to it.</para> |
2211 </sect1> | 2489 </sect1> |
2212 <sect1> | 2490 <sect1> |
2213 <title>SCF DEVICE DRIVER STORAGE DEFINITIONS</title> | 2491 <title>SCF DEVICE DRIVER STORAGE DEFINITIONS</title> |
2214 <para>An SCF!,tAN-type device driver module contains a package of | 2492 <para>An SCF!,tAN-type device driver module contains a package of |
2215 subroutines that perform raw I/o transfers to or from a specific | 2493 subroutines that perform raw I/o transfers to or from a specific |
2216 hardware controller, These modules are usually reentrant so that one | 2494 hardware controller. These modules are usually reentrant so that one |
2217 copy of the module can simultaneously run several different devices | 2495 copy of the module can simultaneously run several different devices |
2218 that use identical I/O controllers, For each | 2496 that use identical I/O controllers. For each |
2219 ~ of the driver, | 2497 ~ of the driver, |
2220 IOMAN will allocate a static storage area for that device, The siz7e | 2498 IOMAN will allocate a static storage area for that device. The siz7e |
2221 of the storage area is given in the device driver module header, Some | 2499 of the storage area is given in the device driver module header. Some |
2222 of this storage area will be used by IOMAN and SCFMAN, the device | 2500 of this storage area will be used by IOMAN and SCFMAN, the device |
2223 driver is free to use the remainder in any way (typically as | 2501 driver is free to use the remainder in any way (typically as |
2224 variables and butters), This static storage is defined as: | 2502 variables and butters). This static storage is defined as: |
2225 OFFSET | 2503 OFFSET |
2226 ORG 0 | 2504 ORG 0 |
2227 $0 V.PAGE RItE 1 PORT EXTENDED ADDRESS | 2505 $0 V.PAGE RItE 1 PORT EXTENDED ADDRESS |
2228 $1 V.PCRT RItE 2 | 2506 $1 V.PCRT RItE 2 |
2229 DEVICE BASE ADDRESS | 2507 DEVICE BASE ADDRESS |
2257 <para>V.PAGE, V.PORT These three bytes are defined by IOMAN to be the 24 | 2535 <para>V.PAGE, V.PORT These three bytes are defined by IOMAN to be the 24 |
2258 bit device address,</para> | 2536 bit device address,</para> |
2259 <para>V.LPRC This location contains the process-Is of the last process | 2537 <para>V.LPRC This location contains the process-Is of the last process |
2260 to use the device. The IRQ service routine is responsible for sending | 2538 to use the device. The IRQ service routine is responsible for sending |
2261 this process the proper signal in case a "QUIT" character | 2539 this process the proper signal in case a "QUIT" character |
2262 or an "INTERRUPT" character is recieved, Defined by SCFMAN,</para> | 2540 or an "INTERRUPT" character is recieved. Defined by SCFMAN,</para> |
2263 <para> | 2541 <para> |
2264 V. BUSY This location contains the process ID of the process | 2542 V. BUSY This location contains the process ID of the process |
2265 currently using the device (zero if it is not being used), This is | 2543 currently using the device (zero if it is not being used). This is |
2266 used by SCFriAN to prevent more than one process from using the | 2544 used by SCFriAN to prevent more than one process from using the |
2267 device at the same moment, Defined by SCFMAN.</para> | 2545 device at the same moment. Defined by SCFMAN.</para> |
2268 <para>V.WAR~ This location contains the process ID of any process that | 2546 <para>V.WAR~ This location contains the process ID of any process that |
2269 is waiting for the device to complete I/O (or zero if there is none | 2547 is waiting for the device to complete I/O (or zero if there is none |
2270 waiting), The interrupt service routine should check this location to | 2548 waiting). The interrupt service routine should check this location to |
2271 see if a process is waiting and if so, send it a wake up signal, | 2549 see if a process is waiting and if so, send it a wake up signal, |
2272 Defined by the device driver</para> | 2550 Defined by the device driver</para> |
2273 <para>V.TYPE This location contains any special characteristics of a | 2551 <para>V.TYPE This location contains any special characteristics of a |
2274 device, It is typically used as a value to initialize the device | 2552 device. It is typically used as a value to initialize the device |
2275 control register, for parity etc. It is defined by SCFMAN which | 2553 control register, for parity etc. It is defined by SCFMAN which |
2276 copies its value from PP.PAR in the path descriptor</para> | 2554 copies its value from PP.PAR in the path descriptor</para> |
2277 <para>V.LINE This location contains the number of lines left till end of | 2555 <para>V.LINE This location contains the number of lines left till end of |
2278 page, Paging is handled by SCFMAN and not by the device driver</para> | 2556 page. Paging is handled by SCFMAN and not by the device driver</para> |
2279 <para>V.PROS This location is a flag used by SCFMAN to indicate that a | 2557 <para>V.PROS This location is a flag used by SCFMAN to indicate that a |
2280 pause character has been recieved, Setting its value to anything | 2558 pause character has been recieved. Setting its value to anything |
2281 other than zero will cause SCFMAN to stop transmitting characters at | 2559 other than zero will cause SCFMAN to stop transmitting characters at |
2282 the end of the next line, Device driver input routines must set | 2560 the end of the next line. Device driver input routines must set |
2283 V.PAUS in the ECHO devic&s static storage area, SCFMAN will check | 2561 V.PAUS in the ECHO devic&s static storage area. SCFMAN will check |
2284 this value in the ECHO device's static storage when output is sent</para> | 2562 this value in the ECHO device's static storage when output is sent</para> |
2285 <para>V.DEV2 This location contains the address of the ECHO (attached) | 2563 <para>V.DEV2 This location contains the address of the ECHO (attached) |
2286 device's static storage area. Typically the device and the attached | 2564 device's static storage area. Typically the device and the attached |
2287 device are one and the same, However they may be different as in the | 2565 device are one and the same. However they may be different as in the |
2288 case of a keyboard and a memory mapped video display, Defined by | 2566 case of a keyboard and a memory mapped video display. Defined by |
2289 SCFMAN</para> | 2567 SCFMAN</para> |
2290 <para>V.INTR Keyboard interrupt character, It is defined by SCFMAN, | 2568 <para>V.INTR Keyboard interrupt character. It is defined by SCFMAN, |
2291 which copies its value from PD.INT in the path descriptor</para> | 2569 which copies its value from PD.INT in the path descriptor</para> |
2292 <para>V.QUIT Keyboard abort character, It is defined by SCFMAN which | 2570 <para>V.QUIT Keyboard abort character. It is defined by SCFMAN which |
2293 copies its value from PD.QUT in the path descriptor</para> | 2571 copies its value from PD.QUT in the path descriptor</para> |
2294 <para>V.PCHR Pause character. It is defined by SCFMAN which copies its | 2572 <para>V.PCHR Pause character. It is defined by SCFMAN which copies its |
2295 value from PD.PsC in the path descriptor</para> | 2573 value from PD.PsC in the path descriptor</para> |
2296 <para>V.ERR This location is used to accumulate I/O errors. Typically it | 2574 <para>V.ERR This location is used to accumulate I/O errors. Typically it |
2297 is used by the IRQ service routine to record errors so that they may | 2575 is used by the IRQ service routine to record errors so that they may |
2298 be reported later when SCFMAN calls one of the device driver routines</para> | 2576 be reported later when SCFMAN calls one of the device driver routines</para> |
2299 </sect1> | 2577 </sect1> |
2300 <sect1> | 2578 <sect1> |
2301 <title>SCFMAN DEVICE DRIVER SUBROUTINES</title> | 2579 <title>SCFMAN DEVICE DRIVER SUBROUTINES</title> |
2302 <para>As with all device drivers, SCFMAN device drivers use a standard | 2580 <para>As with all device drivers. SCFMAN device drivers use a standard |
2303 executable memory module format with a module type of | 2581 executable memory module format with a module type of |
2304 edevice | 2582 edevice |
2305 drivers (CODE $5). The execution offset address in the | 2583 drivers (CODE $5). The execution offset address in the |
2306 module | 2584 module |
2307 header points to a branch table that has six three byte entries, Each | 2585 header points to a branch table that has six three byte entries. Each |
2308 entry is typically a LBRA to the corresponding subroutine, The branch | 2586 entry is typically a LBRA to the corresponding subroutine. The branch |
2309 table is as follows: | 2587 table is as follows: |
2310 ENTRY LERA INIT INITIALIZE DEVICE | 2588 ENTRY LERA INIT INITIALIZE DEVICE |
2311 LBHA | 2589 LBHA |
2312 READ READ CHARACTER | 2590 READ READ CHARACTER |
2313 LBRA WRITE IIRITE CHARACTER | 2591 LBRA WRITE IIRITE CHARACTER |
2317 LBRA TERM | 2595 LBRA TERM |
2318 TERMINATE DEVICE | 2596 TERMINATE DEVICE |
2319 </para> | 2597 </para> |
2320 <para> | 2598 <para> |
2321 Each subroutine should exit with the condition code register C | 2599 Each subroutine should exit with the condition code register C |
2322 bit cleared it no error occured, Otherwise the C bit should be set | 2600 bit cleared it no error occured. Otherwise the C bit should be set |
2323 and an appropriate error code returned in the B register. Below is a | 2601 and an appropriate error code returned in the B register. Below is a |
2324 description of each subroutine, its input parameters and its output | 2602 description of each subroutine, its input parameters and its output |
2325 parameters.</para> | 2603 parameters.</para> |
2326 <sect2> | 2604 <sect2> |
2327 <title>NAME: INIT</title> | 2605 <title>NAME: INIT</title> |
2334 <para>(CC) = C bit set.</para> | 2612 <para>(CC) = C bit set.</para> |
2335 <para>(B) = Appropriate error code.</para> | 2613 <para>(B) = Appropriate error code.</para> |
2336 <para>FUNCTION: INITIALIZE DEVICE AND ITS STATIC STORAGE</para> | 2614 <para>FUNCTION: INITIALIZE DEVICE AND ITS STATIC STORAGE</para> |
2337 <para> | 2615 <para> |
2338 3. Initialize the device static storage,</para> | 2616 3. Initialize the device static storage,</para> |
2339 <para>2, Place the IRQ service routine on the IRQ polling list by using | 2617 <para>2. Place the IRQ service routine on the IRQ polling list by using |
2340 the OS9 F$IRQ service request,</para> | 2618 the OS9 F$IRQ service request,</para> |
2341 <para>3, Initialize the device control registers (enable interrupts if | 2619 <para>3. Initialize the device control registers (enable interrupts if |
2342 necessary),</para> | 2620 necessary),</para> |
2343 <para> | 2621 <para> |
2344 | 2622 |
2345 | 2623 |
2346 </para> | 2624 </para> |
2358 <para>(B) = Appropriate error code.</para> | 2636 <para>(B) = Appropriate error code.</para> |
2359 <para>FUNCTION: GET PJEXT CHARACTER | 2637 <para>FUNCTION: GET PJEXT CHARACTER |
2360 </para> | 2638 </para> |
2361 <para> | 2639 <para> |
2362 This routine should get the next character from the input | 2640 This routine should get the next character from the input |
2363 buffer, If there is no data ready, this routine should copy its | 2641 buffer. If there is no data ready, this routine should copy its |
2364 process ID from V.BUSY into V.WAKE and then use the F$SLEP service | 2642 process ID from V.BUSY into V.WAKE and then use the F$SLEP service |
2365 request to put itself to sleep.</para> | 2643 request to put itself to sleep.</para> |
2366 <para>Later when data is recieved, the IRQ service routine will leave | 2644 <para>Later when data is recieved, the IRQ service routine will leave |
2367 the data in a buffer, then check V.WAKE to see if any process is | 2645 the data in a buffer, then check V.WAKE to see if any process is |
2368 waiting for the device to complete I/O, If so, the IP.Q service | 2646 waiting for the device to complete I/O. If so, the IP.Q service |
2369 routine should send a wakeup signal to it, | 2647 routine should send a wakeup signal to it, |
2370 | 2648 |
2371 | 2649 |
2372 | 2650 |
2373 </para> | 2651 </para> |
2374 <para>NOTE: Data buffers are NOT automatically allocated, It any are | 2652 <para>NOTE: Data buffers are NOT automatically allocated. It any are |
2375 used, they should be defined in the device's static storage area.</para> | 2653 used, they should be defined in the device's static storage area.</para> |
2376 </sect2> | 2654 </sect2> |
2377 <sect2> | 2655 <sect2> |
2378 <title>NAME: WRITE</title> | 2656 <title>NAME: WRITE</title> |
2379 <para>INPUT: (U) = ADDRESS OF DEVICE STATIC STORAGE | 2657 <para>INPUT: (U) = ADDRESS OF DEVICE STATIC STORAGE |
2385 <para>ERROR OUTPUT:</para> | 2663 <para>ERROR OUTPUT:</para> |
2386 <para>(CC) = C bit set.</para> | 2664 <para>(CC) = C bit set.</para> |
2387 <para>(B) = Appropriate error code.</para> | 2665 <para>(B) = Appropriate error code.</para> |
2388 <para>FUNCTION: OUTPUT A CHARACTER</para> | 2666 <para>FUNCTION: OUTPUT A CHARACTER</para> |
2389 <para>This routine places a data byte into an output buffer and enables | 2667 <para>This routine places a data byte into an output buffer and enables |
2390 the device output interrupts, It the data buffer is already full, | 2668 the device output interrupts. It the data buffer is already full, |
2391 this routine should copy its process ID from V.BUSY into V.WAKE and | 2669 this routine should copy its process ID from V.BUSY into V.WAKE and |
2392 then put itself to sleep,</para> | 2670 then put itself to sleep,</para> |
2393 <para>Later when the IRQ service routine transmits a character and makes | 2671 <para>Later when the IRQ service routine transmits a character and makes |
2394 room for more data in th. buffer, it will check V.WAKE to see if | 2672 room for more data in th. buffer, it will check V.WAKE to see if |
2395 there is a process waiting for the device to complete I/O, It there | 2673 there is a process waiting for the device to complete I/O. It there |
2396 is, it will send a wake up signal to that process.</para> | 2674 is, it will send a wake up signal to that process.</para> |
2397 <para>NOTE: This routine must ensure that the IRQ service routine will | 2675 <para>NOTE: This routine must ensure that the IRQ service routine will |
2398 start up when data is placed into the buffer, After an interrupt is | 2676 start up when data is placed into the buffer. After an interrupt is |
2399 generated the IRQ service routine will continue to transmit data | 2677 generated the IRQ service routine will continue to transmit data |
2400 until the data butter is empty, and then it will disable the device's | 2678 until the data butter is empty, and then it will disable the device's |
2401 "ready to transmit" interrupts,</para> | 2679 "ready to transmit" interrupts,</para> |
2402 <para>NOTE: Data buffers are NOT automatically allocated, If any are | 2680 <para>NOTE: Data buffers are NOT automatically allocated. If any are |
2403 used, they should be defined in the device's static storage.</para> | 2681 used, they should be defined in the device's static storage.</para> |
2404 </sect2> | 2682 </sect2> |
2405 <sect2> | 2683 <sect2> |
2406 <title>NAME: GETSTA/SETSTA</title> | 2684 <title>NAME: GETSTA/SETSTA</title> |
2407 <para>INPUT: (U) = ADDRESS OP DEVICE STATIC STORAGE | 2685 <para>INPUT: (U) = ADDRESS OP DEVICE STATIC STORAGE |
2413 </para> | 2691 </para> |
2414 <para> | 2692 <para> |
2415 This routine is a wild card call used to get (set) the device | 2693 This routine is a wild card call used to get (set) the device |
2416 parameters specified in the I$GSTT and I$SSTT service requests, | 2694 parameters specified in the I$GSTT and I$SSTT service requests, |
2417 Currently all of the function codes defined by Microware for SCF- | 2695 Currently all of the function codes defined by Microware for SCF- |
2418 type devices are handled by 1011AM or SCFMAN, Any codes not defined | 2696 type devices are handled by 1011AM or SCFMAN. Any codes not defined |
2419 by Microware will be passed to the device driver,</para> | 2697 by Microware will be passed to the device driver,</para> |
2420 <para>It may be necessary to examine or change the register packet which | 2698 <para>It may be necessary to examine or change the register packet which |
2421 contains the values of the 6809 registers at the time the OS9 service | 2699 contains the values of the 6809 registers at the time the OS9 service |
2422 request was issued, The address of the register packet may be found | 2700 request was issued. The address of the register packet may be found |
2423 in PD.RGS, which is located in the path descriptor, The following | 2701 in PD.RGS, which is located in the path descriptor. The following |
2424 offsets may be used to access any particular value in the register | 2702 offsets may be used to access any particular value in the register |
2425 packet: | 2703 packet: |
2426 OFFSET NMEMONIC MPU REGISTER | 2704 OFFSET NMEMONIC MPU REGISTER |
2427 0 R$CC RItE I CO ITIO S | 2705 0 R$CC RItE I CO ITIO S |
2428 CODE REGISTER | 2706 CODE REGISTER |
2448 <para>(CC) = C bit set.</para> | 2726 <para>(CC) = C bit set.</para> |
2449 <para>(B) = Appropriate error code.</para> | 2727 <para>(B) = Appropriate error code.</para> |
2450 <para>FUNCTION: TERMINATE DEVICE | 2728 <para>FUNCTION: TERMINATE DEVICE |
2451 </para> | 2729 </para> |
2452 <para>This routine is called when a device is no longer in use, defined | 2730 <para>This routine is called when a device is no longer in use, defined |
2453 as when its device descriptor module's link count becomes zero), It | 2731 as when its device descriptor module's link count becomes zero). It |
2454 must perform the following:</para> | 2732 must perform the following:</para> |
2455 <para>1, Wait until the output buffer has been emptied (by the IRQ | 2733 <para>1. Wait until the output buffer has been emptied (by the IRQ |
2456 service routine)</para> | 2734 service routine)</para> |
2457 <para>2. Disable device interrupts,</para> | 2735 <para>2. Disable device interrupts,</para> |
2458 <para>3, Remove device from the IRQ polling list,</para> | 2736 <para>3. Remove device from the IRQ polling list,</para> |
2459 <para> | 2737 <para> |
2460 NOTE: Static storage used by device drivers is never returned | 2738 NOTE: Static storage used by device drivers is never returned |
2461 to the free memory pool, Therefore, it is desirable to NEVER | 2739 to the free memory pool. Therefore, it is desirable to NEVER |
2462 terminate any device that might be used again. Modules contained in | 2740 terminate any device that might be used again. Modules contained in |
2463 the BOOT tile will NEVER be terminated.</para> | 2741 the BOOT tile will NEVER be terminated.</para> |
2464 </sect2> | 2742 </sect2> |
2465 <sect2> | 2743 <sect2> |
2466 <title>NAME: IRQ SERVICE ROUTINE</title> | 2744 <title>NAME: IRQ SERVICE ROUTINE</title> |
2467 <para>FUNCTION: SERVICE DEVICE INTERRUPTS | 2745 <para>FUNCTION: SERVICE DEVICE INTERRUPTS |
2468 </para> | 2746 </para> |
2469 <para> | 2747 <para> |
2470 Although this routine is not included in the device drivers | 2748 Although this routine is not included in the device drivers |
2471 branch table and not called directly from SCFMAN, it is an important | 2749 branch table and not called directly from SCFMAN, it is an important |
2472 routine in device drivers, The,main things that it does are:</para> | 2750 routine in device drivers. The,main things that it does are:</para> |
2473 <para>1. Service the device interrupts (recieve data from device or send | 2751 <para>1. Service the device interrupts (recieve data from device or send |
2474 data to it), This routine should put its data into and get its data | 2752 data to it). This routine should put its data into and get its data |
2475 from buffers which are defined in the device static storage,</para> | 2753 from buffers which are defined in the device static storage,</para> |
2476 <para>2, Wake up any process waiting for I/O to complete by checking | 2754 <para>2. Wake up any process waiting for I/O to complete by checking |
2477 to | 2755 to |
2478 see if there is a process ID in V.WAKE (non-zero) and it so | 2756 see if there is a process ID in V.WAKE (non-zero) and it so |
2479 send | 2757 send |
2480 a wakeup signal to that process,</para> | 2758 a wakeup signal to that process,</para> |
2481 <para>3, If the device is ready to send more data and the output buffer | 2759 <para>3. If the device is ready to send more data and the output buffer |
2482 is emoty, disable the device's "ready to transmit" | 2760 is emoty, disable the device's "ready to transmit" |
2483 interrupts,</para> | 2761 interrupts,</para> |
2484 <para>4, If a pause character is recieved, set V.PAUS in the attached | 2762 <para>4. If a pause character is recieved, set V.PAUS in the attached |
2485 device static storage to a non-zero value, The address of the | 2763 device static storage to a non-zero value. The address of the |
2486 attached device static storage is in V.DEV2,</para> | 2764 attached device static storage is in V.DEV2,</para> |
2487 <para> | 2765 <para> |
2488 When the IRQ service routine finishes servicing an interrupt, | 2766 When the IRQ service routine finishes servicing an interrupt, |
2489 it must clear the carry and exit with an RTS instruction.</para> | 2767 it must clear the carry and exit with an RTS instruction.</para> |
2490 </sect2> | 2768 </sect2> |
2494 <title>ASSEMBLY LANGUAGE PRORAMMING TECHNIQUES</title> | 2772 <title>ASSEMBLY LANGUAGE PRORAMMING TECHNIQUES</title> |
2495 <para>There are four key rules for programmers writing OS-9 assembly | 2773 <para>There are four key rules for programmers writing OS-9 assembly |
2496 language programs:</para> | 2774 language programs:</para> |
2497 <orderedlist numeration="arabic"> | 2775 <orderedlist numeration="arabic"> |
2498 <listitem><para>All programs MUST use position-independent-code (PIC)~. OS9 | 2776 <listitem><para>All programs MUST use position-independent-code (PIC)~. OS9 |
2499 selects load addresses based on available memory at run-time, There | 2777 selects load addresses based on available memory at run-time. There |
2500 is no way to force a program to be loaded at a specific address.</para></listitem> | 2778 is no way to force a program to be loaded at a specific address.</para></listitem> |
2501 <listitem><para>All programs must use the standard OS-9 memory module formats | 2779 <listitem><para>All programs must use the standard OS-9 memory module formats |
2502 or they cannot be loaded and run, Programs must not use | 2780 or they cannot be loaded and run. Programs must not use |
2503 self-moda~fying code, Programs must not change anything in a memory | 2781 self-moda~fying code. Programs must not change anything in a memory |
2504 module or use any art of ~t for varrables.</para></listitem> | 2782 module or use any art of ~t for varrables.</para></listitem> |
2505 <listitem><para>Storage for all variab e and data structures must be within | 2783 <listitem><para>Storage for all variab e and data structures must be within |
2506 a | 2784 a |
2507 data area wb~cb is assigned by OS-9 at run-timer and is | 2785 data area wb~cb is assigned by OS-9 at run-timer and is |
2508 separate | 2786 separate |
2509 from the program memory module~</para></listitem> | 2787 from the program memory module~</para></listitem> |
2510 <listitem><para>4, All input and output operations should be made using OS-9 | 2788 <listitem><para>4. All input and output operations should be made using OS-9 |
2511 service request calls~</para></listitem> | 2789 service request calls~</para></listitem> |
2512 </orderedlist> | 2790 </orderedlist> |
2513 <para>Fortunately~. the 6809's versatile addressing modes make the rules | 2791 <para>Fortunately~. the 6809's versatile addressing modes make the rules |
2514 above easy to follow,, The OS-9 Assembler also helps because it has | 2792 above easy to follow,. The OS-9 Assembler also helps because it has |
2515 special capabilities to assist the programmer in creating programs | 2793 special capabilities to assist the programmer in creating programs |
2516 and memory modules for the OS-9 execution environment.</para> | 2794 and memory modules for the OS-9 execution environment.</para> |
2517 <sect1> | 2795 <sect1> |
2518 <title>HOW TO WRITE POSITION-INDEPENDENT CODE</title> | 2796 <title>HOW TO WRITE POSITION-INDEPENDENT CODE</title> |
2519 <para>The 6809 irsstruct~on set was cpttmized to allow efficient use of | 2797 <para>The 6809 irsstruct~on set was cpttmized to allow efficient use of |
2520 Position Independent Code (PIC)~ The basic technique is to always use | 2798 Position Independent Code (PIC)~ The basic technique is to always use |
2521 PC-relative addressing; for example BRA, LBRA, BSR and L8SR~ Get | 2799 PC-relative addressing; for example BRA, LBRA, BSR and L8SR~ Get |
2522 addresses of constants and tables using LEA instructions instead of | 2800 addresses of constants and tables using LEA instructions instead of |
2523 load immediate instructions, If you use dispatch tables, use tables | 2801 load immediate instructions. If you use dispatch tables, use tables |
2524 of RELATIVE, not absolute, addresses.</para> | 2802 of RELATIVE, not absolute, addresses.</para> |
2525 <literallayout> | 2803 <literallayout> |
2526 INCORRECT CORRECT | 2804 INCORRECT CORRECT |
2527 | 2805 |
2528 LDX =CONSTANT LEAX CONSTANT,PCR | 2806 LDX =CONSTANT LEAX CONSTANT,PCR |
2534 <title> | 2812 <title> |
2535 ADDRESSING VARIABLES AND DATA STRUCTURES | 2813 ADDRESSING VARIABLES AND DATA STRUCTURES |
2536 </title> | 2814 </title> |
2537 <para>Programs executed as processes (by PORE and CHAIN system calls or | 2815 <para>Programs executed as processes (by PORE and CHAIN system calls or |
2538 by the ShellI are assigned a RAM memory area for variables, stacks, | 2816 by the ShellI are assigned a RAM memory area for variables, stacks, |
2539 and data structures at execution-time, The addresses cannot be | 2817 and data structures at execution-time. The addresses cannot be |
2540 determined or specified ahead of time, However, a minimum size for | 2818 determined or specified ahead of time. However, a minimum size for |
2541 this area is specified in the program~s module header, Again, thanks | 2819 this area is specified in the program~s module header. Again, thanks |
2542 to the ESOVs full compliment of addressing modes this presents no | 2820 to the ESOVs full compliment of addressing modes this presents no |
2543 problem to the OS-9 programmer</para> | 2821 problem to the OS-9 programmer</para> |
2544 <para>When the program is first entered, the Y register will have the | 2822 <para>When the program is first entered, the Y register will have the |
2545 address of the top of the process~ data memory area, If the creating | 2823 address of the top of the process~ data memory area. If the creating |
2546 process passed a parameter area, it will be located from the value of | 2824 process passed a parameter area, it will be located from the value of |
2547 the SP to the top of memory (Y)~ and the. U register will contain the | 2825 the SP to the top of memory (Y)~ and the. U register will contain the |
2548 parameter area size in bytes, If the new process was called by the | 2826 parameter area size in bytes. If the new process was called by the |
2549 shell, the parameter area will contain the part of the shell command | 2827 shell, the parameter area will contain the part of the shell command |
2550 line that includes the argument (parameter~ text, The U register will | 2828 line that includes the argument (parameter~ text. The U register will |
2551 have the lower bound of the data memory area, and the UP register | 2829 have the lower bound of the data memory area, and the UP register |
2552 will contain its page number</para> | 2830 will contain its page number</para> |
2553 <para>The most important rule is to NOT USE EXTENDED ADDRESSING! Indexed | 2831 <para>The most important rule is to NOT USE EXTENDED ADDRESSING! Indexed |
2554 and direct page addressing should be used exclusively to access data | 2832 and direct page addressing should be used exclusively to access data |
2555 area values and structures, Do not use program-counter relative | 2833 area values and structures. Do not use program-counter relative |
2556 addressing to find addresses in the data area, but do use it to refer | 2834 addressing to find addresses in the data area, but do use it to refer |
2557 to addresses within the program area</para> | 2835 to addresses within the program area</para> |
2558 <para>The most efficient way to handle tables, buffers, stacks, etc,, is | 2836 <para>The most efficient way to handle tables, buffers, stacks, etc,, is |
2559 to have the program~s initialization routine compute their absolute | 2837 to have the program~s initialization routine compute their absolute |
2560 addresses using the data area bounds passed by OS-9 in the registers, | 2838 addresses using the data area bounds passed by OS-9 in the registers, |
2561 These addresses can then be saved in the direct page where they can | 2839 These addresses can then be saved in the direct page where they can |
2562 be loaded into registers quickly, using short instructions, This | 2840 be loaded into registers quickly, using short instructions. This |
2563 technique has advantages: it is faster than extended addressing, and | 2841 technique has advantages: it is faster than extended addressing, and |
2564 the program is inherently reentrant</para> | 2842 the program is inherently reentrant</para> |
2565 </sect1> | 2843 </sect1> |
2566 <sect1> | 2844 <sect1> |
2567 <title>STACK REQUIREMENTS</title> | 2845 <title>STACK REQUIREMENTS</title> |
2568 <para>Because OS-9 uses interrupts extensively, and also because many | 2846 <para>Because OS-9 uses interrupts extensively, and also because many |
2569 reentrant 6809 programs use the MPU stack for local variable storage, | 2847 reentrant 6809 programs use the MPU stack for local variable storage, |
2570 a generous stack should be maintained at all times,, The recommended | 2848 a generous stack should be maintained at all times,. The recommended |
2571 minimum is approximately 200 bytes,</para> | 2849 minimum is approximately 200 bytes,</para> |
2572 </sect1> | 2850 </sect1> |
2573 <sect1> | 2851 <sect1> |
2574 <title>INTERRUPT MASKS</title> | 2852 <title>INTERRUPT MASKS</title> |
2575 <para>User programs should keep the condition codes re~isrer F (FIRQ | 2853 <para>User programs should keep the condition codes re~isrer F (FIRQ |
2576 mask) and I (IRQ mask) bits off, They can be set during critical | 2854 mask) and I (IRQ mask) bits off. They can be set during critical |
2577 program sequences to avoid task-switching or interrupts, but this | 2855 program sequences to avoid task-switching or interrupts, but this |
2578 time should be kept to a minimum, If they are set for longer than a | 2856 time should be kept to a minimum. If they are set for longer than a |
2579 tick period, system timekeeping accuracy may be affected, Also, some | 2857 tick period, system timekeeping accuracy may be affected. Also, some |
2580 Level Two systems will abort programs having a set IRQ mask</para> | 2858 Level Two systems will abort programs having a set IRQ mask</para> |
2581 </sect1> | 2859 </sect1> |
2582 <sect1> | 2860 <sect1> |
2583 <title>WRITING INTERRUPT-DRIVEN DEVICE DRIVERS</title> | 2861 <title>WRITING INTERRUPT-DRIVEN DEVICE DRIVERS</title> |
2584 <para>OS-9 programs do not use interrupts directly, Any interrupt- | 2862 <para>OS-9 programs do not use interrupts directly. Any interrupt- |
2585 driven fLlnction should be implemented as a device driver module | 2863 driven fLlnction should be implemented as a device driver module |
2586 which should handle all interrupt-related functions, When it is | 2864 which should handle all interrupt-related functions. When it is |
2587 necessary for a program to be synchronized to an interrupt-causing | 2865 necessary for a program to be synchronized to an interrupt-causing |
2588 event, a driver can send a semaphore to a program (or the reverse) | 2866 event, a driver can send a semaphore to a program (or the reverse) |
2589 using OS-9's <emphasis>signal</emphasis> facilities.</para> | 2867 using OS-9's <emphasis>signal</emphasis> facilities.</para> |
2590 <para>It is important to understand that interrupt service routines are | 2868 <para>It is important to understand that interrupt service routines are |
2591 asynchronous and somewhat nebulous in that they are not distinct | 2869 asynchronous and somewhat nebulous in that they are not distinct |
2592 processes, They are in effect subroutines called by OS-9 when an | 2870 processes. They are in effect subroutines called by OS-9 when an |
2593 interrupt occurs</para> | 2871 interrupt occurs</para> |
2594 <para>Therefore, all interrupt-driven device drivers have two basic | 2872 <para>Therefore, all interrupt-driven device drivers have two basic |
2595 parts: the ~mainiine# subroutines that execute as part of the calling | 2873 parts: the ~mainiine# subroutines that execute as part of the calling |
2596 process, and a separate interrupt service routine</para> | 2874 process, and a separate interrupt service routine</para> |
2597 <para>THE TwO ROUTINES ARE ASYNCHRONOUS AND THEREFORE MUST USE SIGNALS | 2875 <para>THE TWO ROUTINES ARE ASYNCHRONOUS AND THEREFORE MUST USE SIGNALS |
2598 FOR COMMUNICATIONS AND COORDINATION.</para> | 2876 FOR COMMUNICATIONS AND COORDINATION.</para> |
2599 <para>The INIT initialization subroutine within the driver package | 2877 <para>The INIT initialization subroutine within the driver package |
2600 should allocate static storage for the service routine, get the | 2878 should allocate static storage for the service routine, get the |
2601 service routine address, and execute the F$IRQ system call to add it | 2879 service routine address, and execute the F$IRQ system call to add it |
2602 to the IRQ polling table</para> | 2880 to the IRQ polling table</para> |
2603 <para>When a device driver routine does something that will result in an | 2881 <para>When a device driver routine does something that will result in an |
2604 interrupt, it should immediately execute a P~SLEP service request, | 2882 interrupt, it should immediately execute a P~SLEP service request, |
2605 This results in the process' deactivation, When the interrupt in | 2883 This results in the process' deactivation. When the interrupt in |
2606 question occurs, its service routine is executed after some random | 2884 question occurs, its service routine is executed after some random |
2607 interval, It should then do the minimal amount of processing | 2885 interval. It should then do the minimal amount of processing |
2608 required, and send a wwakeup~ signal to its associated process using | 2886 required, and send a wwakeup~ signal to its associated process using |
2609 the F$SEND service request~ It may also put some data in its static | 2887 the F$SEND service request~ It may also put some data in its static |
2610 storage (I/O data and Status) which is shared with its associated | 2888 storage (I/O data and Status) which is shared with its associated |
2611 ~sleeping~ process~ | 2889 ~sleeping~ process~ |
2612 </para> | 2890 </para> |
2615 interrupt service routine.</para> | 2893 interrupt service routine.</para> |
2616 </sect1> | 2894 </sect1> |
2617 <sect1> | 2895 <sect1> |
2618 <title>USING STANDARD I/O PATHS</title> | 2896 <title>USING STANDARD I/O PATHS</title> |
2619 <para>Programs should be written to use standard I/O paths wherever | 2897 <para>Programs should be written to use standard I/O paths wherever |
2620 practical, Usually, this involves I/O calls that are intended to | 2898 practical. Usually, this involves I/O calls that are intended to |
2621 communicate to the user's term~nal, or any other case where the OS-9 | 2899 communicate to the user's term~nal, or any other case where the OS-9 |
2622 redirected I/O capability is desirable,</para> | 2900 redirected I/O capability is desirable,</para> |
2623 <para>All three standard I/O paths will already be open when the program | 2901 <para>All three standard I/O paths will already be open when the program |
2624 is entered (they are uThsrited from the parent process), Programs | 2902 is entered (they are uThsrited from the parent process). Programs |
2625 should n~jtt. close these paths except under ~ery special | 2903 should n~jtt. close these paths except under ~ery special |
2626 circumstances,</para> | 2904 circumstances,</para> |
2627 <para>Standard I/O paths are always assigned path numbers zero, one, and | 2905 <para>Standard I/O paths are always assigned path numbers zero, one, and |
2628 two, as down below:</para> | 2906 two, as down below:</para> |
2629 <para>Path 0 Standard Input~ Analogcus to the keyboard or other main | 2907 <para>Path 0 Standard Input~ Analogcus to the keyboard or other main |
2630 data input source.</para> | 2908 data input source.</para> |
2631 <para>Path 1 Standard Output, Analoqous to the terminal display or other | 2909 <para>Path 1 Standard Output. Analoqous to the terminal display or other |
2632 main data output deatination | 2910 main data output deatination |
2633 </para> | 2911 </para> |
2634 <para>Path 2 - Standard Error/Status. This path is provided so output | 2912 <para>Path 2 - Standard Error/Status. This path is provided so output |
2635 messages which are not part of the actual program output can be kept | 2913 messages which are not part of the actual program output can be kept |
2636 separate, Many times paths 1 and 2 will be directed to the same | 2914 separate. Many times paths 1 and 2 will be directed to the same |
2637 device. | 2915 device. |
2638 </para> | 2916 </para> |
2639 </sect1> | 2917 </sect1> |
2640 <sect1> | 2918 <sect1> |
2641 <title>A SAMPLE PROCRAM</title> | 2919 <title>A SAMPLE PROGRAM</title> |
2642 <para>Tue OS-9 "list" utility command program is shown on this | 2920 <para>The OS-9 "list" utility command program is shown on this |
2643 and the next page as an example of assembly language programming,</para> | 2921 and the next page as an example of assembly language programming,</para> |
2644 <programlisting> | 2922 <programlisting> |
2645 Microware OS-9 Assembler 2,1 01/04/82 23:39:37 Page 001 | 2923 Microware OS-9 Assembler 2,1 01/04/82 23:39:37 Page 001 |
2646 LIST - File List Utility | 2924 LIST - File List Utility |
2647 | 2925 |
2694 </chapter> | 2972 </chapter> |
2695 <chapter> | 2973 <chapter> |
2696 <title>ADAPTING OS-9 TO A NEW SYSTEM</title> | 2974 <title>ADAPTING OS-9 TO A NEW SYSTEM</title> |
2697 <para>Thanks to OS-9's modular structure, it is easily portable to | 2975 <para>Thanks to OS-9's modular structure, it is easily portable to |
2698 almost any 6809-based computer, and in fact it has been installed on | 2976 almost any 6809-based computer, and in fact it has been installed on |
2699 an incredible variety of hardware, Usually only device driver and | 2977 an incredible variety of hardware. Usually only device driver and |
2700 device descriptor modules need by rewritten or modified for the | 2978 device descriptor modules need by rewritten or modified for the |
2701 target system's specific hardware devices, The larger and more | 2979 target system's specific hardware devices. The larger and more |
2702 complex kernel and fi1e~manager modules almost never need adaptation</para> | 2980 complex kernel and fi1e~manager modules almost never need adaptation</para> |
2703 <para>One essential point is that you will need a functional OS-9 | 2981 <para>One essential point is that you will need a functional OS-9 |
2704 development system to use during installation of OS-9 on a new target | 2982 development system to use during installation of OS-9 on a new target |
2705 system. Although it is possible to use a non-OS-9 system, or if you | 2983 system. Although it is possible to use a non-OS-9 system, or if you |
2706 are truly masochistic, the target system itself, lack of facilities | 2984 are truly masochistic, the target system itself, lack of facilities |
2707 to generate and test memory modules and create system disks can make | 2985 to generate and test memory modules and create system disks can make |
2708 an otherwise straightforward job a time- consuming headache that is | 2986 an otherwise straightforward job a time- consuming headache that is |
2709 seldom less costly than a commercial OS-9-equipped computer, Over a | 2987 seldom less costly than a commercial OS-9-equipped computer. Over a |
2710 dozen manufacturers offer OS-9 based development systems in all price | 2988 dozen manufacturers offer OS-9 based development systems in all price |
2711 ranges with an excellent Selection of time-saving options such as | 2989 ranges with an excellent Selection of time-saving options such as |
2712 hard disks, line printers, PROM programmers, etc</para> | 2990 hard disks, line printers. PROM programmers, etc</para> |
2713 <para>Microware sells source code for standard I/O drivers, and a "User | 2991 <para>Microware sells source code for standard I/O drivers, and a "User |
2714 Source Code Package" (On OS-9 format disk only) which contains | 2992 Source Code Package" (On OS-9 format disk only) which contains |
2715 source code to the Kernel, Shell, INIT, SYSGO, device driver and | 2993 source code to the Kernel. Shell, INIT, SYSGO, device driver and |
2716 descriptor modules, and & selection of utility commands which can | 2994 descriptor modules, and & selection of utility commands which can |
2717 be useful when moving OS-9 to a new target system</para> | 2995 be useful when moving OS-9 to a new target system</para> |
2718 <para>WARNING: Standard OS-9 software packages are licensed for use on a | 2996 <para>WARNING: Standard OS-9 software packages are licensed for use on a |
2719 single system, OS-9 cannot be resold or otherwise distributed (even | 2997 single system. OS-9 cannot be resold or otherwise distributed (even |
2720 if modified) without a license,, Contact Microware for information | 2998 if modified) without a license,. Contact Microware for information |
2721 regarding software licenses</para> | 2999 regarding software licenses</para> |
2722 <sect1> | 3000 <sect1> |
2723 <title>ADAPTING OS-9 TO DISK-BASED SYSTEMS</title> | 3001 <title>ADAPTING OS-9 TO DISK-BASED SYSTEMS</title> |
2724 <para>Usually, most of the work in moving OS-9 to a disk-based target | 3002 <para>Usually, most of the work in moving OS-9 to a disk-based target |
2725 system is writing a device driver module for the target system~s disk | 3003 system is writing a device driver module for the target system~s disk |
2726 controller, Part of this task involves producing a subset of the | 3004 controller. Part of this task involves producing a subset of the |
2727 driver (mostly disk rea~ functions) for use as a bootstrap module</para> | 3005 driver (mostly disk rea~ functions) for use as a bootstrap module</para> |
2728 <para>Ii terminal and/or parallel I/O for terminals, printers, etc., | 3006 <para>Ii terminal and/or parallel I/O for terminals, printers, etc., |
2729 will use ACIA and/or PIA-type devices, the standard ACIA and PIA | 3007 will use ACIA and/or PIA-type devices, the standard ACIA and PIA |
2730 device driver modules may he used, or device drivers ci your own | 3008 device driver modules may he used, or device drivers ci your own |
2731 design may be used in place of or in addition to these standard | 3009 design may be used in place of or in addition to these standard |
2732 modules Device descriptor modules may also require adaptation to | 3010 modules Device descriptor modules may also require adaptation to |
2733 match device addresses and initialization required by the target | 3011 match device addresses and initialization required by the target |
2734 System</para> | 3012 System</para> |
2735 <para>A CLOcK module may be adapted from a standard version, or a new | 3013 <para>A CLOcK module may be adapted from a standard version, or a new |
2736 one may be created, All other component modules, such as IOMAN, | 3014 one may be created. All other component modules, such as IOMAN, |
2737 R~BFMAN, SCFMAN, SHELL, and utilities seldom require modification</para> | 3015 R~BFMAN, SCFMAN, SHELL, and utilities seldom require modification</para> |
2738 </sect1> | 3016 </sect1> |
2739 <sect1> | 3017 <sect1> |
2740 <title>USING OS-9 IN ROM-BASED SYSTEMS</title> | 3018 <title>USING OS-9 IN ROM-BASED SYSTEMS</title> |
2741 <para>One of OS-9's major features is its ability to reside in ROM | 3019 <para>One of OS-9's major features is its ability to reside in ROM |
2745 utilities) are directly ROMable without modification. In some cases, | 3023 utilities) are directly ROMable without modification. In some cases, |
2746 particularly when the~ target system is to automatically execute an | 3024 particularly when the~ target system is to automatically execute an |
2747 application program upon system start-up, it may be necessary to | 3025 application program upon system start-up, it may be necessary to |
2748 reassemble the two modules used during system startup, INIT and SYSGO</para> | 3026 reassemble the two modules used during system startup, INIT and SYSGO</para> |
2749 <para>The first step in designing a ROM-based system is to select which | 3027 <para>The first step in designing a ROM-based system is to select which |
2750 OS-9 modules to include in ROM, The following checklist is designed | 3028 OS-9 modules to include in ROM. The following checklist is designed |
2751 to help you do so:</para> | 3029 to help you do so:</para> |
2752 <orderedlist numeration="Loweralpha"> | 3030 <orderedlist numeration="Loweralpha"> |
2753 <listitem><para>Include OS9P1, OS9P2, SYSGO, and INIT. These modules are | 3031 <listitem><para>Include OS9P1, OS9P2, SYSGO, and INIT. These modules are |
2754 required in any OS-9 system.</para></listitem> | 3032 required in any OS-9 system.</para></listitem> |
2755 <listitem><para>If the target system is perform any I/O or interrupt | 3033 <listitem><para>If the target system is perform any I/O or interrupt |
2759 device drivers (such as ACIA and PIA, and/or your own), and device | 3037 device drivers (such as ACIA and PIA, and/or your own), and device |
2760 descriptors as needed (such as TERM, TI, 1?, and/or your own),, If | 3038 descriptors as needed (such as TERM, TI, 1?, and/or your own),, If |
2761 device addresses and/or initialization functions need to be changed, | 3039 device addresses and/or initialization functions need to be changed, |
2762 the device descriptor modules must be modified before being ROMed.</para></listitem> | 3040 the device descriptor modules must be modified before being ROMed.</para></listitem> |
2763 <listitem><para>Ii the target system is to perform disk I/O, include RBFMAN, | 3041 <listitem><para>Ii the target system is to perform disk I/O, include RBFMAN, |
2764 and appropriate disk driver and device descriptor modules, As in (c) | 3042 and appropriate disk driver and device descriptor modules. As in (c) |
2765 above, change device addresses and initialization if needed, ii | 3043 above, change device addresses and initialization if needed, ii |
2766 RBFMAN ~JJJ, n~,t. be included, the INIT and SYSGO modules ~ be | 3044 RBFMAN ~JJJ, n~,t. be included, the INIT and SYSGO modules ~ be |
2767 altered to remove references to disk tiles.</para></listitem> | 3045 altered to remove references to disk tiles.</para></listitem> |
2768 <listitem><para>Ii the target system requires multiprogramming, time-cf-day,~ | 3046 <listitem><para>Ii the target system requires multiprogramming, time-cf-day,~ |
2769 or other time-related functions, include a CLOCK module for the | 3047 or other time-related functions, include a CLOCK module for the |
2770 target system's real-time clock, Also consider how the clock is to | 3048 target system's real-time clock. Also consider how the clock is to |
2771 be started,, You may want to ROM the "Setime" command, or | 3049 be started,. You may want to ROM the "Setime" command, or |
2772 have SYSGQ start the clock.</para></listitem> | 3050 have SYSGQ start the clock.</para></listitem> |
2773 <listitem><para>It tne target system will receive commands manually, or if | 3051 <listitem><para>It tne target system will receive commands manually, or if |
2774 any application program uses Shell functions, include the SHELL and | 3052 any application program uses Shell functions, include the SHELL and |
2775 SYSGO modules, otherwise include a modified SYSGO module which calls | 3053 SYSGO modules, otherwise include a modified SYSGO module which calls |
2776 your application program instead of Shell.</para></listitem> | 3054 your application program instead of Shell.</para></listitem> |
2778 </sect1> | 3056 </sect1> |
2779 <sect1> | 3057 <sect1> |
2780 <title>ADAPTING THE INITIALIZATION MODULE</title> | 3058 <title>ADAPTING THE INITIALIZATION MODULE</title> |
2781 <para>INIT is a module that contains system startup parameters. It ~J be | 3059 <para>INIT is a module that contains system startup parameters. It ~J be |
2782 in ROM in any OS-9 system (it usually resides in the same ROM as the | 3060 in ROM in any OS-9 system (it usually resides in the same ROM as the |
2783 kernel), It is a non-executable module named ~INIT~ and has type | 3061 kernel). It is a non-executable module named ~INIT~ and has type |
2784 ~system (code $C). It is scanned once during the system startup, It | 3062 ~system (code $C). It is scanned once during the system startup. It |
2785 begins with the standard header followed by:</para> | 3063 begins with the standard header followed by:</para> |
2786 <para> | 3064 <para> |
2787 MODULE OFFSET</para> | 3065 MODULE OFFSET</para> |
2788 <para>$9,$A,$B This location contains an upper limit RAM memory address | 3066 <para>$9,$A,$B This location contains an upper limit RAM memory address |
2789 used to override OS-9's automatic end-of- RAM search so that memory | 3067 used to override OS-9's automatic end-of- RAM search so that memory |
2790 may be reserved for I/O device addresses or other special purposes. | 3068 may be reserved for I/O device addresses or other special purposes. |
2791 </para> | 3069 </para> |
2792 <para>Number of entries to create in the IRQ polling table. One entry is | 3070 <para>Number of entries to create in the IRQ polling table. One entry is |
2793 required for each interrupt- generating device control register, | 3071 required for each interrupt- generating device control register. |
2794 </para> | 3072 </para> |
2795 <para>Number of entries to create in the system device table, One entry | 3073 <para>Number of entries to create in the system device table. One entry |
2796 is required for each device in the system. | 3074 is required for each device in the system. |
2797 </para> | 3075 </para> |
2798 <para>$E,$F Offset to a string which is the name of the first module to | 3076 <para>$E,$F Offset to a string which is the name of the first module to |
2799 be executed after startup, usually "SYSG0", There must | 3077 be executed after startup, usually "SYSG0". There must |
2800 always be a startup module. | 3078 always be a startup module. |
2801 $10,$11 Offset to the default | 3079 $10,$11 Offset to the default |
2802 directory name string (normally /D0), This device is assumed when | 3080 directory name string (normally /D0). This device is assumed when |
2803 device names are omitted from pathlists, If the system will not use | 3081 device names are omitted from pathlists. If the system will not use |
2804 disks (e.g., RBFMAN will not be used) this offset <emphasis>must</emphasis>be | 3082 disks (e.g., RBFMAN will not be used) this offset <emphasis>must</emphasis>be |
2805 zero, | 3083 zero. |
2806 $12,$13 Offset to the initial standard path string | 3084 $12,$13 Offset to the initial standard path string |
2807 (typically /TERM). This path is opened as the standard paths for the | 3085 (typically /TERM). This path is opened as the standard paths for the |
2808 initial startup module. This offset <emphasis>must</emphasis> contain zero if there | 3086 initial startup module. This offset <emphasis>must</emphasis> contain zero if there |
2809 is none.</para> | 3087 is none.</para> |
2810 <para>$14,$15 Offset to bootstrap module name string, If OS-9 does not | 3088 <para>$14,$15 Offset to bootstrap module name string. If OS-9 does not |
2811 find IOMAN in ROM during the start-up module search, it will execute | 3089 find IOMAN in ROM during the start-up module search, it will execute |
2812 the bootstrap module named to load additional modules from a iLls on | 3090 the bootstrap module named to load additional modules from a iLls on |
2813 a mass-storage device.</para> | 3091 a mass-storage device.</para> |
2814 <para>$16 to N All name strings referred to above go here, Each must | 3092 <para>$16 to N All name strings referred to above go here. Each must |
2815 have the sign bit (bit 7) of the last character set.</para> | 3093 have the sign bit (bit 7) of the last character set.</para> |
2816 </sect1> | 3094 </sect1> |
2817 <sect1> | 3095 <sect1> |
2818 <title>ADAPTING THE SYSGQ MODULE</title> | 3096 <title>ADAPTING THE SYSGQ MODULE</title> |
2819 <para>SYSGO is a program which is the first process started after the | 3097 <para>SYSGO is a program which is the first process started after the |
2820 system start-up sequence, Its function is threefold:</para> | 3098 system start-up sequence. Its function is threefold:</para> |
2821 <para>* It does additional high-level system initialization, for | 3099 <para>* It does additional high-level system initialization, for |
2822 example, disk system SYSGO call the shell to process the "Startup" | 3100 example, disk system SYSGO call the shell to process the "Startup" |
2823 shell procedure file,</para> | 3101 shell procedure file,</para> |
2824 <para>* It starts the first userw prDcess,</para> | 3102 <para>* It starts the first userw prDcess,</para> |
2825 <para>* It thereafter remains in a waite state as insurance against all | 3103 <para>* It thereafter remains in a waite state as insurance against all |
2826 user processes terminating, thus leaving the system halted, If this | 3104 user processes terminating, thus leaving the system halted. If this |
2827 happens, SYSGO can restart the first user program.</para> | 3105 happens. SYSGO can restart the first user program.</para> |
2828 <para>The standard SYSGO module for disk systems cannot be used on | 3106 <para>The standard SYSGO module for disk systems cannot be used on |
2829 non-disk based systems unless it is modified to:</para> | 3107 non-disk based systems unless it is modified to:</para> |
2830 <para>1. Remove initialization of the working execution directory,</para> | 3108 <para>1. Remove initialization of the working execution directory,</para> |
2831 <para>2. Remove processing of the wStartupu procedure file.</para> | 3109 <para>2. Remove processing of the wStartupu procedure file.</para> |
2832 <para>3. Possibly change the name of the first user program from Shell | 3110 <para>3. Possibly change the name of the first user program from Shell |
2833 to the name of a applications program, Here are some example name | 3111 to the name of a applications program. Here are some example name |
2834 strings:</para> | 3112 strings:</para> |
2835 <para>fcs /userpqm/ (object code module "userpgm")</para> | 3113 <para>fcs /userpqm/ (object code module "userpgm")</para> |
2836 <para>fcs /RunB userpgm/ (compiled Basie09 program using RunB | 3114 <para>fcs /RunB userpgm/ (compiled Basie09 program using RunB |
2837 run-time-only system)</para> | 3115 run-time-only system)</para> |
2838 <para>fcs /Basico9 userpgm/ (compiled Basic09 program using Basic09) | 3116 <para>fcs /Basico9 userpgm/ (compiled Basic09 program using Basic09) |
2895 explicitly specified as input or output parameters are not altered. | 3173 explicitly specified as input or output parameters are not altered. |
2896 Strings passed as parameters are normally terminated by having bit | 3174 Strings passed as parameters are normally terminated by having bit |
2897 seven of the last character set, a space character, or an end of line | 3175 seven of the last character set, a space character, or an end of line |
2898 cbaracter.</para> | 3176 cbaracter.</para> |
2899 <sect1> | 3177 <sect1> |
3178 <title>User Mode Service Requests</title> | |
3179 <sect2> | |
2900 <title>ABIT Set bits in an allocation bit map F$ABIT</title> | 3180 <title>ABIT Set bits in an allocation bit map F$ABIT</title> |
2901 <para>ASSEMBLER CALL: OS9 F$ABIT | 3181 <para>ASSEMBLER CALL: OS9 F$ABIT |
2902 </para> | 3182 </para> |
2903 <para>MACHINE CODE: 103F 13</para> | 3183 <para>MACHINE CODE: 103F 13</para> |
2904 <para>INPUT: (X) - Base address of glocation bit map. | 3184 <para>INPUT: (X) - Base address of glocation bit map. |
2905 (D) m Bit | 3185 (D) m Bit |
2906 number of first bit to set, | 3186 number of first bit to set. |
2907 (Y) m Bit count (number of bits to | 3187 (Y) m Bit count (number of bits to |
2908 set) | 3188 set) |
2909 </para> | 3189 </para> |
2910 <para>OUTPUT: None.</para> | 3190 <para>OUTPUT: None.</para> |
2911 <para>ERROR OUTPUT:</para> | 3191 <para>ERROR OUTPUT:</para> |
2913 <para>(B) = Appropriate error code.</para> | 3193 <para>(B) = Appropriate error code.</para> |
2914 <para>This system mode service request sets bits in the allocation bit | 3194 <para>This system mode service request sets bits in the allocation bit |
2915 map specified by the X register~.</para> | 3195 map specified by the X register~.</para> |
2916 <para>Bit numbers range from 0.,N-1, where N is the number of bits in | 3196 <para>Bit numbers range from 0.,N-1, where N is the number of bits in |
2917 the allocation bit map,</para> | 3197 the allocation bit map,</para> |
2918 </sect1> | 3198 </sect2> |
2919 <sect1> | 3199 <sect2> |
2920 <title>CHAIN Load and execute a new primary module, F$CHAN</title> | 3200 <title>CHAIN Load and execute a new primary module, F$CHAN</title> |
2921 <para>ASSEMBLER CALL: OS9 F$CHAN | 3201 <para>ASSEMBLER CALL: OS9 F$CHAN |
2922 </para> | 3202 </para> |
2923 <para>MACHINE CODE: 103F 05</para> | 3203 <para>MACHINE CODE: 103F 05</para> |
2924 <para>INPUT: (X) - Address of module name or file name</para> | 3204 <para>INPUT: (X) - Address of module name or file name</para> |
2928 <para>(B) = Optional data area size (256 byte pages)</para> | 3208 <para>(B) = Optional data area size (256 byte pages)</para> |
2929 <para>ERROR OUTPUT:</para> | 3209 <para>ERROR OUTPUT:</para> |
2930 <para>(CC) = C bit set.</para> | 3210 <para>(CC) = C bit set.</para> |
2931 <para>(B) = Appropriate error code.</para> | 3211 <para>(B) = Appropriate error code.</para> |
2932 <para>This system call is similar to FORR, but it does not create a new | 3212 <para>This system call is similar to FORR, but it does not create a new |
2933 process, It effectively uresets~ the calling process' program and | 3213 process. It effectively uresets~ the calling process' program and |
2934 data memory areas and begins execution of a new primary module, Open | 3214 data memory areas and begins execution of a new primary module. Open |
2935 paths are not closed or otherwise affected</para> | 3215 paths are not closed or otherwise affected</para> |
2936 <para>This system call is used when it is necessary to execute an | 3216 <para>This system call is used when it is necessary to execute an |
2937 entirely new program, but without the overhead of creating a new | 3217 entirely new program, but without the overhead of creating a new |
2938 process, It is functionally similar to a FORK followed by an EXIT. | 3218 process. It is functionally similar to a FORK followed by an EXIT. |
2939 but with 1es~ processing overhe&d</para> | 3219 but with 1es~ processing overhe&d</para> |
2940 <para>The sequence of operations taken by CHAIN is as follows: | 3220 <para>The sequence of operations taken by CHAIN is as follows: |
2941 </para> | 3221 </para> |
2942 <para>1, The system parses the name string ot the new proces& | 3222 <para>1. The system parses the name string ot the new proces& |
2943 ~priinary module~ - the program that will initially be executed, Then | 3223 ~priinary module~ - the program that will initially be executed. Then |
2944 the system module directory is searched to see if a module with the | 3224 the system module directory is searched to see if a module with the |
2945 same name and type / language is already in memory, If so ~c is | 3225 same name and type / language is already in memory. If so ~c is |
2946 linked to, If not, the name string is used as the pathlist of a file | 3226 linked to. If not, the name string is used as the pathlist of a file |
2947 which is to be loaded into memory. Then the first module in this file | 3227 which is to be loaded into memory. Then the first module in this file |
2948 is linked to (several modules may have been loaded from a single | 3228 is linked to (several modules may have been loaded from a single |
2949 file)</para> | 3229 file)</para> |
2950 <para>2. The process' old primary module is UNLINKED</para> | 3230 <para>2. The process' old primary module is UNLINKED</para> |
2951 <para>3. The data memory area is reconfigured to the size specified in | 3231 <para>3. The data memory area is reconfigured to the size specified in |
2968 O = parameter area size | 3248 O = parameter area size |
2969 PC = module entry point abs. | 3249 PC = module entry point abs. |
2970 address | 3250 address |
2971 CC - F-C, I-C, others undefined</para> | 3251 CC - F-C, I-C, others undefined</para> |
2972 <para>? (top of memory pointer) and U (bottom of memory pointer) will | 3252 <para>? (top of memory pointer) and U (bottom of memory pointer) will |
2973 always have a values at 256-byte page boundaries, If the parent does | 3253 always have a values at 256-byte page boundaries. If the parent does |
2974 not specify a parameter area, Y, X, and SP will be the same, and D | 3254 not specify a parameter area. Y, X, and SP will be the same, and D |
2975 will aqua]. zero, The minimum overall data area size is one pa (2 6 | 3255 will aqua]. zero. The minimum overall data area size is one pa (2 6 |
2976 bytes),</para> | 3256 bytes),</para> |
2977 <para> | 3257 <para> |
2978 WARNING: The hardware stack pointer (SP) should be located | 3258 WARNING: The hardware stack pointer (SP) should be located |
2979 somewhere in the direct page before the F$CHAN service request is | 3259 somewhere in the direct page before the F$CHAN service request is |
2980 executed to prevent a ~suicide attempts error or an actual suicide | 3260 executed to prevent a ~suicide attempts error or an actual suicide |
2981 (system crash), This will prevent a suicide from occurring in case | 3261 (system crash). This will prevent a suicide from occurring in case |
2982 the new module requires a smaller data area than what is currently | 3262 the new module requires a smaller data area than what is currently |
2983 being used. You should allow approximately 200 bytes of stack space | 3263 being used. You should allow approximately 200 bytes of stack space |
2984 for execution of the F$CHAN service request and other system | 3264 for execution of the F$CHAN service request and other system |
2985 woverhead~,</para> | 3265 woverhead~,</para> |
2986 <para> | 3266 <para> |
2987 For more information, please see the F$FORK service request | 3267 For more information, please see the F$FORK service request |
2988 description,</para> | 3268 description,</para> |
2989 </sect1> | 3269 </sect2> |
2990 <sect1> | 3270 <sect2> |
2991 <title>COMPARE NAMES Compare two names, F$CNAM</title> | 3271 <title>COMPARE NAMES Compare two names, F$CNAM</title> |
2992 <para>ASSEMBLER CALL: OS9 F$CNAM | 3272 <para>ASSEMBLER CALL: OS9 F$CNAM |
2993 </para> | 3273 </para> |
2994 <para>MACHINE CODE: 103F 11 | 3274 <para>MACHINE CODE: 103F 11 |
2995 </para> | 3275 </para> |
3004 second string, compares them and indicates whether they | 3284 second string, compares them and indicates whether they |
3005 match, | 3285 match, |
3006 Typically used in conjunction with wparsename ~</para> | 3286 Typically used in conjunction with wparsename ~</para> |
3007 <para>The second name must bave the sign bit (bit 7) of the last | 3287 <para>The second name must bave the sign bit (bit 7) of the last |
3008 character set,</para> | 3288 character set,</para> |
3009 </sect1> | 3289 </sect2> |
3010 <sect1> | 3290 <sect2> |
3011 <title>CRC ~. Compute CRC</title> | 3291 <title>CRC ~. Compute CRC</title> |
3012 <para>ASSEMBLER CALL: OS9 F$CRC | 3292 <para>ASSEMBLER CALL: OS9 F$CRC |
3013 </para> | 3293 </para> |
3014 <para>MACHINE CODE: 103F 17 | 3294 <para>MACHINE CODE: 103F 17 |
3015 </para> | 3295 </para> |
3018 (U) = | 3298 (U) = |
3019 Address of 3 byte CRC accumulator.</para> | 3299 Address of 3 byte CRC accumulator.</para> |
3020 <para>OUTPUT: CRC accumulator is updated</para> | 3300 <para>OUTPUT: CRC accumulator is updated</para> |
3021 <para>ERROR OUTPUT: None</para> | 3301 <para>ERROR OUTPUT: None</para> |
3022 <para>This service request calculates the CRC (cyclic redundancy count) | 3302 <para>This service request calculates the CRC (cyclic redundancy count) |
3023 for use by compilers, assemblers, or other module generators, The CRC | 3303 for use by compilers, assemblers, or other module generators. The CRC |
3024 is calculated starting at the source address over Wbyte Countu bytes, | 3304 is calculated starting at the source address over Wbyte Countu bytes, |
3025 it is not necessary to cover an entire module in one call, since the | 3305 it is not necessary to cover an entire module in one call, since the |
3026 CRC may be accumulated~ over several calls, The CRC accumulator can | 3306 CRC may be accumulated~ over several calls. The CRC accumulator can |
3027 be any three byte memory location and must be initialized to $FFFFFF | 3307 be any three byte memory location and must be initialized to $FFFFFF |
3028 before the first F$CRC call</para> | 3308 before the first F$CRC call</para> |
3029 <para>The last three bytes in the module (where the three CRC bytes will | 3309 <para>The last three bytes in the module (where the three CRC bytes will |
3030 be stored) are not included in the CRC generation</para> | 3310 be stored) are not included in the CRC generation</para> |
3031 </sect1> | 3311 </sect2> |
3032 <sect1> | 3312 <sect2> |
3033 <title>DBIT Deallocate in a bit map F$DBIT</title> | 3313 <title>DBIT Deallocate in a bit map F$DBIT</title> |
3034 <para>ASSEMBLER CALL: OS9 F$DBIT | 3314 <para>ASSEMBLER CALL: OS9 F$DBIT |
3035 </para> | 3315 </para> |
3036 <para>MACHINE CODE: 103F 14 | 3316 <para>MACHINE CODE: 103F 14 |
3037 </para> | 3317 </para> |
3038 <para>INPUT: (X) = B e address of an allocation bit map. | 3318 <para>INPUT: (X) = B e address of an allocation bit map. |
3039 (D} - Bit | 3319 (D} - Bit |
3040 number of firs bit to clear, | 3320 number of firs bit to clear. |
3041 (Y) - Bit count (number ~f bits to | 3321 (Y) - Bit count (number ~f bits to |
3042 clear), | 3322 clear). |
3043 </para> | 3323 </para> |
3044 <para>OUTPUT: None, | 3324 <para>OUTPUT: None. |
3045 </para> | 3325 </para> |
3046 <para>ERROR OUTPUT:</para> | 3326 <para>ERROR OUTPUT:</para> |
3047 <para>(CC) = C bit set.</para> | 3327 <para>(CC) = C bit set.</para> |
3048 <para>(B) = Appropriate error code.</para> | 3328 <para>(B) = Appropriate error code.</para> |
3049 <para>This system mode service request is used to clear bits in the | 3329 <para>This system mode service request is used to clear bits in the |
3050 allocation bit map pointed to by X.</para> | 3330 allocation bit map pointed to by X.</para> |
3051 <para>Bit numbers range from 0,,N-l, where N is the number of bits in | 3331 <para>Bit numbers range from 0,,N-l, where N is the number of bits in |
3052 the allocation bit map,</para> | 3332 the allocation bit map,</para> |
3053 </sect1> | 3333 </sect2> |
3054 <sect1> | 3334 <sect2> |
3055 <title>EXIT Terminate the calling process. F$EXIT</title> | 3335 <title>EXIT Terminate the calling process. F$EXIT</title> |
3056 <para>ASSEMBLER CALL: OS9 F$EXIT | 3336 <para>ASSEMBLER CALL: OS9 F$EXIT |
3057 </para> | 3337 </para> |
3058 <para>MACHINE CODE: 103F 06 | 3338 <para>MACHINE CODE: 103F 06 |
3059 </para> | 3339 </para> |
3060 <para>INPUT: (B) = Status code to be returned to the parent process</para> | 3340 <para>INPUT: (B) = Status code to be returned to the parent process</para> |
3061 <para>OUTPUT: Process is terminated.</para> | 3341 <para>OUTPUT: Process is terminated.</para> |
3062 <para>This call kills the calling process and is the only means oy whicn | 3342 <para>This call kills the calling process and is the only means oy whicn |
3063 a process can terminate itself, Its data memory area is deallocated, | 3343 a process can terminate itself. Its data memory area is deallocated, |
3064 and its primary module is UNLINKed, All open paths are automatically | 3344 and its primary module is UNLINKed. All open paths are automatically |
3065 closed</para> | 3345 closed</para> |
3066 <para>The death of the process can be detected by the parent executing a | 3346 <para>The death of the process can be detected by the parent executing a |
3067 WAIT call, which returns to the parent the status byte passed by the | 3347 WAIT call, which returns to the parent the status byte passed by the |
3068 child in its EXIT call, The status byte can be an OS-9 error code the | 3348 child in its EXIT call. The status byte can be an OS-9 error code the |
3069 terminating process wishes to pass back to its parent process (the | 3349 terminating process wishes to pass back to its parent process (the |
3070 shell assumes this), or can be used to pass a user- defined status | 3350 shell assumes this), or can be used to pass a user- defined status |
3071 value, Processes to be called directly by the shell should only | 3351 value. Processes to be called directly by the shell should only |
3072 return an OS-9 error code or zero if no error occutred</para> | 3352 return an OS-9 error code or zero if no error occutred</para> |
3073 </sect1> | 3353 </sect2> |
3074 <sect1> | 3354 <sect2> |
3075 <title>FORK Create a new process. F$FORK</title> | 3355 <title>FORK Create a new process. F$FORK</title> |
3076 <para>ASSEMBLER CALL: OS9 F$FORK | 3356 <para>ASSEMBLER CALL: OS9 F$FORK |
3077 </para> | 3357 </para> |
3078 <para>MACHINE CODE: 103F 03 | 3358 <para>MACHINE CODE: 103F 03 |
3079 </para> | 3359 </para> |
3092 <para>(CC) = C bit set.</para> | 3372 <para>(CC) = C bit set.</para> |
3093 <para>(B) = Appropriate error code.</para> | 3373 <para>(B) = Appropriate error code.</para> |
3094 <para>This system call creates a new process which becomes a ~~childa of | 3374 <para>This system call creates a new process which becomes a ~~childa of |
3095 the caller, and sets up the new process' memory and MPU registers</para> | 3375 the caller, and sets up the new process' memory and MPU registers</para> |
3096 <para>The system parses the name string of the new process' "primary | 3376 <para>The system parses the name string of the new process' "primary |
3097 module" - the program that will initially be executed, Then the | 3377 module" - the program that will initially be executed. Then the |
3098 system module directory is searched to see if the program is already | 3378 system module directory is searched to see if the program is already |
3099 in memory. If so, the module is linked to and executed, If not, the | 3379 in memory. If so, the module is linked to and executed. If not, the |
3100 name string is used as the pathlist of the file which is to b oaded | 3380 name string is used as the pathlist of the file which is to b oaded |
3101 into memory. Then the first module in this file is linked to and | 3381 into memory. Then the first module in this file is linked to and |
3102 executed (several modules may have been loaded from a single file)</para> | 3382 executed (several modules may have been loaded from a single file)</para> |
3103 <para>The primary module's module header is used to determine the | 3383 <para>The primary module's module header is used to determine the |
3104 process' initial data area size, OS-9 then attempts to allocate a | 3384 process' initial data area size. OS-9 then attempts to allocate a |
3105 contiguous RAM area equal tQ the required data storage size, | 3385 contiguous RAM area equal tQ the required data storage size, |
3106 (includes the parameter passing area, which is copied from the parent | 3386 (includes the parameter passing area, which is copied from the parent |
3107 process' data area), The new process' registers are set up as shown | 3387 process' data area). The new process' registers are set up as shown |
3108 in the diagram on the next page, The execution offset given in the | 3388 in the diagram on the next page. The execution offset given in the |
3109 module header is used to set the PC to the module's entry point</para> | 3389 module header is used to set the PC to the module's entry point</para> |
3110 <para>When the shell processes a command line it passes a string in the | 3390 <para>When the shell processes a command line it passes a string in the |
3111 parameter area which is a copy of the parameter part (if any) of the | 3391 parameter area which is a copy of the parameter part (if any) of the |
3112 command line. It also inserts an end-of-line character at the end of | 3392 command line. It also inserts an end-of-line character at the end of |
3113 the parameter string to simplify string-oriented processing. The X | 3393 the parameter string to simplify string-oriented processing. The X |
3115 command line included the optional memory size specification (In or | 3395 command line included the optional memory size specification (In or |
3116 InK), the shell will pass that size as the requested memory size when | 3396 InK), the shell will pass that size as the requested memory size when |
3117 executing the FORK</para> | 3397 executing the FORK</para> |
3118 <para>If any of the above operations are unsuccessful, the FORK is | 3398 <para>If any of the above operations are unsuccessful, the FORK is |
3119 </para> | 3399 </para> |
3120 <para>aborted and the caller is returned an error, The diagram below | 3400 <para>aborted and the caller is returned an error. The diagram below |
3121 shows bow FORK sets up the data memory area and registers for a | 3401 shows bow FORK sets up the data memory area and registers for a |
3122 newly-created process,</para> | 3402 newly-created process,</para> |
3123 <para>+ <-- Y (highest address) | 3403 <para>+ <-- Y (highest address) |
3124 </para> | 3404 </para> |
3125 <para>parameter | 3405 <para>parameter |
3133 <para>O - parameter area size | 3413 <para>O - parameter area size |
3134 PC = module entry point abs. | 3414 PC = module entry point abs. |
3135 address | 3415 address |
3136 CC - F-C, 1-0, others undefined</para> | 3416 CC - F-C, 1-0, others undefined</para> |
3137 <para>y (top of memory pointer) and U (bottom of memory pointer) will | 3417 <para>y (top of memory pointer) and U (bottom of memory pointer) will |
3138 always have a values at 256-byte page boundaries, If the parent does | 3418 always have a values at 256-byte page boundaries. If the parent does |
3139 not specify a parameter area, Y, X, and SP wi I b t e same, and 0 | 3419 not specify a parameter area, Y, X, and SP wi I b t e same, and 0 |
3140 will equal zero, The minimum overall data area size is one page (256 | 3420 will equal zero. The minimum overall data area size is one page (256 |
3141 bytes). Shell will always pass at least an end of line character in | 3421 bytes). Shell will always pass at least an end of line character in |
3142 the parameter area, | 3422 the parameter area, |
3143 NOTE: Both the child and parent process will | 3423 NOTE: Both the child and parent process will |
3144 execute | 3424 execute |
3145 concurrently. If the parent executes a F$WAIT call | 3425 concurrently. If the parent executes a F$WAIT call |
3146 immediately after the fork, it will wait until the child dies before | 3426 immediately after the fork, it will wait until the child dies before |
3147 it resumes execution, Caution should be exercised when recursively | 3427 it resumes execution. Caution should be exercised when recursively |
3148 calling a program that uses the F$FORK service request since another | 3428 calling a program that uses the F$FORK service request since another |
3149 child may be created with each "incarnation", This will | 3429 child may be created with each "incarnation". This will |
3150 continue until the process table becomes full.</para> | 3430 continue until the process table becomes full.</para> |
3151 </sect1> | 3431 </sect2> |
3152 <sect1> | 3432 <sect2> |
3153 <title>INTERCEPT Set up a signal intercept trap. F$ICFT</title> | 3433 <title>INTERCEPT Set up a signal intercept trap. F$ICFT</title> |
3154 <para>ASSEMBLER CALL: OS9 F$ICPT | 3434 <para>ASSEMBLER CALL: OS9 F$ICPT |
3155 </para> | 3435 </para> |
3156 <para>MACHINE CODE. 103F 09 | 3436 <para>MACHINE CODE. 103F 09 |
3157 </para> | 3437 </para> |
3162 <para>ERROR OUTPUT:</para> | 3442 <para>ERROR OUTPUT:</para> |
3163 <para>(CC) = C bit set.</para> | 3443 <para>(CC) = C bit set.</para> |
3164 <para>(B) = Appropriate error code.</para> | 3444 <para>(B) = Appropriate error code.</para> |
3165 <para>This system call tells OS-9 to set a signal intercept trap, where | 3445 <para>This system call tells OS-9 to set a signal intercept trap, where |
3166 X contains the address of the signal handler routine, and U contains | 3446 X contains the address of the signal handler routine, and U contains |
3167 the base address of the routine's storage area, After a signal trap | 3447 the base address of the routine's storage area. After a signal trap |
3168 has been set, whenever the process receives a signal, its intercept | 3448 has been set, whenever the process receives a signal, its intercept |
3169 routine will be executed. A signal will abort any process which has | 3449 routine will be executed. A signal will abort any process which has |
3170 not used the F$ICPT service request to set a signal trap, and its | 3450 not used the F$ICPT service request to set a signal trap, and its |
3171 termination status (B register) will be the signal óode, Many | 3451 termination status (B register) will be the signal óode. Many |
3172 interactive programs will set up an intercept routine to handle | 3452 interactive programs will set up an intercept routine to handle |
3173 keyboard abort (control 0), and keyboard interrupt (control C)</para> | 3453 keyboard abort (control 0), and keyboard interrupt (control C)</para> |
3174 <para>The intercept routine is entered asynchronously because a signal | 3454 <para>The intercept routine is entered asynchronously because a signal |
3175 may be sent at any time (it is like an interrupt) and is passed the | 3455 may be sent at any time (it is like an interrupt) and is passed the |
3176 following: | 3456 following: |
3177 </para> | 3457 </para> |
3178 <para>U = Address of intercept routine local storage</para> | 3458 <para>U = Address of intercept routine local storage</para> |
3179 <para>B - Signal code</para> | 3459 <para>B - Signal code</para> |
3180 <para>NOTE: The value of PP may not be the same as it was when the | 3460 <para>NOTE: The value of PP may not be the same as it was when the |
3181 F$ICFT call was made</para> | 3461 F$ICFT call was made</para> |
3182 <para>Whenever a signal is received, OS-9 will pass the signal code and | 3462 <para>Whenever a signal is received. OS-9 will pass the signal code and |
3183 the base address of its data area (which was defined by a F$ICPT | 3463 the base address of its data area (which was defined by a F$ICPT |
3184 service request) to the signal intercept routine. The base address of | 3464 service request) to the signal intercept routine. The base address of |
3185 the data area is selected by the user and is typically a pointer to | 3465 the data area is selected by the user and is typically a pointer to |
3186 the process' data area</para> | 3466 the process' data area</para> |
3187 <para>The intercept routine is activated when a signal is received, then | 3467 <para>The intercept routine is activated when a signal is received, then |
3188 it takes some action based upon the value of the signal code such as | 3468 it takes some action based upon the value of the signal code such as |
3189 setting a flag in the process' data area. After the signal has been | 3469 setting a flag in the process' data area. After the signal has been |
3190 processed, the handler routine should terminate with an RTI | 3470 processed, the handler routine should terminate with an RTI |
3191 instruction</para> | 3471 instruction</para> |
3192 </sect1> | 3472 </sect2> |
3193 <sect1> | 3473 <sect2> |
3194 <title>GET ID Get process ID / user ID</title> | 3474 <title>GET ID Get process ID / user ID</title> |
3195 <para>ASSEMBLER CALL: OS9 F$ID</para> | 3475 <para>ASSEMBLER CALL: OS9 F$ID</para> |
3196 <para>MACHINE CODE: 103F DC | 3476 <para>MACHINE CODE: 103F DC |
3197 </para> | 3477 </para> |
3198 <para>INPUT: None | 3478 <para>INPUT: None |
3204 <para>(CC) = C bit set.</para> | 3484 <para>(CC) = C bit set.</para> |
3205 <para>(B) = Appropriate error code.</para> | 3485 <para>(B) = Appropriate error code.</para> |
3206 <para>Returns the caller's process ID number, which is a byte value in | 3486 <para>Returns the caller's process ID number, which is a byte value in |
3207 the range of 1 to 255, and the user ID which is a integer in the | 3487 the range of 1 to 255, and the user ID which is a integer in the |
3208 range 0 to 6553$. The process ID is assigned by OS-9 and is unique to | 3488 range 0 to 6553$. The process ID is assigned by OS-9 and is unique to |
3209 the process, The user ID is defined in the system password file, and | 3489 the process. The user ID is defined in the system password file, and |
3210 is used by the file security system and a few other functions, | 3490 is used by the file security system and a few other functions, |
3211 Several processes can have the same user ID,</para> | 3491 Several processes can have the same user ID,</para> |
3212 </sect1> | 3492 </sect2> |
3213 <sect1> | 3493 <sect2> |
3214 <title>LINK: Link to memory module. F $LINK</title> | 3494 <title>LINK: Link to memory module. F $LINK</title> |
3215 <para>ASSEMBLER CALL: OS9 F$LINK</para> | 3495 <para>ASSEMBLER CALL: OS9 F$LINK</para> |
3216 <para>MACHINE CODE: 103F 00</para> | 3496 <para>MACHINE CODE: 103F 00</para> |
3217 <para>INPUT: (X) - Address of the module name string. | 3497 <para>INPUT: (X) - Address of the module name string. |
3218 (A) - Module | 3498 (A) - Module |
3233 If found, the address of the module's header is returned in U, and | 3513 If found, the address of the module's header is returned in U, and |
3234 the absolute address of the module's execution entry point is | 3514 the absolute address of the module's execution entry point is |
3235 returned in Y (as a convenience: this and other information can be | 3515 returned in Y (as a convenience: this and other information can be |
3236 obtained from the module header). The module's link count' is | 3516 obtained from the module header). The module's link count' is |
3237 incremented whenever a LINK references its name, thus keeping track | 3517 incremented whenever a LINK references its name, thus keeping track |
3238 of how many processes are using the module, If the module requested | 3518 of how many processes are using the module. If the module requested |
3239 has an attribute byte indicating it is not sharable (meaning it is | 3519 has an attribute byte indicating it is not sharable (meaning it is |
3240 not reentrant) only one process may link to it at a time</para> | 3520 not reentrant) only one process may link to it at a time</para> |
3241 <para>Possible errors: | 3521 <para>Possible errors: |
3242 </para> | 3522 </para> |
3243 <para>(A) Module not found</para> | 3523 <para>(A) Module not found</para> |
3244 <para>(B) Module busy (not sha:able and in uae)</para> | 3524 <para>(B) Module busy (not sha:able and in uae)</para> |
3245 <para>(C) Incorrect or defective module header</para> | 3525 <para>(C) Incorrect or defective module header</para> |
3246 </sect1> | 3526 </sect2> |
3247 <sect1> | 3527 <sect2> |
3248 <title>LOAD Load module(s) from a file, F$LOAD</title> | 3528 <title>LOAD Load module(s) from a file, F$LOAD</title> |
3249 <para>ASSEMBLER CALL: OS9 F$LOAD</para> | 3529 <para>ASSEMBLER CALL: OS9 F$LOAD</para> |
3250 <para>MACHINE CODE: 103F Dl</para> | 3530 <para>MACHINE CODE: 103F Dl</para> |
3251 <para>INPUT: (X) = Address of pathlist (file name) | 3531 <para>INPUT: (X) = Address of pathlist (file name) |
3252 (A) = Language / | 3532 (A) = Language / |
3272 permission and contain a module or modules that have a proper module | 3552 permission and contain a module or modules that have a proper module |
3273 header. The file will be loaded from the working execution directory | 3553 header. The file will be loaded from the working execution directory |
3274 unless a complete pathlist is given.</para> | 3554 unless a complete pathlist is given.</para> |
3275 <para>Possible errors: module directory full; memory full; plus errors | 3555 <para>Possible errors: module directory full; memory full; plus errors |
3276 that occur on OPEN, READ, CLOSE and LINK system calls,</para> | 3556 that occur on OPEN, READ, CLOSE and LINK system calls,</para> |
3277 </sect1> | 3557 </sect2> |
3278 <sect1> | 3558 <sect2> |
3279 <title>MEM Resize data memory area, F$MEM</title> | 3559 <title>MEM Resize data memory area, F$MEM</title> |
3280 <para>ASSEMBLER CALL: OS9 F$MEM | 3560 <para>ASSEMBLER CALL: OS9 F$MEM |
3281 </para> | 3561 </para> |
3282 <para>MACHINE CODE: 103F 07 | 3562 <para>MACHINE CODE: 103F 07 |
3283 </para> | 3563 </para> |
3285 <para>OUTPUT: (P) = Address of new memory area upper bound</para> | 3565 <para>OUTPUT: (P) = Address of new memory area upper bound</para> |
3286 <para>(D) - Actual new memory .area size in bytes</para> | 3566 <para>(D) - Actual new memory .area size in bytes</para> |
3287 <para>ERROR OUTPUT:</para> | 3567 <para>ERROR OUTPUT:</para> |
3288 <para>(CC) = C bit set.</para> | 3568 <para>(CC) = C bit set.</para> |
3289 <para>(B) = Appropriate error code.</para> | 3569 <para>(B) = Appropriate error code.</para> |
3290 <para>Used to expand or contract the process' data memory area, The new | 3570 <para>Used to expand or contract the process' data memory area. The new |
3291 size requested is rounded up to the next 256-byte page boundary. | 3571 size requested is rounded up to the next 256-byte page boundary. |
3292 Additional memory is allocated contiguously u~ard (towards higher | 3572 Additional memory is allocated contiguously u~ard (towards higher |
3293 addresses), or deallocated downward from the old highest address. If | 3573 addresses), or deallocated downward from the old highest address. If |
3294 0 " 0, then the current upper bound and size will be returned</para> | 3574 0 " 0, then the current upper bound and size will be returned</para> |
3295 <para>This request can never return all of a process' memory, or the | 3575 <para>This request can never return all of a process' memory, or the |
3300 by other processes may fragment free memory into smaller, scattered | 3580 by other processes may fragment free memory into smaller, scattered |
3301 blocks that are not adjacent to the caller's present data area. Level | 3581 blocks that are not adjacent to the caller's present data area. Level |
3302 Two systems do not have this restriction because of the availability | 3582 Two systems do not have this restriction because of the availability |
3303 of hardware for memory relocation, and because each process has its | 3583 of hardware for memory relocation, and because each process has its |
3304 own "address space"</para> | 3584 own "address space"</para> |
3305 </sect1> | 3585 </sect2> |
3306 <sect1> | 3586 <sect2> |
3307 <title>PRERR Print error message. F$PERR</title> | 3587 <title>PRERR Print error message. F$PERR</title> |
3308 <para>ASSEMBLER CALL: OS9 F$PERR | 3588 <para>ASSEMBLER CALL: OS9 F$PERR |
3309 </para> | 3589 </para> |
3310 <para>MACHINE CODE: 103F 0F | 3590 <para>MACHINE CODE: 103F 0F |
3311 </para> | 3591 </para> |
3312 <para>INPUT: (A) = Output path number,</para> | 3592 <para>INPUT: (A) = Output path number,</para> |
3313 <para>(B) = Error code, | 3593 <para>(B) = Error code. |
3314 </para> | 3594 </para> |
3315 <para>OUTPUT: None,</para> | 3595 <para>OUTPUT: None,</para> |
3316 <para>ERROR OUTPUT:</para> | 3596 <para>ERROR OUTPUT:</para> |
3317 <para>(CC) = C bit set.</para> | 3597 <para>(CC) = C bit set.</para> |
3318 <para>(B) = Appropriate error code.</para> | 3598 <para>(B) = Appropriate error code.</para> |
3319 <para>This is the system's error reporting utility. It writes an error | 3599 <para>This is the system's error reporting utility. It writes an error |
3320 message to the output path specified, Most OS-9 systems will display:</para> | 3600 message to the output path specified. Most OS-9 systems will display:</para> |
3321 <para>ERROR I(decimal number> | 3601 <para>ERROR I(decimal number> |
3322 </para> | 3602 </para> |
3323 <para>by default. The error reporting routine is vectored and can be | 3603 <para>by default. The error reporting routine is vectored and can be |
3324 replaced with a more elaborate reporting module, To replace this | 3604 replaced with a more elaborate reporting module. To replace this |
3325 routine use the F$SSVC service request</para> | 3605 routine use the F$SSVC service request</para> |
3326 </sect1> | 3606 </sect2> |
3327 <sect1> | 3607 <sect2> |
3328 <title>PARSENAME Parse a path name, F$PNAM</title> | 3608 <title>PARSENAME Parse a path name, F$PNAM</title> |
3329 <para>ASSEMBLER CALL: OS9 F$PNAM | 3609 <para>ASSEMBLER CALL: OS9 F$PNAM |
3330 </para> | 3610 </para> |
3331 <para>MACHINE CODE: 103F 10 | 3611 <para>MACHINE CODE: 103F 10 |
3332 </para> | 3612 </para> |
3342 <para>(X) - Updated past space characters. | 3622 <para>(X) - Updated past space characters. |
3343 | 3623 |
3344 | 3624 |
3345 | 3625 |
3346 </para> | 3626 </para> |
3347 <para>Parses the input text string for a legal OS-9 name, The name is | 3627 <para>Parses the input text string for a legal OS-9 name. The name is |
3348 terminated by any character that is not a legal component character, | 3628 terminated by any character that is not a legal component character, |
3349 This system call is useful for processing pathlist arguments passed | 3629 This system call is useful for processing pathlist arguments passed |
3350 to new processes. Also if X was at the end of a pathlist, a bad name | 3630 to new processes. Also if X was at the end of a pathlist, a bad name |
3351 error will be returned and X will be moved past any space characters | 3631 error will be returned and X will be moved past any space characters |
3352 so that the next pathlist in a command line may be parsed</para> | 3632 so that the next pathlist in a command line may be parsed</para> |
3353 <para>Note that this system call processes only one name, so several | 3633 <para>Note that this system call processes only one name, so several |
3354 calls may be needed to process a pathlist that has more than one name</para> | 3634 calls may be needed to process a pathlist that has more than one name</para> |
3355 <para>BEFORE F$PNAM CALL; | 3635 <para>BEFORE F$PNAM CALL; |
3356 </para> | 3636 </para> |
3357 <para>£ I | 3637 <para> |
3358 | 3638 |
3359 | 3639 |
3360 | 3640 |
3361 </para> | 3641 </para> |
3362 <para>X | 3642 <para>X |
3363 </para> | 3643 </para> |
3364 <para>AFTER THE F$PNAM GALL: | 3644 <para>AFTER THE F$PNAM GALL: |
3365 </para> | 3645 </para> |
3366 <para>£/IDIOI/IFIIILIEI I I £ I | 3646 <para> |
3367 X Y (B)a2</para> | 3647 X Y (B)a2</para> |
3368 </sect1> | 3648 </sect2> |
3369 <sect1> | 3649 <sect2> |
3370 <title>SBMAP Search bit map for a free area F$SBIT</title> | 3650 <title>SBMAP Search bit map for a free area F$SBIT</title> |
3371 <para> | 3651 <para> |
3372 ASSEMBLER CALL: OS9 F$SBIT | 3652 ASSEMBLER CALL: OS9 F$SBIT |
3373 | 3653 |
3374 | 3654 |
3386 <para>This system mode service request searches the specified allocation | 3666 <para>This system mode service request searches the specified allocation |
3387 bit map starting at the "beginning bit number" for a free | 3667 bit map starting at the "beginning bit number" for a free |
3388 block (cleared bits) of the required length.</para> | 3668 block (cleared bits) of the required length.</para> |
3389 <para>If no b o k of the specified size exists, it returns with the | 3669 <para>If no b o k of the specified size exists, it returns with the |
3390 carry set, beginning bit number and size of the largest block.</para> | 3670 carry set, beginning bit number and size of the largest block.</para> |
3391 </sect1> | 3671 </sect2> |
3392 <sect1> | 3672 <sect2> |
3393 <title>SEND Send a signal to another process, F$SEND</title> | 3673 <title>SEND Send a signal to another process, F$SEND</title> |
3394 <para>ASSEMBLER CALL: OS9 F$SEND | 3674 <para>ASSEMBLER CALL: OS9 F$SEND |
3395 </para> | 3675 </para> |
3396 <para>MACHINE CODE: 103F 08 | 3676 <para>MACHINE CODE: 103F 08 |
3397 </para> | 3677 </para> |
3405 specified. The sianajL code is a single byte value of 1 - 255</para> | 3685 specified. The sianajL code is a single byte value of 1 - 255</para> |
3406 <para>If the signal's destination process is sleeping or waiting, it | 3686 <para>If the signal's destination process is sleeping or waiting, it |
3407 will be activated so that it may process the signal. The signal | 3687 will be activated so that it may process the signal. The signal |
3408 processing routine (intercept) will be executed if a signal trap was | 3688 processing routine (intercept) will be executed if a signal trap was |
3409 set up (see F$ICPT), otherwise the signal will abort the destination | 3689 set up (see F$ICPT), otherwise the signal will abort the destination |
3410 process, and the signal code becomes the exit status (see WAIT), An | 3690 process, and the signal code becomes the exit status (see WAIT). An |
3411 exception is the WAKEUP signal, which activates a sleeping process | 3691 exception is the WAKEUP signal, which activates a sleeping process |
3412 but does not cause the signal intercept routine to be executed</para> | 3692 but does not cause the signal intercept routine to be executed</para> |
3413 <para>Some of the signal codes have meanings defined by convention: | 3693 <para>Some of the signal codes have meanings defined by convention: |
3414 </para> | 3694 </para> |
3415 <para>0 a System Abort (cannot be intercepted) | 3695 <para>0 a System Abort (cannot be intercepted) |
3423 <para>4-255 = user defined | 3703 <para>4-255 = user defined |
3424 </para> | 3704 </para> |
3425 <para>If an attempt is made to send a signal to a process that has an | 3705 <para>If an attempt is made to send a signal to a process that has an |
3426 unprocessed, previous signal pending, the current "send" | 3706 unprocessed, previous signal pending, the current "send" |
3427 request will be cancelled and an error will be returned. An attempt | 3707 request will be cancelled and an error will be returned. An attempt |
3428 can be made to re-send the signal later, It is good practice to issue | 3708 can be made to re-send the signal later. It is good practice to issue |
3429 a "sleep" call for a few ticks before a retry to avoid | 3709 a "sleep" call for a few ticks before a retry to avoid |
3430 wasting NPU time</para> | 3710 wasting NPU time</para> |
3431 <para>For related information see the F$ICPT, F$WAIT. and F$SLEP service | 3711 <para>For related information see the F$ICPT, F$WAIT. and F$SLEP service |
3432 request descriptions</para> | 3712 request descriptions</para> |
3433 </sect1> | 3713 </sect2> |
3434 <sect1> | 3714 <sect2> |
3435 <title>SLEEP Put calling process to sleep. F$SLEP</title> | 3715 <title>SLEEP Put calling process to sleep. F$SLEP</title> |
3436 <para>ASSEMBLER CALL: OS9 F$SLEP</para> | 3716 <para>ASSEMBLER CALL: OS9 F$SLEP</para> |
3437 <para>MACHINE CODE: 103F 0A</para> | 3717 <para>MACHINE CODE: 103F 0A</para> |
3438 <para>INPUT: (X) = Sleep time in ticks (0 a indefinitely) | 3718 <para>INPUT: (X) = Sleep time in ticks (0 a indefinitely) |
3439 </para> | 3719 </para> |
3442 <para>ERROR OUTPUT:</para> | 3722 <para>ERROR OUTPUT:</para> |
3443 <para>(CC) = C bit set.</para> | 3723 <para>(CC) = C bit set.</para> |
3444 <para>(B) = Appropriate error code.</para> | 3724 <para>(B) = Appropriate error code.</para> |
3445 <para>Ibis call deactivates the calling process for a specified time, or | 3725 <para>Ibis call deactivates the calling process for a specified time, or |
3446 indefinitely if K - 0, If X = 1, the effect is to have the caller | 3726 indefinitely if K - 0, If X = 1, the effect is to have the caller |
3447 give up its current time slice, The process will be activated before | 3727 give up its current time slice. The process will be activated before |
3448 the full time interval if a signal is received, therefore sleeping | 3728 the full time interval if a signal is received, therefore sleeping |
3449 indefinitely is a good way to wait for a signal or interrupt without | 3729 indefinitely is a good way to wait for a signal or interrupt without |
3450 wasting CPU time</para> | 3730 wasting CPU time</para> |
3451 <para>The duration of a tiek is system dependent but is wost commonly | 3731 <para>The duration of a tiek is system dependent but is wost commonly |
3452 100 milliseconds</para> | 3732 100 milliseconds</para> |
3453 <para>Due to the fact that it is not known when the F$SLEP request was | 3733 <para>Due to the fact that it is not known when the F$SLEP request was |
3454 made during the current tick, F$SLEP can not be used for precise | 3734 made during the current tick. F$SLEP can not be used for precise |
3455 timing, A sleep of one tick is effectively a "give up remaining | 3735 timing. A sleep of one tick is effectively a "give up remaining |
3456 time slice" request; the process is immediately inserted into | 3736 time slice" request; the process is immediately inserted into |
3457 the active process queue and will resume execution when it reaches | 3737 the active process queue and will resume execution when it reaches |
3458 the front of the queue, A sleep of two or more ticks causes the | 3738 the front of the queue. A sleep of two or more ticks causes the |
3459 process to be inserted into the active process queue after N-l ticks | 3739 process to be inserted into the active process queue after N-l ticks |
3460 occur and will resume execution when it reaches the front of the | 3740 occur and will resume execution when it reaches the front of the |
3461 queue</para> | 3741 queue</para> |
3462 </sect1> | 3742 </sect2> |
3463 <sect1> | 3743 <sect2> |
3464 <title>SETPR Set process priority. F$SPRI</title> | 3744 <title>SETPR Set process priority. F$SPRI</title> |
3465 <para>ASSEMBLER CALL: OS9 F$SPRI</para> | 3745 <para>ASSEMBLER CALL: OS9 F$SPRI</para> |
3466 <para>MACHINE CODE: 103F 00</para> | 3746 <para>MACHINE CODE: 103F 00</para> |
3467 <para>INPUT: (A) = Process ID number, | 3747 <para>INPUT: (A) = Process ID number, |
3468 (B) = Priority: | 3748 (B) = Priority: |
3474 <para>(CC) = C bit set.</para> | 3754 <para>(CC) = C bit set.</para> |
3475 <para>(B) = Appropriate error code.</para> | 3755 <para>(B) = Appropriate error code.</para> |
3476 <para>Changes the process' priority to the new value given. $FF is the | 3756 <para>Changes the process' priority to the new value given. $FF is the |
3477 highest possible priority, $00 is the lowest. A process can change | 3757 highest possible priority, $00 is the lowest. A process can change |
3478 another process' priority only if it has the same user ID.</para> | 3758 another process' priority only if it has the same user ID.</para> |
3479 </sect1> | 3759 </sect2> |
3480 <sect1> | 3760 <sect2> |
3481 <title>SSVC Install function request F$SSVC</title> | 3761 <title>SSVC Install function request F$SSVC</title> |
3482 <para>ASSEMBLER CALL: OS9 F$SSVC | 3762 <para>ASSEMBLER CALL: OS9 F$SSVC |
3483 </para> | 3763 </para> |
3484 <para>MACHINE CODE: 103F 32</para> | 3764 <para>MACHINE CODE: 103F 32</para> |
3485 <para>INPUT: (Y) - Address of service request initialization table,</para> | 3765 <para>INPUT: (Y) - Address of service request initialization table,</para> |
3487 <para>ERROR OUTPUT:</para> | 3767 <para>ERROR OUTPUT:</para> |
3488 <para>(CC) = C bit set.</para> | 3768 <para>(CC) = C bit set.</para> |
3489 <para>(B) = Appropriate error code.</para> | 3769 <para>(B) = Appropriate error code.</para> |
3490 <para>This system mode service request is used to add a new function | 3770 <para>This system mode service request is used to add a new function |
3491 request to OS-9's user and privileged system service request tables, | 3771 request to OS-9's user and privileged system service request tables, |
3492 or to replace an old one, The Y register passes the address of a | 3772 or to replace an old one. The Y register passes the address of a |
3493 table which contains the function codes and offsets to the | 3773 table which contains the function codes and offsets to the |
3494 corresponding service request handler routines. This table has the | 3774 corresponding service request handler routines. This table has the |
3495 following format:</para> | 3775 following format:</para> |
3496 <para>OFFSET</para> | 3776 <para>OFFSET</para> |
3497 <para>4... | 3777 <para>4... |
3498 $00 1 Function Code £ (--- First entry | 3778 $00 1 Function Code (--- First entry |
3499 4.... | 3779 4.... |
3500 ,.,e,, - r~, | 3780 ,.,e,, - r~, |
3501 $01 I Offset From Byte 3 £ | 3781 $01 I Offset From Byte 3 |
3502 4.,... | 3782 4.,... |
3503 $02 I | 3783 $02 I |
3504 To Function Handler 1 | 3784 To Function Handler 1 |
3505 4-, | 3785 4-. |
3506 $03 I Function Code 1 <--a Second | 3786 $03 I Function Code 1 <--a Second |
3507 entry | 3787 entry |
3508 $04 I ofrset From Byte E £ | 3788 $04 I ofrset From Byte E |
3509 4.-.,</para> | 3789 4.-.,</para> |
3510 <para>I To Function Handler I | 3790 <para>I To Function Handler I |
3511 </para> | 3791 </para> |
3512 <para>I (--- Third entry etc. | 3792 <para>I (--- Third entry etc. |
3513 I MORE ENTRIES £ | 3793 I MORE ENTRIES |
3514 I I | 3794 I I |
3515 I | 3795 I |
3516 I | 3796 I |
3517 $80 I <--- End of table mark</para> | 3797 $80 I <--- End of table mark</para> |
3518 <para>NOTE: If the sign bit of the function code is set, on y the system | 3798 <para>NOTE: If the sign bit of the function code is set, on y the system |
3519 table will be updated. Otherwise both the system and user tables will | 3799 table will be updated. Otherwise both the system and user tables will |
3520 be updated. Privileged system service requests may be called only | 3800 be updated. Privileged system service requests may be called only |
3521 while executing a system routine. | 3801 while executing a system routine. |
3522 The service request handler | 3802 The service request handler |
3523 routine should process the service request and return from subroutine | 3803 routine should process the service request and return from subroutine |
3524 with an RTS instruction, They may alter all MPU registers (except for | 3804 with an RTS instruction. They may alter all MPU registers (except for |
3525 SP), The U register will pass the address of the register stack to | 3805 SP). The U register will pass the address of the register stack to |
3526 the service request handler as shown in the following diagram: | 3806 the service request handler as shown in the following diagram: |
3527 OFFSET | 3807 OFFSET |
3528 OSHDEFS | 3808 OSHDEFS |
3529 MNEMONIC | 3809 MNEMONIC |
3530 U---> I CC I $0 R$CC | 3810 U---> I CC I $0 R$CC |
3537 X I $4 R$X | 3817 X I $4 R$X |
3538 - a | 3818 - a |
3539 a am - - - - m~* + | 3819 a am - - - - m~* + |
3540 Y I $6 R$Y | 3820 Y I $6 R$Y |
3541 ------- -"4. | 3821 ------- -"4. |
3542 U £ | 3822 U |
3543 $8 R$tY | 3823 $8 R$tY |
3544 4-.. | 3824 4-.. |
3545 PC I $A R$PC | 3825 PC I $A R$PC |
3546 .-..m4 | 3826 .-..m4 |
3547 </para> | 3827 </para> |
3563 NOTE: These categories are defined by convention and not | 3843 NOTE: These categories are defined by convention and not |
3564 enforced by OS9,</para> | 3844 enforced by OS9,</para> |
3565 <para> | 3845 <para> |
3566 Codes $25.,$27, and S70..$7F will not be used by MICROWARE and | 3846 Codes $25.,$27, and S70..$7F will not be used by MICROWARE and |
3567 are free for user definition.</para> | 3847 are free for user definition.</para> |
3568 </sect1> | 3848 </sect2> |
3569 <sect1> | 3849 <sect2> |
3570 <title>SETSWI Set SWI vector, F$SSWI</title> | 3850 <title>SETSWI Set SWI vector, F$SSWI</title> |
3571 <para>ASSEMBLER CALL: OS9 F$SSWI</para> | 3851 <para>ASSEMBLER CALL: OS9 F$SSWI</para> |
3572 <para>MACHINE CODE: 103F QE</para> | 3852 <para>MACHINE CODE: 103F QE</para> |
3573 <para>INPUT: (A) = SWI type code,</para> | 3853 <para>INPUT: (A) = SWI type code,</para> |
3574 <para>(X) = Address of user SWI service routine. | 3854 <para>(X) = Address of user SWI service routine. |
3576 <para>OUTPUT: None</para> | 3856 <para>OUTPUT: None</para> |
3577 <para>ERROR OUTPUT:</para> | 3857 <para>ERROR OUTPUT:</para> |
3578 <para>(CC) = C bit set.</para> | 3858 <para>(CC) = C bit set.</para> |
3579 <para>(B) = Appropriate error code.</para> | 3859 <para>(B) = Appropriate error code.</para> |
3580 <para>Sets up the interrupt vectors for SWI, ~I2 and SWI3 instructions. | 3860 <para>Sets up the interrupt vectors for SWI, ~I2 and SWI3 instructions. |
3581 Each process has its own local vectors, Each SETSWI call sets up one | 3861 Each process has its own local vectors. Each SETSWI call sets up one |
3582 type of vector according to the code number passed in A.</para> | 3862 type of vector according to the code number passed in A.</para> |
3583 <para>1 - SWI | 3863 <para>1 - SWI |
3584 2 - SWI2 | 3864 2 - SWI2 |
3585 3 - ~4I3 | 3865 3 - ~4I3 |
3586 </para> | 3866 </para> |
3587 <para>When a process is created, all three vectors are initialized with | 3867 <para>When a process is created, all three vectors are initialized with |
3588 the address of the OS-9 service call processor.</para> | 3868 the address of the OS-9 service call processor.</para> |
3589 <para>WARNING: Microware-supplied software uses SWI2 to call OS-9. If | 3869 <para>WARNING: Microware-supplied software uses SWI2 to call OS-9. If |
3590 you reset this vector these programs will not work, If you chance all | 3870 you reset this vector these programs will not work. If you chance all |
3591 three vectors, you will not be able to call OS-9 at all.</para> | 3871 three vectors, you will not be able to call OS-9 at all.</para> |
3592 </sect1> | 3872 </sect2> |
3593 <sect1> | 3873 <sect2> |
3594 <title>SETIME Set system date and time, F$STIM</title> | 3874 <title>SETIME Set system date and time, F$STIM</title> |
3595 <para>ASSEMBLER CALL: OS9 F$STIM</para> | 3875 <para>ASSEMBLER CALL: OS9 F$STIM</para> |
3596 <para>MACHINE CODE: 103F 16 | 3876 <para>MACHINE CODE: 103F 16 |
3597 </para> | 3877 </para> |
3598 <para>INPUT: (K) = Address of time packet (see below)</para> | 3878 <para>INPUT: (K) = Address of time packet (see below)</para> |
3599 <para>OUTPUT: Time/date is set,</para> | 3879 <para>OUTPUT: Time/date is set,</para> |
3600 <para>ERROR OUTPUT:</para> | 3880 <para>ERROR OUTPUT:</para> |
3601 <para>(CC) = C bit set.</para> | 3881 <para>(CC) = C bit set.</para> |
3602 <para>(B) = Appropriate error code.</para> | 3882 <para>(B) = Appropriate error code.</para> |
3603 <para>This service request is used to set the current system date/time | 3883 <para>This service request is used to set the current system date/time |
3604 and start the system real-time clock, The date and time are passed in | 3884 and start the system real-time clock. The date and time are passed in |
3605 a time packet as follows: | 3885 a time packet as follows: |
3606 OFFSET VALUE</para> | 3886 OFFSET VALUE</para> |
3607 <para>0 £year | 3887 <para>0 year |
3608 1 I month | 3888 1 I month |
3609 2 Iday | 3889 2 Iday |
3610 3 1 hours | 3890 3 1 hours |
3611 4 £ | 3891 4 minutes |
3612 minutes | |
3613 5 1 seconds | 3892 5 1 seconds |
3614 </para> | 3893 </para> |
3615 </sect1> | 3894 </sect2> |
3616 <sect1> | 3895 <sect2> |
3617 <title>TIME Get system date and time, F$TIRE</title> | 3896 <title>TIME Get system date and time. F$TIRE</title> |
3618 <para>ASSEMBLER CALL: OS9 F$TIME | 3897 <para>ASSEMBLER CALL: OS9 F$TIME |
3619 </para> | 3898 </para> |
3620 <para>MACHINE CODE: 103F 15</para> | 3899 <para>MACHINE CODE: 103F 15</para> |
3621 <para>INPUT: (KY - Address of place to store the time packet.</para> | 3900 <para>INPUT: (KY - Address of place to store the time packet.</para> |
3622 <para>OUTPUT: Time packet (see below), | 3901 <para>OUTPUT: Time packet (see below). |
3623 </para> | 3902 </para> |
3624 <para>ERROR OUTPUT:</para> | 3903 <para>ERROR OUTPUT:</para> |
3625 <para>(CC) = C bit set.</para> | 3904 <para>(CC) = C bit set.</para> |
3626 <para>(B) = Appropriate error code.</para> | 3905 <para>(B) = Appropriate error code.</para> |
3627 <para>Thx~ returns the current system date and time in the form of a six | 3906 <para>Thx~ returns the current system date and time in the form of a six |
3628 byte packet (in binary), The packet is copied to the address passed | 3907 byte packet (in binary). The packet is copied to the address passed |
3629 in X, The packet looks like: | 3908 in X. The packet looks like: |
3630 OFFSET VALUE | 3909 OFFSET VALUE |
3631 | 3910 |
3632 0 I year | 3911 0 I year |
3633 1 1 | 3912 1 1 |
3634 month | 3913 month |
3635 2 1 day | 3914 2 1 day |
3636 3 1 hours | 3915 3 1 hours |
3637 4 1 minutes | 3916 4 1 minutes |
3638 5 1 seconds</para> | 3917 5 1 seconds</para> |
3639 </sect1> | 3918 </sect2> |
3640 <sect1> | 3919 <sect2> |
3641 <title>UNLINK Unlink a module, F$UNLK</title> | 3920 <title>UNLINK Unlink a module. F$UNLK</title> |
3642 <para>ASSEMBLER CALL: OS9 F$UNLK | 3921 <para>ASSEMBLER CALL: OS9 F$UNLK |
3643 </para> | 3922 </para> |
3644 <para>MACHINE CODE: 103F 02 | 3923 <para>MACHINE CODE: 103F 02 |
3645 </para> | 3924 </para> |
3646 <para>INPUT: (U) = Address of the module header</para> | 3925 <para>INPUT: (U) = Address of the module header</para> |
3654 destroyed and its memory deallocated when the link count equals zero, | 3933 destroyed and its memory deallocated when the link count equals zero, |
3655 The module will not be destroyed if in use by any other process(es) | 3934 The module will not be destroyed if in use by any other process(es) |
3656 because its link count will be non-zero. In Level Two systems, the | 3935 because its link count will be non-zero. In Level Two systems, the |
3657 module is usually switched out of the process' address space</para> | 3936 module is usually switched out of the process' address space</para> |
3658 <para>oevice driver modules in use or certain system modules cannot he | 3937 <para>oevice driver modules in use or certain system modules cannot he |
3659 unlinked, HOMed iodules can be unlinked but cannot be deleted from | 3938 unlinked. HOMed iodules can be unlinked but cannot be deleted from |
3660 the module directory</para> | 3939 the module directory</para> |
3661 </sect1> | 3940 </sect2> |
3662 <sect1> | 3941 <sect2> |
3663 <title>WAIT Wait for child process to die, F$WAIT</title> | 3942 <title>WAIT Wait for child process to die. F$WAIT</title> |
3664 <para>ASSEMBLER CALL: OS9 F$WAIT | 3943 <para>ASSEMBLER CALL: OS9 F$WAIT |
3665 </para> | 3944 </para> |
3666 <para>MACHINE CODE: 103F 04 | 3945 <para>MACHINE CODE: 103F 04 |
3667 </para> | 3946 </para> |
3668 <para>INPUT: None | 3947 <para>INPUT: None |
3672 <para>ERROR OUTPUT:</para> | 3951 <para>ERROR OUTPUT:</para> |
3673 <para>(CC) = C bit set.</para> | 3952 <para>(CC) = C bit set.</para> |
3674 <para>(B) = Appropriate error code.</para> | 3953 <para>(B) = Appropriate error code.</para> |
3675 <para>The calling process is deactivated until a child process | 3954 <para>The calling process is deactivated until a child process |
3676 terminates by executing an EXIT system call, or by receiving a | 3955 terminates by executing an EXIT system call, or by receiving a |
3677 signal, The child's ID number and exit status is returned to the | 3956 signal. The child's ID number and exit status is returned to the |
3678 parent. If the child died due to a signal, the exit status byte (B | 3957 parent. If the child died due to a signal, the exit status byte (B |
3679 register) is the signal code</para> | 3958 register) is the signal code</para> |
3680 <para>If the caller has several children, the caller is activated when | 3959 <para>If the caller has several children, the caller is activated when |
3681 the fir~t one dies, so one WAIT system call is required to detect | 3960 the fir~t one dies, so one WAIT system call is required to detect |
3682 termination of each child</para> | 3961 termination of each child</para> |
3683 <para>If a child died before the WAIT call, the caller is reactivated | 3962 <para>If a child died before the WAIT call, the caller is reactivated |
3684 almost immediately. WAIT will return an error if the caller has no | 3963 almost immediately. WAIT will return an error if the caller has no |
3685 children</para> | 3964 children</para> |
3686 <para>See the EXIT description for more related information</para> | 3965 <para>See the EXIT description for more related information</para> |
3687 </sect1> | 3966 </sect2> |
3688 <sect1> | 3967 </sect1> |
3968 <sect1> | |
3969 <title>System Mode Service Requests</title> | |
3970 <sect2> | |
3689 <title>A64 Allocate a 64 byte memory block F$A64</title> | 3971 <title>A64 Allocate a 64 byte memory block F$A64</title> |
3690 <para>ASSEMBLER CALL: OS9 F$A64 | 3972 <para>ASSEMBLER CALL: OS9 F$A64 |
3691 </para> | 3973 </para> |
3692 <para>MACHINE CODE: 103F 30 | 3974 <para>MACHINE CODE: 103F 30 |
3693 </para> | 3975 </para> |
3701 <para>(B) = Appropriate error code.</para> | 3983 <para>(B) = Appropriate error code.</para> |
3702 <para>This system mode service request is used to dynamically allocate | 3984 <para>This system mode service request is used to dynamically allocate |
3703 64 byte blocks of memory by splitting whole pages (256 byte) into | 3985 64 byte blocks of memory by splitting whole pages (256 byte) into |
3704 tour sections. The first 64 bytes of the base page are used as a | 3986 tour sections. The first 64 bytes of the base page are used as a |
3705 "page table", which contains the MSB of all pages in the | 3987 "page table", which contains the MSB of all pages in the |
3706 memory structure, Passing a value of zero in the N register will | 3988 memory structure. Passing a value of zero in the N register will |
3707 cause the F$A64 service request to allocate a new base page and the | 3989 cause the F$A64 service request to allocate a new base page and the |
3708 first 64 byte memory block, Whenever a new page is needed, an F$SRQM | 3990 first 64 byte memory block. Whenever a new page is needed, an F$SRQM |
3709 service request will automatically be, executed, The first byte of | 3991 service request will automatically be, executed. The first byte of |
3710 each block contains the block number; routines using this service | 3992 each block contains the block number; routines using this service |
3711 request should not alter it. Below is a diagram to show how 7 blocks | 3993 request should not alter it. Below is a diagram to show how 7 blocks |
3712 might be allocated: | 3994 might be allocated: |
3713 </para> | 3995 </para> |
3714 <para>ANY 256 BYTE ANY 256 BYTE | 3996 <para>ANY 256 BYTE ANY 256 BYTE |
3719 I PAGETABLE I BLOCK 4 1 | 4001 I PAGETABLE I BLOCK 4 1 |
3720 1 (64 bytes) I (64 bytes) | 4002 1 (64 bytes) I (64 bytes) |
3721 S | 4003 S |
3722 | 4004 |
3723 IX LX | 4005 IX LX |
3724 I BLOCK1 I S BLOCKS £ | 4006 I BLOCK1 I S BLOCKS |
3725 (64 bytes) I I (64 | 4007 (64 bytes) I I (64 |
3726 bytes) S | 4008 bytes) S |
3727 | 4009 |
3728 IX IX I | 4010 IX IX I |
3729 1 BLOCK2 I S BLOCKE I | 4011 1 BLOCK2 I S BLOCKE I |
3730 1 (64 byte) I 1 | 4012 1 (64 byte) I 1 |
3731 (64 byte) | 4013 (64 byte) |
3732 a., m4, 4- ..,*.a,,m + | 4014 a., m4, 4- ..,*.a,,m + |
3733 IX £ IX 1 | 4015 IX IX 1 |
3734 I BLOCK3 I | 4016 I BLOCK3 I |
3735 BLOCK? I | 4017 BLOCK? I |
3736 £ (64 byte) £ 1 (64 byte) £ | 4018 (64 byte) 1 (64 byte) |
3737 4--a + | 4019 4--a + |
3738 4.-mm +</para> | 4020 4.-mm +</para> |
3739 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST | 4021 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST |
3740 </para> | 4022 </para> |
3741 </sect1> | 4023 </sect2> |
3742 <sect1> | 4024 <sect2> |
3743 <title>APRC Insert process in active process queue F$APRC</title> | 4025 <title>APRC Insert process in active process queue F$APRC</title> |
3744 <para>ASSEMBLER CALL: OS9 F$APRC | 4026 <para>ASSEMBLER CALL: OS9 F$APRC |
3745 </para> | 4027 </para> |
3746 <para>MACHINE CODE: 103F 2C | 4028 <para>MACHINE CODE: 103F 2C |
3747 </para> | 4029 </para> |
3756 the age of the specified process is set to its priority If the | 4038 the age of the specified process is set to its priority If the |
3757 process is in system state, it is inserted after any other process~s | 4039 process is in system state, it is inserted after any other process~s |
3758 also in system state, but before any process in user state. If the | 4040 also in system state, but before any process in user state. If the |
3759 process is in user state, it is inserted according to its age</para> | 4041 process is in user state, it is inserted according to its age</para> |
3760 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4042 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
3761 </sect1> | 4043 </sect2> |
3762 <sect1> | 4044 <sect2> |
3763 <title>FIND-64 Find a 64 byte memory block F$F64</title> | 4045 <title>FIND-64 Find a 64 byte memory block F$F64</title> |
3764 <para>ASSEMBLER CALL: OS9 F$F64</para> | 4046 <para>ASSEMBLER CALL: OS9 F$F64</para> |
3765 <para>MACHINE CODE: 103F 2F | 4047 <para>MACHINE CODE: 103F 2F |
3766 </para> | 4048 </para> |
3767 <para>INPUT: (K) = Add ess o base page, (A) - Block number, | 4049 <para>INPUT: (K) = Add ess o base page, (A) - Block number. |
3768 </para> | 4050 </para> |
3769 <para>OUTPUT: (Y) = Address of block</para> | 4051 <para>OUTPUT: (Y) = Address of block</para> |
3770 <para>ERROR OUTPUT:</para> | 4052 <para>ERROR OUTPUT:</para> |
3771 <para>(CC) = C bit set.</para> | 4053 <para>(CC) = C bit set.</para> |
3772 <para>(B) = Appropriate error code.</para> | 4054 <para>(B) = Appropriate error code.</para> |
3775 used this service request to find process descriptors and path | 4057 used this service request to find process descriptors and path |
3776 descriptors when given their number,</para> | 4058 descriptors when given their number,</para> |
3777 <para>Block numbers range from 1,.N</para> | 4059 <para>Block numbers range from 1,.N</para> |
3778 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST | 4060 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST |
3779 </para> | 4061 </para> |
3780 </sect1> | 4062 </sect2> |
3781 <sect1> | 4063 <sect2> |
3782 <title>IODEL Delete I/O device from system F$IODL</title> | 4064 <title>IODEL Delete I/O device from system F$IODL</title> |
3783 <para>ASSEMBLER CALL: OS9 F$IODL | 4065 <para>ASSEMBLER CALL: OS9 F$IODL |
3784 </para> | 4066 </para> |
3785 <para>MACHINE CODE: 103F 33</para> | 4067 <para>MACHINE CODE: 103F 33</para> |
3786 <para>INPUT: (K) - Address of an I/O module, (see description)</para> | 4068 <para>INPUT: (K) - Address of an I/O module, (see description)</para> |
3787 <para>OUTPUT: None</para> | 4069 <para>OUTPUT: None</para> |
3788 <para>ERROR OUTPUT:</para> | 4070 <para>ERROR OUTPUT:</para> |
3789 <para>(CC) = C bit set.</para> | 4071 <para>(CC) = C bit set.</para> |
3790 <para>(B) = Appropriate error code.</para> | 4072 <para>(B) = Appropriate error code.</para> |
3791 <para>This system mode service request is used to determine whether or | 4073 <para>This system mode service request is used to determine whether or |
3792 not an I/O module is being used, The N register passes the address of | 4074 not an I/O module is being used. The N register passes the address of |
3793 a device descriptor module, device driver module, or file manager | 4075 a device descriptor module, device driver module, or file manager |
3794 module, The address .is used to search the device table, and if found | 4076 module. The address .is used to search the device table, and if found |
3795 the use count is checked to see if it is zero, If it is not zero, an | 4077 the use count is checked to see if it is zero. If it is not zero, an |
3796 error condition is returned</para> | 4078 error condition is returned</para> |
3797 <para>This service request is used primarily by IOMAN and may be of | 4079 <para>This service request is used primarily by IOMAN and may be of |
3798 limited or no use for other applications</para> | 4080 limited or no use for other applications</para> |
3799 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST | 4081 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST |
3800 </para> | 4082 </para> |
3801 </sect1> | 4083 </sect2> |
3802 <sect1> | 4084 <sect2> |
3803 <title>IOQUEUE Enter I/O queue F$IOQU</title> | 4085 <title>IOQUEUE Enter I/O queue F$IOQU</title> |
3804 <para>ASSEMBLER CALL: OS9 F$IQQU</para> | 4086 <para>ASSEMBLER CALL: OS9 F$IQQU</para> |
3805 <para>MACHINE CODE: 103F 2B</para> | 4087 <para>MACHINE CODE: 103F 2B</para> |
3806 <para>INPUT: (A) = Process Number,</para> | 4088 <para>INPUT: (A) = Process Number,</para> |
3807 <para>OUTPUT: None,</para> | 4089 <para>OUTPUT: None,</para> |
3811 <para>~IIi~ system mode service request links the calling process into | 4093 <para>~IIi~ system mode service request links the calling process into |
3812 the I/O queue of the specified process and performs an untimed sleep. | 4094 the I/O queue of the specified process and performs an untimed sleep. |
3813 It is assumed that routines associated with the specified process | 4095 It is assumed that routines associated with the specified process |
3814 will send a wakeup signal to the calling process,</para> | 4096 will send a wakeup signal to the calling process,</para> |
3815 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4097 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
3816 </sect1> | 4098 </sect2> |
3817 <sect1> | 4099 <sect2> |
3818 <title>SETIRQ Add or remove device from IRQ table, F$IRQ</title> | 4100 <title>SETIRQ Add or remove device from IRQ table. F$IRQ</title> |
3819 <para>ASSEMBLER CALL: OS9 F$IRQ | 4101 <para>ASSEMBLER CALL: OS9 F$IRQ |
3820 </para> | 4102 </para> |
3821 <para>MACHINE CODE: 103F 2A | 4103 <para>MACHINE CODE: 103F 2A |
3822 </para> | 4104 </para> |
3823 <para>INPUT: (X) - Zero to remove device from table, or the address of a | 4105 <para>INPUT: (X) - Zero to remove device from table, or the address of a |
3837 <para>OUTPUT: None</para> | 4119 <para>OUTPUT: None</para> |
3838 <para>ERROR OUTPUT:</para> | 4120 <para>ERROR OUTPUT:</para> |
3839 <para>(CC) = C bit set.</para> | 4121 <para>(CC) = C bit set.</para> |
3840 <para>(B) = Appropriate error code.</para> | 4122 <para>(B) = Appropriate error code.</para> |
3841 <para>This service request is used to add a device to or remove a device | 4123 <para>This service request is used to add a device to or remove a device |
3842 from the IRQ polling table, To remove a device from the table the | 4124 from the IRQ polling table. To remove a device from the table the |
3843 input should be (X)-0, (U)- Addr of service routine's static storage. | 4125 input should be (X)-0, (U)- Addr of service routine's static storage. |
3844 This service request is primarily used by device driver routines. See | 4126 This service request is primarily used by device driver routines. See |
3845 the text of this manual for a complete discussion of the interrupt | 4127 the text of this manual for a complete discussion of the interrupt |
3846 polling system</para> | 4128 polling system</para> |
3847 <para>PACKET DEFINITIONS: | 4129 <para>PACKET DEFINITIONS: |
3848 </para> | 4130 </para> |
3849 <para>Flip Byte This byte selects whether the bits in the device | 4131 <para>Flip Byte This byte selects whether the bits in the device |
3850 status | 4132 status |
3851 register are active when set or active when | 4133 register are active when set or active when |
3852 cleared, A set bit(s) | 4134 cleared. A set bit(s) |
3853 identifies the active | 4135 identifies the active |
3854 bit(s).</para> | 4136 bit(s).</para> |
3855 <para>Mask Byte This byte selects one or more bits within the device | 4137 <para>Mask Byte This byte selects one or more bits within the device |
3856 status register that are interrupt request flag(s). A set bit | 4138 status register that are interrupt request flag(s). A set bit |
3857 identifies an active bit(s)</para> | 4139 identifies an active bit(s)</para> |
3858 <para>Priority The device priority number: | 4140 <para>Priority The device priority number: |
3859 0 = lowest | 4141 0 = lowest |
3860 255 - | 4142 255 - |
3861 highest</para> | 4143 highest</para> |
3862 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4144 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
3863 </sect1> | 4145 </sect2> |
3864 <sect1> | 4146 <sect2> |
3865 <title>NXTPRCS Start next process F$NPRC</title> | 4147 <title>NXTPRCS Start next process F$NPRC</title> |
3866 <para>ASSEMBLER CALL: OS9 F$NPRC</para> | 4148 <para>ASSEMBLER CALL: OS9 F$NPRC</para> |
3867 <para>MACHINE CODE: 103F 2D</para> | 4149 <para>MACHINE CODE: 103F 2D</para> |
3868 <para>INPUT: None,</para> | 4150 <para>INPUT: None,</para> |
3869 <para>OUTPUT: Control does not return to caller,</para> | 4151 <para>OUTPUT: Control does not return to caller,</para> |
3870 <para>This system mode service request takes the next process out of the | 4152 <para>This system mode service request takes the next process out of the |
3871 Active Process Queue and initiates its execution, If there is no | 4153 Active Process Queue and initiates its execution. If there is no |
3872 proess in the queue, OS-9 waits for an interrupt, and then checks the | 4154 proess in the queue. OS-9 waits for an interrupt, and then checks the |
3873 active process queue again.</para> | 4155 active process queue again.</para> |
3874 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4156 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
3875 </sect1> | 4157 </sect2> |
3876 <sect1> | 4158 <sect2> |
3877 <title>R64 Deallocate a 64 byte memory block F$R64</title> | 4159 <title>R64 Deallocate a 64 byte memory block F$R64</title> |
3878 <para>ASSEMBLER CALL: OS9 F$R64 | 4160 <para>ASSEMBLER CALL: OS9 F$R64 |
3879 </para> | 4161 </para> |
3880 <para>MACHINE CODE: 103F 31 | 4162 <para>MACHINE CODE: 103F 31 |
3881 </para> | 4163 </para> |
3886 <para>(CC) = C bit set.</para> | 4168 <para>(CC) = C bit set.</para> |
3887 <para>(B) = Appropriate error code.</para> | 4169 <para>(B) = Appropriate error code.</para> |
3888 <para>This system mode service request deallocates a 64 byte block of | 4170 <para>This system mode service request deallocates a 64 byte block of |
3889 memory as described in the F$A64 service request</para> | 4171 memory as described in the F$A64 service request</para> |
3890 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4172 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
3891 </sect1> | 4173 </sect2> |
3892 <sect1> | 4174 <sect2> |
3893 <title>SRQMEM System memory request F$SRQM</title> | 4175 <title>SRQMEM System memory request F$SRQM</title> |
3894 <para>ASSEMBLER CALL: OS9 F$SRQM</para> | 4176 <para>ASSEMBLER CALL: OS9 F$SRQM</para> |
3895 <para>MACHINE CODE: 103F 28</para> | 4177 <para>MACHINE CODE: 103F 28</para> |
3896 <para>INPUT: (D) - Byte count,</para> | 4178 <para>INPUT: (D) - Byte count,</para> |
3897 <para>OUTPUT: (U) = Beginning address ,of memory area</para> | 4179 <para>OUTPUT: (U) = Beginning address ,of memory area</para> |
3901 <para>Th~s system mode service request allocates a block of memory from | 4183 <para>Th~s system mode service request allocates a block of memory from |
3902 the top of available RAM of the specified size. The size requested is | 4184 the top of available RAM of the specified size. The size requested is |
3903 rounded to the next 256 byte page boundary,</para> | 4185 rounded to the next 256 byte page boundary,</para> |
3904 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST | 4186 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST |
3905 </para> | 4187 </para> |
3906 </sect1> | 4188 </sect2> |
3907 <sect1> | 4189 <sect2> |
3908 <title>SRTMEM System memory request F$SRTMEM</title> | 4190 <title>SRTMEM System memory request F$SRTMEM</title> |
3909 <para>ASSEMBLER CALL: OS9 F$SRTM</para> | 4191 <para>ASSEMBLER CALL: OS9 F$SRTM</para> |
3910 <para>MACHINE CODE: 103F 29</para> | 4192 <para>MACHINE CODE: 103F 29</para> |
3911 <para>INPUT: | 4193 <para>INPUT: |
3912 </para> | 4194 </para> |
3913 <para>OUTPUT: | 4195 <para>OUTPUT: |
3914 </para> | 4196 </para> |
3915 </sect1> | 4197 </sect2> |
3916 <sect1> | 4198 <sect2> |
3917 <title>VMODULE Validate module F$VMODUL</title> | 4199 <title>VMODULE Validate module F$VMODUL</title> |
3918 <para>ASSEMBLER CALL: OS9</para> | 4200 <para>ASSEMBLER CALL: OS9</para> |
3919 <para>MACHINE CODE: 103F</para> | 4201 <para>MACHINE CODE: 103F</para> |
3920 <para>INPUT: | 4202 <para>INPUT: |
3921 </para> | 4203 </para> |
3922 <para>OUTPUT: | 4204 <para>OUTPUT: |
3923 </para> | 4205 </para> |
3924 </sect1> | 4206 </sect2> |
3925 <sect1> | 4207 </sect1> |
3926 <title>ATTACH Attach a new device to the system, I$ATCH</title> | 4208 <sect1> |
4209 <title>I/O Service Requests</title> | |
4210 <sect2> | |
4211 <title>ATTACH Attach a new device to the system. I$ATCH</title> | |
3927 <para>ASSEMBLER CALL: OS9 I$ATCH | 4212 <para>ASSEMBLER CALL: OS9 I$ATCH |
3928 </para> | 4213 </para> |
3929 <para>MACHINE CODE: 103F 80 | 4214 <para>MACHINE CODE: 103F 80 |
3930 </para> | 4215 </para> |
3931 <para>INPUT: (K) - Address of device name string</para> | 4216 <para>INPUT: (K) - Address of device name string</para> |
3938 or verify that it is already attached. The device's name string is | 4223 or verify that it is already attached. The device's name string is |
3939 used to search the system module directory to see if a device | 4224 used to search the system module directory to see if a device |
3940 descriptor module with the same name is in memory (this is the name | 4225 descriptor module with the same name is in memory (this is the name |
3941 the device will be known by). The descriptor module will contain the | 4226 the device will be known by). The descriptor module will contain the |
3942 name of the device's file manager, device driver and other related | 4227 name of the device's file manager, device driver and other related |
3943 information, It it is found and the device is not already attached, | 4228 information. It it is found and the device is not already attached, |
3944 OS-9 will link to its file manager and device driver, and then place | 4229 OS-9 will link to its file manager and device driver, and then place |
3945 their address' in a new device table entry. Any permanent storage | 4230 their address' in a new device table entry. Any permanent storage |
3946 needed by the device driver is allocated, and the driver's | 4231 needed by the device driver is allocated, and the driver's |
3947 initialization routine is called (which usually initializes the | 4232 initialization routine is called (which usually initializes the |
3948 hardware)</para> | 4233 hardware)</para> |
3958 </para> | 4243 </para> |
3959 <para>0 = Use device capabilities</para> | 4244 <para>0 = Use device capabilities</para> |
3960 <para>1 = Read only</para> | 4245 <para>1 = Read only</para> |
3961 <para>2 a = Write only</para> | 4246 <para>2 a = Write only</para> |
3962 <para>3 a = Both read and write</para> | 4247 <para>3 a = Both read and write</para> |
3963 </sect1> | 4248 </sect2> |
3964 <sect1> | 4249 <sect2> |
3965 <title>CHDIR Change working directory, I$CDIR</title> | 4250 <title>CHDIR Change working directory. I$CDIR</title> |
3966 <para>ASSEMBLER CALL: OS9 I$CDIR | 4251 <para>ASSEMBLER CALL: OS9 I$CDIR |
3967 </para> | 4252 </para> |
3968 <para>MACHINE CODE: 103F 86 | 4253 <para>MACHINE CODE: 103F 86 |
3969 </para> | 4254 </para> |
3970 <para>INPUT: (X) - Address of the pathlist</para> | 4255 <para>INPUT: (X) - Address of the pathlist</para> |
3972 <para>OUTPUT: None</para> | 4257 <para>OUTPUT: None</para> |
3973 <para>ERROR OUTPUT:</para> | 4258 <para>ERROR OUTPUT:</para> |
3974 <para>(CC) = C bit set.</para> | 4259 <para>(CC) = C bit set.</para> |
3975 <para>(B) = Appropriate error code.</para> | 4260 <para>(B) = Appropriate error code.</para> |
3976 <para>Changes a process working directory to another directory file | 4261 <para>Changes a process working directory to another directory file |
3977 specified by the pathlist, Dependinq on the access mode given, the | 4262 specified by the pathlist. Dependinq on the access mode given, the |
3978 current execution or the current data directory may be changed (but | 4263 current execution or the current data directory may be changed (but |
3979 only one may be changed per call), The file specified must be a | 4264 only one may be changed per call). The file specified must be a |
3980 directory file, and the caller must have read permission for it | 4265 directory file, and the caller must have read permission for it |
3981 (public read if not owned by the calling process)</para> | 4266 (public read if not owned by the calling process)</para> |
3982 <para>ACCESS MODES | 4267 <para>ACCESS MODES |
3983 </para> | 4268 </para> |
3984 <para>1 a = Read | 4269 <para>1 a = Read |
3990 <para>4 = Executr | 4275 <para>4 = Executr |
3991 </para> | 4276 </para> |
3992 <para>If the access mode is read, write, or update the current data | 4277 <para>If the access mode is read, write, or update the current data |
3993 directory is changed. If the access mode is execute, the current | 4278 directory is changed. If the access mode is execute, the current |
3994 ex~cution directory is changed</para> | 4279 ex~cution directory is changed</para> |
3995 </sect1> | 4280 </sect2> |
3996 <sect1> | 4281 <sect2> |
3997 <title>CLOSE Close a path to a file/device. I$CLOS</title> | 4282 <title>CLOSE Close a path to a file/device. I$CLOS</title> |
3998 <para>ASSEMBLER CALL: OS9 I$OLOS | 4283 <para>ASSEMBLER CALL: OS9 I$OLOS |
3999 </para> | 4284 </para> |
4000 <para>MACHINE CODE: 103F 8F | 4285 <para>MACHINE CODE: 103F 8F |
4001 </para> | 4286 </para> |
4002 <para>INPUT: (A) = Path number</para> | 4287 <para>INPUT: (A) = Path number</para> |
4003 <para>OUTPUT: None</para> | 4288 <para>OUTPUT: None</para> |
4004 <para>ERROR OUTPUT:</para> | 4289 <para>ERROR OUTPUT:</para> |
4005 <para>(CC) = C bit set.</para> | 4290 <para>(CC) = C bit set.</para> |
4006 <para>(B) = Appropriate error code.</para> | 4291 <para>(B) = Appropriate error code.</para> |
4007 <para>Terminates the I/O path specified by the path number, I/O can no | 4292 <para>Terminates the I/O path specified by the path number. I/O can no |
4008 longer be performed to the file/device, unless another OPEN or CREATE | 4293 longer be performed to the file/device, unless another OPEN or CREATE |
4009 call is used, Devices that are non-sharable become available to other | 4294 call is used. Devices that are non-sharable become available to other |
4010 requesting processes, All OS-9 internally managed buffers and | 4295 requesting processes. All OS-9 internally managed buffers and |
4011 descriptors are deallocated</para> | 4296 descriptors are deallocated</para> |
4012 <para>Note: Because the OS9 F$EXIT service request automatically closes | 4297 <para>Note: Because the OS9 F$EXIT service request automatically closes |
4013 all open paths (except the standard I/O paths), it may not he | 4298 all open paths (except the standard I/O paths), it may not he |
4014 necessary to close them individually with the OS9 I$CLOS service r eq | 4299 necessary to close them individually with the OS9 I$CLOS service r eq |
4015 U e St</para> | 4300 U e St</para> |
4016 <para>Standard I/O paths are not typically closed except when it is | 4301 <para>Standard I/O paths are not typically closed except when it is |
4017 desired to change the files/devices they correspond to</para> | 4302 desired to change the files/devices they correspond to</para> |
4018 </sect1> | 4303 </sect2> |
4019 <sect1> | 4304 <sect2> |
4020 <title>CREATE Create a path to a new file, I$CREA</title> | 4305 <title>CREATE Create a path to a new file. I$CREA</title> |
4021 <para>ASSEMBLER CALL: OS9 I$CREA | 4306 <para>ASSEMBLER CALL: OS9 I$CREA |
4022 </para> | 4307 </para> |
4023 <para>MACHINE CODE: 103F 83 | 4308 <para>MACHINE CODE: 103F 83 |
4024 </para> | 4309 </para> |
4025 <para>INPUT: (N) = Address of the pathlist</para> | 4310 <para>INPUT: (N) = Address of the pathlist</para> |
4030 <para>ERROR OUTPUT:</para> | 4315 <para>ERROR OUTPUT:</para> |
4031 <para>(CC) = C bit set.</para> | 4316 <para>(CC) = C bit set.</para> |
4032 <para>(B) = Appropriate error code.</para> | 4317 <para>(B) = Appropriate error code.</para> |
4033 <para>Used to create a new file on a mnu~1tifiIe mass storage device, | 4318 <para>Used to create a new file on a mnu~1tifiIe mass storage device, |
4034 The pathlist is parsed, and the new file name is entered in the | 4319 The pathlist is parsed, and the new file name is entered in the |
4035 specified (or default working) directory, The file is given the | 4320 specified (or default working) directory. The file is given the |
4036 attributes passed in the B register, which has individual bits | 4321 attributes passed in the B register, which has individual bits |
4037 defined as follows</para> | 4322 defined as follows</para> |
4038 <para>bit 0 = read permit | 4323 <para>bit 0 = read permit |
4039 </para> | 4324 </para> |
4040 <para>bit 3. = write permit bit 2 = execute permit bit 3 = public read | 4325 <para>bit 3. = write permit bit 2 = execute permit bit 3 = public read |
4044 <para>The access mode parameter passed in register A must be either | 4329 <para>The access mode parameter passed in register A must be either |
4045 "WRITE" or "UPDATE". This only affects the file | 4330 "WRITE" or "UPDATE". This only affects the file |
4046 until it is closed; it can be reopened later in any access mode | 4331 until it is closed; it can be reopened later in any access mode |
4047 allowed by the file attributes (see OPEN). Files open for "WRITE" | 4332 allowed by the file attributes (see OPEN). Files open for "WRITE" |
4048 may allow faster dat~i transfer than "UPDATE", which | 4333 may allow faster dat~i transfer than "UPDATE", which |
4049 sometimes needs to pre- read setors, These access codes are defined | 4334 sometimes needs to pre- read setors. These access codes are defined |
4050 as given below: | 4335 as given below: |
4051 </para> | 4336 </para> |
4052 <para>2 = Write only</para> | 4337 <para>2 = Write only</para> |
4053 <para>3 = Update (read and write)</para> | 4338 <para>3 = Update (read and write)</para> |
4054 <para>NOTE: If the execute bit (bit 2) is set, the file will be created | 4339 <para>NOTE: If the execute bit (bit 2) is set, the file will be created |
4060 is created; this is done automatically by WRITE or explicitly by the | 4345 is created; this is done automatically by WRITE or explicitly by the |
4061 PUTSTAT call</para> | 4346 PUTSTAT call</para> |
4062 <para>An error will occur if the file name already exists in the | 4347 <para>An error will occur if the file name already exists in the |
4063 directory. CREATE calls that specify non-multiple file devices (such | 4348 directory. CREATE calls that specify non-multiple file devices (such |
4064 as printers, terminals, etc.) work correctly: the CREATE behaves the | 4349 as printers, terminals, etc.) work correctly: the CREATE behaves the |
4065 same as OPEN, Create cannot be used to make directory files (see | 4350 same as OPEN. Create cannot be used to make directory files (see |
4066 MAKDIR)</para> | 4351 MAKDIR)</para> |
4067 </sect1> | 4352 </sect2> |
4068 <sect1> | 4353 <sect2> |
4069 <title>DELETE Delete a file, I$DLET</title> | 4354 <title>DELETE Delete a file. I$DLET</title> |
4070 <para>ASSEMBLER CALL: OS9 I$DLET</para> | 4355 <para>ASSEMBLER CALL: OS9 I$DLET</para> |
4071 <para>MACHINE CODE: 103F 87</para> | 4356 <para>MACHINE CODE: 103F 87</para> |
4072 <para>INPUT: (K) = Address of pathlist,</para> | 4357 <para>INPUT: (K) = Address of pathlist,</para> |
4073 <para>OUTPUT: (X) = Updated past pathlist (trailing spaces skipped),</para> | 4358 <para>OUTPUT: (X) = Updated past pathlist (trailing spaces skipped),</para> |
4074 <para>ERROR OUTPUT:</para> | 4359 <para>ERROR OUTPUT:</para> |
4075 <para>(CC) = C bit set.</para> | 4360 <para>(CC) = C bit set.</para> |
4076 <para>(B) = Appropriate error code.</para> | 4361 <para>(B) = Appropriate error code.</para> |
4077 <para>This service request deletes the file specified by the pathlist, | 4362 <para>This service request deletes the file specified by the pathlist, |
4078 The file must have write permission attributes (public write if ~ot | 4363 The file must have write permission attributes (public write if ~ot |
4079 the owner), and reside on a multifile mass storage device, Attempts | 4364 the owner), and reside on a multifile mass storage device. Attempts |
4080 to delete devices will result in an error,</para> | 4365 to delete devices will result in an error,</para> |
4081 </sect1> | 4366 </sect2> |
4082 <sect1> | 4367 <sect2> |
4083 <title>DETACH Remove a device from the system. I$DTCH</title> | 4368 <title>DETACH Remove a device from the system. I$DTCH</title> |
4084 <para>ASSEMBLER CALL: OS9 I$DTCB | 4369 <para>ASSEMBLER CALL: OS9 I$DTCB |
4085 </para> | 4370 </para> |
4086 <para>MACHINE CODE: 103F 81</para> | 4371 <para>MACHINE CODE: 103F 81</para> |
4087 <para>INPUT: (U) = Address of the device table entry.</para> | 4372 <para>INPUT: (U) = Address of the device table entry.</para> |
4089 <para>ERROR OUTPUT:</para> | 4374 <para>ERROR OUTPUT:</para> |
4090 <para>(CC) = C bit set.</para> | 4375 <para>(CC) = C bit set.</para> |
4091 <para>(B) = Appropriate error code.</para> | 4376 <para>(B) = Appropriate error code.</para> |
4092 <para>Removes a device from the system device table if not in use by any | 4377 <para>Removes a device from the system device table if not in use by any |
4093 other process. The device driver's termination routine is called, | 4378 other process. The device driver's termination routine is called, |
4094 then any permanent storage assigned to the driver is deallocated, The | 4379 then any permanent storage assigned to the driver is deallocated. The |
4095 device driver and file manager modules associated with the device are | 4380 device driver and file manager modules associated with the device are |
4096 unlinked (and may be destroyed if not in use by another process</para> | 4381 unlinked (and may be destroyed if not in use by another process</para> |
4097 <para>The I$DTCH service request must be used to un-attach devices that | 4382 <para>The I$DTCH service request must be used to un-attach devices that |
4098 were attached with the I$ATCH service request. Both of these are used | 4383 were attached with the I$ATCH service request. Both of these are used |
4099 mainly by IOHAN and are of limited (or no use) to the typical user, | 4384 mainly by IOHAN and are of limited (or no use) to the typical user, |
4100 SCFMAN also uses ATTACH/DETACH to setup its second (echo) devile | 4385 SCFMAN also uses ATTACH/DETACH to setup its second (echo) devile |
4101 </para> | 4386 </para> |
4102 </sect1> | 4387 </sect2> |
4103 <sect1> | 4388 <sect2> |
4104 <title>DUP Duplicate a path. I$DUP</title> | 4389 <title>DUP Duplicate a path. I$DUP</title> |
4105 <para>ASSEMBLER CALL: OS9 I$DUP | 4390 <para>ASSEMBLER CALL: OS9 I$DUP |
4106 | 4391 |
4107 | 4392 |
4108 | 4393 |
4109 </para> | 4394 </para> |
4110 <para>MACHINE CODE: 103F 82 | 4395 <para>MACHINE CODE: 103F 82 |
4111 </para> | 4396 </para> |
4112 <para>INPUT: (A) = Path number of path to duplicate.</para> | 4397 <para>INPUT: (A) = Path number of path to duplicate.</para> |
4113 <para>OUTPUT: (B) = New path number, | 4398 <para>OUTPUT: (B) = New path number. |
4114 </para> | 4399 </para> |
4115 <para>ERROR OUTPUT:</para> | 4400 <para>ERROR OUTPUT:</para> |
4116 <para>(CC) = C bit set.</para> | 4401 <para>(CC) = C bit set.</para> |
4117 <para>(B) = Appropriate error code.</para> | 4402 <para>(B) = Appropriate error code.</para> |
4118 <para>Given the number of an existing path, returns another synonymous | 4403 <para>Given the number of an existing path, returns another synonymous |
4119 path number for the same file or device, SHELL uses this service | 4404 path number for the same file or device. SHELL uses this service |
4120 request when it redirects I/O. Service requests using either the old | 4405 request when it redirects I/O. Service requests using either the old |
4121 or new path numbers operate on the same file or device,</para> | 4406 or new path numbers operate on the same file or device,</para> |
4122 <para> | 4407 <para> |
4123 NOTE. This only increments the "use count" of a path | 4408 NOTE. This only increments the "use count" of a path |
4124 descriptor and returns the synonymous path number, The path | 4409 descriptor and returns the synonymous path number. The path |
4125 descriptor is not copied.</para> | 4410 descriptor is not copied.</para> |
4126 </sect1> | 4411 </sect2> |
4127 <sect1> | 4412 <sect2> |
4128 <title>GETSTAT Get file device status. I$GSTT</title> | 4413 <title>GETSTAT Get file device status. I$GSTT</title> |
4129 <para>ASSEMBLER CALL: OS9 ISC$TI</para> | 4414 <para>ASSEMBLER CALL: OS9 ISC$TI</para> |
4130 <para>MACHINE CODE: 103F 80</para> | 4415 <para>MACHINE CODE: 103F 80</para> |
4131 <para>(A) = Path numter, | 4416 <para>(A) = Path numter. |
4132 (B) Status code | 4417 (B) Status code |
4133 (Other registers depend | 4418 (Other registers depend |
4134 upon status code) | 4419 upon status code) |
4135 </para> | 4420 </para> |
4136 </sect1> | 4421 </sect2> |
4137 <sect1> | 4422 <sect2> |
4138 <title>Write Write Data to File or Device I$WRITE</title> | 4423 <title>Write Write Data to File or Device I$WRITE</title> |
4139 <para>ASSEMBLER CALL: OS9 I$Write</para> | 4424 <para>ASSEMBLER CALL: OS9 I$Write</para> |
4140 <para>MACHINE CODE: 103F</para> | 4425 <para>MACHINE CODE: 103F</para> |
4141 <para>/3- Path number | 4426 <para>/3- Path number |
4142 </para> | 4427 </para> |
4159 </para> | 4444 </para> |
4160 <para>NOTE: On RBF devices, any record that was locked is released. | 4445 <para>NOTE: On RBF devices, any record that was locked is released. |
4161 </para> | 4446 </para> |
4162 <para>SEE ALSO: I$Open, I$Create, and I$WritLn</para> | 4447 <para>SEE ALSO: I$Open, I$Create, and I$WritLn</para> |
4163 <para>POSSIBLE ERRORS: E$BPNum, E$BMode, and E$Write</para> | 4448 <para>POSSIBLE ERRORS: E$BPNum, E$BMode, and E$Write</para> |
4164 </sect1> | 4449 </sect2> |
4165 <sect1> | 4450 <sect2> |
4166 <title>WritLn Write Line of Text with Editing</title> | 4451 <title>WritLn Write Line of Text with Editing</title> |
4167 <para>ASSEMBLER CALL: OS9 I$WritLn</para> | 4452 <para>ASSEMBLER CALL: OS9 I$WritLn</para> |
4168 <para>MACHINE CODE: 103F 8C</para> | 4453 <para>MACHINE CODE: 103F 8C</para> |
4169 <para>INPUT: (A) Path number | 4454 <para>INPUT: (A) Path number |
4170 </para> | 4455 </para> |
4195 <para> | 4480 <para> |
4196 SEE ALSO: I$Open, I$Create, and I$Write; OS-9 Technical I/O | 4481 SEE ALSO: I$Open, I$Create, and I$Write; OS-9 Technical I/O |
4197 Manual chapter on SCF Drivers</para> | 4482 Manual chapter on SCF Drivers</para> |
4198 <para>(line editing). | 4483 <para>(line editing). |
4199 POSSIBLE ERRORS: E$BPNum, E$BMode, and E$Write</para> | 4484 POSSIBLE ERRORS: E$BPNum, E$BMode, and E$Write</para> |
4485 </sect2> | |
4200 </sect1> | 4486 </sect1> |
4201 </chapter> | 4487 </chapter> |
4488 | |
4489 | |
4202 <appendix> | 4490 <appendix> |
4203 <title>APPENDIX E</title> | 4491 <title>Memory Module Diagrams</title> |
4492 <para>These did not scan well</para> | |
4493 </appendix> | |
4494 | |
4495 | |
4496 <appendix> | |
4497 <title>Standard Floppy Disk Formats</title> | |
4498 <para>These did not scan well</para> | |
4499 </appendix> | |
4500 | |
4501 | |
4502 <appendix> | |
4503 <title>Service Request Summary</title> | |
4504 <para>These did not scan well</para> | |
4505 </appendix> | |
4506 | |
4507 | |
4508 <appendix> | |
4509 <title>Error Codes</title> | |
4510 <para>These did not scan well</para> | |
4511 </appendix> | |
4512 | |
4513 | |
4514 | |
4515 | |
4516 | |
4517 <appendix> | |
4518 <title>Level Two System Service Requests</title> | |
4204 <sect1> | 4519 <sect1> |
4205 <title>$3A*F$AllImg Allocate Image RAM blocks F$AllImg</title> | 4520 <title>$3A*F$AllImg Allocate Image RAM blocks F$AllImg</title> |
4206 <para>ASSEMBLER CALL: OS9 F$AllImg</para> | 4521 <para>ASSEMBLER CALL: OS9 F$AllImg</para> |
4207 <para>MACHINE CODE: 103F 3A</para> | 4522 <para>MACHINE CODE: 103F 3A</para> |
4208 <para>INPUT: (V B~~g block nu~er | 4523 <para>INPUT: (V B~~g block nu~er |
4319 </para> | 4634 </para> |
4320 <para>ERROR OUTPUT:</para> | 4635 <para>ERROR OUTPUT:</para> |
4321 <para>(CC) = C bit set.</para> | 4636 <para>(CC) = C bit set.</para> |
4322 <para>(B) = Appropriate error code.</para> | 4637 <para>(B) = Appropriate error code.</para> |
4323 <para>external memory tutu tbe user s buffer tur inspec~cn. Any n,esrc ~ | 4638 <para>external memory tutu tbe user s buffer tur inspec~cn. Any n,esrc ~ |
4324 tue system ~iy be vrewed in t.his wav~</para> | 4639 the system ~iy be vrewed in t.his wav~</para> |
4325 </sect1> | 4640 </sect1> |
4326 <sect1> | 4641 <sect1> |
4327 <title>C nvert DAT block/offset to Doqical Addr 0 eq</title> | 4642 <title>C nvert DAT block/offset to Doqical Addr 0 eq</title> |
4328 <para>ASSEMBLER CALL: OS9 Y~ATLcg</para> | 4643 <para>ASSEMBLER CALL: OS9 Y~ATLcg</para> |
4329 <para>MACHINE CODE: 103F 44</para> | 4644 <para>MACHINE CODE: 103F 44</para> |
4403 <title>$4E* F$FModul Find Module directory entry F$FModul</title> | 4718 <title>$4E* F$FModul Find Module directory entry F$FModul</title> |
4404 <para>ASSEMBLER CALL: OS9</para> | 4719 <para>ASSEMBLER CALL: OS9</para> |
4405 <para>MACHINE CODE: 103F</para> | 4720 <para>MACHINE CODE: 103F</para> |
4406 <para>OUTPUT: | 4721 <para>OUTPUT: |
4407 </para> | 4722 </para> |
4408 <para>(B) - Appropriate error code, | 4723 <para>(B) - Appropriate error code. |
4409 </para> | 4724 </para> |
4410 </sect1> | 4725 </sect1> |
4411 <sect1> | 4726 <sect1> |
4412 <title>$3E* F$FreeHB get Free High block F$FreeHB</title> | 4727 <title>$3E* F$FreeHB get Free High block F$FreeHB</title> |
4413 <para>ASSEMBLER CALL: OS9</para> | 4728 <para>ASSEMBLER CALL: OS9</para> |
4472 <para>MACHINE CODE: 103F 18 | 4787 <para>MACHINE CODE: 103F 18 |
4473 "" (A) a Requested process | 4788 "" (A) a Requested process |
4474 ED> | 4789 ED> |
4475 1 - 512 byte buffer pointer> | 4790 1 - 512 byte buffer pointer> |
4476 </para> | 4791 </para> |
4477 <para>£771 More | 4792 <para>771 More |
4478 ERROR OUTPUT:</para> | 4793 ERROR OUTPUT:</para> |
4479 <para>(CC) = C bit set.</para> | 4794 <para>(CC) = C bit set.</para> |
4480 <para>(B) = Appropriate error code.</para> | 4795 <para>(B) = Appropriate error code.</para> |
4481 <para>a. process descriptor into the caLling process~ tufter fo | 4796 <para>a. process descriptor into the caLling process~ tufter fo |
4482 s~~~e<'x>en, There is no way to change dmts in a process | 4797 s~~~e<'x>en. There is no way to change dmts in a process |
4483 descrIptor></para> | 4798 descrIptor></para> |
4484 </sect1> | 4799 </sect1> |
4485 <sect1> | 4800 <sect1> |
4486 <title>$37* F$GProcP Get Process Pointer F$GProcP</title> | 4801 <title>$37* F$GProcP Get Process Pointer F$GProcP</title> |
4487 <para>ASSEMBLER CALL: OS9 F$GIProcP</para> | 4802 <para>ASSEMBLER CALL: OS9 F$GIProcP</para> |
4491 <para>pp~'~ (A~ - Process ID | 4806 <para>pp~'~ (A~ - Process ID |
4492 >7' - Pointer to Process Descriptor</para> | 4807 >7' - Pointer to Process Descriptor</para> |
4493 <para>ERROR OUTPUT:</para> | 4808 <para>ERROR OUTPUT:</para> |
4494 <para>(CC) = C bit set.</para> | 4809 <para>(CC) = C bit set.</para> |
4495 <para>(B) = Appropriate error code.</para> | 4810 <para>(B) = Appropriate error code.</para> |
4496 <para>a process ID number to the aodress at its ~"o ~ pt ~t the | 4811 <para>a process ID number to the address at its ~"o ~ pt ~t the |
4497 system address space | 4812 system address space |
4498 </para> | 4813 </para> |
4499 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4814 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
4500 </sect1> | 4815 </sect1> |
4501 <sect1> | 4816 <sect1> |
4509 </para> | 4824 </para> |
4510 <para>X - 0a~a byte at 0,1 in task~s address space</para> | 4825 <para>X - 0a~a byte at 0,1 in task~s address space</para> |
4511 <para>ERROR OUTPUT:</para> | 4826 <para>ERROR OUTPUT:</para> |
4512 <para>(CC) = C bit set.</para> | 4827 <para>(CC) = C bit set.</para> |
4513 <para>(B) = Appropriate error code.</para> | 4828 <para>(B) = Appropriate error code.</para> |
4514 <para>7e Cyta is returned from the logical address in I) in tue | 4829 <para>7e Cyta is returned from the logical address in I) in the |
4515 ~ | 4830 ~ |
4516 address space> This is typically used to get one | 4831 address space> This is typically used to get one |
4517 </para> | 4832 </para> |
4518 <para>Von the current process's memory an a system state | 4833 <para>Von the current process's memory an a system state |
4519 ~Ut Va</para> | 4834 ~Ut Va</para> |
4562 </sect1> | 4877 </sect1> |
4563 <sect1> | 4878 <sect1> |
4564 <title>$48* F$LDDDXY Load D [D+X, [Y] ] F$LDDDXY</title> | 4879 <title>$48* F$LDDDXY Load D [D+X, [Y] ] F$LDDDXY</title> |
4565 <para>ASSEMBLER CALL: OS9</para> | 4880 <para>ASSEMBLER CALL: OS9</para> |
4566 <para>MACHINE CODE: 103F 48 | 4881 <para>MACHINE CODE: 103F 48 |
4567 N = Uff~et to cffse>. | 4882 N = Off~et to cffse>. |
4568 I) - Offset | 4883 I) - Offset |
4569 S | 4884 S |
4570 - DAT nags</para> | 4885 - DAT nags</para> |
4571 <para>= bytes add essed by ~ | 4886 <para>= bytes add essed by ~ |
4572 ERROR OUTPUT:</para> | 4887 ERROR OUTPUT:</para> |
4573 <para>(CC) = C bit set.</para> | 4888 <para>(CC) = C bit set.</para> |
4574 <para>(B) = Appropriate error code.</para> | 4889 <para>(B) = Appropriate error code.</para> |
4575 <para>two tytes from the memory block described by the 73A>~' Lma;e | 4890 <para>two tytes from the memory block described by the 73A>~' Lma;e |
4576 | 4891 |
4577 "so cc b~ (Y), The bytes loaded are at the offset (D'~'X) rz | 4892 "so cc b~ (Y). The bytes loaded are at the offset (D'~'X) rz |
4578 ", a rratr~~'r' bloak,</para> | 4893 ", a rratr~~'r' bloak,</para> |
4579 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4894 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
4580 </sect1> | 4895 </sect1> |
4581 <sect1> | 4896 <sect1> |
4582 <title>$4F* F$MapBlk Map specific Block F$MapBlk</title> | 4897 <title>$4F* F$MapBlk Map specific Block F$MapBlk</title> |
4623 <para>ASSEMBLER CALL: OS9 F$RelTsk | 4938 <para>ASSEMBLER CALL: OS9 F$RelTsk |
4624 </para> | 4939 </para> |
4625 <para>MACHINE CODE: 103F 43 | 4940 <para>MACHINE CODE: 103F 43 |
4626 ""1 U) Task number</para> | 4941 ""1 U) Task number</para> |
4627 <para>in</para> | 4942 <para>in</para> |
4628 <para>5 137 . (077 a C bit set, | 4943 <para>5 137 . (077 a C bit set. |
4629 (B) = Appropriate error code. | 4944 (B) = Appropriate error code. |
4630 </para> | 4945 </para> |
4631 <para>a t,~e spec'>fred DAT Task number> | 4946 <para>a t,~e spec'>fred DAT Task number> |
4632 | 4947 |
4633 | 4948 |
4642 <para>" | 4957 <para>" |
4643 in 7' - ~>~~k' rcmber</para> | 4958 in 7' - ~>~~k' rcmber</para> |
4644 <para>ERROR OUTPUT:</para> | 4959 <para>ERROR OUTPUT:</para> |
4645 <para>(CC) = C bit set.</para> | 4960 <para>(CC) = C bit set.</para> |
4646 <para>(B) = Appropriate error code.</para> | 4961 <para>(B) = Appropriate error code.</para> |
4647 <para> DAT task number, | 4962 <para> DAT task number. |
4648 | 4963 |
4649 | 4964 |
4650 | 4965 |
4651 </para> | 4966 </para> |
4652 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 4967 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
4677 <title>$41* F$SetTsk Set process Task DAT registers F$SetTsk</title> | 4992 <title>$41* F$SetTsk Set process Task DAT registers F$SetTsk</title> |
4678 <para>ASSEMBLER CALL: OS9 F$SetTsk</para> | 4993 <para>ASSEMBLER CALL: OS9 F$SetTsk</para> |
4679 <para>MACHINE CODE: 103F 41</para> | 4994 <para>MACHINE CODE: 103F 41</para> |
4680 <para>I) = Process Descriptor pointer | 4995 <para>I) = Process Descriptor pointer |
4681 </para> | 4996 </para> |
4682 <para>F 7>7 | 4997 <para>ERROR OUTPUT:</para> |
4683 ERROR OUTPUT:</para> | |
4684 <para>(CC) - C bit set.</para> | 4998 <para>(CC) - C bit set.</para> |
4685 <para>(B) Appropriate error code.</para> | 4999 <para>(B) Appropriate error code.</para> |
4686 <para>a in roinss Task DAT registers,</para> | 5000 <para>a in roinss Task DAT registers,</para> |
4687 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> | 5001 <para>NOTE: THIS IS A PRIVILEGED SYSTEM MODE SERVICE REQUEST</para> |
4688 </sect1> | 5002 </sect1> |
4825 if a full pathlist (a pathtJ.rtat beginning witt a ~ appears, the | 5139 if a full pathlist (a pathtJ.rtat beginning witt a ~ appears, the |
4826 access mode is ignored</para> | 5140 access mode is ignored</para> |
4827 <para>ACCESS MODES' | 5141 <para>ACCESS MODES' |
4828 </para> | 5142 </para> |
4829 <para>1 a Read | 5143 <para>1 a Read |
4830 2 - WrIte | 5144 2 - Write |
4831 B = Update (read or write) | 5145 3 = Update (read or write) |
4832 4 - | 5146 4 - |
4833 Execute | 5147 Execute |
4834 | 5148 |
4835 | 5149 |
4836 | 5150 |