This is our project for the OS exam 2021/22, details in the pdf file.
We did the minimum version because of lack of time, but we got the max score.
Clone this repository
git clone https://gitlab2.educ.di.unito.it/st203699/os-proj.git
cd os-projYou can compile with the Make utility and use some parameters to change the program's behavior.
To compile the master program with the SO_BLOCK_SIZE set to 100 and SO_REGISTRY_SIZE set to 1000 as described in the first configuration of the project found in the pdf.
make all cfg=1The second configuration is conf2 which sets SO_BLOCK_SIZE to 10 and SO_REGISTRY_SIZE to 10000.
make all cfg=2The third configuration is conf3 which sets SO_BLOCK_SIZE to 10 and SO_REGISTRY_SIZE to 1000.
make all cfg=3Of course, there is a way to compile the master program with custom values. To do so, you must edit line 4 and 5 of the makefile and launch make all.
###############################
# Custom configuration values #
###############################
SO_BLOCK_SIZE = [CHANGE_THIS]
SO_REGISTRY_SIZE = [CHANGE_THIS]
...make allThe default C Compiler Flags are -std=c89 -pedantic -O2, but it's possible to compile the master program for debugging purposes with make all debug=1.
It will change the C Compiler Flags to -std=c89 -pedantic -O0 -g, it will define the DEBUG macro and it will use the custom configuration parameters.
To clean the output of the make utility, you can run make clean which will remove all the object files from the project directory.
make cleanYou can also try more complex configurations:
make all debug=1 cfg=2Before running the program, you must load the environment variables that will be checked at run time. To do so, we'll use the source utility from bash, zsh, ..., but unfortunately it doesn't exist in the sh shell.
If you have the source command, run
source cfg/<conf_file>.cfg
make runOtherwise, you have to manually append the contents of a configuration file that you can find in the cfg/ directory into ~/.shrc or ~/.bashrc or ~/.zshrc file and then run the following command (Maybe you must restart the terminal in this case).
make run- Filippo Bogetti
- Roberto Carletto
This project is licensed under the MIT License - see the LICENSE.md file for details
We are coding in C, so there is no reason why we shouldn't follow the Linux Kernel coding style.