DOC PREVIEW
LSU CSC 4103 - Main Memory

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1CSC 4103 - Operating SystemsFall 2009Tevfik Ko!arLouisiana State UniversityOctober 22nd, 2009Lecture - XVIMain Memory - I2Roadmap• Midterm Discussion• Project 1 Discussion• Main Memory– Introduction– Contiguous Allocation– Dynamic Allocation Algorithms– Fragmentation– Address Binding– Address Protection3!The O/S must fit multiple processes in memory"memory needs to be subdivided to accommodate multiple processes"memory needs to be allocated to ensure a reasonable supply of ready processes so that the CPU is never idleFitting processes into memory is like fitting boxes into a fixed amount of space"memory management is an optimization task under constraintsMemory Management Requirements12Memory Allocation - contiguous• Fixed-partition allocation– Divide memory into fixed-size partitions– Each partition contains exactly one process– The degree of multi programming is bound by the number of partitions– When a process terminates, the partition becomes available for other processes#no longer in useOSprocess 5process 9process 2process 1013Memory Allocation (Cont.)• Variable-partition Scheme (Dynamic)– When a process arrives, search for a hole large enough for this process– Hole – block of available memory; holes of various size are scattered throughout memory– Allocate only as much memory as needed– Operating system maintains information about:a) allocated partitions b) free partitions (hole)OSprocess 5process 2OSprocess 5process 2OSprocess 5process 9process 2process 9process 1014Dynamic Storage-Allocation Problem• First-fit: Allocate the first hole that is big enough• Best-fit: Allocate the smallest hole that is big enough; must search entire list, unless ordered by size. Produces the smallest leftover hole.• Worst-fit: Allocate the largest hole; must also search entire list. Produces the largest leftover hole.How to satisfy a request of size n from a list of free holesFirst-fit and best-fit better than worst-fit in terms of speed and storage utilizationExample715Fragmentation• External Fragmentation – total memory space exists to satisfy a request, but it is not contiguous (in average ~50% lost)• Internal Fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used• Reduce external fragmentation by compaction– Shuffle memory contents to place all free memory together in one large block– Compaction is possible only if relocation is dynamic, and is done at execution time9Logical Address Space• Each process has a separate memory space• Two registers provide address protection between processes: • Base register: smallest legal address space• Limit register: size of the legal range10Address Binding• Addresses in a source program are generally symbolic – eg. int count;• A compiler binds these symbolic addresses to relocatable addresses– eg. 100 bytes from the beginning of this module• The linkage editor or loader will in turn bind the relocatable addresses to absolute addresses– eg. 74014 • Each binding is mapping from one address space to another11Memory-Management Unit (MMU)• Hardware device that maps virtual to physical address• In MMU scheme, the value in the relocation register (base register) is added to every address generated by a user process at the time it is sent to memory• The user program deals with logical addresses; it never sees the real physical addresses12HW Address Protection• CPU hardware compares every address generated in user mode with the registers• Any attempt to access other processes’ memory will be trapped and cause a fatal error13SummaryHmm..• Reading Assignment: Chapter 8 from Silberschatz.•Next Lecture: Continue with Main Memory• Main Memory– Contiguous Allocation– Dynamic Allocation Algorithms– Fragmentation– Address Binding– Address Protection14Acknowledgements• “Operating Systems Concepts” book and supplementary material by A. Silberschatz, P. Galvin and G. Gagne• “Operating Systems: Internals and Design Principles” book and supplementary material by W. Stallings• “Modern Operating Systems” book and supplementary material by A. Tanenbaum• R. Doursat and M. Yuksel from


View Full Document

LSU CSC 4103 - Main Memory

Download Main Memory
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Main Memory and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Main Memory 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?