CECS Home | ANU Home | Search ANU
The Australian National University
ANU College of Engineering and Computer Science
Research School of Computer Science
Printer Friendly Version of this Document

UniSAFE

Operating Systems Implementation

An Operating System for the Meggy Jr RGB - COMP3300/6330 Assignment 2

Goals

The main objective of this assignment is to design and develop a small Operating System (OS) for the Meggy Jr RGB game platform by Evil Mad Science. This platform is based on the Atmel ATmega328P microcontroller with good (open source) support for C development. Meggy Jr RGB is also compatible with the popular Arduino development environment.

The aim of this OS implementation is to make game development for the Meggy Jr RGB simpler so the details of the hardware is hidden from the application program. Also, the OS you develop should provide some form of multi-threading. In doing this assignment students should gain some experience in low level C programming and gain an understanding of issues involved in the design and development of an operating system.

Groups

This assignment is intended to be done in groups of two. Each group will be provided with a Meggy Jr RGB and USB-serial programming cabler. These must be returned at the final demonstration.

It is expected that each member of the group will contribute sufficiently to the overall effort of the assignment, and the statement "Each member of the group has contributed sufficiently to the assignment and each member is happy for the marks to be apportioned equally." needs to be included on the assignment cover sheet and agreed to by all members of the group. If this is not the case then the work of the assignment will be partitioned and marked individually.

The assignment may be done individually. However if done individually the school may not be able to provide a Meggy Jr RGB and cable.

Groups of 3 would be expected to do a little more at a higher quality to gain a similar mark to that of groups of 2.

Also if the assignment is done individually it is expected that students will not have to do as much to gain a similar mark to that of a group of 2.

Assignment Requirements

The assignment will be marked out of 40 and has 4 parts. Each part will contribute 10 marks and these marks will be awarded based on:

  • does the submitted OS do what is expected,
  • design quality and implementation quality of your code,
  • is there evidence of appropriate testing,
  • the difficulty and extent of what is submitted,
  • and the clarity and completeness of the associated section of your report.

Part 1 - Application Programmers Library [10 marks]

Design and develop a library to provide application programmers a simple interface to the Meggy Jr RGB hardware. This will enable the application programmers to: draw to the display, obtain button presses, and access the buzzer.

This will involve creating a set of documented methods an application programmer could use for writing games. As you design these you should ask the following questions: How would each method be used? Does it make it simpler for the application programmer? Does the library place constraints on how the hardware is used? Are these constraints reasonable and justifiable? Have race conditions been addressed if the library is used in a multi-threaded environment? How can you test your implementation?

Part 2 - Multi-Threading [10 marks]

Create a Multi-Threaded environment for the Meggy Jr RGB. This may be preemptive or non-preemptive and should enable at a minimum 2 threads to be running concurrently.

As you design this you should ask a few questions: What is the overhead (memory and CPU) of providing a multi-threaded environment? How are threads scheduled? Are there any race issues within your OS code? How does the multi-threading interact with the application programmers library? Are there any race issues with this library?

Part 3 - A Simple Game [10 marks]

Using Part 1 and Part 2 (possibly Part 4) design and implement a simple game. The game should highlight why your OS is good for implementing simple games.

Part 4 - Extension [10 marks]

Add an extra feature to your OS that would be useful for game application programmers. This could be just about anything you think of. Some possibilities include (but not limited to):

  • a way of sleeping a thread for a fixed amount of time,
  • message passing between threads,
  • mutex locks between threads,
  • reader/writer lock,
  • semaphores,
  • priority scheduler,
  • earliest deadline first scheduler,
  • a way of accessing non-volatile EEPROM for storing information that persisted between power cycles,
  • graphics sprites, ....

Highest marks will be given for implementations that are working and tested. However, you can still gain marks for a submission that is not working but has a feasible design and with some progress being made in the implementation. .e.g. A group would pass if they are able to get Part 1 and Part 3 (without using multi-threading) working and some progress had been made in the design of part 2.

Report

This assignment involves producing a short report that provides an overview of your design and implementation. The report should be in pdf format and include the following:
  1. A cover pages which includes: a title, names and uni ids of the members of the group, the date, and the statement of contribution.
  2. An abstract which provides a short overview of what your group achieved (can be placed on the cover page).
  3. 2 pages of content with about half a page on each of the 4 parts above. For each part state what you did, why you took this approach, and discuss any issues you believe are worth mentioning.
  4. An appendix which includes listings of your code.
If you have made use of other people's code within your own then this should be clearly referenced. Also if you have used ideas or approaches from other people's code this should also be properly referenced within the code and the report. e.g. "Using a similar approach to .... in ... we ..." or "The below code is copied with permission from ...."

Demonstration

The demonstration will be a short and informal chance for you to show off your submission. You should include a demo of you OS working on the Meggy Jr RGB. It will also be an opportunity for the lecturers to ask you few questions about the approach you have take. You will return the Meggy Jr RGB at the end of the demonstration.

Due Dates

Only one member of the group needs to submit the report. Use the the following command to submit your report:
submit comp3300 assign2 yourfile.pdf
or
submit comp6330 assign2 yourfile.pdf
The report is due Week 12 - Sunday 10pm (29/10/2012). The demonstration will be during the normal lab session in Week 13.

A late penalty of 10% per day applies (these are working days and apply from after the assignment is collected). The assignment will be collected some time after the deadline. Also note this penalty is caped so it does not take your assignment mark below 40%. Assignment work will not be accepted after the last day of semester. Extensions are possible in documented exceptional cases (e.g. medical certificate).

Example Code

Some example code is provided to help you implement your code.