1 / 12

Lab8 REAL TIME OS-2_Experiment

This lab explores the concepts of inter-process communication and context switching in a real-time operating system environment. It includes exercises and discussions on implementing ID checking engines and front-end interfaces.

israelj
Download Presentation

Lab8 REAL TIME OS-2_Experiment

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. Lab8 REAL TIME OS-2_Experiment Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department of Computer Science National Tsing Hua University

  2. Outline • Lab – µC/OS-II • Context switch example • Using Inter-Process Communication (IPC) • Exercise & Discussion

  3. Context switch • Open project “eg2” in ./Lab08/Code/SW/eg2/ with CodeWorrior • Repeat step 2 ~ 7 at Lab08-1 Building Program with μC/OS-II • Build and Run, you can see programs running on μC/OS-II in AXD console window

  4. Using Inter-Process Communication (IPC)(1/5) This program does the very same thing as eg1 does. However, eg3 use one task for input and another task for output. Data is passed between tasks using Mailbox. • Open project “eg3” in ./Lab8/Code/SW/eg3/ with CodeWorrior • Repeat step 2 ~ 7 at Lab08-1 Building Program with μC/OS-II • Because multiple value are to be passed, declare a structure to hold the values  • We will trace uC/OS-II IPC machenism, so link Debug target of uC/OS-II

  5. Using Inter-Process Communication (IPC) (2/5) • Build project and start AXD for Debug  • Set a break point near line 75 in Task1, where Task1 posts mail to the mailbox. • Use “Step In (F8)” to trace into the OSMboxPost(). The cursur should jump to OSMboxPost() function in “os_mbox.c”.  • Next, use “Step (F10)” to trace how message is delivered from Task1 to Task2.  • When you reach “OSSched()” function, use “Step in” again to trace into the scheduler.

  6. Using Inter-Process Communication (IPC) (3/5)

  7. Using Inter-Process Communication (IPC) (4/5) • When you reach “OS_TASK_SW()” function, use “Step in” again. • Finally, you reach Task2 near line 88. where Task2 pending on the mailbox.

  8. Using Inter-Process Communication (IPC) (5/5)

  9. Outline • Lab – µC/OS-II • Context switch example • Using Inter-Process Communication (IPC) • Exercise & Discussion

  10. Exercise (1/2) Write an ID checking engine and a front–end interface. The checking rule is in the reference section. Requirements:The engine and front-end must be implemented in different task. The front-end interface can accept up to 64 entries of ID in each round. The program runs continuously round by round. User input: The amount of ID to be checked. The ID numbers Program output: The ID number Check result

  11. Exercise (2/2) Example:  (start of round) How many IDs to check: 2 Enter ID #1: A123456789 Enter ID #2: B987654321  === check result === A123456789 valid B987654321 invalid (end of round)

  12. Discussion • Explain and describe executing process of eg2 • Write down your suggestions about this lab

More Related