This course was taught by Professor Robert Kinicki, from January to March 2014.
We covered a massive range of Systems Programming Concepts, Data Structures, and intense simulations in C and C++ over the course of the class.
The professor above all else encouraged a meaningful understanding of the C compiler, and comprehension of pointers, arrays, permissions, memory allocation, and other lower-level programming concepts.
There were two main sets of assignments for this course, Labs and Programs. Labs were usually simpler, one-off ideas or concepts, and Programs covered a multitude of topics and were significantly more intricate. Below, I'll include a short summary of each Lab and Program we worked on, along with instructions on how to compile them.
The order follows as a timeline of coursework: We alternated between simplistic, concept-level labs and larger, more comprehensive and polished projects.
Project Name | Project Description | Project Source | Project Readme |
---|---|---|---|
Lab 1 | Description | Source | Readme |
Program 1 | Description | Source | Readme |
Lab 2 | Description | Source | Readme |
Program 2 | Description | Source | Readme |
Lab 3 | Description | Source | Readme |
Program 3 | Description | Source | Readme |
Lab 4 | Description | Source | Readme |
Program 4 | Description | Source | Readme |
Lab 5 | Description | Source | Readme |
Program 5 | Description | Source | Readme |
This was a simple C program to learn how to work with command-line input, Unix commands, and return a result based on an average of numbers.
$ gcc -o Lab1 Lab1.c
$ ./Lab1
Program 1 had us learn functions, syntax, and C variable types. We designed functions that returned the log2(input), and another function that calculated the euclidian distance between elements. We also became familiar with scanf and other C conventions. You can test the program with the included "Program1.txt" text input.
$ gcc -o Program1 Program1.c -lm -std=c99
$ ./Program1
$ ./Program1 <Program1.txt >output.txt
Lab 2 was designed to familarize us with Arrays, Makefiles, and the GDB Debugger for our C programs. It moves elements based on a direction integer across the field until it reaches the edge of the field, for the amount of elements passed to it.
A Makefile is used from these programs on, so to compile the program all that is particularly needed is to run:
$ make
in the folder directory of the project.
Test data is included, Here as Lab2.txt, and can be piped in. Example output is included as well, Here as Lab2.out.
$ ./Lab2
Motion Smashball is a sophisticated and intricate game, with players, directions, player interactions, eliminations of the opponent, and much more. I implemented Version I of Motion Smashball, the most difficult variant of the game. More on the Smashball assignment can be found Here. You should also check out my original readme for the file, located in the Program2 directory.
Again a Makefile is used, so all that is needed is:
$ make
Smashball requires no additional parameters. It outputs a lot, so it's very much recommended to pipe the output, as shown below.
$ ./Program2 >output.txt
Lab 3 was designed to teach us a simple First Come, First Serve Queue with an Event List. We can remove from, add to, and print the queue in this lab. This was our preliminary introduction to pointers, and command line arguments.
$ make
Lab 3 has a command line argument for number of sources it takes for its queue, and then has a user input the process-id, arrival_time and cpu_time, one per line of text input. Input would follow as:
$ ./Lab3 [sources]
$ ./Lab3 10 <lab3.dat
Program 3 was a simulation of a process queue for a processor running a time-sharing operating system, in three different increasing complexities. In this Program, I implemented the first two: The First Come First Serve (FCFS) queue was the simplest variant, where every process is scheduled linearly without any concept of timeslices. The Round Robin Scheduler was a more realistic representation of an operating system processor queue, where every process is allowed a certain frame of time to be worked on, then brought back to the end of the queue. Further reading on this processor simulation can be found Here, on the course website.
$ make
This program is fairly complicated, and has some running options. Refer to the Readme in the Program3 folder for running options.
Sample output based on various simulation modes are provided in the program folder, including FCFS Output, FCFS Debug Output, RR Output, and RR Debug Output
Lab 4 was designed to teach us binary trees and how to print these trees in order. It furthered our understanding of binary trees, pointers, and data structure representation in C. Further reading on the lab description can be found Here, on the course website.
$ make
Further running instructions can be found in the Readme in the Lab4 folder for running options, but simply:
$ ./Lab4 [Number of students]
Lab 4 can use the test data "Lab4.dat" as piped input for simple tests.
Program 4 generated cross references of every word (case-insensitive) that it finds in an ASCII text file with a Binary Search Tree data structure, and sorts these words in order alphabetically, noting the number of occurences of the word and the lines the word occurs on. Further insight into this program can be found Here.
This program was done in pairs, and I do not have permission to share my partner's name. I will refer to them in files as "Program Partner".
$ make
When compiling, make sure to have g++ installed on your machine.
Program 4 takes in any ASCII file as input, using the pipe character.
$ ./Program4 <[file.txt]
Included in the same folder is sample data such as the US Constitution "US_Constitution.txt" and a simple test "simpletest.txt" that are ideal examples for this program.
Lab 5 is mainly preparation for Program 5, a complete MANET Simulation. It is a direct simplification, with non-moving mule nodes from sender to receiver. A sender sends 100 packets of varying transmission time and propogation time across two mules with another sender, all to a receiver, with 100ms simulation time slices, or sims. This lab also helped introduce file readers and build guards. For further reading on this lab concept, look Here for a stronger understanding of Lab requirements.
$ make
The total time in sending packets increases linearly across the Lab, so you do not need to set each packet's behavior. Example output is included [Here] (/Lab5/packetsim.txt).
$ ./Lab5
Program 5 is by all means the most complicated program of the course. It combines many aspects of Program 1, Program 2, and Program 3, to design a complete Mobile Ad hoc Network (MANET) Simulation. Specific design decisions and program parameters are outlined in the [Program Description] (http://web.cs.wpi.edu/~rek/Systems/C14/Program5_C14.pdf) and my Readme for Program 5.
$ make
There are several parameters that should be followed closely- change the prog5.txt file to change different source nodes- change these source nodes based on the guidelines of the Program Description. Sample output is provided here.
$ ./manetsim [sources] [receivers] [mules] [dimension]