Micro COSII Osamah A Rawashdeh Darren Brown UK
Micro. C/OS-II Osamah A. Rawashdeh Darren Brown UK IDEA Lab Feb. 2005
Outline • • • Why use an RTOS? What is Micro. C/OS-II? Micro. C/OS-II Architecture Micro. C/OS-II Services Ideanix Example Application 2
Why use an RTOS? • “Divide and Conquer” Applications. • RTOS ensures time critical events are processed as efficiently as possible (timing correctness). • Multitasking. • Dynamically create/delete tasks. • Simple Application expansion/modification. • Allows for Platform independence. Foreground/Background Application (no OS) 3
What is Micro. C/OS-II ? • Micro. C/OS-II is a portable, ROMable, scalable, preemptive, real-time, multi-tasking, priority-based OS. • Open source ANSI C and free for academic use. • Was ported to 40+ architectures (8 to 64 bit) since 1992. • Meets RTCA DO-178 B standard. • Uses 4% CPU and 3 KB - 30 KB 4
Micro. C/OS-II Architecture Application Software Micro. C/OS-II (processor independent code) Micro. C/OS-II Configuration (application specific) Micro. C/OS-II Port (processor-specific code) Software Hardware CPU Timer 5
Micro. C/OS-II Services • Task Management – create, delete, suspend, resume task, change priority – Max 56 Tasks – Stack Checking Utility • Time Management – delay, resume, set_time, get_time – OSClock. Tick, 10 – 100 Hz, increments a 32 bit counter • Binary and Counting Semaphores – For Event signaling, control access to shared resource, and synchronization – accept, create, del, pend, post, query • Mutual Exclusion Semaphores – For controlling access to a shared resource (with priority inheritance) – accept, create, del, pend, post, query 6
Micro. C/OS-II Services (cont. ) • Event Flags – For sync with multiple events – accept, create, del, pend, post, query • Message Mailboxes – For passing of pointers – Create, pend, post_opt, accept, query • Message Queues – For queuing pointer size messages – create, del, pend, post_front, post_opt, accept, flush, query • Memory Management – Alternative to malloc() and free() – Partitions memory into blocks of equal sizes – create, get, put, query 7
Ideanix • IDEANIX is a unique build of the embedded operating system micro. C OS II • It is currently configured with the standard x-bar configuration for the T. I. M. • It has both UARTs enabled (ISRs) and being configured to a #define’d baudrate • It also configures TIMER 0 as the OS clock source and is set to allow the OS to “tick” every 10 ms. (100 ticks per second) 8
Example Application • The Fighting Bobs with a Mediator • Example utilizes queues to do communication between tasks and semaphores to not only protect a resource but to also trigger an event. 9
Questions? 10
- Slides: 10