Professional Documents
Culture Documents
Training
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 1
Purpose
This self-paced tutorial is a detailed introduction to the
System Services Interface and the common
functionality shared among the various flavors of SSI.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 2
Goal
Through this training presentation, customers
familiarize themselves with the common architectural
features and functionality of the System Services
Interface.
By understanding how the System Services Interface
isolates Trillium software products from the
underlying operating system, the customer can fully
integrate and customize their software, and thus
begin the larger task of addressing application
development considerations.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 3
Objectives
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 4
Agenda
Terms
System Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 5
Terms
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 6
TAPA Task
• A TAPA Task is an invocation of a Trillium layer
• Identified by entity, instance, and processor IDs:
– An entity ID functionally distinguishes between
Trillium products.
– An instance ID distinguishes between multiple
instances of the same entity. Although an instance
ID is one of the parameters that identifies the task,
multiple instances of the task may not be
supported in an actual implementation.
– A processor ID identifies a physical processor or a
logical process in a system. Processor IDs are
globally unique.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 7
System Task
• A System Task is a schedulable unit of execution in
the underlying operating system (a thread on Solaris
or Windows NT, a task on VxWorks or pSOS).
• A TAPA Task must be attached to a System Task in
order to be activated.
• Once a TAPA Task is attached to a System Task, the
System Task schedules activation of the TAPA Task
based on the TAPA Task’s priority and on incoming
events.
• Any number of TAPA Tasks can be attached to a
System Task.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 8
Permanent Task
• A Permanent Task is a specialized TAPA Task
• Its behavior is similar to an ‘idle’ task on a real time
operating system.
• A Permanent Task has the following features:
– It is usually implemented as a low priority task
(relative to the TAPA Task).
– It is activated irrespective of whether there is a
message for it or not.
– Based upon the operating system scheduler, it
may be activated only when no normal TAPA Task
can be run.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 9
Driver Task
• A Driver Task is a specialized TAPA Task that can be
used to route messages across address space
boundaries.
• It is identified by a channel instance ID and not by
entity, instance, and processor IDs.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 10
Memory
• Memory is divided into one or more regions.
• Region attributes:
– May be a contiguous block
– May or may not be protected
– May physically exist on different boards
– May be SRAM or DRAM
– May be shared memory
• A region is identified by a region ID.
• Each region is handled by a memory manager which
is responsible for handling allocation and deallocation
requests.
• Memory regions are divided into one or more pools.
A memory pool is identified by a pool ID.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 11
Memory Models
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 12
Static Memory
• A task requests System Services to reserve space
from the specified region for the entire memory
requirements of the task’s structures (SGetSMem).
• System Services reserves this space.
• System Services returns a specific pool ID to the task
for the space it has reserved.
• A task allocates static buffers from the specific region
and pool.
• A static buffer is a unit of memory allocated from the
specified region and pool.
• A task overlays dynamic data structures on the static
buffers (SGetSBuf).
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 13
Dynamic Memory
• A task allocates dynamic buffers from the dynamic
memory.
• Dynamic buffer are used to build messages.
• The dynamic memory is identified by the specified
region and pool.
• The region and pool information are obtained from
the SAP to which a message is associated.
• A different region and pool may be assigned to each
SAP used by a task. The assignment is done by a
Configuration Request primitive issued by the layer
manager.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 14
Message
• A message is a data abstraction that allows
information to be exchanged between TAPA tasks
(SGetMsg).
• Logically, a message is an ordered sequence of bytes
with no pre-defined size.
• System Services maintains some control information
in each message (sender, receiver, message priority,
and so on).
• The contents of the data part of the message are
bilaterally defined between the communicating tasks.
• Internally, a message is a STREAMS-standard
message.
• Messages are allocated from dynamic memory.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 15
Message Priority
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 16
Message Route
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 17
STREAMS Messages
mblk_t dblk_t
Queue b_next db_frtnp
pointers b_prev db_base
b_cont db_lim
b_rptr db_ref
b_wptr db_type
Data buffer
b_datap
read position
mblk_t
write position
Reference
count Type
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 18
Trillium Messages
dblk_t
mblk_t
(M_PROTO)
data buffer (SsMsgInfo)
dblk_t
mblk_t data buffer
(M_DATA)
dblk_t
mblk_t data buffer
(M_DATA)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 19
Post Structure
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 20
Post Structure
typedef struct pst {
ProcId dstProcId; /* destination processor ID */
ProcId srcProcId; /* source processor ID */
Ent dstEnt; /* destination entity */
Inst dstInst; /* destination instance */
Ent srcEnt; /* source entity */
Inst srcInst; /* source instance */
Prior prior; /* priority */
Route route; /* route */
Event event; /* event */
Region region; /* region */
Pool pool; /* pool */
Selector selector; /* selector */
} Pst;
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 21
Post Structure Elements
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 22
Post Structure Elements
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 23
Terminology Quiz
1. A TAPA task must be attached to a _____ task in
order to be activated.
2. A TAPA task is identified by what three types of
identifiers (IDs)?
3. What type of ID identifies a driver task?
4. There are ____ types of memory. Name them.
5. Messages are allocated from _____ memory.
6. SAPs and their post structures are initialized by a
________ primitive invoked by the ______.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 24
Terminology Quiz -- Answers
1. A TAPA task must be attached to a system task
in order to be activated.
2. A TAPA task is identified by what three types of
identifiers (Ids)? Entity, Instance, and Processor.
3. What type of ID identifies a driver task? A
channel instance ID.
4. There are 2 types of memory. Name them. Static
and Dynamic.
5. Messages are allocated from dynamic memory.
6. SAPs and their post structures are initialized by a
configuration request primitive invoked by the
layer manager.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 25
Agenda
• Terms
• System Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 26
System Services Overview
Operating
System
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 27
System Services Overview
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 28
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 29
Task Management and Scheduling
Overview
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 30
TAPA Task Information
• TAPA Task information is contained in the TAPA
Task table.
• The TAPA Task table is indexed via the entity and
instance IDs.
• A write into the TAPA Task table is protected via a
table lock.
• If required, the ‘dep’ structure in the TAPA Task table
is filled in with the underlying OS-specific information.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 31
TAPA Task Information
Index table TAPA task table Table lock
tTskTbl[0]
tTskTbl[1] tTskTblSem
tTskIds[ent][inst]
Table
modification
index
nxtTTskEntry
SS_MAX_TTSKS
TAPA task count
numTTsks
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 32
TAPA Task Information
TAPA task entry
SS_MAX_TTSKS
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 33
System Task Information
System task table System task entry
sTskTbl[0]
• dep (dependent portion)
sTskTbl[1] • used (entry is occupied)
• termPend (task is being terminated)
• tskId (task ID)
• tskPrior (task priority)
• dQ (demand queue)
• tTsks (table of attached TAPA tasks)
• numTTsks (count of attached TAPA tasks)
• lock (for attached task table access)
• nxt (sTskTbl modification index)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 34
Task Management
• The task management calls are:
– SRegTTsk()
– SDeregTTsk()
– SCreateSTsk()
– SDestroySTsk()
– SAttachTTsk()
– SDetachTTsk()
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 35
Task Management
System Task
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 36
Tasking Functions--Coupling
• Tight coupling with tasking functions:
– Any two TAPA tasks that are tightly coupled need
to attach to the same system task.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 37
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 38
Memory Management
Overview
• Memory Information
• Memory Region Calls
• Mapping Pool ID to Size
• Typical Pool Configuration
• Memory Allocation
• Static Memory Calls
• Functions:
– SGetSMem
– SGetSBuf
– SPutSBuf
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 39
Memory information
Region table
regionTbl[0]
Region entry
regionTbl[1]
• dep (dependent portion)
• used (entry is occupied)
• start (start address of memory region)
SS_MAX_REGS • size (size of memory region)
• regCb (region control block)
Region count • flags (memory flags)
• poolTbl (table of pools in the region)
numRegions
• numPools (count of pools)
• alloc (pointer to memory allocation function)
• free (pointer to memory freeing function)
Table lock
• ctl (pointer to memory control function
regionTblSem
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 40
Memory Information
Pool entry
• dep (dependent portion)
• type (dynamic or static)
• u (union)
• dynamic pool entry
• specific pool entry
• dep (dependent portion)
• size (for use in the SAlloc() call)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 41
Memory Region Calls
• Memory related calls include:
– SRegRegion():Registers the specified region
with System Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 42
Pool ID to Size
allocation.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 43
Slide 43
N1 Nitin, 4/13/2004
Typical Pool Configuration
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 44
Memory Allocation
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 45
Static Memory Calls
• SGetSMem()
– Request the ID of a specific pool containing at
least the specified amount of memory.
– Current implementation is empty.
• SPutSMem()
– Release a specific pool ID.
– Current implementation is empty.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 46
Static Memory Calls
• SGetSBuf()
– Allocate a block of memory of the specified size.
– Currently maps directly to SAlloc()
• SPutSBuf()
– Release an allocated block of memory.
– Currently maps directly to SFree()
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 47
SGetSBuf
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 48
SGetSBuf
System Services Layer Manager
CfgReq
(Lower
SAP)
SGetSBuf
(region, pool,
**bufPtr,
size)
Lower
SAP
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 49
SPutSBuf
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 50
SPutSBuf
System Services Layer Manager
Task {ENTXX, INSTXX)
CntrlReq
(Delete
Lower SAP)
SPutSBuf
(region, pool,
*buf, size)
Lower SAP
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 51
SPutSBuf
System Services Layer Manager
Task {ENTXX, INSTXX)
CfgReq
(Delete
Lower SAP)
SPutSBuf
(region, pool,
*buf, size)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 52
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 53
Inter-task Communication
Overview
• Functions:
– SPstTsk:Routes a message from a source task
to a destination task.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 54
•Dequeue message
•Copy contents of post structure
SPstTsk
from message Layer 3
•Identifies destination task from
pst->dstEnt, pst- actvTsk(Pst *pst,
>dstInst Buffer *mBuf)
•Invokes task’s activation •Invoke the primitive pointed to SAP SAP
function by the pst->event field
Primitive message
System Services
Layer 2
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 55
Review
1. TAPA task information is contained in the _____?
2. ______ information provides a mapping of pool ID to
size.
3. _____ reserves _____ memory of the specified size
in the specified region and allots a specific pool ID to
reference this memory.
4. _____ routes a message from a ____ task to a ____
task.
5. _____ allocates memory from a specified region.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 56
Review -- Answers
1. TAPA task information is contained in the TAPA task
table.
2. Pool configuration information provides a mapping
of pool ID to size.
3. SGetSMem reserves static memory of the specified
size in the specified region and allots a specific pool
ID to reference this memory.
4. SPstTsk routes a message from a source task to a
destination task.
5. SAlloc() allocates memory from a specified
region.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 57
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 58
Message Management
Overview
• Message Allocation
• Functions:
– SGetMsg
– SGetDBuf
– SAddPstMsg
– SAddDBufPst
– SAddPstMsgMult
– SAddPreMsg
– SAddPreMsgMult
– SPutMsg
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 59
Message Allocation
• Protocol layers use the SGetMsg() call to allocate a
message.
• System Services calls SAlloc() to retrieve a
message block, a data block, and a data buffer large
enough to contain an SsMsgInfo structure.
• This initial message buffer holds control information
about the message.
• The pool ID passed to SGetMsg() is translated into
a size using the information in the region table.
• This size is the size of the data buffer to be allocated
for following message buffers that hold layer data.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 60
SGetMsg
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 61
SGetMsg •Data indication received in message
SGetMsg
(region, pool,
**mBufPtr) •Fill message with Data Response
Message
•Send message
(Data Confirm)
Layer 3
Message
(Data Indication)
Layer 2
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 62
SGetMsg
SGetMsg(Region region, Pool
*mBufPtr pool, Buffer **mBufPtr)
mblk_t dblk_t
b_next db_frtnp
b_prev db_base
b_cont db_lim
b_rptr db_ref
b_wptr db_type
MSGINFO
b_datap
Reference
count = 1
System
Type
Services SS_M_DATA
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 63
SGetDBuf
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 64
SGetDBuf
SGetDBuf(Region region, Pool
*BufPtr pool, Buffer **BufPtr)
mblk_t dblk_t
b_next db_frtnp
b_prev db_base
b_cont db_lim
b_rptr db_ref
b_wptr db_type
Data Buffer
b_datap
System Reference
count = 1 Type
Services SS_M_DATA
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 65
SAddPreMsg
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 66
SAddPreMsg
SAddPreMsg(Data data, Buffer,
*mBuf)
dblk_t
mblk_t SsMsgInfo
(M_PROTO)
dblk_t
mblk_t data buffer
(M_DATA)
1 2 3 4 5 6 7
System
Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 67
SAddDBufPst
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 68
SAddPreMsgMult
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 69
SAddPstMsg
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 70
SAddPstMsg
SAddPstMsg(Data data, Buffer,
*mBuf)
dblk_t
mblk_t SsMsgInfo
(M_PROTO)
dblk_t
mblk_t data buffer
(M_DATA)
1 2 3 4 5 6 7
Each byte of data added to the end of the message comes after each
invocation of SAddPreMsg.
System
Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 71
SAddPstMsgMult
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 72
SPutMsg
• Deallocates a message.
• Data buffers attached to the message are returned to
the dynamic memory pool from where they were
allocated.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 73
Review
• Identify the following functions:
– SGetMsg
– SGetDBuf
– SAddPreMsg
– SAddPreMsgMult
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 74
Review
• Identify the following functions:
– SGetMsg: Used by protocol layers to allocate a
message from a specified region and pool
– SGetDBuf: Allocates a dynamic buffer from a
specified region and pool
– SAddPreMsg: Adds one byte of data to the front of
a message
– SAddPreMsgMult: Copies the specified number
of bytes to the start of a message
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 75
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 76
Timing
Overview
• Timer Information
• Timer Management
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 77
Timer Information
Timer table Timer entry
tnrTbl[0]
• dep (dependent portion)
tmrTbl[1] • used (entry is occupied)
• tmrId (timer ID)
• ownerEnt (owner TAPA task entity ID)
• ownerInst (owner TAPA task instance ID)
• interval (period of timer)
• tmrActvFn (timer activation function)
• mBuf (timer message buffer)
• nxt (tmrTbl modification index)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 78
Timer Management
• Timer management calls include:
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 79
Timer Management
D
e
Layer ‘x’
m
a
n Layer ‘y’
d SRegTmr()
Layer ‘z’ System Services
q
u Attached TAPA tasks
e tmrActvFn()
u
e System task ‘A’
ssDmndQPutLast()
‘A’
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 80
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 81
Driver Task Management
Overview
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 82
Driver Task Information
Driver task table
Driver task entry
drvrTskTbl[0]
drvrTskTbl[1]
• dep (dependent portion)
• used (entry is occupied)
• channel (channel ID)
• actvTsk (message activation function)
• isTsk (interrupt service activation function)
• low (low processor ID)
• high (high processor ID)
SS_MAX_DRVRTSKS • lock (to serialize calls to activation functions)
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 83
Driver Task Management
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 84
SRegDrvrTsk
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 85
SRegDrvrTsk
• When the driver activation function routine routes
messages to tasks outside the context of System
Services:
– System Services receives a message posted by a
task (SPstTsk).
– System Services identifies the message as
destined to a task outside the context of System
Services (through the foreign processor ID value
in the pst->dstProcId field).
– System Services packs the channel instance
associated with the foreign processor ID into the
message.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 86
SRegDrvrTsk
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 87
SRegDrvrTsk
• When the driver interrupt service routine receives
messages from tasks outside the context of System
Services:
– The driver interrupt service routine is invoked by
System Services.
– The driver interrupt service routine is invoked either
periodically or in a deferred processing mode
(SSetIntPend).
– If driver interrupt service routine is invoked
periodically it checks for the receipt of a message.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 88
SRegDrvrTsk
• When the driver interrupt service routine receives
messages from tasks outside the context of System
Services (continued):
– If the message format is not the same as the System
Service message format, then the received message
is copied into a System Service message.
– If required, a post structure is constructed
– Message is posted (SPstTsk).
– System Services is responsible for the delivery of the
message.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 89
Driver Task Usage
Lower SAPs
Layer N+1 pst->dstProcId = y; Relay
Processor ID range (driver task)
Relay low <= x <= high
(driver task) Layer N
Processor ID range
low <= y <= high Upper SAPs
pst->dstProcId = x;
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 90
Driver Task Usage
isTsk()
SPstTsk() SSetIntPend()
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 91
SSI Functionality
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 92
Other Miscellaneous Calls
Overview
• Queue Information
• Queue Management
• A Few Esoteric System Services:
– SHoldInt
– SRelInt
– SEnbInt
– SDisInt
– SPutVect
– SGetVect
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 93
Queue Information
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 94
Queue Management
The following functions are queue management calls:
– SInitQueue()
– SQueueFirst(), SQueueLast()
– SDequeueFirst(), SDequeueLast()
– SFlushQueue()
– SCatQueue()
– SFndLenQueue()
– SExamQueue()
– SAddQueue()
– SRemQueue()
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 95
A Few Esoteric System Services
• SHoldInt
• SRelInt
• SEnbInt
• SDisInt
• SPutVect
• SGetVect
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 96
Esoteric System Services, Continued
• SDisInt() and SEnbInt()
– Parameters: none.
– Disable all interrupts and enable all interrupts.
– All code between calls to these should be non-interruptible.
– Used only in a few products and can be empty on high level
operating systems like UNIX.
• SHoldInt() and SRelInt()
– Parameters: none.
– Set the IRQ level to mask out the timer interrupt but permit
other interrupts at higher IRQ level through, and reverse.
– Used only in a few products and can be empty on high level
operating systems like UNIX.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 97
Esoteric System Services, Continued
• SPutVect() and SGetVect()
– Parameters: vector number and vector function
handler.
– Insert the vector function handler at the specified
vector offset.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 98
Review
1. _______ registers a timer with System Services.
2. Driver task management calls include ___ and ___.
3. The driver interrupt service routine is invoked when
messages are received from ____ the context of
System Services.
4. To enable and disable interrupts, what functions are
used?
5. True or False: Queue operations use memory
resources.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 99
Review
1. SRegTmr() registers a timer with System Services.
2. Driver task management calls include
SRegDrvrTsk() and SSetIntPend().
3. The driver interrupt service routine is invoked when
messages are received from outside the context of
System Services.
4. To enable and disable interrupts, what functions are
used? SEnbInt() and SDisInt().
5. True or False: Queue operations use memory
resources. False. These operations use no memory
resources.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 100
Agenda
• Terms
• System Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 101
Flavors of System Services
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 102
Flavors of System Services
OS
Core System Services independent
portion
Operating System
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 103
Core System Services
• Core System Services includes:
– All platform independent system services functions.
– Data structure definitions that are used globally across all
implementations.
– A generic mechanism for implementations to include
platform-dependent data into the core data structures.
– Wrapper functions for a number of platform-specific system
services functions to perform tasks such as table lookups,
free entry location, locking, and so on.
– A clearly defined interface to the platform dependent portion
of the implementation (the SSD interface).
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 104
SSI-Specific to VxWorks
VxWorks SSI
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 105
SSI-Specific to VxWorks
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 106
SSI-Specific to VxWorks
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 107
SSI-Specific to Solaris Threads
MTSS SSI
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 108
SSI-Specific to Solaris Threads
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 109
SSI-Specific to Solaris Threads
• Provides priority-based scheduling of tasks and
message delivery.
• Separates memory management from the core
system services, thereby permitting the use of
different, specialized memory managers, if required.
• Utilizes POSIX calls exclusively, thereby making it
simpler to port to other POSIX- compliant systems.
• Uses the STREAMS message buffer format
internally.
• Permits errors to be logged to a console, if available.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 110
SSI-Specific to Windows NT
Windows NT SSI
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 111
SSI-Specific to Windows NT
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 112
SSI-Specific to Windows NT
• Provides low overhead priority based scheduling
using a demand queue design that allows an
arbitrary arrangement of communications channels
between any pair of processors.
• Provides low overhead timing design that can
provide timing ticks over a wide range of values.
• Provides a mechanism for creating user threads,
system tasks, TAPA tasks and has a flexible
mapping mechanism between system tasks and
TAPA tasks.
• Provides a way to use a native memory manager or
any other custom memory manager to manage
memory region(s).
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 113
SSI-Specific to pSOS
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 114
SSI-Specific to pSOS
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 115
SSI-Specific to pSOS
• Operates in either single thread mode or multi-
thread mode. In the single thread mode, a single
System Task handles all the TAPA Tasks. In multi-
thread mode, multiple System Tasks can be used
to handle the TAPA tasks.
• Uses the common memory manager supplied by
Trillium as part of pSOS/pRISM+ System Services.
• Uses the STREAMS message buffer format.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 116
SSI – SDK
• The System Services Interface – Software
Development Kit (SSI – SDK) provides a quick,
efficient, and flexible way to implement the system
services interface on any platform, and thereby to
run any of Trillium’s protocol layers.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 117
Trillium’s OS Partners
The following companies and their corresponding RTOS
(Real Time Operating System) are certified by
Trillium Digital Systems as being “Trillium
Compliant”:
• ENEA OSE
• LynuxWorks LynxOS
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 118
Summary
In this presentation, you have reviewed:
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 119
SSI Review Questions
1. The System Services Interface can be defined as:
a) A generic interface that replaces the underlying
operating system with a Trillium-specific OS
b) A generic interface that isolates Trillium’s portable
layer from the underlying operating system
c) A means of establishing multiple product
relationships
d) All of the above
e) None of the above
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 120
SSI Review Questions
2. A TAPA Task is identified by:
a) Only an entity ID
b) An entity ID and an instance ID
c) An entity ID, an instance ID, a channel ID, and a
processor ID
d) An instance ID and a processor ID
e) An entity ID, an instance ID, and a processor ID
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 121
SSI Review Questions
3. True or False:
A permanent task can only be activated when there
is a message for it.
4. True or False:
TAPA tasks must be attached to a system task in
order to be activated.
5. Identify the following:
SRegTTsk
SGetSMem
SPstTsk
SAddPreMsg
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 122
SSI Review -- Answers
1. B
2. E
3. False
4. True
5. SRegTTsk registers a task’s initialization function
and activation function with system services.
SGetSMem reserves static memory of a specified
size in a specified region and allots a specific pool
ID to reference this memory. SPstTsk is the
message passing function. SAddPreMsg adds a
byte of data at the head of a message.
1079003 1.1 © 2000 Trillium Digital Systems, Inc. All rights reserved.
Confidential and Proprietary 123