preview

LOCAL VS GLOBAL ALLOCATION POLLICIES The main issue occurs how the memory should be allocated and

Satisfactory Essays

LOCAL VS GLOBAL ALLOCATION POLLICIES The main issue occurs how the memory should be allocated and how the page is removed from the frames whenever a page fault occurs. There are two ways on the basis of which memory can be easily owed which page should be removed from the frame. I. Local Allocation policy: In this policy an age is assigned to each page as to keep the record of occurrence of that particular page. Whenever page fault occurs, the page that should be removed is decided among the rest of the pages of its own process. The least occurred page is removed, regardless of the fact if the other process has a least occurred page as compared to the page that has just been removed. The major disadvantage of this policy is that it wastes …show more content…

PAGE FAULTS 1. The hardware traps to the kernel and program counter is saved on the stack as to keep the track of the instructions. 2. Assembly code routine is started to save the information and variables from the general registers. 3. The operating system discovers that a page fault has occurred, and tries to discover which virtual page is needed. 4. Once the virtual address that caused the fault is known, the system checks to see if this address is valid and the protection consistent with the access. 5. If the page frame selected is dirty, the page is scheduled for transfer to the disk, and a context switch takes place. 6. When page frame is clean, operating system looks up the disk address where the needed page is, schedules a disk operation to bring it in. 7. When disk interrupt indicates page has arrived, page tables updated to reflect position, frame marked as being in normal state. 8. Faulting instruction backed up to state it had when it began and program counter reset to point to that instruction. 9. Faulting process scheduled, operating system returns to the (assembly language) routine that called it. 10. This routine reloads registers and other state information and returns to user space to continue execution, as if no fault had occurred. SEGMENTATION Problem 2: How to free the programmer from managing the expansion and contraction of tables? Solution: Segmentation is one of the ways of protecting memory. They are

Get Access