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

(Version: 2)

Due Date: Thu, Oct 26, 2023, 8:30am 11:59pm

Introduction

In this final kernel assignment, you use the interrupt processing capabilities of your kernel to create tasks that provide interrupt driven input/output. User programs will then be able to call Getc(), Putc() and any other primitives you choose to implement to access input and output streams on either of the two UARTs. It is also expected that during this final stage of development you polish the code of your kernel, integrating tightly the functionality you have implemented and thereby making the code robust.

To demonstrate your serial I/O you are to redo the functionality of Assignment 0, but using interrupt-mediated I/O and task-structured application code. As well as testing your I/O this provides you with a valuable capability that you will certainly use when developing your train application. We explicitly expect that you will have these capabilities available for later demos.

Description

I/O Interface

This assignment does not require the implementation of any new system calls. However, you should implement I/O servers which offer an API like this:

int Getc(int tid, int channel) int Putc(int tid, int channel, unsigned char ch).

See the kernel description for more detail on how these primitives should operate. You might modify or add to this API - do so sparingly and with good justification.

Server Tasks

Putc() and Getc() should be implemented as wrappers around Sends to one or more I/O server tasks. The servers' task ids should be obtained by the client using a call to the name server. Your I/O servers are expected to implement this API without busy-waiting, using interrupts.

There is more than one way to design your I/O server tasks. You need to create at least one I/O server, but possibly more: do what you think is best. Describe the task structure you chose, and why you chose it, in your documentation.

Hint

There is not a unique 'best' task structure, but some task structures are better than others. As mentioned in class, servers should never use Send() or AwaitEvent() and mostly be blocked waiting on Receive(). Notifiers should almost always be in AwaitEvent(). Keep in mind that the two serial devices (UARTs) play very different roles in train applications. One is much more performance-limiting than the other.

Serial I/O

To test your serial I/O you are asked to redo the functionality of Assignment 0, this time Getc and Putc. What collection of tasks you use is implementation-dependent, but you should describe and explain your design decisions.

Once your UART implementation is complete you do not need to do much more than connecting terminal commands to output for the train controller, and connecting train input to the terminal display. In doing so please remember to retain features such as the display of idle time, which you added earlier in your kernel development.

Also, remember that typing a command at the terminal does not test either terminal or train controller I/O very rigorously: human typing is way slower than a machine sending at full bandwidth.

Hand In

Your group should submit a PDF document into the K4 dropbox in Learn before the assignment deadline. The PDF should include the following information
  1. The names and student IDs if 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. Your repository should include a README file that describes how to build and run your code.
  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 your kernel and your I/O interface implementation:
    1. The I/O interface description should describe what I/O servers you've created and what they do. If you modified the I/O interface, be sure to explain and justify those changes.
    2. The kernel description should be a final comprehensive description of your kernel, including tasks, scheduling, and message and event handling. If you added any additional kernel functionality for this assignment, be sure to describe that as well. Much of your kernel description should already be written, from previous assignments, so you can simply refine (if necessary) and include that material here.