Question
Work in pairs on this question, and keep a copy of your answer. You will need to submit your software, including the test programmes that you use to demonstrate it, and your documentation. These items should be placed into a single zipped file, and uploaded to a Canvas submission point to be advised. The submission deadline is 2pm on Friday 20th January, 2023.
The work consists of writing a basic time-slicing system, along the lines of the one discussed in the lecture. Implementing and testing a basic time-slicing system should allow the execution of several concurrent user tasks, with support for task scheduling and inter-task communication. Test your system, and using short test programmes of the type used in the lectures, show clearly that each function is working. Demonstrate the operation of mutual exclusion and task synchronisation. Write a short document describing how to use the system, stating the maximum number of instructions executed by each of the functions.
The system runs in the foreground, and is entered following either a timer interrupt or a software interrupt from one of the tasks requesting service. Implementing and testing a basic time-slicing system will include another hardware interrupt to be added later. The following system calls should be supported by means of software interrupts. They can either each be allocated to a separate trap number, or (as in the demonstration system) they can all be called on the same trap, with one of the registers used to hold a value identifying the requested function. Some of the calls also require additional parameters in other registers.