This Software can be used as an educational approach for simulation of memory allocation algorithms. Although initially just best fit has been implemented here, you can contribute with this project forking and send pull requests with improvements made.
This was an final project presented at UniNorte Laureate University through Operating Systems discipline, ministered by Prof.ª Ângela Lima, M.Sc.
The best fit deals with an algorithm that searches the first closest memory block size of process size to alloc it one. And as an advantage, best fit provide a memory utilization more optimized.
You can find a quickly content about more allocation algorithms accessing the last item of References. For a deep reading about this subject, I recommend the two firsts items of References.
.
├── img
│ ├── about.png
│ ├── github.png
│ ├── icon_old.png
│ └── icon.png
├── nano_os
│ ├── __init__.py
│ ├── memory.py
│ ├── processor.py
│ └── support.py
├── LICENSE
├── README.md
├── interface.ui
├── interface.py
├── ui_manager.py
├── cli_testing.py
└── app.py
I advise you to use these tools to make easier your work and save time:
- Some unix-based OS as Debian, Ubuntu or OSX;
- PyCharm IDE (it's free for students);
- Read about PyQt can be helpful.
-
Python 2.7.x
Download Python 2.7.x interpreter here.
-
PyQt4
-
If you are using a Debian-based system, you can install it using the following command:
$ sudo apt-get install python-qt4
-
If you are using OS X:
$ brew install pyqt
-
You can also find a compatible version for your system in oficial PyQt website.
-
-
Clone the repo
$ git clone https://github.com/allexlima/PyBestfit.git $ cd PyBestfit/
-
Run PyBestfit
-
You can install PyBestfit in your Debian-based system running
setup.sh
file as sudo or root:$ sudo ./setup.sh
and type
i
to proceed installation -
Or just run it:
$ python app.py
-
If you want run without graphical interface, enjoy yourself with
cli_testing.py
example.
-
-
Running
app.py
, this window will open: -
You must click on the Create button to generate pseudo-random values, then you can to browse through tabs:
-
Now, clicking in Memory Alloc button, you will allocate the generated process in a memory spaces through the best fit algorithm.
-
To generate new values, click in Update button.
-
Testing mode can be checked to use pre-defined values in memory block sizes. These values are in
SIZES
list, available innano_os/support.py
.
- Tanenbaum, A. S., & Bos, H. (2014). Modern operating systems. Prentice Hall Press.
- Maziero, C. A. (2013). Sistemas Operacionais: Conceitos e Mecanismos. Online: http://dainf.ct.utfpr.edu.br/~maziero/lib/exe/fetch.php/so:so-cap09.
- Summerfield, M. (2007). Rapid GUI programming with Python and Qt: the definitive guide to PyQt programming. Pearson Education.
- https://nikolak.com/pyqt-qt-designer-getting-started/
- https://www.tutorialspoint.com/operating_system/os_memory_allocation_qa2.htm
Developed by Allex Lima, Daniel Bispo, Paulo Moraes and Renan Barroncas with ❤️ using Python 2.7.x and PyQt4!