-
Notifications
You must be signed in to change notification settings - Fork 0
/
disk.h
33 lines (26 loc) · 817 Bytes
/
disk.h
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
/*
* File: disk.h
* Author: yanivdu
*
* Created on May 22, 2010, 7:45 PM
*/
#ifndef _DISK_H
#define _DISK_H
#include "datatypes.h"
#include "globaldefs.h"
#include "freelist.h"
static Disk_t Disk;
//initializes the disk data-type
//return true on success, false otherwise
bool DISK_Init();
//Findes a free space in the Disk using the PCB and allocate the space
bool DISK_AllocateSpace(unsigned int start,unsigned int end);
//Removes the relevant PCB block
bool DISK_DeAllocateSpace(unsigned int start,unsigned int end);
//returns the Page to the PRM
void DISK_ReadPage(int pageNum, OUT Page* pageToReturn);
//Writes the data to the pageNumber returns true if all went well, false otherwise.
bool DISK_WritePage(Page data,int pageNum);
void DISK_PrintContent();
void DISK_DeInit();
#endif /* _DISK_H */