-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVirtualMemoryManager.h
More file actions
54 lines (45 loc) · 1.12 KB
/
VirtualMemoryManager.h
File metadata and controls
54 lines (45 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// author Janik und Patrick Tinz
#include "Statistics.h"
#include "PageTable.h"
#include "Page.h"
#include "Constants.h"
#include <cstdlib>
#include <string>
#include <vector>
#include <list>
using namespace std;
#ifndef VIRTUALMEMORYMANAGER_H
#define VIRTUALMEMORYMANAGER_H
class VirtualMemoryManager {
public:
VirtualMemoryManager();
virtual ~VirtualMemoryManager();
void init();
void popPage();
void writeRam(Page insertPage);
void writeMemory(Page newPage);
void fifo();
void lru();
void operatingSystem(Page insertPage);
void readRam();
bool mmu(Page actualPage, string);
void readMemory(Page page);
int generateVirtualAddress();
Page generatePage(int);
void cpu();
void run(double);
void report();
void menuSettings();
int mainMenu();
int processNumber;
int actualProcessNumber;
int algo; // default lru
int addressGenerator;
vector<int> newAddressVector;
list<Page> ram; // example: Page 256 Byte 128 * 256 = 32768 Byte = 32KB
vector<Page> memory;
vector<PageTable> tables;
private:
Statistics st;
};
#endif