The Operating System. Chapter 6

Size: px
Start display at page:

Download "The Operating System. Chapter 6"

Transcription

1 The Operating System Machine Level Chapter 6 1

2 Contemporary Multilevel Machines A six-level l computer. The support method for each level is indicated below it.2

3 Operating System Machine a) Operating System is a program that, from the programmer s point of view, adds a variety of new instructions and features. b) Normally, operating system is implemented in software. c) Both the OSM and the ISA levels are abstract (software). 3

4 OSM and ISA a) The OSM level instruction set is the complete set of instructions available to application programmers. b) It contains all ISA level instructions plus the set of new instructions. c) The new instructions are called system calls. A system call invokes a predefined operating system service. d) The OSM level is always interpreted. 4

5 Operating System Machine Positioning of the operating system machine level. 5

6 Three Topics of OSM a) Virtual Memory a technique to make the machine appear to have more memory than it in reality has. b) File I/O a higher level concept of I/O instructions. c) Parallel Processing how multiple processes can execute, communicate, and synchronize. 6

7 Virtual Memory a) IBM 650 has only 2000 words of memory, PDP-1 only bit words. b) The traditional solution was the use of secondary memory, such as disk. Overlay management c) 1961, Manchester, England, a method proposed to perform the overlay process automatically Virtual Memory! d) By the early 1970s, virtual memory had become available on most computers. 7

8 Paging a) The idea of separating the concepts of address space and memory locations b) The technique for automatic overlaying is called paging g and the chucks of program read in from disk are called pages. c) Because the programmer can program as though paging did not exist, the paging mechanism is said to be transparent. d) The virtual machine provided by the operating system can provide the illusion that all the virtual addresses are backed up by real memory. Only operating system writers have to know how the illusion is supported. 8

9 Paging A mapping in which virtual addresses 4096 to 8191 are mapped A mapping in which virtual addresses 4096 to 8191 are mapped onto main memory addresses 0 to

10 Paging - Example a) The contents of main memory would be saved on disk b) Words 8192 to would be located on disk c) Words 8192 to would be loaded into main memory d) The address map would be changed to map addresses 8192 to onto memory locations 0 to 4096 e) Execution would continue as through h nothing unusual had happened. 10

11 Implementation of Paging The virtual address space is broken up into a number of equal-sized pages. Page sizes ranging from 512 to 64K bytes are common. Sizes as large as 4 MB are used occasionally. The page size is always a power of 2. The physical address space is broken up into pieces in a similar way, each piece being the size of a page. These pieces of main memory into which the pages go are called page frames. 11

12 Implementation of Paging Every computer with virtual memory has a device for doing the virtualto-physical mapping. This device is called the MMU (Memory Management Unit). It may be on the CPU chip, or it may be on a separate chip that works closely with the CPU chip. Since our sample MMU maps from a 32-bit virtual address to a 15-bit physical address, it needs a 32-bit input register and a 15-bit output register. 12

13 Implementation of Paging On the following slide, the MMU is presented with a 32-bit virtual address. It separates the address into a 20-bit virtual page number and a 12-bit offset within the page (because the pages are 4K). The virtual page number is used as an index into the page table to find the entry for the page referenced. In the example, the virtual page number is 3, so entry 3 of the page table is selected, as shown. The first thing the MMU does is check to see if the page referenced is in main memory. 13

14 Implementation of Paging Not all virtual pages can be in memory at once. The MMU makes this check by examining the present/absent bit in the page table entry. In the example, the bit is 1, meaning the page is currently in memory. Now, the page frame value from the selected entry (6 in this case) is copied into the upper 3 bits of the 15-bit output register. In parallel with this operation, the low-order 12-bits of the virtual address (the page offset field) are copied into the low-order 12 bits of the output register. 14

15 Implementation of fpaging (1) The first 64 KB of virtual address space divided into 16 pages, with each page being 4K. a) Indexing, indirect addressing may be used to generate this address. 15

16 Implementation of fpaging (2) A 32 KB main memory divided up into eight page frames of 4 KB each. 16

17 Implementation of Paging (3) Formation of a main memory address from a virtual address. 17

18 Demand Paging and the Working Set Model A possible mapping of the first 16 virtual pages onto a main memory with eight page frames. 18

19 Paging a) The alternative approach is based on the observation that most programs do not reference their address space uniformly but that the references tend to cluster on a small number of pages. Locality Principle b) At any instant time, there exists a set consisting of all the pages used dby the K most recent memory references. Working Set. 19

20 Page Replacement Policy a) When a program references a page that is not in main memory, the needed page must be fetched from the disk. Some other page will generally have to be sent back to the disk. b) Choosing a page to remove at random is not a good idea. c) One way is to make a prediction when the next reference to each page will occur and remove the page whose predicted next reference lies furthest in the future. d) Least Recently Used (LRU) algorithm evicts the page least recently used because the a priori probability of its not being in the current working set is high. 20

21 Page Replacement Policy Failure of the LRU algorithm. 21

22 Alternative Page Replacement Algorithm a) First-In First-Out (FIFO) algorithm removes the least recently loaded page, independent of when this page was last referenced. 22

23 Page Internal Fragmentation a) Internal Fragmentation waste: user s program and data happen not to fill an integral number of pages exactly, b) Using a small page size can minimize waste c) On the other hand, a small page size means many pages, as well as a large page table more registers, increased cost, and more time to load and save 23

24 Segmentation a) In many cases, have two or more separate virtual address spaces may be much better than having only one b) Segments many completely independent address spaces c) Each segment consists of a linear sequence of addresses. Different segments may have different lengths, and the lengths may change during execution. d) Because each segment constitutes a separate address space, different segments can grow or shrink independently, without affecting each other. 24

25 Segmentation (1) In a one dimensional address space with growing tables In a one-dimensional address space with growing tables, one table may bump into another. 25

26 Segmentation (2) A segmented memory allows each table to grow or shrink independently of the other tables. 26

27 Segmentation (3) Comparison of paging g and segmentation. 27

28 Implementation of Segmentation Segmentation can be implemented in one of two ways: swapping and paging. In the former, some set of segments are in memory at a given instant. If a reference to a segment not currently in memory, that segment is brought into memory. One or more segments may have to be written to the disk. This is like demand paging, but pages are fixed size and segments are not. External fragmentation can result because of this. 28

29 Implementation of Segmentation (1) (a) (d) Development of external fragmentation (a)-(d) Development of external fragmentation. (e) Removal of the external fragmentation by compaction. 29

30 Implementation of Segmentation The second approach is to divide each segment up into fixed size pages and demand page them. In this scheme, some of the pages of a segment may be in memory and others may not be. To page a segment, a separate page table is needed for each segment. Since a segment is just a linear address space, all the techniques we have seen so far for paging apply to each segment. The only new feature here is that each segment gets its own page table. 30

31 Implementation of Segmentation (2) Conversion of a two part MULTICS address Conversion of a two-part MULTICS address into a main memory address. 31

32 Virtual Memory on the Pentium 4 The Pentium 4 has a sophisticated virtual memory system that supports demand paging, pure segmentation, and segmentation with paging. The heart of the Pentium 4 virtual memory consists of two tables: the LDT (Local Descriptor Table) and the GDT (Global Descriptor Table). Each program has its own LDT, but there is a single GDT, shared by all programs. 32

33 Virtual Memory on the Pentium 4 The LDT describes segments local to each program, including its code, data, stack, and so on, whereas the GDT describes system segments, including the OS itself. To access a segment, a Pentium 4 program first loads a selector for that segment into one of the segment registers. Each selector is a 16-bit number. One of the selector bits tells whether the segment is local or global. Thirteen other bits specify the LDT or GDT entry number. The other 2 bits relate to protection. 33

34 Virtual Memory on the Pentium 4 Descriptor 0 is invalid and causes a trap if used. At the time a selector is loaded into a segment register, the corresponding descriptor is fetched from the LDT or GDT and stored in internal MMU registers so it can be accessed quickly. A descriptor consists of 8 bytes, including the segment s base address, size, and other information. The format of the selector makes locating the descriptor easy. First either LDT or GDT is selected, based on bit 2. Then the selector is copied to an MMU scratch register, and the 3 low-order bits are set to 0. 34

35 Virtual Memory on the Pentium 4 Now the address of either the LDT or GDT table (kept in internal MMU registers) is added to it, to give a direct pointer to the descriptor. A (selector, offset) pair is converted to a physical address. As soon as the hardware knows which segment register is being used, it can find the complete descriptor corresponding to that t selector in its internal registers. If the segment does not exist (selector 0) or is currently not in memory (P is 0), a trap occurs. 35

36 Virtual Memory on the Pentium 4 (1) A Pentium 4 selector. A Pentium 4 code segment descriptor. Data segments differ slightly. 36

37 Virtual Memory on the Pentium 4 It then checks to see if the offset is beyond the end of the segment, in which case a trap also occurs. If the G (Granularity) field is 0, the LIMIT field is the exact segment size in bytes, up to 1 MB. If it is 1, the LIMIT field gives the segment size in pages. The Pentium 4 page size is never smaller than 4 KB, so 20 bits is enough for segments up to 2 32 bytes. Assuming that the segment is in memory and the offset is in range, the Pentium 4 then adds the 32-bit BASE field in the descriptor to the offset to form a linear address. 37

38 Virtual Memory on the Pentium 4 (2) Conversion of a (selector, offset) pair to a linear address. 38

39 Virtual Memory on the Pentium 4 If paging is disabled (by a bit in a global control register), the linear address is interpreted as the physical address and sent to the memory to read or write. Thus, with paging disabled we have a pure segmentation scheme with each segment s base address given in its descriptor. If paging is enabled, the linear address is interpreted as a virtual address and mapped onto the physical address using page tables. A two-level mapping is used. 39

40 Virtual Memory on the Pentium 4 Each running program has a page directory consisting of bit entries. It is located at an address pointed to by a global register. Each entry points to a page table also containing bit entries. The page table entries point to page frames. To avoid making repeated references to memory, the Pentium 4 MMU has special hardware support to look up the most recently used DIR- PAGE combinations quickly. 40

41 Virtual Memory on the Pentium 4 (3) Mapping of a linear address onto a physical address. 41

42 Virtual Memory on the Pentium 4 If an application does not need segmentation, all segment registers can be set up with the same selector, whose descriptor has BASE = 0 and LIMIT set to the maximum. The Pentium 4 also supports four protection levels, with level 0 being the most privileged and level 3 the least. At each instant, a running program is at a certain level, indicated by a 2-bit field in its PSW (Program Status Word). Each segment also belongs to a certain level. l 42

43 Virtual Memory on the Pentium 4 (4) Protection ti on the Pentium 4. 43

44 Virtual Memory on the Pentium 4 As long as a program restricts itself to using segments at its own level, everything works fine. Attempts to access data at a higher level are permitted. Attempts to access data at a lower level are illegal and cause traps. 44

45 Virtual I/O Instructions a) Input/Output is one of the areas where the OSM and ISA levels differ considerably. b) Security reasons c) Doing I/O at the ISA level is extremely tedious and complex 45

46 Files a) One way of organizing the virtual I/O is to use an abstraction called a file. b) In its simplest form, a file consists of a sequence of bytes written to an I/O device. c) Different files have different lengths and other properties. (For example, files on a disk) The abstraction of a file allows virtual I/O to be organized in a simple way. 46

47 Files a) File I/O is done by system calls for opening, reading, writing, and closing files. b) The process of opening a file allows the operating system to locate the file on disk and bring into memory information necessary to access it. c) The read system call must have: An indication of which open file is to be read. A pointer to a buffer in memory in which to put the data. The number of bytes to be read. d) The read call puts the requested data in the buffer. 47

48 Files a) Mainframe operating systems have a more sophisticated definition of file A sequence of logical records, each with a well-defined structure. 48

49 Implementation of Virtual I/O Instructions (1) Reading a file consisting of logical records. (a) Before reading record 19. (b) After reading record

50 Implementation of Virtual I/O Instructions a) The allocation unit often consists of a block of consecutive sectors. b) A fundamental property of a file implementation is whether a file is stored in consecutive allocation units or not. 50

51 Implementation of Virtual I/O Instructions (2) Disk allocation strategies Disk allocation strategies. (a) A file in consecutive sectors. (b) A file not in consecutive sectors. 51

52 Implementation of Virtual I/O Instructions a) The operating system sees the file as an ordered, although not necessarily consecutive, collection of allocation units (on disk). b) A table, file index, is needed to locate any arbitrary byte or logical record, given the allocation units and their actual disk addresses. (used by UNIX) c) An alternative method of locating the allocation units of a file is to organize the file as a linked list. (used by MS-DOS and Windows 95/98) 52

53 Implementation of Virtual I/O Instructions a) Why do we need both consecutively allocated files and nonconsecutive allocated files? 53

54 Implementation of Virtual I/O Instructions a) In order to allocate space on the disk for a file, the operating system must keep track of which blocks are available, and which are already in use storing other files. b) One method consists of maintaining a list of all the holes, a hole being any number of contiguous allocation units. This list is called the free list. c) An alternative method is to maintain a bit map. If has the advantage of being constant in size compared with the free list. d) When any file on the disk is allocated and returned, the allocation list or table are updated. 54

55 Implementation of Virtual I/O Instructions (3) Two ways of keeping track of available sectors. (a) A free list. (b) A bit map. 55

56 Directory Management Instructions a) Information that is directly accessible to the computer without the need for human intervention is on-line line, as contrasted with off-line information. b) The usual way for an operating system to organize on-line files is to group them into directories. c) System calls provide Create a file and enter it in a directory Delete a file from a directory Rename a file Change the protection status of a file d) Tree of directories

57 Directory Management Instructions A user file directory and the contents of a

58 d) If only one processor available, the effect of parallel processing can be simulated by having the processor run each process in turn for a short time. Virtual Instructions for Parallel Processing a) Some computations can be most conveniently programmed for two or more cooperating processes running in parallel rather than for a single processor. Others can be divided into pieces, which can then be carried out in parallel to decrease the elapsed time required for the total computation. b) Physical limit (for subnanosecond computers) c) On a computer with more than on CPU each of several cooperating processes can be assigned to its own CPU (process simultaneously) l

59 Virtual Instructions for Parallel Processing (a) True parallel processing with multiple CPUs. (b) P ll l i i l t d b it hi (b) Parallel processing simulated by switching one CPU among three processes.

60 Process Creation a) Most modern operating systems allow processes to be created and terminated dynamically. b) The take full advantage, a system call to create a new process is needed to achieve parallel processing. c) In some cases, the creating (parent) process maintains partial or complete control over the created (child) process. d) Virtual instructions ti exist for a parent to stop, restart, t examine, and terminate its children. In other cases, once a process has been created, there is no way for the parent to forcibly stop, restart, t examine, or terminate it. Two processes run

61 Race Conditions (1) Use of a circular buffer.

62 Race Conditions (2) Parallel processing with a fatal race condition.

63 Race Conditions (3) Parallel processing with a fatal race condition.

64 Race Conditions (4) Parallel processing with a fatal race condition.

65 Race Conditions (5) Failure of the producer-consumer communication

66 Process Synchronization Using Semaphores (1) The effect of a semaphore operation.

67 Process Synchronization Using Semaphores (2) Parallel l processing using semaphores.

68 Process Synchronization Using Semaphores (3) Parallel l processing using semaphores.

69 Process Synchronization Using Semaphores (4) Parallel l processing using semaphores.

70 Critical Regions a) While the CPU protects itself against simultaneous use, the code that interacts with the other serially reusable resources cannot. b) Such code is called a critical region. c) If two tasks enter the same critical region simultaneously, a catastrophic error occur.

71 Semaphores a) The most common methods for protecting critical regions involves a special variable called a semaphore. b) A semaphore S is a memory location that t acts as a lock to protect critical regions. c) Two operations: wait P(S), signal V(S)

72 void P(int S) { while (S == true); S = true; } void V(int S) { S = false; } Semaphore is initialized to false.

73 Semaphores a) The wait operation suspends any program calling until the semaphore S is FALSE, whereas the signal operation sets the semaphore S to FALSE. b) Code that enters a critical region is bracketed by calls to wait and signal. This prevents more than one process from entering the critical region.

74 Process_1... P(S) critical region V(S)... Process_2... P(S) critical region V(S)...

75 Mailboxes and Semaphores a) Mailboxes can be used to implement semaphores is semaphore primitives iti are not provided d by the operating system. b) In this case, there is the added advantage that the pend instruction suspends the waiting process rather than actually waiting for the semaphore.

76 void P(int S) { int key = 0; pend(key, S); } void V(int S) { int key = 0; post(key, S); }

77 Counting Semaphores a) The P and V semaphores are called binary semaphores because they can take one of two values. b) Alternatively, a counting semaphore can be used to protect pools of resources, or to keep track of the number of free resources.

78 void P(int S) { S--; while(s < 0); } void V(int S) { S++; }

79 void MP(int R) /* multiple wait */ { P(S); /* lock counter */ R--; /* request a resource */ if (R < 0) /* none available? */ { } V(S); /* release counter */ P(T); /* wait for free resource */ } V(S); /* release counter */ void MV(int R) /* multiple l signal */ { P(S); /* lock counter */ R++; /* free resource */ if (R <= 0) V(T); else V(S); /* release counter */ }

80 Counting Semaphores a) The integer R keeps track of the number of free resources. Binary semaphore S protects R, and binary semaphore T is used to protect the pool of resources. b) The initial value of S is set to False, T to True, and R ),, to the number of available resources in the kernel.

81 OSM Level - ISA Level a) Virtual Memory b) Virtual I/O Instructions c) Virtual Instructions for Parallel Processing

82 UNIX (1) A rough breakdown of the UNIX system calls.

83 UNIX (2) The structure t of a typical UNIX system.

84 Windows XP The structure t of Windows XP.

85 UNIX Virtual Memory The address space of a single UNIX process.

86 Windows XP Virtual Memory The principal i Windows XP API calls for managing

87 UNIX Virtual I/O (1) The principal i UNIX file system calls.

88 UNIX Virtual I/O (2) A program fragment for copying a file using the UNIX system calls. This fragment is in C because Java hides the

89 UNIX Virtual I/O (3) Part of a typical UNIX directory system.

90 UNIX Virtual I/O (4) The principal i UNIX directory management calls.

91 Windows XP Virtual I/O (1) The principal Win32 API functions for file I/O.

92 Windows XP Virtual I/O (2) A program fragment for copying a file using the Windows XP API functions. This fragment is in C because Java hides the low-level system calls and we are trying to expose

93 Windows XP Virtual I/O (3) The principal Win32 API functions for directory management. The second column gives the nearest UNIX equivalent, when one exists.

94 Windows XP Virtual I/O (4) The Windows XP master file table.

95 UNIX Process Management (1) A process tree in UNIX.

96 UNIX Process Management (2) The principal i POSIX thread calls.

Today s class. Operating System Machine Level. Informationsteknologi. Friday, November 16, 2007 Computer Architecture I - Class 12 1

Today s class. Operating System Machine Level. Informationsteknologi. Friday, November 16, 2007 Computer Architecture I - Class 12 1 Today s class Operating System Machine Level Friday, November 16, 2007 Computer Architecture I - Class 12 1 Operating System Machine Friday, November 16, 2007 Computer Architecture I - Class 12 2 Paging

More information

The Operating System Machine Level

The Operating System Machine Level The Operating System Machine Level Wolfgang Schreiner Research Institute for Symbolic Computation (RISC-Linz) Johannes Kepler University Wolfgang.Schreiner@risc.uni-linz.ac.at http://www.risc.uni-linz.ac.at/people/schreine

More information

The Working Set. CS 355 Operating Systems. The Working Set. Working Set Model 3/27/18. Paging Algorithms and Segmentation

The Working Set. CS 355 Operating Systems. The Working Set. Working Set Model 3/27/18. Paging Algorithms and Segmentation CS 355 Operating Systems Paging Algorithms and 1 Processes exhibit locality of memory reference During any phase of execution, the process references only a relatively small fraction of its pages. The

More information

The Operating System Machine Level

The Operating System Machine Level The Operating System Machine Level Wolfgang Schreiner Research Institute for Symbolic Computation (RISC-Linz) Johannes Kepler University Wolfgang.Schreiner@risc.uni-linz.ac.at http://www.risc.uni-linz.ac.at/people/schreine

More information

Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is.

Memory Management. Chapter 4 Memory Management. Multiprogramming with Fixed Partitions. Ideally programmers want memory that is. Chapter 4 Memory Management Ideally programmers want memory that is Memory Management large fast non volatile 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms

More information

Modeling Page Replacement: Stack Algorithms. Design Issues for Paging Systems

Modeling Page Replacement: Stack Algorithms. Design Issues for Paging Systems Modeling Page Replacement: Stack Algorithms 7 4 6 5 State of memory array, M, after each item in reference string is processed CS450/550 Memory.45 Design Issues for Paging Systems Local page replacement

More information

MEMORY MANAGEMENT/1 CS 409, FALL 2013

MEMORY MANAGEMENT/1 CS 409, FALL 2013 MEMORY MANAGEMENT Requirements: Relocation (to different memory areas) Protection (run time, usually implemented together with relocation) Sharing (and also protection) Logical organization Physical organization

More information

Chapter 4 Memory Management. Memory Management

Chapter 4 Memory Management. Memory Management Chapter 4 Memory Management 4.1 Basic memory management 4.2 Swapping 4.3 Virtual memory 4.4 Page replacement algorithms 4.5 Modeling page replacement algorithms 4.6 Design issues for paging systems 4.7

More information

Part-A QUESTION BANK UNIT-III 1. Define Dynamic Loading. To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines

More information

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Advantages of Multi-level Page Tables

Outline. V Computer Systems Organization II (Honors) (Introductory Operating Systems) Advantages of Multi-level Page Tables Outline V22.0202-001 Computer Systems Organization II (Honors) (Introductory Operating Systems) Lecture 15 Memory Management (cont d) Virtual Memory March 30, 2005 Announcements Lab 4 due next Monday (April

More information

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory

Multi-Process Systems: Memory (2) Memory & paging structures: free frames. Memory & paging structures. Physical memory Multi-Process Systems: Memory (2) What we will learn A detailed description of various ways of organizing memory Discuss various memory-management techniques, including paging and segmentation To provide

More information

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts

Memory management. Last modified: Adaptation of Silberschatz, Galvin, Gagne slides for the textbook Applied Operating Systems Concepts Memory management Last modified: 26.04.2016 1 Contents Background Logical and physical address spaces; address binding Overlaying, swapping Contiguous Memory Allocation Segmentation Paging Structure of

More information

a process may be swapped in and out of main memory such that it occupies different regions

a process may be swapped in and out of main memory such that it occupies different regions Virtual Memory Characteristics of Paging and Segmentation A process may be broken up into pieces (pages or segments) that do not need to be located contiguously in main memory Memory references are dynamically

More information

Virtual Memory Outline

Virtual Memory Outline Virtual Memory Outline Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory Other Considerations Operating-System Examples

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and 64-bit Architectures Example:

More information

Chapter 8: Memory-Management Strategies

Chapter 8: Memory-Management Strategies Chapter 8: Memory-Management Strategies Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel 32 and

More information

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table

stack Two-dimensional logical addresses Fixed Allocation Binary Page Table Question # 1 of 10 ( Start time: 07:24:13 AM ) Total Marks: 1 LRU page replacement algorithm can be implemented by counter stack linked list all of the given options Question # 2 of 10 ( Start time: 07:25:28

More information

Process size is independent of the main memory present in the system.

Process size is independent of the main memory present in the system. Hardware control structure Two characteristics are key to paging and segmentation: 1. All memory references are logical addresses within a process which are dynamically converted into physical at run time.

More information

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES

CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES CHAPTER 8 - MEMORY MANAGEMENT STRATEGIES OBJECTIVES Detailed description of various ways of organizing memory hardware Various memory-management techniques, including paging and segmentation To provide

More information

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1

Memory Allocation. Copyright : University of Illinois CS 241 Staff 1 Memory Allocation Copyright : University of Illinois CS 241 Staff 1 Recap: Virtual Addresses A virtual address is a memory address that a process uses to access its own memory Virtual address actual physical

More information

Clock page algorithm. Least recently used (LRU) NFU algorithm. Aging (NFU + forgetting) Working set. Process behavior

Clock page algorithm. Least recently used (LRU) NFU algorithm. Aging (NFU + forgetting) Working set. Process behavior When a page fault occurs Page replacement algorithms OS 23 32 OS has to choose a page to evict from memory If the page has been modified, the OS has to schedule a disk write of the page The page just read

More information

CS6401- Operating System UNIT-III STORAGE MANAGEMENT

CS6401- Operating System UNIT-III STORAGE MANAGEMENT UNIT-III STORAGE MANAGEMENT Memory Management: Background In general, to rum a program, it must be brought into memory. Input queue collection of processes on the disk that are waiting to be brought into

More information

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t

Move back and forth between memory and disk. Memory Hierarchy. Two Classes. Don t Memory Management Ch. 3 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Memory Hierarchy Cache CPU Main Swap Area Memory

More information

Memory Management Ch. 3

Memory Management Ch. 3 Memory Management Ch. 3 Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ 1 Memory Hierarchy Cache RAM Disk Compromise between speed and cost. Hardware manages the cache. OS has to manage disk. Memory Manager Ë ¾¾ Ì Ï ÒÒØ Å ÔÔ ÓÐÐ

More information

CS450/550 Operating Systems

CS450/550 Operating Systems CS450/550 Operating Systems Lecture 4 memory Palden Lama Department of Computer Science CS450/550 Memory.1 Review: Summary of Chapter 3 Deadlocks and its modeling Deadlock detection Deadlock recovery Deadlock

More information

Chapter 8: Main Memory. Operating System Concepts 9 th Edition

Chapter 8: Main Memory. Operating System Concepts 9 th Edition Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

Chapters 9 & 10: Memory Management and Virtual Memory

Chapters 9 & 10: Memory Management and Virtual Memory Chapters 9 & 10: Memory Management and Virtual Memory Important concepts (for final, projects, papers) addressing: physical/absolute, logical/relative/virtual overlays swapping and paging memory protection

More information

Chapter 3 Memory Management: Virtual Memory

Chapter 3 Memory Management: Virtual Memory Memory Management Where we re going Chapter 3 Memory Management: Virtual Memory Understanding Operating Systems, Fourth Edition Disadvantages of early schemes: Required storing entire program in memory

More information

Chapter 3 - Memory Management

Chapter 3 - Memory Management Chapter 3 - Memory Management Luis Tarrataca luis.tarrataca@gmail.com CEFET-RJ L. Tarrataca Chapter 3 - Memory Management 1 / 222 1 A Memory Abstraction: Address Spaces The Notion of an Address Space Swapping

More information

Memory Management (Chaper 4, Tanenbaum)

Memory Management (Chaper 4, Tanenbaum) Memory Management (Chaper 4, Tanenbaum) Memory Mgmt Introduction The CPU fetches instructions and data of a program from memory; therefore, both the program and its data must reside in the main (RAM and

More information

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition

Chapter 7: Main Memory. Operating System Concepts Essentials 8 th Edition Chapter 7: Main Memory Operating System Concepts Essentials 8 th Edition Silberschatz, Galvin and Gagne 2011 Chapter 7: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure

More information

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Motivation. Memory Management. Memory Management. Computer Hardware Review

Motivation. Memory Management. Memory Management. Computer Hardware Review Memory Management Motivation Vera Goebel Department of Informatics, University of Oslo with slides from: C. Griwodz (Ifi/UiO), P. Halvorsen (Ifi/UiO), K. Li (Princeton), A. Tanenbaum (VU Amsterdam), and

More information

Page Size Page Size Design Issues

Page Size Page Size Design Issues Paging: design and implementation issues 1 Effect of page size More small pages to the same memory space References from large pages more probable to go to a page not yet in memory References from small

More information

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 8: MEMORY MANAGEMENT. By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 8: MEMORY MANAGEMENT By I-Chen Lin Textbook: Operating System Concepts 9th Ed. Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the

More information

Chapter 9 Memory Management

Chapter 9 Memory Management Contents 1. Introduction 2. Computer-System Structures 3. Operating-System Structures 4. Processes 5. Threads 6. CPU Scheduling 7. Process Synchronization 8. Deadlocks 9. Memory Management 10. Virtual

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Segmentation Paging Structure of the Page Table Example: The Intel

More information

Operating Systems, Fall Lecture 5 1. Overhead due to page table and internal fragmentation. Tbl 8.2 [Stal05] 4.

Operating Systems, Fall Lecture 5 1. Overhead due to page table and internal fragmentation. Tbl 8.2 [Stal05] 4. Paging: design and implementation issues Effect of page size More small pages to the same memory space References from large pages more probable to go to a page not yet in memory References from small

More information

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Operating Systems: Internals and Design Principles Chapter 8 Virtual Memory Seventh Edition William Stallings Modified by Rana Forsati for CSE 410 Outline Principle of locality Paging - Effect of page

More information

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France

Operating Systems Memory Management. Mathieu Delalandre University of Tours, Tours city, France Operating Systems Memory Management Mathieu Delalandre University of Tours, Tours city, France mathieu.delalandre@univ-tours.fr 1 Operating Systems Memory Management 1. Introduction 2. Contiguous memory

More information

Operating Systems, Fall Lecture 5 1

Operating Systems, Fall Lecture 5 1 Paging: design and implementation issues 1 Effect of page size More small pages to the same memory space References from large pages more probable to go to a page not yet in memory References from small

More information

CISC 7310X. C08: Virtual Memory. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/22/2018 CUNY Brooklyn College

CISC 7310X. C08: Virtual Memory. Hui Chen Department of Computer & Information Science CUNY Brooklyn College. 3/22/2018 CUNY Brooklyn College CISC 7310X C08: Virtual Memory Hui Chen Department of Computer & Information Science CUNY Brooklyn College 3/22/2018 CUNY Brooklyn College 1 Outline Concepts of virtual address space, paging, virtual page,

More information

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi

Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Embedded Systems Dr. Santanu Chaudhury Department of Electrical Engineering Indian Institute of Technology, Delhi Lecture - 13 Virtual memory and memory management unit In the last class, we had discussed

More information

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1

Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9 Memory Management Main Memory Operating system concepts. Sixth Edition. Silberschatz, Galvin, and Gagne 8.1 Chapter 9: Memory Management Background Swapping Contiguous Memory Allocation Segmentation

More information

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses.

Addresses in the source program are generally symbolic. A compiler will typically bind these symbolic addresses to re-locatable addresses. 1 Memory Management Address Binding The normal procedures is to select one of the processes in the input queue and to load that process into memory. As the process executed, it accesses instructions and

More information

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1 Memory Management Disclaimer: some slides are adopted from book authors slides with permission 1 CPU management Roadmap Process, thread, synchronization, scheduling Memory management Virtual memory Disk

More information

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition

Chapter 8: Virtual Memory. Operating System Concepts Essentials 2 nd Edition Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management

ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Memory Management ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Memory Management 1 Hardware background The role of primary memory Program

More information

Memory and multiprogramming

Memory and multiprogramming Memory and multiprogramming COMP342 27 Week 5 Dr Len Hamey Reading TW: Tanenbaum and Woodhull, Operating Systems, Third Edition, chapter 4. References (computer architecture): HP: Hennessy and Patterson

More information

Chapter 8 Virtual Memory

Chapter 8 Virtual Memory Chapter 8 Virtual Memory Contents Hardware and control structures Operating system software Unix and Solaris memory management Linux memory management Windows 2000 memory management Characteristics of

More information

Chapter 3: Important Concepts (3/29/2015)

Chapter 3: Important Concepts (3/29/2015) CISC 3595 Operating System Spring, 2015 Chapter 3: Important Concepts (3/29/2015) 1 Memory from programmer s perspective: you already know these: Code (functions) and data are loaded into memory when the

More information

Main Memory (Part I)

Main Memory (Part I) Main Memory (Part I) Amir H. Payberah amir@sics.se Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Main Memory 1393/8/5 1 / 47 Motivation and Background Amir

More information

MODERN OPERATING SYSTEMS. Chapter 3 Memory Management

MODERN OPERATING SYSTEMS. Chapter 3 Memory Management MODERN OPERATING SYSTEMS Chapter 3 Memory Management No Memory Abstraction Figure 3-1. Three simple ways of organizing memory with an operating system and one user process. Base and Limit Registers Figure

More information

Introduction to Virtual Memory Management

Introduction to Virtual Memory Management Introduction to Virtual Memory Management Minsoo Ryu Department of Computer Science and Engineering Virtual Memory Management Page X Demand Paging Page X Q & A Page X Memory Allocation Three ways of memory

More information

Memory Management (Chaper 4, Tanenbaum)

Memory Management (Chaper 4, Tanenbaum) Memory Management (Chaper 4, Tanenbaum) Copyright 1996 25 Eskicioglu and Marsland (and Prentice-Hall and Paul Lu) Memory Mgmt Introduction The CPU fetches instructions and data of a program from memory;

More information

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register

Memory Management. 3. What two registers can be used to provide a simple form of memory protection? Base register Limit Register Memory Management 1. Describe the sequence of instruction-execution life cycle? A typical instruction-execution life cycle: Fetches (load) an instruction from specific memory address. Decode the instruction

More information

Chapter 8: Virtual Memory. Operating System Concepts

Chapter 8: Virtual Memory. Operating System Concepts Chapter 8: Virtual Memory Silberschatz, Galvin and Gagne 2009 Chapter 8: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s

Chapter 8: Memory- Manage g me m nt n S tra r t a e t gie i s Chapter 8: Memory- Management Strategies Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2009/12/16

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Silberschatz, Galvin and Gagne 2005 Background Program/Code

More information

Virtual Memory I. Jo, Heeseung

Virtual Memory I. Jo, Heeseung Virtual Memory I Jo, Heeseung Today's Topics Virtual memory implementation Paging Segmentation 2 Paging Introduction Physical memory Process A Virtual memory Page 3 Page 2 Frame 11 Frame 10 Frame 9 4KB

More information

Module 8: Memory Management

Module 8: Memory Management Module 8: Memory Management Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts 8.1 Silberschatz and Galvin

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information

Memory management, part 3: outline

Memory management, part 3: outline Memory management, part 3: outline Segmentation Case studies o MULTICS o x86 (Pentium) o Unix o Linux o Windows 1 Segmentation Several address spaces per process a compiler needs segments for o source

More information

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition

Chapter 9: Virtual Memory. Operating System Concepts 9 th Edition Chapter 9: Virtual Memory Silberschatz, Galvin and Gagne 2013 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating

More information

Paging. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Paging. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Paging Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Virtual memory implementation Paging Segmentation 2 Paging (1) Paging Permits

More information

Virtual Memory 1. To do. q Segmentation q Paging q A hybrid system

Virtual Memory 1. To do. q Segmentation q Paging q A hybrid system Virtual Memory 1 To do q Segmentation q Paging q A hybrid system Address spaces and multiple processes IBM OS/360 Split memory in n parts (possible!= sizes) A process per partition Program Code Heap Operating

More information

Paging. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

Paging. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University Paging Jinkyu Jeong (jinkyu@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Today s Topics Virtual memory implementation Paging Segmentation 2 Paging (1) Paging Permits

More information

Announcement. Exercise #2 will be out today. Due date is next Monday

Announcement. Exercise #2 will be out today. Due date is next Monday Announcement Exercise #2 will be out today Due date is next Monday Major OS Developments 2 Evolution of Operating Systems Generations include: Serial Processing Simple Batch Systems Multiprogrammed Batch

More information

Background. Contiguous Memory Allocation

Background. Contiguous Memory Allocation Operating System Lecture 8 2017.5.9 Chapter 8 (Main Memory) Background Swapping Contiguous Memory Allocation Segmentation - Paging Memory Management Selection of a memory-management method for a specific

More information

Basic Memory Management

Basic Memory Management Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester 10/15/14 CSC 2/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it

More information

Chapter 8 & Chapter 9 Main Memory & Virtual Memory

Chapter 8 & Chapter 9 Main Memory & Virtual Memory Chapter 8 & Chapter 9 Main Memory & Virtual Memory 1. Various ways of organizing memory hardware. 2. Memory-management techniques: 1. Paging 2. Segmentation. Introduction Memory consists of a large array

More information

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2

6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 6 - Main Memory EECE 315 (101) ECE UBC 2013 W2 Acknowledgement: This set of slides is partly based on the PPTs provided by the Wiley s companion website (including textbook images, when not explicitly

More information

CS 143A - Principles of Operating Systems

CS 143A - Principles of Operating Systems CS 143A - Principles of Operating Systems Operating Systems - Review of content from midterm to final Prof. Nalini Venkatasubramanian nalini@ics.uci.edu Deadlocks System Model Resource allocation graph,

More information

Preview. Memory Management

Preview. Memory Management Preview Memory Management With Mono-Process With Multi-Processes Multi-process with Fixed Partitions Modeling Multiprogramming Swapping Memory Management with Bitmaps Memory Management with Free-List Virtual

More information

Memory management, part 3: outline

Memory management, part 3: outline Memory management, part 3: outline Segmentation Case studies o MULTICS o Pentium o Unix o Linux o Windows 1 Segmentation Several address spaces per process a compiler needs segments for o source text o

More information

CSE 120 Principles of Operating Systems

CSE 120 Principles of Operating Systems CSE 120 Principles of Operating Systems Spring 2018 Lecture 10: Paging Geoffrey M. Voelker Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L20 Virtual Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 Questions from last time Page

More information

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization

Memory management. Requirements. Relocation: program loading. Terms. Relocation. Protection. Sharing. Logical organization. Physical organization Requirements Relocation Memory management ability to change process image position Protection ability to avoid unwanted memory accesses Sharing ability to share memory portions among processes Logical

More information

Address spaces and memory management

Address spaces and memory management Address spaces and memory management Review of processes Process = one or more threads in an address space Thread = stream of executing instructions Address space = memory space used by threads Address

More information

CSE 120 Principles of Operating Systems Spring 2017

CSE 120 Principles of Operating Systems Spring 2017 CSE 120 Principles of Operating Systems Spring 2017 Lecture 12: Paging Lecture Overview Today we ll cover more paging mechanisms: Optimizations Managing page tables (space) Efficient translations (TLBs)

More information

Operating System Support

Operating System Support Operating System Support Objectives and Functions Convenience Making the computer easier to use Efficiency Allowing better use of computer resources Layers and Views of a Computer System Operating System

More information

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1

Basic Memory Management. Basic Memory Management. Address Binding. Running a user program. Operating Systems 10/14/2018 CSC 256/456 1 Basic Memory Management Program must be brought into memory and placed within a process for it to be run Basic Memory Management CS 256/456 Dept. of Computer Science, University of Rochester Mono-programming

More information

Operating Systems. Operating Systems Sina Meraji U of T

Operating Systems. Operating Systems Sina Meraji U of T Operating Systems Operating Systems Sina Meraji U of T Recap Last time we looked at memory management techniques Fixed partitioning Dynamic partitioning Paging Example Address Translation Suppose addresses

More information

Processes and Tasks What comprises the state of a running program (a process or task)?

Processes and Tasks What comprises the state of a running program (a process or task)? Processes and Tasks What comprises the state of a running program (a process or task)? Microprocessor Address bus Control DRAM OS code and data special caches code/data cache EAXEBP EIP DS EBXESP EFlags

More information

OPERATING SYSTEM. Chapter 9: Virtual Memory

OPERATING SYSTEM. Chapter 9: Virtual Memory OPERATING SYSTEM Chapter 9: Virtual Memory Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel Memory

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

VIRTUAL MEMORY. Operating Systems 2015 Spring by Euiseong Seo

VIRTUAL MEMORY. Operating Systems 2015 Spring by Euiseong Seo VIRTUAL MEMORY Operating Systems 2015 Spring by Euiseong Seo Today s Topics Virtual memory implementation Paging Segmentation Paging Permits the physical address space of a process to be noncontiguous

More information

Operating System Concepts

Operating System Concepts Chapter 9: Virtual-Memory Management 9.1 Silberschatz, Galvin and Gagne 2005 Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped

More information

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006 Operating Systems Comprehensive Exam Spring 2006 Student ID # 3/16/2006 You must complete all of part I (60%) You must complete two of the three sections in part II (20% each) In Part I, circle or select

More information

Segmentation (Apr 5 and 7, 2005)

Segmentation (Apr 5 and 7, 2005) Segmentation (Apr 5 and 7, 2005) Apr 5 and 7, 2005 1 Review of Memory Management Memory Hierarchy (capacity/speed tradeoff) E.g., Registers, Cache, RAM, Disk, Tape When we speak of memory management we

More information

Chapter 8: Memory Management

Chapter 8: Memory Management Chapter 8: Memory Management Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 8.2 Background Program must be brought into memory and placed

More information

Logical versus Physical Address Space

Logical versus Physical Address Space CHAPTER 8: MEMORY MANAGEMENT Background Logical versus Physical Address Space Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Operating System Concepts, Addison-Wesley 1994

More information

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems 3rd edition Uses content with permission from Assoc. Prof. Florin Fortis, PhD

OPERATING SYSTEMS. After A.S.Tanenbaum, Modern Operating Systems 3rd edition Uses content with permission from Assoc. Prof. Florin Fortis, PhD OPERATING SYSTEMS #8 After A.S.Tanenbaum, Modern Operating Systems 3rd edition Uses content with permission from Assoc. Prof. Florin Fortis, PhD MEMORY MANAGEMENT MEMORY MANAGEMENT The memory is one of

More information

Memory Management! How the hardware and OS give application pgms:" The illusion of a large contiguous address space" Protection against each other"

Memory Management! How the hardware and OS give application pgms: The illusion of a large contiguous address space Protection against each other Memory Management! Goals of this Lecture! Help you learn about:" The memory hierarchy" Spatial and temporal locality of reference" Caching, at multiple levels" Virtual memory" and thereby " How the hardware

More information

Virtual Memory Demand Paging. Virtual Memory Working Set Model

Virtual Memory Demand Paging. Virtual Memory Working Set Model Virtual Memory Demand Paging When a reference is made to an address on a page not present in main memory, it is called a page fault. The operating system must read in the required page from the disk, enter

More information

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions: Techno India Batanagar Department of Computer Science & Engineering Model Questions Subject Name: Operating System Multiple Choice Questions: Subject Code: CS603 1) Shell is the exclusive feature of a)

More information

CS420: Operating Systems

CS420: Operating Systems Virtual Memory James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Background Code needs to be in memory

More information

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University

Main Memory. CISC3595, Spring 2015 X. Zhang Fordham University Main Memory CISC3595, Spring 2015 X. Zhang Fordham University 1 Memory Management! Background!! Contiguous Memory Allocation!! Paging!! Structure of the Page Table!! Segmentation!! Example: The Intel Pentium

More information

Objectives and Functions Convenience. William Stallings Computer Organization and Architecture 7 th Edition. Efficiency

Objectives and Functions Convenience. William Stallings Computer Organization and Architecture 7 th Edition. Efficiency William Stallings Computer Organization and Architecture 7 th Edition Chapter 8 Operating System Support Objectives and Functions Convenience Making the computer easier to use Efficiency Allowing better

More information

Memory Management and Protection

Memory Management and Protection Part IV Memory Management and Protection Sadeghi, Cubaleska RUB 2008-09 Course Operating System Security Memory Management and Protection Main Memory Virtual Memory Roadmap of Chapter 4 Main Memory Background

More information