1 / 18

uC/OS The Real-Time Kernel

uC/OS The Real-Time Kernel. By Sam 2001/07/25 MICETEK International Inc. Contents. Part 1: Real_time Kernel Concepts Part 2: Kernel Structure Part 3: Interrupt Processing Part 4: Communication Part 5: Initialization & Configuration Part 6: Function Lists and Examples.

lelandkoch
Download Presentation

uC/OS The Real-Time Kernel

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. uC/OSThe Real-Time Kernel By Sam 2001/07/25 MICETEK International Inc.

  2. Contents • Part 1: Real_time Kernel Concepts • Part 2: Kernel Structure • Part 3: Interrupt Processing • Part 4: Communication • Part 5: Initialization & Configuration • Part 6: Function Lists and Examples

  3. Part 1: Real_time Kernel Concepts 1 • RTOS/Embedded system examples • Process control • Automotive • Office automation • Computer peripherals • Robots • Aerospace • Domestic

  4. Part 1: Real_time Kernel Concepts 2 • Task (Thread) States • Task is a simple program that thinks it has the CPU all to itself. Each task has its priority, its own set of CPU registers and its own stack area. • States: • DORMANT • READY • RUNNING • DELAYED • PENDING • INTERRUPTED

  5. Part 1: Real_time Kernel Concepts 3 • Multiple Tasks

  6. Part 1: Real_time Kernel Concepts 4 • Preemptive Kernel vs. Non-Preemptive Kernel • Preemptive Kernel is used when system responsiveness is important. The highest priority task ready to run is always given control of the CPU. When a task makes a higher task ready to run, the current task is preempted(suspended and the higher priority task is immediately given control of the CPU. If a ISR makes a higher priority task ready, when the ISR completes, the interrupted task is suspended and the new higher priority task is resumed. ) • Non-Preemptive kernel require that each task does something to explicitly give up control of CPU. It is also called cooperative multitasking. The kernel is much simpler to design than preemptive kernels. One of the advantages of a non-preemptive kernel is that the interrupt latency is typically low. Non-reentrant functions can be used by each task without fear of corruption by another task. • Task Priority • Static, Dynamic

  7. Preemptive Kernel vs. Non-Preemptive Kernel

  8. Part 1: Real_time Kernel Concepts 5 • Semaphores • Why to use? • Access to a shared resource • Signal the occurrence of event • Allow two tasks to synchronize • Type • Binary • Counting • Message Mailboxes • Message Queues

  9. Part 1: Real_time Kernel Concepts 6 • Clock Tick: System heart beat • Performance • Context Switching Time • Interrupt Response Time • Determinism

  10. Part 2: Kernel Structure • Critical Sections • Tasks • Task Control Blocks • Task Scheduling • Lock/ Unlock • Changing Priority • Delaying a task

  11. Part 3: Interrupt Processing • Interrupt Service Routine • Interrupt Latency, Response and Recovery • Clock Tick

  12. Part 4: Communication • Events • Semaphores • Message Mailboxes • Message Queues

  13. Semaphores

  14. Semaphores

  15. Semaphores

  16. Mailbox and Queue

  17. Part 5: Init & Config • Init&Config • OS_IDLE_TASK_STK_SIZE • OS_MAX_TASKS • OS_MAX_QS • OSInit(),OSStart()

  18. Part 6: Function Lists and Examples • System Functions Lists • OSInitOSStartOSStartHighRdy • OSTimeDly OSTimeTick OSTickISR • OSIntEnter OSIntExit • OSCtxSwOSIntCtxSw • OSSched OSChangePrio • OSTaskCreateOSTaskDelete • OSLock OSUnlock • OSSemInit OSSemPost OSSemPend • OSMboxInit OSMboxPost OSMboxPend • OSQInit OSQPost OSQPend • OSTCBGetFree OSTCBPutFree • Exapmples • Test 1 Run Test1 • Test 2 Run Test2

More Related