User Tools

Site Tools


lab2

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lab2 [2010/02/24 23:58] natalialab2 [2010/03/19 12:50] (current) natalia
Line 39: Line 39:
 You MUST invoke OSIntEnter() and OSIntExit() in pairs. In other words, for every call to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the end of the ISR. You MUST invoke OSIntEnter() and OSIntExit() in pairs. In other words, for every call to OSIntEnter() at the beginning of the ISR you MUST have a call to OSIntExit() at the end of the ISR.
  
-Please note that rescheduling is prevented when the scheduler is locked (see [[syntax#OS_SchedLock|OS_SchedLock()]])+Please note that rescheduling is prevented when the scheduler is locked (see OSSchedLock)
  
 == OSTaskCreate == == OSTaskCreate ==
Line 186: Line 186:
   * "cnt" is the initial value for the semaphore. If the value is 0, no resource is available (or no event has occurred). You initialize the semaphore to a non-zero value to specify how many resources are available (e.g. if you have 10 resources, you would initialize the semaphore to 10).    * "cnt" is the initial value for the semaphore. If the value is 0, no resource is available (or no event has occurred). You initialize the semaphore to a non-zero value to specify how many resources are available (e.g. if you have 10 resources, you would initialize the semaphore to 10). 
  
-Return will be (void *)0 if no event control blocks were available. Otherwise return is a pointer to the event control block (OS_EVENT) associated with the created semaphore.+Returns: 
 +  * (void *)0 if no event control blocks were available. Otherwise return is a pointer to the event control block (OS_EVENT) associated with the created semaphore.
  
 == OSSemPost == == OSSemPost ==
Line 199: Line 200:
 == OSSemPendAbort == == OSSemPendAbort ==
 OSSemPendAbort function aborts & readies any tasks currently waiting on a semaphore. This function should be used to fault-abort the wait on the semaphore, rather than to normally signal the semaphore via OSSemPost(). OSSemPendAbort function aborts & readies any tasks currently waiting on a semaphore. This function should be used to fault-abort the wait on the semaphore, rather than to normally signal the semaphore via OSSemPost().
 +==== Prelab studies ====
 +Please make sure to read and understand the license agreements listed below:
 +  * {{:legalnotice_os_only.pdf}}
 +  * {{:micrium-sla-cpu.pdf}}
 +  * {{:micrium-sla-p1.pdf}}
 +  * {{:micrium-sla-pl.pdf}}
 +Also read the following study guides and application notes:
 +  * {{:an1004_the_10-minute_guide_to_rtos_.pdf}}
 +  * {{:ucos-ii-refman.pdf}}
 +  * {{:quickrefchart-color.pdf}}
 +  * {{:task-state-diagram.pdf}}
 +  * {{:an1002_mutual_exclusion_semaphores_.pdf}}
 +  * {{:an1005_inter-process_communication_.pdf}}
 +  * {{:an1007a_c_os-ii_and_event_flags_.pdf}}
 +  * {{:ucos-ii-cfgman.pdf}}
 +
 +
 +==== Evaluation ====
 +μC/OS-II source code is divided into platform dependent and platform independent files. Platform independent files can be found in Micrium/Software/uCOS-II/Source/. Platform independent files can be found in Micrium/Software/uCOS-II/Ports/HCS12/Paged/Metrowerks/SerialMonitor/
 +
 +By study the source structure and Micrium/ReadMe/uCOS-II-RefMan.pdf briefly answer the following questions:
 +  - Write a pseudo code using μC/OS-II to create two tasks and protect their critical sections that is accessing a common variable called XYZ.
 +  - In your own words, explain how multitasking is achieved in the μC/OS-II (pay special attention to os_cpu_a.s)?
  
 +==== Resources =====
 +  * {{:serialmonitor.zip}}
lab2.1267055892.txt.gz · Last modified: 2010/02/24 23:58 by natalia