CSC 4103 Operating Systems Program 2 Assignment: Implement a simulated RAID-5 array
Name: Samuel Jones
Date: 11/22/2021
I have provided a sample input text file to easily see and understand the results of the program.
This code can be compiled with GCC using the following command in a bash terminal:
g++ -o raid raid.cpp
The file must be given execute permission in linux with the following command:
chmod +x raid
Then, the file can be run in the following configuration:
raid 4 16 write input.txt
As you can see there are four command line arguments, which will be explained in the next section.
The executable requires 4 command line arguments
- Integer >= 3: Number of disks to be simulated in the RAID-5 array
- Integer > 0: The block size of the disks in bytes
- String (read, write, rebuild): The command for the program to execute
- String: A path to a file
The commands have the following functions
- Read: Takes input from the file specified in command line argument 4 and stores it in disk files.
- Write: Takes the information stored in the simulated disk array and writes it to the file path specified in command line argument 4
- Rebuild: Rebuilds the disk specified by command line argument 4 (where arg4 = disk.i, i in (0..arg1-1)), simulating a lost drive being rebuilt using parity information.