CS 452/652 Fall 2023 - Kernel (Part 3)

(Version: 1)

Due Date: Thu, Oct 19, 2023, 8:30am

Introduction

The third part of your kernel adds interrupts generated by a timer. You use this capability to create a clock server. To do so you must have working
  1. an implementation of the AwaitEvent() system call,
  2. an implementation of an idle task,
  3. implementations of a clock server and a clock notifier, and
  4. implementations of Time(), Delay(), and DelayUntil() as wrappers for Send() to the clock server.
  5. an implementation of clock server client tasks, for testing.
Tasks that want to obtain service from the clock server must do so by obtaining its tid from the name server.

Description

Kernel

To accomplish this part of the kernel you must have the following kernel primitive operating:

int AwaitEvent(int eventType)

See the kernel description for the details of how this primitive should operate. In addition you must program a first user task, which creats the clock server and the clock server's clients.

The Clock Server and Notifier

The clock server should be implemented as described in the kernel documentation. The clock notifier is a helper task that is created by the clock server. The notifier waits on events from a timer, and sends notifications that the timer ticked to the clock server.

Client Tasks

A single type of client task tests your kernel and clock server. It is created by the first user task, and immediately sends to its parent, the first user task, requesting a delay interval, t in ticks, and a number, n, of delays. It then uses WhoIs() to discover the tid of the clock server. It then delays n times, each time for the delay interval, t. After each delay it prints its tid, its delay interval, and the number of delays currently completed on the terminal connected to the ARM box.

FirstUserTask

The first user task creates the clock server and four client tasks with different priorities. It then executes Receive() four times to receive the parameter requests from the four client tasks. It replies to each client task in turn. The following table shows the parameters to be given to the clients.

Priority (smaller is higher)Delay Interval (in ticks)Number of Delays
31020
4239
5336
6713

Idle Task

During the time that all client tasks are delayed, an idle task should run. The idle task should report the fraction of execution time that it (the idle task) uses. This should be displayed on the console. We will expect you to maintain this performance indicator throughout the remainder of the term. You will find it a useful diagnostic of performance problems. Ideally, the idle task should put the CPU into a low-power state.

Hand In

Your group should submit a PDF document into the K3 dropbox in Learn by the assignment deadline. The PDF should include the following information:
  1. The names and student IDs of your group members.
  2. The name of your group's code repository in GitLab (git.uwaterloo.ca), readable by the TAs and instructor, containing the source code of your assignment.
  3. The commit SHA for the repository commit that we should review and test. The commit must have been created before the assignment deadline.
  4. A description of the structure of your kernel so far, highlighting the changes for this assignment. We will judge your kernel primarily on the basis of this description. Describe which algorithms and data structures you used and why you chose them.
  5. The output produced by the clock server client tasks, and an explanation of the observed behavior.
In addition, your git repository should include a README file which explains how to build and run your clock server test.