Lynx OS RTOS RealTime Operating System Stephen J
- Slides: 14
Lynx. OS RTOS (Real-Time Operating System) Stephen J. Franz CS-550 Section 1 Fall 2005 Stephen J Franz - CS 550 - Fall 2005
Lynux. Works • Founded in 1986. • Private – Not publicly traded. • 75 Employees. • Offers two RTOS products – Lynx. OS – developed in 1988 – Lynx. OS-178 – built on Lynx. OS foundation • Lynx. OS is the focus of this discussion Stephen J Franz - CS 550 - Fall 2005 2
RTOS One of the most critical aspects of Real Time Operating Systems: …the need to process events in a timely and predictable fashion. Discussion will focus on Lynx. OS Scheduling Stephen J Franz - CS 550 - Fall 2005 3
Lynx. OS Scheduling Lynx. OS Thread scheduling is: • Preemptive • Reentrant (kernel threads can be called multiple times) and • Supports the following scheduling policies – FIFO (First In First Out) – Round Robin – Priority Based Quantum – Lynux. Works proprietary – variation of round robin but quantum values can differ for each priority Stephen J Franz - CS 550 - Fall 2005 4
Interrupt Handling Example Hardware Interrupts Software Threads High Priority Low Stephen J Franz - CS 550 - Fall 2005 5
Priority Inversion Hardware Interrupts Software Processes High Interrupt Priority Low Interrupt received for low priority process draws resources from high priority thread Stephen J Franz - CS 550 - Fall 2005 6
Hardware vs. Software Priorities High Priority H/W Interrupt Low Priority H/W Interrupt Priority High Priority S/W Thread Low Priority S/W Thread Stephen J Franz - CS 550 - Fall 2005 7
Kernel vs. User Thread Priorities Traditional Approach Kernel Thread User Thread Priority User Thread Kernel Threads traditionally run at higher priorities than User Threads Stephen J Franz - CS 550 - Fall 2005 8
Kernel vs. User Thread Priorities Lynx. OS Approach User Thread Kernel Thread Priority User Thread Kernel and User threads both share same pool of priorities Stephen J Franz - CS 550 - Fall 2005 9
Kernel Threads w/ Priority Tracking Hardware Software Processes High (*) Low Priority Low (*) When data is available, driver creates and prioritizes kernel thread. Stephen J Franz - CS 550 - Fall 2005 10
Priority Tracking Example The priority of the Kernel Thread tracks or follows the priority of the User Thread being serviced. • Kernel Threads initially start as low priority. • As User Thread opens a device, Kernel Thread is created and promoted to the priority of the User Thread… (as long as the User Thread is higher priority than the Kernel Thread) • As the User Threads completes, the Kernel Thread is demoted to priority of next calling User Thread. Stephen J Franz - CS 550 - Fall 2005 11
Priority Tracking Example Kernel Thread Priority Kernel Thread initial creation User thread 1 (priority 10) opens device - kernel thread promotion User thread 2 (priority 60) opens device – kernel thread promotion User thread 3 (priority 30) opens device – kernel thread remains unchanged User thread 2 completes – kernel thread demotion User thread 3 completes – kernel thread demotion User thread 1 completed – kernel thread demotion Stephen J Franz - CS 550 - Fall 2005 0 10 60 60 30 10 0 12
Putting it Together • Lynx. OS schedules User and Kernel Threads from the same pool of Priorities. • Lynx. OS device drivers create Kernel Threads rather than processing device via interrupts in order to: – Minimize work that would drain resources from high priority tasks • Lynx. OS kernel threads utilize priority tracking in order to: – Allow for device processing (Kernel Thread) based on appropriate priority – Properly pair device processing (Kernel Threads) with the User Thread to be serviced. Stephen J Franz - CS 550 - Fall 2005 13
Conclusion Lynux. Works’ success is demonstrated in multiple ways: – Financially – $16. 8 million from 75 employees! – Technically – Developed and implemented techniques (priority tracking and kernel threads) to overcome scheduling anomalies (priority inversions). – Competitively - Impressive list of customers across multiple industries. Lynx. OS has been on the market for more than 16 years. Stephen J Franz - CS 550 - Fall 2005 14