160 likes | 185 Vues
LynxOS RTOS (Real-Time Operating System). Stephen J. Franz CS-550 Section 1 Fall 2005. LynuxWorks. Founded in 1986. Private – Not publicly traded. 75 Employees. Offers two RTOS products LynxOS – developed in 1988 LynxOS-178 – built on LynxOS foundation
E N D
LynxOSRTOS (Real-Time Operating System) Stephen J. Franz CS-550 Section 1 Fall 2005
LynuxWorks • Founded in 1986. • Private – Not publicly traded. • 75 Employees. • Offers two RTOS products • LynxOS – developed in 1988 • LynxOS-178 – built on LynxOS foundation • LynxOS is the focus of this discussion Stephen J Franz - CS550 - Fall 2005
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 LynxOS Scheduling Stephen J Franz - CS550 - Fall 2005
LynxOS Scheduling LynxOS 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 • LynuxWorks proprietary – variation of round robin but quantum values can differ for each priority Stephen J Franz - CS550 - Fall 2005
Interrupt Handling Example Software Threads Hardware Interrupts High High Priority Low Low Stephen J Franz - CS550 - Fall 2005
Priority Inversion Hardware Interrupts Software Processes High High Interrupt Priority Low Low Interrupt received for low priority process draws resources from high priority thread Stephen J Franz - CS550 - Fall 2005
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 - CS550 - Fall 2005
Kernel vs. User Thread PrioritiesTraditional Approach Kernel Thread Kernel Thread User Thread Priority User Thread User Thread Kernel Threads traditionally run at higher priorities than User Threads Stephen J Franz - CS550 - Fall 2005
Kernel vs. User Thread Priorities LynxOS Approach User Thread User Thread Kernel Thread Priority User Thread Kernel Thread Kernel and User threads both share same pool of priorities Stephen J Franz - CS550 - Fall 2005
Kernel Threads w/ Priority Tracking Hardware Software Processes High High (*) Priority Low Low Low (*) When data is available, driver creates and prioritizes kernel thread. Stephen J Franz - CS550 - Fall 2005
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 - CS550 - Fall 2005
Priority Tracking Example Kernel Thread Priority Kernel Thread initial creation 0 User thread1 (priority 10) opens device - kernel thread promotion 10 User thread2 (priority 60) opens device – kernel thread promotion 60 User thread3 (priority 30) opens device – kernel thread remains unchanged 60 User thread2 completes – kernel thread demotion 30 User thread3 completes – kernel thread demotion 10 User thread1 completed – kernel thread demotion 0 Stephen J Franz - CS550 - Fall 2005
Putting it Together • LynxOS schedules User and Kernel Threads from the same pool of Priorities. • LynxOS device drivers create Kernel Threads rather than processing device via interrupts in order to: • Minimize work that would drain resources from high priority tasks • LynxOS 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 - CS550 - Fall 2005
Conclusion LynuxWorks’ 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. LynxOS has been on the market for more than 16 years. Stephen J Franz - CS550 - Fall 2005