| 173 | } |
| 174 | |
| 175 | int MemoryManager::allocateVirtualPages(enum AddressPoolType type, const int count) |
| 176 | { |
| 177 | int start = -1; |
| 178 | |
| 179 | if (type == AddressPoolType::KERNEL) |
| 180 | { |
| 181 | start = kernelVirtual.allocate(count); |
| 182 | } |
| 183 | else if (type == AddressPoolType::USER) |
| 184 | { |
| 185 | start = programManager.running->userVirtual.allocate(count); |
| 186 | } |
| 187 | |
| 188 | return (start == -1) ? 0 : start; |
| 189 | } |
| 190 | |
| 191 | bool MemoryManager::connectPhysicalVirtualPage(const int virtualAddress, const int physicalPageAddress) |
| 192 | { |