Embedded Systems - Assignment 11 Sharing the Processor | CS 404, Assignments of Computer Science

Material Type: Assignment; Class: ST:Sem-Scholarshp/Serv Prog; Subject: Computer Science; University: University of Idaho; Term: Unknown 1989;

Typology: Assignments

Pre 2010

Uploaded on 08/19/2009

koofers-user-f8s
koofers-user-f8s 🇺🇸

5

(1)

9 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Embedded Systems – Assignment 11
Sharing the Processor 1
Introduction
In this project, you will install, operate, and demonstrate an understanding of a basic multitasking kernel.
Task 1
Install and operate the kernel. Your AppMain must install at least two tasks. These can be keyboard and
display tasks or something more interesting. Document the process of installing the kernel. Document the
process of constructing tasks that operate under the kernel.
Task 2
Develop a mechanism to determine the CPU usage by the user’s application program, consisting of several
tasks. Consider putting a counter in the ThumbTwiddlingTask. Every time that task is executed, the
counter increments. The higher the count, the lower the CPU utilization by the user’s tasks Show example
data with your program from Task 1 and at least one more. Give some guidelines to a user of this kernel on
how to know the limits of its capabilities.
Task 3
Demonstrate what happens when you do not allocate enough stack space for one of the tasks. Explain what
happened and when it happened. If you had not known there was not enough stack space, what clues
would you have to find this problem?
As always, documented code, screen captures, and a demonstration of the operation of your software is
required.
Task 4
Write a paragraph (or more) on each of the following
1. Describe an approach to determining the rate of calling the TaskSwitchISR. This is the rate at which
the counter generates interrupts to the TaskSwitcherISR. Consider the clock speed of the processor,
other L0S ISRs, and the tasks to be managed.
2. As the time-keeping operations associated with TickerISR and TimeOfDayISR have been removed to
allow the hardware ticker to drive the TaskSwitcherISR, a new means is required to keep and measure
time. Write a task that runs under the real-time kernel to perform the time keeping operations that
were formerly done by TickerISR. Also, write a new task that performs operations analogous to those
found in TimeOfDayISR but which works with your new time keeping task.
3. Give a detailed description of what is happening to the stack(s) during the execution of a user’s
program that consists of several tasks. You may use pencil/paper and scanner to submit your report or
a nice CAD program to show it.
4. Each task of a multitasking application requires its own stack (as if it were the only program in the
processor). How does a designer of the application program that uses the kernel determine how much
stack space to allocate for each task?
5. One of the classically challenging problems to debug occurs when a program execution overflows its
allocated stack space. How would you provide a mechanism to check for this and what is the cost?
6. All tasks managed by the kernel presented are required to be built as code with infinite loops. Then,
calls to the various commands of the TaskManagerISR are used to allow various starting and stopping
conditions for the tasks. Explain why a task cannot be allowed just to terminate like any other C-
pf2

Partial preview of the text

Download Embedded Systems - Assignment 11 Sharing the Processor | CS 404 and more Assignments Computer Science in PDF only on Docsity!

Embedded Systems – Assignment 11

Sharing the Processor 1

Introduction

In this project, you will install, operate, and demonstrate an understanding of a basic multitasking kernel.

Task 1 Install and operate the kernel. Your AppMain must install at least two tasks. These can be keyboard and display tasks or something more interesting. Document the process of installing the kernel. Document the process of constructing tasks that operate under the kernel.

Task 2 Develop a mechanism to determine the CPU usage by the user’s application program, consisting of several tasks. Consider putting a counter in the ThumbTwiddlingTask. Every time that task is executed, the counter increments. The higher the count, the lower the CPU utilization by the user’s tasks Show example data with your program from Task 1 and at least one more. Give some guidelines to a user of this kernel on how to know the limits of its capabilities.

Task 3 Demonstrate what happens when you do not allocate enough stack space for one of the tasks. Explain what happened and when it happened. If you had not known there was not enough stack space, what clues would you have to find this problem?

As always, documented code, screen captures, and a demonstration of the operation of your software is required.

Task 4 Write a paragraph (or more) on each of the following

  1. Describe an approach to determining the rate of calling the TaskSwitchISR. This is the rate at which the counter generates interrupts to the TaskSwitcherISR. Consider the clock speed of the processor, other L0S ISRs, and the tasks to be managed.
  2. As the time-keeping operations associated with TickerISR and TimeOfDayISR have been removed to allow the hardware ticker to drive the TaskSwitcherISR, a new means is required to keep and measure time. Write a task that runs under the real-time kernel to perform the time keeping operations that were formerly done by TickerISR. Also, write a new task that performs operations analogous to those found in TimeOfDayISR but which works with your new time keeping task.
  3. Give a detailed description of what is happening to the stack(s) during the execution of a user’s program that consists of several tasks. You may use pencil/paper and scanner to submit your report or a nice CAD program to show it.
  4. Each task of a multitasking application requires its own stack (as if it were the only program in the processor). How does a designer of the application program that uses the kernel determine how much stack space to allocate for each task?
  5. One of the classically challenging problems to debug occurs when a program execution overflows its allocated stack space. How would you provide a mechanism to check for this and what is the cost?
  6. All tasks managed by the kernel presented are required to be built as code with infinite loops. Then, calls to the various commands of the TaskManagerISR are used to allow various starting and stopping conditions for the tasks. Explain why a task cannot be allowed just to terminate like any other C-

function by running to its end. Consider (1) what is on the stack and (2) the management of the task control block (TCB).

  1. Various device drivers (resources) that compose the L0S are non-reentrant. (a) Define reentrant and non-reentrant (b) Which parts of the L0S are non-reentrant? Why? (c) Which resources could be changed to become reentrant? (d) For several tasks to simultaneously use the same L0S resource, that resource would have to be reentrant. How would you prevent multiple tasks from using the same L0S resource, such as a serial communication channel, parallel port, or the display? A typical mechanism for limiting access to resources is called a semiphore.