Privileged System
Mode Calls / 8
Clear Specified
Block
OS9 F$C1rBlk 103E 50
Entry Conditions:
B = number of blocks
U = address of first block
Exit Conditions:
None
Additional Information:
Marks blocks in the
process DAT image as
unallocated
After Clear Specified Block deallocates blocks, the blocks
are free for the process to use for other data or program
areas. If the block address passed to Clear Specified Block
is invalid or if the call attempts to clear the stack area, it
returns E$IBA.
The support module for the call is OS9p2.
8-77
OS-9 Technical Reference
DAT to Logical
Address
OS9 F$DATLog 103E 44
Entry Conditions:
B = DAT image offset
X = block offset
Exit Conditions:
Error Output:
logical address
CC = C bit set on error
B = appropriate error code
Additional Information:
0
Following is a sample conversion:
2000 - 2FFF
1000 - 1FFF
0 - FFF
Converts a DAT image
clock number and
block offset to its
equivalent logical
address
Input:
B = 2
X = $0329
Output: X = $2329
0
The support module for this call is OS9p1.
8-78
Privileged System Mode Calls l 8
Deallocate Image
Deallocates image
RAM Blocks
RAM blocks
OS9 F$DelImg 103E 3B
Entry Conditions:
A = number of starting block
B = block count
X = process descriptor pointer
Error Output:
CC = C bit set on error
B = appropriate error code
Additional Information:
· This system call deallocates memory from a process's
address space. It frees the RAM for system use and frees
the DAT image for the process. Its main use is to let the
system clean up after a process death.
· The support module for this call is OS9p2.
8-79
OS-9 Technical Reference
Deallocate
Process
Descriptor
OS9 F$De1Prc 103E 4C
Entry Conditions:
Returns a process
descriptor's memory to
a free memory pool
A = process ID
Error Output:
CC = C bit set on error
B = appropriate error code
Additional Information:
· Use this call to clear the system scratch memory and stack
area associated with the process.
· The support module for this call is OS9p2.
8-80
Privileged System
Mode Calls / 8
Deallocate RAM
blocks
OS9 F$De1RAM 103E 51
Entry Conditions:
B = number of blocks
X = starting block number
Exit Conditions:
None
Additional Information:
Clears a block's RAM
In Use flag in the
system memory block
map
The Deallocate RAM Blocks call assumes the blocks being
deallocated are not associated with any DAT image.
· The support module for this call is OS9p2.
8-81
OS-9 Technical Reference
Deallocate Task
Number
OS9 F$De1Tsk 103E 40
Entry Conditions:
X = process descriptor pointer
Error Output:
CC
B
C bit set on error
appropriate error code
Additional Information:
0
The support module for this call is OS9p1.
Releases the task
number that the
process specified by
the passed descriptor
pointer
8-82
Privileged System Mode Calls l 8
Link Using
Performs a link using a
Module Directory
pointer to a module
'1
Entry
directory entry
E
OS9 F$ELink 103E 4D
Entry Conditions:
B = module type
X = pointer to module directory entry
Exit Conditions:
U = module header address
Y = module entry point
Error Output:
CC = C bit set on error
i B = appropriate error code
Additional Information:
· This call differs from Link in that you supply a pointer to
the module directory entry rather than a pointer to a mod
ule name.
The support module for this call is OS9p1.
8-83
OS-9 Technical Reference
Find Module
Directory Entry
OS9 F$FModul 103E 4E
Entry Conditions:
A = module type
X = pointer to the name string
Y = DAT image pointer (for
name)
Exit Conditions:
A
B
X
Error Output:
Returns a pointer to
the module directory
entry
module type
module revision number
updated name string; (if
Register A contains 0 on
entry)
module directory entry pointer
CC = C bit set on error
B = appropriate error code
Additional Information:
0
The Find Module Directory Entry call returns a pointer to
the module directory entry for the first module that has a
name and type matching the specified name and type. If
you pass a module type of zero, the system call finds any
module.
0
The support module for this call is OS9p1.
8-84
Privileged System Mode Calls / 8
Find 64
OS9 F$Find64 103E 2F
Returns the address
of a 64-byte memory
block
Entry Conditions:
A = block number
X = address of
the block
Exit Conditions:
Y = address of
the block
CC = carry set if block not allowed or not in use
Additional Information:
0
OS-9 uses Find 64 to find path descriptors when given
their block number. The block number can be any positive
integer.
8-85
OS-9 Technical Reference
Get Free High
Block
OS9 F$FreeHB 103E 3E
Searches the DAT
image for the
highest set of
contiguous free
blocks of the
specified size
Entry Conditions:
B
= block count
Y = DAT image pointer
Exit Conditions:
A = starting block number
Error Output:
CC = C bit set on error
B = appropriate
error code
Additional Information:
0
The Get Free High Block call returns the block number of
the beginning memory address of the free blocks.
0
The support module for this system call is OS9p 1.
8-86
Privileged System Node Calls / 8
Get Free Low
Block
OS9 F$FreeLB 103E 3D
Entry Conditions:
B
= block count
Y = DAT image pointer
Exit Conditions:
A = starting block number
Error Output:
CC = C bit set on error
B = appropriate error code
Additional Information:
Searches the DAT
image for the lowest set
of contiguous free
blocks of the specified
size
· The Get Free Low Block call returns the block number of
the beginning memory address of the free blocks.
· The support module for this system call is OS9p1.
8-87
OS-9 Technical Reference
Compact Module
Directory
OS9 F$GCMDir 103E 52
Entry Conditions:
None
Exit Conditions:
None
Additional Information:
Compacts the entries in
the module directory
0
This function is only for internal OS-9 system use. You
should never call it from a program.
8-88
Privileged System Mode Calls l 8
Get Process
Gets a pointer to a
Pointer
process
F$GProcP 103E 37
Entry Conditions:
A = process ID
Exit Conditions:
B = pointer
to process descriptor
(if no error)
Error Output:
CC = carry set on error
B
= error
code (If an error occurs (E$BPrcID))
Additional Information:
0
The Get Process Pointer call translates a process ID num
ber to the address of its process descriptor in the system
address space. Process descriptors exist only in the system
task address space. Because of this, the address returned
only refers to system address space.
0
The support module for this call is OS9p2.
8-89
OS-9 Technical Reference
1/O Delete
Deletes an I/O module
OS9 F$IODel 103E 33 that is not being used
Entry Conditions:
X = address of an I1O module
Error Output:
CC = carry set on error
B = error code (if any)
Additional Information:
· The I/O Delete deletes the specified I/O module from the
system, if the module is not in use. This system call is
used mainly by the I/O MANAGER, and can be of limited
or no use for other applications.
· This is the order in which I/O Delete operates:
1. Register X passes the address of a device descriptor
module, device driver module, or file manager module.
2. OS-9 searches the device table for the address.
3. If OS-9 finds the address, it checks the module's use
count. If the count is zero, the module is not being
used; OS-9 deletes it. If the count is not zero, the mod
ule is being used; OS-9 returns an error.
· I/O Delete returns information to the Unlink system call
after determining whether a device is busy.
8-90
Privileged System Mode Calls / 8
I/O (queue
OS9 F$IOQu 103E 2B
Inserts the calling
process into another
process's I/O queue,
and puts the calling
process to sleep
Entry Conditions:
A =
process number
Error Output:
CC = carry set on error
B = error code
(if any)
Additional Information:
The I/O Queue call links the calling process into the I/O
queue of the specified process and performs an untimed
sleep. The IO Manager and the file managers are primary
and extensive users of I/O Queue.
0
Routines associated with the specified process send a wake
up signal to the calling process.
8-91
OS-9 Technical Reference
Set IRQ
OS9 F$IRQ 103E 2A
Entry Conditions:
Adds a device to or
removes it from the
polling table
D = address of the device status register
X = 0 (to remove a device) or
the address of a packet (to
add a device)
· the address at X is the flip byte
· the address at X + 1 is the mask byte
· the address at X + 2 is the priority byte
= address of the device IRQ service routine
U = address of the service routine's memory area
Error Output:
CC = carry set on error
B = error code
(if any)
Additional Information:
· Set IRQ is used mainly by device driver routines. (See
"Interrupt Processing" in Chapter 2 for a complete discus
sion of the interrupt polling system.)
Packet Definitions:
The Flip Byte.
Determines whether the bits in the device
status register indicate active when set or active when
cleared. If a bit in the flip byte is set, it indicates that the
task is active whenever the corresponding bit in the status
register is clear (and vice versa).
The Mask Byte.
Selects one or more bits within the device
status register that are interrupt request flag(s). One or
more set bits identify which task or device is active.
The Priority Byte.
Contains the device priority number (0
= lowest priority, 255 = highest priority).
8-92
Privileged System Mode Calls l 8
Load A From
Loads A from O,X in
Task B
task B
F$LDABX 103E 49
Entry Conditions:
B = task number
X = pointer to data
Exit Conditions:
A = byte at O,X in task address space
Error Output:
CC = carry set on error
B = error code (if any)
Additional Information:
0
The value in Register X is an offset value from the begin
ning address of the Task module. The Load A From Task B
call returns one byte from this logical address. Use this
system call to get one byte from the current process's mem
ory in a system state routine.
8-93
OS-9 Technical Reference
Get One
Byte
Loads A from [X, [Y]]
F$LDAXY 103E 46
Entry Conditions:
X = block offset
Y = DAT image pointer
Exit Conditions:
A = contents of byte at DAT image (Y) offset by X
Error Output:
CC = carry set on error
B = error code (if any)
Additional Information:
0
The Get One Byte system call gets the contents
of
one byte
in the specified memory block. The block is specified by the
DAT image in (Y), offset by (X). The call assumes that the
DAT image pointer is to the actual block desired, and that
X is only an offset within the DAT block. The value in Reg
ister X must be less than the size
of
the DAT block. OS-9
does not check to see if X is out of range.
8-94
Privileged System Mode Calls l 8
Get Two Bytes
Loads D from
F$LDDDXY 103E 48 fD + X],[Y]
Entry Conditions:
D = Offset to the offset within the DAT
image
X = Offset within the DAT image
Y = DAT image
pointer
Exit Conditions:
D = contents of two bytes at [D+X,YJ
Error Output:
CC = carry set on error
B = error code
(if any)
Additional Information:
Get Two Bytes loads two bytes from the address space
described by the DAT image pointer. If the DAT image
pointer is to the entire DAT, then make D + X equal to the
process address for data. If the DAT image is not the entire
image (64K), then you must adjust D + X relative to the
beginning of the DAT image. Using D + X lets you keep a
local pointer within a block, and also lets you point to an
offset within the DAT image that points to a specified block
8-95
OS-9 Technical Reference
Map Specific
Block
F$MapBlk 103E 4F
Entry Conditions:
X = starting block number
B
= number of blocks
Maps the specified
block(s) into
unallocated blocks of
process space
Exit Conditions:
U = address of first block
Error Output:
B = error code (if
any)
CC = carry set on error
Additional Information:
0
The system maps blocks from the top down. It maps new
blocks into the highest available addresses in the address
space. See Clear Specified Block for information on
unmapping.
8-96
Privileged System Mode Calls / 8
Move Data
F$Move 103E 38
Entry Conditions:
A
B
X
Y
U
Error Output:
CC
B
source task number
destination task number
source pointer
byte count
destination pointer
carry set on error
error code (if
any)
Additional Information:
Moves data bytes from
one address space to
another
· You can use the Move Data system call to move data bytes
from one address space to another, usually from system to
user, or vice versa.
· The support module for this call is OS9p1.
8-97
OS-9 Technical Reference
Next Process
OS9 F$NProc 103E 2D
Executes the next
process in the active
process queue
Entry Conditions:
None
Exit Conditions:
Control does not return to caller.
Additional Information:
· The Next Process system call takes the next process out of
the active process queue and initiates its execution. If the
queue contains no process, OS-9 waits for an interrupt, and
then checks the queue again.
· The process calling Next Process must already be in one of
the three process queues. If it is not, it becomes unknown
to the system even though the process descriptor still exists
and can be displayed by a PROCS command.
Privileged System Mode Calls / 8
Release A Task
F$Re1Tsk 103E 43
Entry Conditions:
B = task
number
Error Output:
CC = carry set on error
B
= error code (if
any)
Additional Information:
* The support module for this call OS9p1.
Releases a specified
DAT task number from
use by a process,
making the task's DAT
hardware available for
use by another task
8-99
OS-9 Technical Reference
Reserve Task
Reserves a Dat task
Number
number
F$ResTsk 103E 42
Entry Conditions: none
Exit Conditions:
B = task number (if
no error)
Error Output:
CC = carry set on error
B = error code if an
error occurs
Additional Information:
· The Reserve Task Number call fords a free DAT task num-
ber, reserves it, and returns the task number to the caller.
The caller often then assigns the task number to a process.
· The support module for this call is OS9p1.
1-11
8-100