MINIX4RT: a Real-Time Operating System Based on MINIX

MINIX4RT: a Real-Time Operating System Based on MINIX

MINIX4RT: A Real-Time Operating System Based on MINIX Pablo Andrés Pessolani ABSTRACT Tanenbaum’s MINIX Operating System was extended with a Real-Time microkernel and services to conform MINIX4RT, a Real-Time Operating System for academic uses that includes more flexible Interprocess Communications facilities supporting basic priority inheritance protocol, a fixed priority scheduler, timer and event driven interrupt management, statistics and Real-Time metrics gathering keeping backward compatibility with standard MINIX versions. Keywords : Operating Systems, Minix, Interrupt Handling, Real-Time. Presented to the Universidad Nacional de La Plata of the Requirements for the Degree of Master on Computer Networks . February 2006 Thesis Director: Ph.D. Silvio Gonnet Thesis Co-Director: Eng. Armando De Giusti This thesis is dedicated to my lovely daughters Flor and Vicky, to the "love of my life" Ana, and to my "iron willpower" parents Merce and Pety. Acknowledgments I would like to express my sicere gratitude to Dr. Silvio Gonnet for his suggestions, dedication and vast patience as thesis director. I would like to thanks Nicolás Cesar and Felipe Ieder for their contributions with the system latency and timeliness tests and German Maglione for supplying the IBM Thinkpad 370 notebook used in the implementation and tests of MINIX4RT. I acknowledge help received from Telecom Argentina S.A. for sponsoring my UNLP Master career, the Department of Information Systems of UTN-FRSF for sponsoring the presentation of articles about MINIX4RT in the Argentine Symposium of Technology 2004/5 and the Postgraduate Office of UNLP for its attention and patience. This acknowledgment would be incomplete if I forgot to mention my whole family for their love, support, and encouragement throughout this course of study. PREFACE MINIX4RT is the result of fifteen years dedicated to study, to research and to teach about Operating Systems. It is a new open-source Real-Time Operating System intended as teaching tool, but it can be usable as a serious system on resource-limited computers. MINIX4RT is a Real-Time branch of the popular MINIX used in grade level Operating Systems courses. This work discuss the modifications that have been made to MINIX that give it the ability to support the stringent timing requirements of Real-Time applications, while still giving Non Real-Time ones access to the full range of MINIX services without any changes. MINIX4RT does not stops with this thesis. It is the authors intention to conform a team of developers around the world of people interesting in cooperate with the growth and enhancement of MINIX4RT. CONTENTS 1. INTRODUCTION...........................................................................................................12 1.1. CONTRIBUTIONS .............................................................................................................13 1.2. MOTIVATION ..................................................................................................................14 1.3. OTHER RTOS U SED IN EDUCATION ..............................................................................15 1.4. MINIX T IME SHARING FEATURES .................................................................................16 1.5. RT-MINIX F EATURES ...................................................................................................17 1.6. MINIX4RT F EATURES ..................................................................................................18 1.7. ORGANIZATION ..............................................................................................................22 1.8. TERMINOLOGY AND NOTATION .....................................................................................22 2. ARCHITECTURE AND INTERRUPT HANDLING.................................................24 2.1. MINIX S YSTEM ARCHITECTURE AND INTERRUPT PROCESSING ...................................24 2.2. MINIX4RT S YSTEM ARCHITECTURE ............................................................................26 2.3. INTERRUPT HANDLING ...................................................................................................28 2.3.1. Interrupt Handling Virtualization...........................................................................29 2.3.2. Hardware Interrupts Emulation .............................................................................30 2.3.3. User and Kernel Stacks ..........................................................................................31 2.3.4. Interrupt Handler Types .........................................................................................32 2.3.5. Interrupt Service Routines ......................................................................................33 2.3.6. Interrupt Descriptor Data Structure.......................................................................33 2.3.7. Interrupt Handler Dispatching...............................................................................35 2.3.8. Interrupt Handler's Priority ...................................................................................38 2.3.9. Real-Time Input/Output Tasks................................................................................40 2.3.10. Software Interrupts...............................................................................................40 2.3.11. Returning from System Calls and Interrupts Service Routines.............................41 2.3.12. Flushing Deferred Interrupts................................................................................42 2.3.13. Executing Interrupt Handlers...............................................................................44 2.3.14. Interrupt Descriptor Timestamp Field..................................................................46 2.3.15. Kernel Functions for Interrupt Handling and Synchronization ...........................46 2.3.16. Estimating Interrupt Handler Processing Time....................................................48 2.3.17. Nested Interrupts ..................................................................................................50 2.3.18. Real-Time Interrupt Processing ...........................................................................51 2.3.19. Standard MINIX Non Real-Time interrupts..........................................................52 2.3.20. Real-Time Timer-Driven Interrupts......................................................................52 2.3.21. Real-Time Event-Driven Interrupts ......................................................................54 2.4. PREVENTING INTERRUPT PRIORITY INVERSION .............................................................54 2.5. RT-PROCESS DISPATCH LATENCY .................................................................................55 3. RT-PROCESS MANAGEMENT AND SCHEDULING.............................................57 3.1. MINIX4RT E XECUTION MODES ...................................................................................58 3.2. REAL -TIME PROCESS CREATION ...................................................................................58 3.3. RT-PROCESS STATES AND TRANSITIONS .......................................................................60 3.4. PROCESS DESCRIPTOR REAL -TIME FIELDS ....................................................................62 3.5. THE RT-PROCESS SCHEDULER ......................................................................................64 3.6. PROCESS PRIORITY .........................................................................................................65 3.6.1. NRT-Process Priorities...........................................................................................66 3.6.2. RT-Process Priorities .............................................................................................66 3.7. RT-READY QUEUES MANAGEMENT ..............................................................................67 3.8. RT-PROCESS TERMINATION ...........................................................................................70 3.8.1. RT-process Termination Using the exit() System Call............................................70 3.8.2. RT-process Termination Using the signal() System Call........................................71 3.8.3. Releasing RT-process Resourses and Housecleaning ............................................71 4. TIME MANAGEMENT.................................................................................................72 4.1. TIMING MECHANISMS ....................................................................................................72 4.2. MINIX4RT T IMER INTERRUPTS ....................................................................................73 4.3. MINIX V IRTUAL TIMER INTERRUPTS ...........................................................................75 4.4. TIMER RESOLUTION .......................................................................................................76 4.5. 8253/4 P ROGRAMMABLE INTERVAL TIMER PROGRAMMING .........................................78 4.6. ESTIMATING THE TIMER INTERRUPT LATENCY .............................................................80 4.7. REAL -TIME AND NON REAL -TIME TIMER HANDLERS ...................................................81 4.8. VIRTUAL TIMERS ...........................................................................................................81 4.8.1. Virtual Timers Handling Functions........................................................................82

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    248 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us