A C++17 project demonstrating a "mini operating system" concept using Object-Oriented Programming (OOP).
This project simulates two classic OS modules — Process Management and File System — by implementing process scheduling and basic file operations (create/read/delete/rename/move/list).
mini-os/
├── main.cpp # Entry point: demo of process scheduling + file operations
├── Process.h # Declaration of Process class (name, priority, sort/print methods)
├── Process.cpp # Implementation of Process class
├── FileSystem.h # Declaration of FileSystem class (CRUD, rename, move, list)
├── FileSystem.cpp # Implementation of FileSystem class (using <filesystem> and std::rename)
└── Makefile # Build script (g++ -std=c++17)
- g++ 9+ or any compiler supporting C++17
- OS: Linux / macOS / WSL
make # build the mini_os executable
./mini_os # run demo
make clean # remove executable- Sorting: sort by priority (ascending order)
- Printing: print processes in scheduling order
- Interfaces:
Process::sortProcesses,Process::printProcesses
- Create:
createFile(name, content) - Read:
readFile(name)(read one line for demo) - Delete:
deleteFile(name) - Rename:
renameFile(oldName, newName) - List:
listDirectory(path)(display absolute path + file list) - Move:
moveFile(src, dst)(usescreate_directoriesthenstd::rename)
Why Move/Rename uses
std::rename?
On the same filesystem, rename/move simply updates the directory entry pointing to an inode —
it does not actually move the physical data blocks. That’s why it’s very fast and almost atomic.