E.1Mini-Driver Interface Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
9f752a73f46527d3240ce0a5
List of Figures
3-1Thread Priorities. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 3-2Preemption Scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 3-3Using Swi_inc() to Post a Swi. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 3-4Using Swi_andn() to Post a Swi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 3-5Using Swi_dec() to Post a Swi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 3-6Using Swi_or() to Post a Swi.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 3-7Execution Mode Variations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 4-1Trace Window Results from Example 4-4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 B–1 Hardware Interrupt to Blocked Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 B–2 Hardware Interrupt to Software Interrupt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217 B–3 Post of Software Interrupt Again . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 B–4 Post Software Interrupt without Context Switch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 B–5 Post Software Interrupt with Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 218 B–6 Create a New Task without Context Switch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 B–7 Create a New Task with Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 B–8 Set a Task's Priority without a Context Switch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 B–9 Lower the Current Task's Priority, Context Switch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 B–10 Raise a Ready Task's Priority, Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 B–11 Task Yield . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220 B–12 Post Semaphore, No Waiting Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 B–13 Post Semaphore, No Context Switch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 B–14 Post Semaphore with Task Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 B–15 Pend on Semaphore, No Context Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221 B–16 Pend on Semaphore with Task Switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
SPRUEX3K—December 20117 Submit Documentation Feedback
9f752a73f46527d3240ce0a5
List of Tables
1–1XDCtools Modules Using in C Code and Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1–2Packages and Modules Provided by SYS/BIOS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 3-1Comparison of Thread Characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 3-2Thread Preemption. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3–3Hook Functions by Thread Type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 3–4System Stack Use for Hwi Nesting by Target Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 3–5System Stack Use for Swi Nesting by Target Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 3-6Swi Object Function Differences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 3–7Task Stack Use by Target Family . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 5–1Timeline for One-shot and Continuous Clocks. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 6–1Heap Implementation Comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149 7–1Proxy to Delegate Mappings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170 C–1Comparison of Benchmark Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
8 SPRUEX3K—December 2011
Submit Documentation Feedback
SPRUEX3K—December 2011
Read This First 9Submit Documentation Feedback Preface
SPRUEX3K—December 2011
Read This First
About This Manual
This manual describes the TI SYS/BIOS Real-time Operating System, which is also called "SYS/BIOS". The latest version number as of the publication of this manual is SYS/BIOS 6.33.01. Versions of
SYS/BIOS prior to 6.30 were called DSP/BIOS. The new name reflects that this operating system can also be use on processors other than DSPs.
SYS/BIOS gives developers of mainstream applications on Texas Instruments devices the ability to develop embedded real-time software. SYS/BIOS provides a small firmware real-time library and easy-to-use tools for real-time tracing and analysis.
Notational Conventions
This document uses the following conventions:
?Program listings, program examples, and interactive displays are shown in a special typeface.
Examples use a bold version of the special typeface for emphasis.
Here is a sample program listing:
?Square brackets ( [ and ] ) identify an optional parameter. If you use an optional parameter, you
specify the information within the brackets. Unless the square brackets are in a bold typeface, do not enter the brackets themselves.
Related Documentation From Texas Instruments
See the detailed list and links in Section 1.6.
Related Documentation
You can use the following books to supplement this reference guide:
The C Programming Language (second edition), by Brian W. Kernighan and Dennis M. Ritchie, published by Prentice-Hall, Englewood Cliffs, New Jersey, 1988
Programming in C , Kochan, Steve G., Hayden Book Company
Programming Embedded Systems in C and C++, by Michael Barr, Andy Oram (Editor), published by O'Reilly & Associates; ISBN: 1565923545, February 1999
Real-Time Systems , by Jane W. S. Liu, published by Prentice Hall; ISBN: 013099651, June 2000 #include
int main(){
System_printf("Hello World!\n");
return (0);
}
10Read This First SPRUEX3K—December 2011Submit Documentation Feedback Trademarks
9f752a73f46527d3240ce0a5
Principles of Concurrent and Distributed Programming (Prentice Hall International Series in
Computer Science), by M. Ben-Ari, published by Prentice Hall; ISBN: 013711821X, May 1990
American National Standard for Information Systems-Programming Language C X3.159-1989, American National Standards Institute (ANSI standard for C); (out of print)
Trademarks
The Texas Instruments logo and Texas Instruments are registered trademarks of Texas Instruments. Trademarks of Texas Instruments include: TI, Code Composer, Code Composer Studio, DSP/BIOS, SPOX, TMS320, TMS320C54x, TMS320C55x, TMS320C62x, TMS320C64x, TMS320C67x,
TMS320C28x, TMS320C5000, TMS320C6000 and TMS320C2000.
Windows is a registered trademark of Microsoft Corporation.
Linux is a registered trademark of Linus Torvalds.
All other brand or product names are trademarks or registered trademarks of their respective companies or organizations.
December 22, 2011
SPRUEX3K—December 2011
About SYS/BIOS 11Submit Documentation Feedback Chapter 1
SPRUEX3K—December 2011
About SYS/BIOS
This chapter provides an overview of SYS/BIOS and describes its relationship to XDCtools. 1.1What is SYS/BIOS?. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.2How is SYS/BIOS Different from DSP/BIOS? . . . . . . . . . . . . . . . . . . . 12
1.3How are SYS/BIOS and XDCtools Related? . . . . . . . . . . . . . . . . . . . . 13
1.4SYS/BIOS Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.5Using C++ with SYS/BIOS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.6
For More Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Topic
Page
12About SYS/BIOS SPRUEX3K—December 2011Submit Documentation Feedback What is SYS/BIOS?
9f752a73f46527d3240ce0a5
1.1What is SYS/BIOS?
SYS/BIOS is a scalable real-time kernel. It is designed to be used by applications that require real-time scheduling and synchronization or real-time instrumentation. SYS/BIOS provides preemptive multi-
threading, hardware abstraction, real-time analysis, and configuration tools. SYS/BIOS is designed to minimize memory and CPU requirements on the target. See the video introducing SYS/BIOS for an

