a os implementation in C language
Description: implement the MEMORY module of OSP, need code for the internal functions of this module according to instructions in an osp manual.(will provide pages if needed) need to implement the least recently used (LRU) page replacement policy. There are eight internal functions for MEMORY. memory_init() is an initialization function prepage() and start_cost() are associated with bringing in additional pages from disk in advance of their being requested to improve performance. DO NOT need to implement pre-paging prepage() may be left empty and start_cost() can return a constant value. deallocate() is called when a process terminates. Its function is to de-allocate all the physical memory (frames) used by that process (i.e. they become free frames). lock_page() and unlock_page() are used to lock and unlock pages when doing I/O, respectively. refer()simulates a memory reference by a process. Its job is to convert from the provided logical address to a physical address and then simulate the memory access, possibly causing a page fault if the page is not in memory. a write to a frame will set its dirty field to true. get_page() is the function where you will implement your page replacement policy. This function is responsible for brining in pages from disk to memory and for writing out dirty pages from memory to disk (actually, the OSP system uses a “drum??, through the siodrum() call; a drum was a type of large storage device used in older computer systems and you can think of it as a hard disk drive).