F0 - Write a Novel Specification 📐

You will conceive of an idea for a novel character device with the objective of designing something that is creative and non-trivial and will provide for an entertaining demonstration as part of someone's final presentation.

With the knowledge that it is one of your colleagues who will be responsible for actually implementing your idea, you will write a specification of the behavior of each system call that is precise and detailed enough for them to implement it correctly.

To further guide your colleague in implementing a device that complies with your creative vision, you must write a userspace program that executes a suite of tests that a correct implementation should pass.

For F1, you will randomly be assigned one of the specifications submitted for F0.

Outcomes:

What to submit:

Procedure:

  1. Brainstorm some ideas with an eye for how the behavior can be implemented by a real character device

  2. The most important system calls to figure out will be read(2), write(2) and ioctl(2)

  3. Once you have designed the core functionality of the device, consider how those functions will (or will not) interact with the file position value that the kernel stores for each open file and how lseek will fit into that picture

  4. Finally, you have to think about the resource lifecycle within the module

  5. Write a plain-text specification for the open(2), read(2), write(2), close(2), ioctl(2), and lseek(2) system calls

  6. Write a program that implements a minimum of 25 tests

  7. You will not have an implementation to run your test program against, however you can still verify that it is performing the right operations by pointing it at a dummy file like /dev/null or /dev/zero and verifying that it is making the right system calls with strace

Frequently Asked Questions


msg = (silence)
whoami = None
singularity v0.7 https://github.com/underground-software/singularity