tailieunhanh - Lecture Operating system concepts - Lecture 12

This chapter is primarily concerned with issues surrounding file storage and access on the most common secondary-storage medium, the disk. We explore ways to structure file use, to allocate disk space, to recover freed space, to track the locations of data, and to interface other parts of the operating system to secondary storage. Performance issues are considered throughout the chapter. | CSC 322 Operating Systems Concepts Lecture - 13: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Virtual Memory lECTURE-13 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Programs require more memory than the growth in the size of memory. Example: VAX -4MB, for dozens of users , Microsoft suggest 512MB single user, Vista requires 1GB Swapping is too slow (100 Mbytes/sec disk transfer rate=>10 sec to swap out a 1 Gbyte program) What if we want to: Run the program which requires more memory than physical memory Keep multiple parts of multiple programs in the memory such that the accumulative size is much higher than physical memory Virtual Memory - The history lECTURE-13 3 Ahmed Mumtaz Mustehsan, CIIT, Islamabad How to do that? Overlays-programmer breaks program into pieces which are swapped in by overlay manager Ancient idea-not really . | CSC 322 Operating Systems Concepts Lecture - 13: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. (Chapter-3) Ahmed Mumtaz Mustehsan, CIIT, Islamabad 1 Chapter 3 Memory Management Virtual Memory lECTURE-13 Ahmed Mumtaz Mustehsan, CIIT, Islamabad 2 Programs require more memory than the growth in the size of memory. Example: VAX -4MB, for dozens of users , Microsoft suggest 512MB single user, Vista requires 1GB Swapping is too slow (100 Mbytes/sec disk transfer rate=>10 sec to swap out a 1 Gbyte program) What if we want to: Run the program which requires more memory than physical memory Keep multiple parts of multiple programs in the memory such that the accumulative size is much higher than physical memory Virtual Memory - The history lECTURE-13 3 Ahmed Mumtaz Mustehsan, CIIT, Islamabad How to do that? Overlays-programmer breaks program into pieces which are swapped in by overlay manager Ancient idea-not really accepted with open heart Too hard to do-programmer has to break up program Complex Time consuming Boring Error prone Soon realized that the job has to be done by computer the method adopted is called Virtual Memory Virtual Memory - The history lECTURE-13 4 Ahmed Mumtaz Mustehsan, CIIT, Islamabad Program’s address space is broken up into fixed size chunks called pages Pages are mapped to physical memory. Only few pages of the program are kept in memory, the rest are kept on disk. If instruction refers to a page in memory, fine. Otherwise OS gets the page, reads it in, and restarts the instruction. Many programs are in memory therefore while page is being read in, another process gets the CPU. Virtual Memory lECTURE-13 5 Ahmed Mumtaz Mustehsan, CIIT, Islamabad Virtual Memory lECTURE-13 6 Ahmed Mumtaz Mustehsan, CIIT, Islamabad Program generated addresses are called virtual addresses; virtual address space. Memory Management Unit: generates physical address from virtual address provided by the .