os9@nyit.UUCP (OS9 News) (02/20/86)
This is in reply to James Jones on his questions about the File
Manager entry points in OS9/6809.
As a preface to the main discussion, I am posting the listing of two
sections of the OS9defs file. These are the definitions for the File
Manager Entry Offsets and the I/O Service Requests.
These definitions will figure prominently in the following discussion.
00001 ************************************************************
00002 *
00003 * File Manager Entry Offsets
00004 *
00005 D 0000 ORG 0
00006 D 0000 FMCREA rmb 3 Create (Open New) File
00007 D 0003 FMOPEN rmb 3 Open File
00008 D 0006 FMMDIR rmb 3 Make Directory
00009 D 0009 FMCDIR rmb 3 Change Directory
00010 D 000C FMDLET rmb 3 Delete File
00011 D 000F FMSEEK rmb 3 Position File
00012 D 0012 FMREAD rmb 3 Read from File
00013 D 0015 FMWRIT rmb 3 Write to File
00014
00015 * Two of the Entry Points are Missing
00016 * In the OS9defs File.
00017
00018 D 0018 FMRDLN rmb 3 Read from File to EOR
00019 D 001B FMWRLN rmb 3 Write to File to EOR
00020
00021 D 001E FMGSTA rmb 3 Get File Status
00022 D 0021 FMSSTA rmb 3 Set File Status
00023 D 0024 FMCLOS rmb 3 Close File
00024
00025 ************************************************************
00026 *
00027 * I/O Service Request Code Definitions
00028 *
00029 D 0080 ORG $80
00030 D 0080 I$Attach rmb 1 Attach I/O Device
00031 D 0081 I$Detach rmb 1 Detach I/O Device
00032 D 0082 I$Dup rmb 1 Duplicate Path
00033
00034 * The Following I$ Calls Correspond Exactly
00035 * To the File Manager Entry Points.
00036
00037 D 0083 I$Create rmb 1 Create New File
00038 D 0084 I$Open rmb 1 Open Existing File
00039 D 0085 I$MakDir rmb 1 Make Directory File
00040 D 0086 I$ChgDir rmb 1 Change Default Directory
00041 D 0087 I$Delete rmb 1 Delete File
00042 D 0088 I$Seek rmb 1 Change Current Position
00043 D 0089 I$Read rmb 1 Read Data
00044 D 008A I$Write rmb 1 Write Data
00045 D 008B I$ReadLn rmb 1 Read Line of ASCII Data
00046 D 008C I$WritLn rmb 1 Write Line of ASCII Data
00047 D 008D I$GetStt rmb 1 Get Path Status
00048 D 008E I$SetStt rmb 1 Set Path Status
00049 D 008F I$Close rmb 1 Close Path
00050
00051 * The Others Are Handled Via IOMan.
00052
00053 D 0090 I$DeletX rmb 1 Delete from exec dir
***************************************************************************
Any service requests to OS9 with a value of $80 or greater are passed
to IOMan. All of the I/O requests from I$Create ($83) to I$Close ($8F) are
subsequently passed on to the File Manager for the actual processing.
IOMan determines the proper entry point in the file manager by subtracting
$83 from the Request Code, multiplying the result by 3, and adding this to
the execution entry point of the File Manager module (defined by M$EXEC in
the module header). So you can see that the I/O requests and the entry
points correspond exactly.
This means that you can use the OS9 System Call Definitions to
determine the operating parameters and the register setup for each
individual I/O System Call.
However, on actual entry into the File Manager the registers are NOT
set up as described. The Y Register is pointing to the Path Descriptor and
the U Register points to the stacked User Registers. There are two ways of
accessing these registers. Both require using the R$ register definitions
in the OS9defs file. If the U Register has not been modified they can be
accessed directly as R$A,U (for the A Register). If U has been changed,
then PD.RGS must be used. This Path Descriptor location contains the
address of the User Stack. LDX PD.RGS,Y followed by LDA R$A,X would once
again restore the A Register as before. Also note that all parameters to
be passed back to the process must use the stacked registers in the same
fashion.
The balance of the message concerns Mr. Jones' questions about pipes
and get/setstat.
Unfortunately, neither Pipeman nor Piper have ANY getstat or setstat
calls. In fact, it turns out that Piper is nothing but a nul driver.
I cannot say how easy it would be to modify either to make the
SS.Ready call available, since I just completed the disassemblies and have
not really had a chance to do any dedicated hacking on them.
Kent D. Meyers ihnp4!chinet!draco
Box 266
Le Roy, MN 55951
(507)-324-5836
Disclaimer: The views expressed here are not necessarily those of this
station, or the sponsor. (Or for that matter, of anyone in their right
mind!)
--
---
516-686-7644 (Bruce Perens or Alex Arthur)
{allegra,seismo,decvax,vax135,ihnp4,mcvax}!philabs!nyit!os9
nyit!os9%suny-sb.CSnet@CSnet-Relay.ARPA
OS-9 and BASIC09 are trademarks of Microware Systems Corporation and Motorola.
mod.os.os9 is a personal (not an NYIT) project.