Project 6

Advanced Project

Overview

Previous projects covered many of the essential aspects of systems programming. The goal of the final project is to allow you to showcase what you have learned in 414/415 by building an interesting system component. There is no set assignment. You are free to pick any one of the problems listed below, or to persue other projects that we deem appropriate. In all cases, email us (cs414@cs) with the subject line "Final project topic" by 5 pm on April 26 with your selection.

There are very few ground rules for the final project. You may develop in any language you like, including C, Java, assembler, or whatever other language you choose. We ask that you build on minithreads. You may integrate other people's code into your projects, provided that the part of the project you write is substantial and embodies an interesting systems concept. In fact, we encourage you to save work whereever possible by reusing code components such as GUI toolkits, image manipulation libraries, and regular expression packages.

If you have any doubts about what to choose, the first option is the safest.

Project Options

  1. Filesystems. Implement a filesystem for use with minithreads. Details are here

  2. RAID. Implement RAID level 5 for the filesystem and disk interface described here.

  3. Graphics and mouse device. Add a graphics and mouse device to your minithreads system, which currently only supports the keyboard. Integrate with the windows event loop such that concurrent threads work correctly in the presence of mouse and window repaint events. Showcase your work by adding a GUI to your project 5 implementation.

  4. Peer-to-peer filesharing. Implement Freenet, as described in class and in their papers.
    Implementation: You will probably need a software package that implements the DES, MD5 or SHA algorithms.
    Demo: I ask for a Metallica album that you have made available, my machine finds it, decrypts it and caches it for future use (for this demo, we will purchase two copies of a Metallica album).

  5. Distributed event notification system. There are N hosts arranged in an arbitrary network, with clients attached. Clients can register to be notified when an event occurs, and they can raise events. When a client generates an event, e.g. "X happened", everyone who registered to be notified of the X event gets a message.
    Implementation: The trick is to do it first by using dumb flooding, and then to move to an intelligent event-filtering scheme that will scale. Note that the excitement level of this project is closely indexed to how expressive a language you provide for event handlers. Here are some definitions you will need:
    
    typedef struct EventHandler EventHandler;
    typedef struct Predicate Predicate;
    typedef enum Op Op;
    
    enum Op { EQUAL, LE, LT, GE, GT };
    
    struct Predicate {
         Op op;  // comparison operator
         int offset; // offset of byte in event array
         int value;  // value to compare to
    };
    
    struct EventHandler {
         Predicate p;
         Predicate *next;
    };
    
    void raiseevent(char *eventarray, int len) {} // event can be anything
    
    void registereventhandler(EventHandler eh, void (*eventhandlerfunc)(char *eventarray, int len)) {}
    
    An event handler interprets predicates specified according to the scheme above, e.g. "first byte of the event should be equal to "M", second byte to "S", third to "F", fourth to "T" and the fifth byte should be greater than 100.
    Demo: "Let me know when YAHOO stock goes above 80," or "let me know when someone is sharing Metallica songs."

  6. Dynamic code loading for minithreads. Currently, the only code that you can run in your minithreads system is code that was compiled in with your system ahead of time. There is no way to dynamically add new code to the system and run it in a new thread. Your task in this project is to enable this by adding a dynamic code loading facility to minithreads. You can use the GNU BFD library to read object files and to link them into minithreads. You should allow programs to query functions through the symbol table in the object file and to make calls to those functions once you have linked them in using BFD.
    Demo: I write some code in foo.c, compile it to foo.o, type "load foo.o" to minithreads, which reads it in, and I type "run foo" to invoke function foo in a new thread.

  7. Porting minithreads. Port the minithreads to the Palmax @migo handheld. Or port them to Linux. The same code should compile on Windows NT, CE for HPC, CE for @migo and Linux.

    How to get started

    Build on your submission for the previous project.

    Submissions

    You should follow the generic submission guidelines to submit this project. Make sure you use the correct project number (6).

    We also ask that you sign up for a demo slot during finals week to demonstrate your code to the course staff.

    Final Word

    If you need help with any part of the assignment, we are here to help. You may also find the FAQ useful.