microc os ii n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
MicroC/OS-II PowerPoint Presentation
Download Presentation
MicroC/OS-II

Loading in 2 Seconds...

play fullscreen
1 / 11

MicroC/OS-II - PowerPoint PPT Presentation


  • 174 Views
  • Uploaded on

MicroC/OS-II. Embedded Systems Design and Implementation. MicroC/OS-2. Real-time kernel 5,500 lines of code portable (written in ANSI C) ROMable Scalable (services selectable) Preemptive Multitasking Interrupt management Rich services. Accessing critical section.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'MicroC/OS-II' - yitta


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
microc os ii

MicroC/OS-II

Embedded Systems Design and Implementation

microc os 2
MicroC/OS-2
  • Real-time kernel
    • 5,500 lines of code
    • portable (written in ANSI C)
    • ROMable
    • Scalable (services selectable)
    • Preemptive
    • Multitasking
    • Interrupt management
    • Rich services
accessing critical section
Accessing critical section
  • OS_ENTER_CRITICAL -- disabling interrupt
  • OS_EXIT_CRITICAL -- enabling interrupt
issues with disabling interrupt
Issues with disabling interrupt
  • If you call the processor supported instruction directly
    • you may get inconsistency
  • Use PSW (processor status word)
    • can be done on the stack or local variable
tasks
Tasks
  • A task is often written as an infinite loop or as self-terminating
  • MicroC/OS-II supports 64 tasks, two are used by the system (priority 62 and 63)
    • lower number = higher priority
    • each task must have a unique priority; thus task id = task priority
task creation
Task creation
  • can be done prior to multitasking or dynamically
    • what happens of the priority of the created task is higher than its creator?
  • a task can suspend itself or wait for for events to occur
slide7

Task States

task

waiting

task

dormant

task

ready

task

running

ISR

running

task control block
Task control block
  • data structure that is used to maintain the state of a task when it is preempted so that it can resume where it left off
    • maintain information about the runtime stack (current top of stack, bottom of stack, stack size)
    • CPU content is saved on the stack
task scheduling
Task scheduling
  • execute the highest priority task ready to run
    • task scheduling is done in constant time
    • context switch is done through software trap
      • save CPU content of preempted task
      • restore CPU content of the next running task
locking scheduler
Locking scheduler
  • allows a task to keep control of the CPU
    • interrupts still being serviced if enabled
    • locking function can be nested 255 levels deep
idle and statistics tasks
Idle and statistics tasks
  • idle task -- lowest priority task
    • increment counters to support statistics task
  • statistics task -- lowest-prio - 1
    • compute the percentage of CPU usage