MockOS is a C++ implementation of a mock operating system that provides file management and command execution capabilities. This project is designed to simulate basic operating system functionalities and serves as an educational tool for understanding OS concepts.
- File system management (creation, deletion, reading, writing)
- Support for text and image files
- Password-protected files
- Command-line interface with various commands
- Extensible command system
- Visitor pattern for file operations
- Macro commands for complex operations
- CMake (version 3.20 or higher)
- C++14 compatible compiler
-
Clone the repository:
git clone https://github.com/yourusername/mockos.git cd mockos
-
Create a build directory and navigate to it:
mkdir build cd build
-
Generate the build files with CMake:
cmake ..
-
Build the project:
cmake --build .
To run the unit tests, execute the following command from the build directory:
ctest
After building the project, you can run the MockOS executable:
./src/lab5
MockOS provides a command-line interface with various commands for file and system management. Here are some example commands:
touch <filename>
: Create a new filels
: List all files in the systemcat <filename>
: Display and edit file contentsrm <filename>
: Remove a filecp <source> <destination>
: Copy a fileds <filename>
: Display file contentsrn <oldname> <newname>
: Rename a file
For more detailed information on each command, use the help
command followed by the command name, e.g., help touch
.
include/
: Header fileslib/
: Source files for the MockOS librarysrc/
: Source files for executable programstests/
: Unit testsdocs/
: Documentation files