Introduction 1.1 Overview
COMP2007 - OSC: Coursework Specification
October 2023
The goal of this coursework is to make use of operating system APIs, particularly the POSIX API, to implement a process simulator on Linux. Your final implementation will be based upon principles that you would find in modern operating systems, and will exploit some standard concurrency techniques.
Completing all the tasks will give you a good understanding of: Key concepts in operating systems.The use of operating system APIs.
Implementations of process tables and process queues.
The basics of concurrent/parallel programming using operating system functionality. Critical sections, semaphores, mutexes, and mutual exclusion.
Bounded buffers.
C programming.
Successfully implementing the coursework will be a key step towards the learning outcomes for this module.
To maximise your chances of completing this coursework successfully, and to give you the best chance of getting a good grade, it is recommend that you break it down in the different stages listed in Section 3. Each step gradually adds more complexity and builds up key insights. Only the final version of your code, which will include all components of the previous stages, should be submitted in Moodle. Only this submitted version will be marked.
1.2 Coding
1.2.1 Servers
Tutorials on how to log on to the servers are available in the Lab section on the Moodle page. When off campus:
From Windows:
1
– Set up an ssh tunnel using:
plink -N -L 2201:bann.cs.nott.ac.uk:22 -P 2222 @canal.cs.nott.ac.uk
– When using WinSCP or Putty, make sure to specify localhost for the hostname and port 2201 to connect to.
From iOS/Linux: – For ssh use:
ssh -J @canal.cs.nott.ac.uk:2222 @bann
– For scp use:
scp -J @canal.cs.nott.ac.uk:2222 file.c @bann: This will copy file.c to your root home directory.
The H: drive where you store your code is shared with the servers. Any code written in an editor such as Notepad++ or Visual Studio, and stored on the H: drive, will be automatically visible on bann, and can be compiled there using an ssh connection.
Important: You must test that you are able to connect to the servers from home using an ssh tunnel early in the term so that any problems can be resolved. Not being able to connect to the servers will not be a valid ground for ECs.
1.2.2 GNU C-Compiler
Your code must compile and run on bann.cs.nott.ac.uk. Your submission will be tested and marked
on this machine, and we cannot account for potential differences with other configurations. YoucancompileyourcodewiththeGNUC-compilerusingthecommandgcc -std=gnu99 ,
where is a list of C source files. For example: gcc -std=gnu99 file1.c file2.c
compiles an executable called a.out from two source files. If you are using pthreads, you must add the flag -lpthread when compiling. For example:
gcc -std=gnu99 file.c -lpthread
compiles an executable called a.out from one source file which might use the pthread library. If you want to specify the name of the executable file, extend your compile command with -o