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


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:






· 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




'1

















i B = appropriate error code









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:





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


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 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


· This is the order in which I/O Delete operates:







· I/O Delete returns information to the Unlink system call


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


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:


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:


8-94


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:


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.