EMBSYS105 Assignment 2 – ContextSwitch Solved

30.00 $ 15.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . zip solution files instantly, after Payment

Description

Rate this product

The goal of this assignment is to gain understanding of context switching by writing context switch code in assembly language.

  1. Download and unzip the ContextSwitch project contained in the zip file: ContextSwitch.zip
  2. Open the ContextSwitch.eww workspace in the EWARM IDE.
  3. Make sure the ContextSwitch project builds.
  4. Launch TeraTerm (38400 Baud rate)
  5. Build and upload the project and start it running.
  6. Break into the program to stop the output stream on the UART.
  7. Notice it is printing an endless stream of messages from task one like this:

University of Washington – Context Switch Application task one: 0 task one: 1 task one: 2 task one: 3

  1. Implement the context switch code specified by the comments in switch.s.
  2. When completed correctly you should see output in the UART from both task one and task two as the context switches at every clock tick.

10.Clean your completed project and zip it into a file named

ContextSwitch_<YourUwNetId>.zip

  1. Clean means delete the “Debug” folder before zipping so you don’t bloat your submission.
  2. Example submission filename: uDebugger_johndoe.zip 11.Submit your zip file by the due date.

Optional Additional challenge!

Those looking for an additional challenge may want to implement testAndSet(). Implement it in assembly language using LDREX and STREX. Call it in the C code of each task to protect access to the UART so each task can print an entire line without interference. You may want to remove the print statement in the scheduler routine.

  • module02-euqmob.zip