Introduction to Operating Systems

Size: px
Start display at page:

Download "Introduction to Operating Systems"

Transcription

1 Reading ICT106 Fundamentals of Computer Systems Topic 12 Introduction to Operating Systems Irvine (4 th Edition) Chapter bit MS-DOS Chapter 14 Disk Fundamentals Chapter 2 Section 2.3 IA-32 Memory management ICT 106 _Week 12_06 2 Objectives To understand the components and functions of an operating system To understand the resource allocation functions of an operating system To understand the mechanisms by which an operating system manages programs and processes Objectives To understand the mechanisms by which an operating system manages the CPU To understand the mechanisms by which an operating system manages memory ICT 106 _Week 12_06 3 ICT 106 _Week 12_06 4 1

2 An Operating System (OS) consists of a set of sophisticated, coordinated and cooperative programs which make the hardware useful by providing an interface to the user and other programs which require the use of the computer's resources. Not all computers need an OS, eg some simple embedded applications. In such applications, a program in ROM controls some system. (eg, a car's engine management system, microprocessor controlled home electronic devices, bank ATM s etc) ICT 106 _Week 12_06 5 ICT 106 _Week 12_06 6 Services provided by an Operating System The services provided by an operating system (OS) can be broken into the following categories: 1. User interface and User Management: commands, GUI etc., login/logout, accounting info, access control, account maintenance 2. I/O Management : I/O services, device management 3. File System Management - providing an abstract view of secondary storage to the user. Functions include device maintenance, volume maintenance, creation/deletion, backup/recovery 4. Process Management - the running of programs (note: the OS itself is a program). Process creation/deletion, loading, inter-process communication ICT 106 _Week 12_06 7 ICT 106 _Week 12_06 8 2

3 5. Memory Management - very important task of OS - even the most simple OS (where there is only 1 process so that process management is not really needed) has to perform memory management. Involves memory allocation, swapping, address translation. 6. CPU Management - interrupt handling, CPU scheduling. Mechanisms to call OS services (User Interface) Calls to operating systems by the user: these are directed through an interface provided by the OS (DOS command line, Windows - menus, icons, dialog boxes) the provision of the User Interface (UI) is another task of an OS: Character UI (CUI) or Graphical UI (GUI). Calls to the OS by user programs: User written programs making use of OS Services (via system calls - recall INT 21H) ICT 106 _Week 12_06 9 ICT 106 _Week 12_06 10 System Calls Calls to the system procedures/functions But the code which constitutes the system routines is not part of the collection of user files The code to be executed may already be sitting within memory At link time, appropriate address/references can be made provided address of system routines are known. INT 21h is an example of a system call for one particular OS. System calls are also called software interrupts and are generated by the CPU executing an INT n instruction. The INT instruction is essentially a fancy variant of the CALL instruction Major advantage over CALL instruction relates to software portability ICT 106 _Week 12_06 11 ICT 106 _Week 12_

4 Application programs contain calls to operating system services via software interrupts System software can be in physically different locations on different types of computers - don t need to know actual address of routine (eg. BIOS) Interrupt vectors provide the hooks (connections) between routines desired to be executed, and their actual location (you can check this by examining the IVT). ICT 106 _Week 12_06 13 Eg, using debug we can examine element 21h of the interrupt vector table, and then unassemble the instructions found at the address specified at element 21h Concept of software interrupt is reasonably standard for a wide range of operating systems: Macintosh, Unix, OS/2 Known as the TRAP instruction on some machines ICT 106 _Week 12_06 14 Cooking Services (I/O device Management) Every day common services Typical example is keyboard echo and backspace correction Done by software - two components: reading & writing Character buffering (interrupt routine) This OS preprocessing of characters before being received by an application program is known as cooked mode C's scanf function works in cooked mode, in which special chars are given special processing, eg, the BackSpace key which has ASCII value 8, is given special treatment, and a "backspace action" is performed. Prior to hitting the return key, user can revoke previously entered characters by using the BackSpace key ICT 106 _Week 12_06 15 ICT 106 _Week 12_

5 In cooked mode no input is considered final until the user hits the return key Also, user will have to hit the return key after typing a command, instead of getting instant response raw mode is without preprocessing C Example: getchar & getch Use online help in Borland C/C++ for further details Also, the device drivers which control the operation of the various devices and their communication with the processor File System A file is a named collection of related information. It is an abstraction provided to the user by an OS File system: part of the OS which manages files on secondary memory (eg, disk) Disks and associated hardware allow for reading and writing of sectors of information ICT 106 _Week 12_06 17 ICT 106 _Week 12_06 18 A single disk has two sides (surfaces). Each side is divided into tracks. Tracks are numbered: 0 (outermost), 1(the next one), 2, and so on. A track is divided into sectors. A sector is the smallest unit of information that can be transferred to/from a disk. The mapping from name, contents, size, creation date etc. of a file to the physical locations on a disk is handled and maintained by the file management system Implementation of file systems can be different for different OSs (even on the same computer) Sectors on a disc are accessed by specifying platter, side, track and sector within track. Easiest to deal with logical sector - all sectors on a disk aggregated into a single numbering system: 0, 1, 2, 3... ICT 106 _Week 12_06 19 ICT 106 _Week 12_

6 Different DOS services available for physical vs logical sector access (eg. absread (DOS) or DOS interrupt 25 ) Typical low level OS service provides for a number of sectors of information to be copied from/to memory to/from a disk Some OS do not provide to a user such low level access to disk, although the OS itself does this low level disk access all the time. File System Functions To allow users to create, update and delete their files (new, save, open, close, delete, rename, read, write etc.) To allow controlled access to other users files in order to share information, eg, read access, write access, execute access etc. To allow structuring of files in a manner appropriate for an application ICT 106 _Week 12_06 21 ICT 106 _Week 12_06 22 Management of secondary memory users need not worry where on disk the files are stored Device independence allow reference to files by logical names (symbolic) rather than having to use physical device names Provide backup and recovery facilities against system failures MS-DOS has an hierarchical, tree structured file system Top most level known as the root directory Some files are subdirectories (ie. data contents are essentially lists of the files contained within them) File descriptor: each file has a file descriptor (index entry) which contains information necessary to manage the file, ICT 106 _Week 12_06 23 ICT 106 _Week 12_

7 Information about a File File name Location on disk (address) File type, eg, text, object, binary, etc. File attributes (access rights), eg, read, write, execute, delete Current size Date and time file created/last modified Mapping of logical file name to a physical location on disk is achieved via a file directory File directory is like a symbol table contains the above information about each named file. ICT 106 _Week 12_06 25 ICT 106 _Week 12_06 26 Implementation of File System under DOS To look at the details of the DOS implementation, it is essential to know the consecutive disc sector allocation as follows: Boot record File allocation table (FAT) Directory index sectors File data clusters (cluster 2, 3,...) Sector 0: boot record - normally read into memory upon power up, containing some data - BIOS parameter block (BPB) and a small program boot loader program which reads in and begins executing OS ICT 106 _Week 12_06 27 ICT 106 _Week 12_

8 Some data contained in boot record includes: bytes per sector - bytes 0bh - 0ch sectors per cluster (a cluster is a set of consecutive sectors grouped to form one storage unit) - byte 0dh number of copies of file allocation table (usually 2 copies of FAT) - byte 10h FAT lists which clusters the files are stored in, and which clusters are currently unused and thus available for new files Two copies of FAT are stored on disk because if one of them gets corrupted, the other may be used to recover files. number of directory index entries (total number of files) - bytes 11h - 12h FAT size in sectors - bytes 16h - 17h ICT 106 _Week 12_06 29 ICT 106 _Week 12_06 30 Directory index entries (each 20h, 32bytes long) Location determined from size and number of copies of FAT (eg. 7 sectors, 2 copies => FAT 1-14 sectors) or (eg. 9 sectors, 2 copies => FAT 1-18 sectors) Directory index size: 224 entries * 32 bytes ==> 7168 bytes ==> 14 sectors Directory index: sectors 15 to 28 (for 7 sector FAT) Each entry contains following at the given byte offsets: b0..b7: Filename 8 chars. b8..ba: Extension 3 chars. bb: Attribute eg, read-only, hidden, system file, subdirectory, archive etc b1a:first cluster (2 bytes) Cluster 2 starts after directory index, and numbered consecutively from there, but remember to take into account number of sectors per cluster ICT 106 _Week 12_06 31 ICT 106 _Week 12_

9 Looking at contents of first cluster of file, will verify it corresponds to the data in the start of the corresponding file First cluster indicated in directory index, remaining clusters which constitute the file are contained in the File allocation table FAT is a linked list data structure: entry for kth cluster contains link pointing to (k+1) cluster of file Unix and many other modern file systems (from user point of view) are largely similar to MS-DOS although they have no or higher limits on length of file names. Some (& most new) allow 255 chars for filenames and have no concept of extension. ICT 106 _Week 12_06 33 ICT 106 _Week 12_06 34 Process Management Useful to have several user programs alternating in execution, eg, background printing, clock, network popup messages Known as multi-tasking - it gives the appearance that a computer is running several programs simultaneously CPU is still only executing one program at any one time, although several programs may exist in memory at any one time. CPU switches between the tasks very rapidly. Two simplest forms of multi-tasking Co-operative - eg. Windows (uses TaskSwitch functions) Time-sharing MS-DOS provides limited multitasking facilities (TSR) but the hardware itself is not the limiting factor - it is the OS ICT 106 _Week 12_06 35 ICT 106 _Week 12_

10 Process (or task as in multi-tasking) Fundamental to the concept of multitasking An instance of execution of a program - each instance is a process Could be same program code (eg. same code segment) but different data (eg. different data segments) Multiple processes Different programs - different code & data segments As examples, consider Windows - multiple instances of clock, notepad,... Unix facility ( & operator) to startup another program in the background ICT 106 _Week 12_06 37 ICT 106 _Week 12_06 38 Time sharing (CPU Scheduling) All code (programs) required to be executed is within memory or has to be brought into memory Executing Code + Data constitutes a Process States of a process: Active, Ready, Awaiting some action to complete (blocked) etc Active (running): a process is said to be active if it currently has the CPU Ready: a process is said to be in the ready state if it could use a CPU if one was available Blocked: a process is said to be in blocked state if it is waiting for some event to happen (eg, I/O transfer) before it can proceed ICT 106 _Week 12_06 39 ICT 106 _Week 12_

11 Process Table OS maintains tables of data concerning all processes Each process currently in the system is represented by a data structure (process descriptor) which contains relevant information about the process: Unique identification of the process, eg process name Current state of the process (i.e., running, ready, blocked/asleep) The process s priority Addresses of code & data associated with the process Area to save process s registers ICT 106 _Week 12_06 41 ICT 106 _Week 12_06 42 Linked list or queue of all processes More sophisticated OS support priorities, time sharing intervals (CPU scheduling) etc Timer interrupts allow OS to periodically take a look around and decide whether or not to switch control of the CPU to another process Time slice or quantum of execution is the basis for providing equity in time of execution of processes Round Robin the simplest scheduling policy. The CPU time is divided into time-slices. A real-time clock generates pulses at regular and frequent intervals (typically 1/100 second). At each pulse, the OS performs the following steps: ICT 106 _Week 12_06 43 ICT 106 _Week 12_

12 The currently active process is suspended OS checks the status of each process, in strict sequence, to see whether the process requires CPU time. The first process requiring CPU time gets its time slice When the end of the sequence is reached, the CPU returns to the start of the sequence and repeats the sequence again. Context switching the term used for switching the CPU between two processes Wait loop I/O is avoided - tasks requiring I/O use interrupt driven I/O while other tasks are given normal access to CPU Timer interrupt is absolutely essential otherwise OS has no opportunity to intervene and context switch. ICT 106 _Week 12_06 45 ICT 106 _Week 12_06 46 Context switches require OS to save the state of the currently executing process, and restoring the previous state of the task about to be switched into action Return from an interrupt is either to the same process OR to a different process upon a context switch Processes may end their turns before allocated time slice has ended by making a system call (eg. I/O access ==> I/O interrupt driven) Usually processes can be given a priority. The higher the priority the more time slices they can get. When interrupt driven I/O is combined with process priorities, the ability to put processes to sleep, actions of interdependent processes, etc, the scheduling or context switching algorithms can become quite complex ICT 106 _Week 12_06 47 ICT 106 _Week 12_

13 The most important concept to remember is as follows: The OS has no power whatsoever when a user program is executing. The OS cannot simply step in and stop a user program; either an I/O device interrupt, timer interrupt, or the user program (via system call) results in the user program relinquishing control of the CPU to the OS. Memory Management (MM) Memory Management (MM) is required for the effective use of a computer even for a single tasking OS (eg. to hold the OS and user program) For a multi-tasking OS, MM is absolutely essential. ICT 106 _Week 12_06 49 ICT 106 _Week 12_06 50 In a computer system which allows multiple programs to be run concurrently, memory must be divided/shared by the resident part of the operating system (some times called the resident monitor) and a number of user programs which may be running (ie. processes). It is the function of the OS to perform this task of Memory Management. Why do we want to run multiple programs concurrently? To make as efficient use of the computer resources (typically the CPU) as possible. The CPU should not be kept running idle waiting for something to happen. ICT 106 _Week 12_06 51 ICT 106 _Week 12_

14 Does the CPU actually stop running? The CPU goes through the fetch/execute cycle (FEC) from power up i.e. it runs something all the time. If there are no user programs to run, what is it running? Running the OS is poor use of CPU. User programs may not be running all the time. Such processes could be waiting for I/O - waiting for the user to process a key. Think of a word processor. Almost all of the word-processor s time is spent waiting for a key to be pressed. ICT 106 _Week 12_06 53 ICT 106 _Week 12_06 54 For a process to run, it must be in memory. We want to keep running as many processes as possible, which means we would need more memory One solution is to keep increasing memory by adding more RAM. Even though RAM is cheap these days, it still costs more than other solutions to the problem. Also, there is a limit to the amount of RAM that one can use - why is that? The size of the address bus puts an upper limit on amount of addressable memory. ICT 106 _Week 12_06 55 ICT 106 _Week 12_

15 Another solution is swapping. So instead of sitting in memory while waiting for an I/O event, the process is swapped to disk so that space in memory is made available for another process. Swapping is used with different schemes for carving up memory for the different processes that are running. The OS occupies a fixed portion of memory. The rest of memory is partitioned for use by the user processes. One scheme has been to use fixed size partitions: Memory is divided into a number of partitions of some fixed sizes (fixed equal sizes, or fixed unequal sizes). For the scheme with fixed unequal sized partitions, a process brought into memory is placed into the smallest partition that can contain the process (best fit). ICT 106 _Week 12_06 57 ICT 106 _Week 12_06 58 Another approach is to use variable size partitions: Fixed size memory partitions are wasteful in terms of computer memory. A process may be much smaller than the smallest available partition resulting in internal fragmentation. Also, a process may be too big to fit in any partition. Fixed sized partitioning is generally not used today Another approach is to use variable size partitions: A process is given only as much space as needed when it is brought into memory. When things first start out (i.e. in the beginning) this approach looks all right. ICT 106 _Week 12_06 59 ICT 106 _Week 12_

16 But over the life cycle of the MM technique, as processes terminate and other processes are spawned, little holes will develop in memory which are too small for any process to be slotted in. This is again wasting memory external fragmentation -because the amount of memory used up by these holes could be quite large. Another way to partition memory is to use fixed size small chunks of memory called frames. A program (process) is broken up into similar fixed size small chunks called pages. There is still wastage in this scheme but at most the wastage for each process is only a proportion of a frame. The OS maintains a list of available frames. ICT 106 _Week 12_06 61 ICT 106 _Week 12_06 62 Another advantage of this technique is that page frames need not be contiguous for a program to be loaded. This leads to better memory utilisation. To implement this scheme, the OS maintains a page table for each process. The table maps the process s page to the memory frames. Given a page number and relative address within the page, CPU hardware translates this to frame number and relative address using the page table. This technique for dealing with partitioned memory led to the development of virtual memory. Virtual Memory Virtual memory - the effective useable memory by user(s) and/or OS is larger than the main memory of the computer (actual RAM, core, internal,..) Extra memory and contents are swapped to/from disk from/to main memory Disk Swap area - special area (contiguous area) is created/allocated on the disk specifically for supporting this swapping Actual sectors allocated can affect performance ICT 106 _Week 12_06 63 ICT 106 _Week 12_

17 Virtual Address Space - is the range of useable virtual addresses Physical Address Space - actual physical addresses corresponding to existing memory What does the physical address space depend on? amount of memory (eg. I have 128 Mb of Ram)? number of bits making up the address (size of address bus)? Virtual memory support & disk swapping etc is transparent to the user User program does not normally need to consider memory management. But to make efficient use of resources, an understanding of the concepts is needed. External user can be aware of virtual memory being utilised because of flashing HDD light. Program may take extra time ICT 106 _Week 12_06 65 ICT 106 _Week 12_06 66 Note however, knowledge of virtual memory can greatly affect program efficiency (ie. more or less execution time) The maximum execution speed of a program running in a virtual memory environment can be at most equal but never exceed the execution speed of the same program running on the same hardware but with virtual memory turned off. Very often, a program running in a virtual memory system is slower. Paging and Paged Memory Physical memory is broken up into fixed size chunks called frames Each page is of the same size and typically 256-4K bytes ICT 106 _Week 12_06 67 ICT 106 _Week 12_

18 Example implementation 64k virtual address space with 16 4K pages Given any address ==> Page# Vaddress = 4bit page# + offset into page 16k of main memory with 4 4K page frames Given any main memory address ==> PageFrame# Paddress = 2 bit page frame# + page offset All pages cannot be in memory at any one time Page table provides mapping between pages and main memory/disk 1 bit flag: Page in memory or is not Several bits relating to location of page on disk (eg. could be logical sector number) Page frame # if in memory ICT 106 _Week 12_06 69 ICT 106 _Week 12_06 70 Vaddress access Split into Page# and PageOffset Go through page table to determine whether page in memory If not, read page from disk into a page frame in physical memory ( page fault --> interrupt) Get PageFrame# from table Paddress = PageFrame# +PageOffset Page replacement policy If all page frames are full and a required page not in memory? LRU - Least recently used page is a simple and most typical replacement policy Reuse the page frame which has been used least recently Thrashing is where a program generates page faults frequently and continuously ICT 106 _Week 12_06 71 ICT 106 _Week 12_

19 Segmentation Some details already addressed - we have actually used segments - (remember stack segment, data segment?) Segmentation in the Intel Pentium (the Pentium has hardware support for both paging and segmentation) Each virtual (logical) address consists of a 16 bit selector and a 32 bit offset. 2 bits of the selector deal with memory protection or privilege and the other 14 bits take part in addressing. Together with the offset, 46 bits can be used for addressing, giving virtual memory space of 2 46 = 64 Terabytes. Without segmentation, virtual memory space is 2 32 = 4 Gigabytes. The physical address space is also 4 Gbytes as the address bus is 32 bits wide ICT 106 _Week 12_06 73 ICT 106 _Week 12_06 74 Local & Global Descriptor tables are used to support virtual memory LDT local to a program describes its segments corresponding to code, data, stack, etc GDT shared by all programs, typically system segments including operating system itself Each selector has bits relating to table index, local/global, and privilege level Some of the crucial MM issues specific to 80x86 machines are as follows: 1. How can many processes run the same code? (Ans: through memory sharing) 2. Can one process be prevented from accidentally writing to memory belonging to another? (Ans: use virtual addressing) 3. What if the collective size of all processes & OS exceeds available memory? (Ans: virtual memory) ICT 106 _Week 12_06 75 ICT 106 _Week 12_

20 Memory Sharing (Issue 1) Segmented architecture of 80x86 is ideal for this Different processes can be allocated the same code segments, different data segments Virtual Addressing (Issue 2) In real mode 80x86 support 20bit addressing (00000H to FFFFFH = 1 MB) Address calculations typified by instruction address 16 * c(cs) + c(ip) ICT 106 _Week 12_06 77 ICT 106 _Week 12_06 78 In protected mode 80x86 machines support following bit addresses ==> 16 MB 386/486 (and later) - 32 bit addresses ==> (range: H to FFFFFFFFH) ==> can address up to 4 GB of RAM The OS maintains a Local Descriptor Table (LDT) for each program (task) it loads into memory. When a program is loaded, the OS puts appropriate values in the segment registers and physical segment addresses into the LDT. The values in the segment registers are used to index the LDT. Address calculations are typified by instruction address. An LDT entry contains other information too. The CS register shown below also contains other information too) LDT [ c(cs) ] + c(ip) OS also maintains a Global Descriptor Tables (GDT) in memory to store info about all processes in the system Notation LDT[n] means contents of nth entry of LDT ICT 106 _Week 12_06 79 ICT 106 _Week 12_

21 Entries in LDT are physical addresses (as well as other information), size of which is equal to address size of machine Other segments registers identical to CS: DS, SS, ES In protected mode, they do not contain segment address Instead they contain pointers (selectors) to entries in the LDT table Once segment address is calculated, offset calculations are same as before (add the two values) Even in protected mode, offsets are still 16bit for 286 machines, and segment size still restricted to max of 64k Protected mode for 386/486 (and later machines) have 32bit offsets, so a segment could fill entire memory space ICT 106 _Week 12_06 81 ICT 106 _Week 12_06 82 All registers (eg. IP, BX, BP...) are also 32bit and are called EIP, EBX, EBP,... etc Hardware has means to avoid slowdown in performance of continually having to read memory to access DT entries Virtual addressing refers to the fact that in protected mode, addresses only appear to have certain values. Any attempt to access addresses outside these values would cause memory violation. Physical addressing is the raw absolute address (continual mapping between virtual and physical addresses via selectors & DT entries). This is the address which is put on the address bus by the CPU. ICT 106 _Week 12_06 83 ICT 106 _Week 12_

22 Associated with each DT entry, is also a size which has been allocated for that selector (segment) If a process attempts to access memory outside the allocated segment, an interrupt will be generated. This addresses MM Issue 2 Memory management and allocation is performed by OS, memory protection is handled by hardware (ie. latter can t be done by OS, as it is not executing) Virtual addressing through the DT also allows for support of the concept of virtual memory (Issue 3) Virtual memory make use of the disk, and physically moves memory contents to/from physical memory from/to special regions on the disk (Disk swapping) ICT 106 _Week 12_06 85 ICT 106 _Week 12_06 86 DT entries also contain a present bit which indicates whether or not the segment is physically in memory or needs to be first read from the disk into memory In reading a segment from the disk to memory, if there is not enough physical memory space, a segment in memory may first be required to be saved to disk, with the present bit being changed appropriately Handled by hardware, which generates an interrupt, allow user program to be temporarily suspended while operating system loads a segment from the disk Normally, support of this is completely transparent to the user. Note: Understand the general concepts only - no need to be able to implement any of these details. ICT 106 _Week 12_06 87 ICT 106 _Week 12_

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

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

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

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. 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 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 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

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

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

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

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

CS609 Final Term Solved MCQs with References Without Repetitions 14/02/2013

CS609 Final Term Solved MCQs with References Without Repetitions 14/02/2013 1 CS609 Final Term Solved MCQs with References Without Repetitions 14/02/2013 In BPB, root directory is saved in. (BIOS parameter block) Cluster#0 Cluster#1 (Ref) Cluster#2 Cluster#3 In NTFS, total sizes

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

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

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

SHANDONG UNIVERSITY 1

SHANDONG UNIVERSITY 1 Chapter 8 Main Memory SHANDONG UNIVERSITY 1 Contents Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium SHANDONG UNIVERSITY 2 Objectives

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 8 Main Memory

Chapter 8 Main Memory COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 8 Main Memory Zhi Wang Florida State University Contents Background Swapping Contiguous memory allocation Paging Segmentation OS examples

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

Chapter 9: Virtual-Memory

Chapter 9: Virtual-Memory Chapter 9: Virtual-Memory Management Chapter 9: Virtual-Memory Management Background Demand Paging Page Replacement Allocation of Frames Thrashing Other Considerations Silberschatz, Galvin and Gagne 2013

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

The Operating System. Chapter 6

The Operating System. Chapter 6 The Operating System Machine Level Chapter 6 1 Contemporary Multilevel Machines A six-level l computer. The support method for each level is indicated below it.2 Operating System Machine a) Operating System

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2017 Lecture 23 Virtual memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Is a page replaces when

More information

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018 CSE 4/521 Introduction to Operating Systems Lecture 27 (Final Exam Review) Summer 2018 Overview Objective: Revise topics and questions for the final-exam. 1. Main Memory 2. Virtual Memory 3. Mass Storage

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

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed.

CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. CHAPTER 11: IMPLEMENTING FILE SYSTEMS (COMPACT) By I-Chen Lin Textbook: Operating System Concepts 9th Ed. File-System Structure File structure Logical storage unit Collection of related information File

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

CS3600 SYSTEMS AND NETWORKS

CS3600 SYSTEMS AND NETWORKS CS3600 SYSTEMS AND NETWORKS NORTHEASTERN UNIVERSITY Lecture 11: File System Implementation Prof. Alan Mislove (amislove@ccs.neu.edu) File-System Structure File structure Logical storage unit Collection

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

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

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

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

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory Chapter 9: Virtual Memory Chapter 9: Virtual Memory 9.1 Background 9.2 Demand Paging 9.3 Copy-on-Write 9.4 Page Replacement 9.5 Allocation of Frames 9.6 Thrashing 9.7 Memory-Mapped Files 9.8 Allocating

More information

Computer Organization and Architecture. OS Objectives and Functions Convenience Making the computer easier to use

Computer Organization and Architecture. OS Objectives and Functions Convenience Making the computer easier to use Computer Organization and Architecture Chapter 8 Operating System Support 1. Processes and Scheduling 2. Memory Management OS Objectives and Functions Convenience Making the computer easier to use Efficiency

More information

Chapter 8 Memory Management

Chapter 8 Memory Management Chapter 8 Memory Management Da-Wei Chang CSIE.NCKU Source: Abraham Silberschatz, Peter B. Galvin, and Greg Gagne, "Operating System Concepts", 9th Edition, Wiley. 1 Outline Background Swapping Contiguous

More information

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18

PROCESS VIRTUAL MEMORY. CS124 Operating Systems Winter , Lecture 18 PROCESS VIRTUAL MEMORY CS124 Operating Systems Winter 2015-2016, Lecture 18 2 Programs and Memory Programs perform many interactions with memory Accessing variables stored at specific memory locations

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

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 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

More information

File System: Interface and Implmentation

File System: Interface and Implmentation File System: Interface and Implmentation Two Parts Filesystem Interface Interface the user sees Organization of the files as seen by the user Operations defined on files Properties that can be read/modified

More information

CS399 New Beginnings. Jonathan Walpole

CS399 New Beginnings. Jonathan Walpole CS399 New Beginnings Jonathan Walpole Memory Management Memory Management Memory a linear array of bytes - Holds O.S. and programs (processes) - Each cell (byte) is named by a unique memory address Recall,

More information

Memory Management. Dr. Yingwu Zhu

Memory Management. Dr. Yingwu Zhu Memory Management Dr. Yingwu Zhu Big picture Main memory is a resource A process/thread is being executing, the instructions & data must be in memory Assumption: Main memory is infinite Allocation of memory

More information

3.1 (a) The Main Features of Operating Systems

3.1 (a) The Main Features of Operating Systems Chapter 3.1 The Functions of Operating Systems 3.1 (a) The Main Features of Operating Systems The operating system (OS) must provide and manage hardware resources as well as provide an interface between

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

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

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

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition

Chapter 8: Memory- Management Strategies. Operating System Concepts 9 th Edition Chapter 8: Memory- Management Strategies Operating System Concepts 9 th Edition Silberschatz, Galvin and Gagne 2013 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation

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

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure.

File Systems. OS Overview I/O. Swap. Management. Operations CPU. Hard Drive. Management. Memory. Hard Drive. CSI3131 Topics. Structure. File Systems I/O Management Hard Drive Management Virtual Memory Swap Memory Management Storage and I/O Introduction CSI3131 Topics Process Management Computing Systems Memory CPU Peripherals Processes

More information

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition

Chapter 8: Memory Management. Operating System Concepts with Java 8 th Edition Chapter 8: Memory Management 8.1 Silberschatz, Galvin and Gagne 2009 Background Program must be brought (from disk) into memory and placed within a process for it to be run Main memory and registers are

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

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management

8.1 Background. Part Four - Memory Management. Chapter 8: Memory-Management Management Strategies. Chapter 8: Memory Management Part Four - Memory Management 8.1 Background Chapter 8: Memory-Management Management Strategies Program must be brought into memory and placed within a process for it to be run Input queue collection of

More information

Processes and Non-Preemptive Scheduling. Otto J. Anshus

Processes and Non-Preemptive Scheduling. Otto J. Anshus Processes and Non-Preemptive Scheduling Otto J. Anshus Threads Processes Processes Kernel An aside on concurrency Timing and sequence of events are key concurrency issues We will study classical OS concurrency

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

With regard to operating systems the kernel consists of the most frequently used functions in the operating system and it kept in main memory.

With regard to operating systems the kernel consists of the most frequently used functions in the operating system and it kept in main memory. CS 320 Ch 8 Operating Systems An operating system controls execution of applications and acts as an interface between the user and the computer. A typical OS provides the following services: Program Creation

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

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015

Operating Systems. 09. Memory Management Part 1. Paul Krzyzanowski. Rutgers University. Spring 2015 Operating Systems 09. Memory Management Part 1 Paul Krzyzanowski Rutgers University Spring 2015 March 9, 2015 2014-2015 Paul Krzyzanowski 1 CPU Access to Memory The CPU reads instructions and reads/write

More information

Chapter 8: Main Memory

Chapter 8: Main Memory Chapter 8: Main Memory Operating System Concepts 8 th Edition,! Silberschatz, Galvin and Gagne 2009! Chapter 8: Memory Management Background" Swapping " Contiguous Memory Allocation" Paging" Structure

More information

Chapter 8: Main Memory

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

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 L17 Main Memory Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ Was Great Dijkstra a magician?

More information

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging

Chapter 8: Memory Management. Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging Chapter 8: Memory Management Background Swapping Contiguous Allocation Paging Segmentation Segmentation with Paging 1 Background Memory management is crucial in better utilizing one of the most important

More information

Operating Systems Unit 6. Memory Management

Operating Systems Unit 6. Memory Management Unit 6 Memory Management Structure 6.1 Introduction Objectives 6.2 Logical versus Physical Address Space 6.3 Swapping 6.4 Contiguous Allocation Single partition Allocation Multiple Partition Allocation

More information

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358

Memory Management. Reading: Silberschatz chapter 9 Reading: Stallings. chapter 7 EEL 358 Memory Management Reading: Silberschatz chapter 9 Reading: Stallings chapter 7 1 Outline Background Issues in Memory Management Logical Vs Physical address, MMU Dynamic Loading Memory Partitioning Placement

More information

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium

Outlook. Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium Main Memory Outlook Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table Segmentation Example: The Intel Pentium 2 Backgound Background So far we considered how to share

More information

IA32 Intel 32-bit Architecture

IA32 Intel 32-bit Architecture 1 2 IA32 Intel 32-bit Architecture Intel 32-bit Architecture (IA32) 32-bit machine CISC: 32-bit internal and external data bus 32-bit external address bus 8086 general registers extended to 32 bit width

More information

Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space

Chapter 9: Virtual Memory. Chapter 9: Virtual Memory. Objectives. Background. Virtual-address address Space 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 Other Considerations

More information

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on Chapter 1: Introduction Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Objectives To describe the basic organization of computer systems To provide a grand tour of the major

More information

Chapter 9: Virtual Memory

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

More information

Chapter 9: Virtual Memory

Chapter 9: Virtual Memory 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 Other Considerations

More information

Chapter 5. File and Memory Management

Chapter 5. File and Memory Management K. K. Wagh Polytechnic, Nashik Department: Information Technology Class: TYIF Sem: 5G System Subject: Operating Name of Staff: Suyog S.Dhoot Chapter 5. File and Memory Management A. Define file and explain

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

Optimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs

Optimal Algorithm. Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs Optimal Algorithm Replace page that will not be used for longest period of time Used for measuring how well your algorithm performs page 1 Least Recently Used (LRU) Algorithm Reference string: 1, 2, 3,

More information

File Management By : Kaushik Vaghani

File Management By : Kaushik Vaghani File Management By : Kaushik Vaghani File Concept Access Methods File Types File Operations Directory Structure File-System Structure File Management Directory Implementation (Linear List, Hash Table)

More information

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS)

Segmentation with Paging. Review. Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Segmentation with Page (MULTICS) Review Segmentation Segmentation Implementation Advantage of Segmentation Protection Sharing Segmentation with Paging Segmentation with Paging Segmentation with Paging Reason for the segmentation with

More information

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23

FILE SYSTEMS. CS124 Operating Systems Winter , Lecture 23 FILE SYSTEMS CS124 Operating Systems Winter 2015-2016, Lecture 23 2 Persistent Storage All programs require some form of persistent storage that lasts beyond the lifetime of an individual process Most

More information

First-In-First-Out (FIFO) Algorithm

First-In-First-Out (FIFO) Algorithm First-In-First-Out (FIFO) Algorithm Reference string: 7,0,1,2,0,3,0,4,2,3,0,3,0,3,2,1,2,0,1,7,0,1 3 frames (3 pages can be in memory at a time per process) 15 page faults Can vary by reference string:

More information

Operating Systems Design Exam 2 Review: Spring 2011

Operating Systems Design Exam 2 Review: Spring 2011 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu 1 Question 1 CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

More information

CS 416: Opera-ng Systems Design March 23, 2012

CS 416: Opera-ng Systems Design March 23, 2012 Question 1 Operating Systems Design Exam 2 Review: Spring 2011 Paul Krzyzanowski pxk@cs.rutgers.edu CPU utilization tends to be lower when: a. There are more processes in memory. b. There are fewer processes

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

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

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1

Introduction to OS. File Management. MOS Ch. 4. Mahmoud El-Gayyar. Mahmoud El-Gayyar / Introduction to OS 1 Introduction to OS File Management MOS Ch. 4 Mahmoud El-Gayyar elgayyar@ci.suez.edu.eg Mahmoud El-Gayyar / Introduction to OS 1 File Management Objectives Provide I/O support for a variety of storage device

More information

Older geometric based addressing is called CHS for cylinder-head-sector. This triple value uniquely identifies every sector.

Older geometric based addressing is called CHS for cylinder-head-sector. This triple value uniquely identifies every sector. Review: On Disk Structures At the most basic level, a HDD is a collection of individually addressable sectors or blocks that are physically distributed across the surface of the platters. Older geometric

More information

CS 3733 Operating Systems:

CS 3733 Operating Systems: CS 3733 Operating Systems: Topics: Memory Management (SGG, Chapter 08) Instructor: Dr Dakai Zhu Department of Computer Science @ UTSA 1 Reminders Assignment 2: extended to Monday (March 5th) midnight:

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

Chapter 4. File Systems. Part 1

Chapter 4. File Systems. Part 1 Chapter 4 File Systems Part 1 1 Reading Chapter 4: File Systems Chapter 10: Case Study 1: Linux (& Unix) 2 Long-Term Storage of Information Must store large amounts of data Information must survive the

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

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

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit

Performance of Various Levels of Storage. Movement between levels of storage hierarchy can be explicit or implicit Memory Management All data in memory before and after processing All instructions in memory in order to execute Memory management determines what is to be in memory Memory management activities Keeping

More information

Virtual Memory. control structures and hardware support

Virtual Memory. control structures and hardware support Virtual Memory control structures and hardware support 1 Hardware and Control Structures Memory references are dynamically translated into physical addresses at run time A process may be swapped in and

More information

12: Memory Management

12: Memory Management 12: Memory Management Mark Handley Address Binding Program goes through multiple steps from compilation to execution. At some stage, addresses in the program must be bound to physical memory addresses:

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

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

UNIT III MEMORY MANAGEMENT

UNIT III MEMORY MANAGEMENT UNIT III MEMORY MANAGEMENT TOPICS TO BE COVERED 3.1 Memory management 3.2 Contiguous allocation i Partitioned memory allocation ii Fixed & variable partitioning iii Swapping iv Relocation v Protection

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

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University

COS 318: Operating Systems. Overview. Prof. Margaret Martonosi Computer Science Department Princeton University COS 318: Operating Systems Overview Prof. Margaret Martonosi Computer Science Department Princeton University http://www.cs.princeton.edu/courses/archive/fall11/cos318/ Announcements Precepts: Tue (Tonight)!

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

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 8: MEMORY MANAGEMENT Chapter 8: Memory Management Background Swapping Contiguous Memory Allocation Paging Structure of the

More information

Operating Systems. Memory Management. Lecture 9 Michael O Boyle

Operating Systems. Memory Management. Lecture 9 Michael O Boyle Operating Systems Memory Management Lecture 9 Michael O Boyle 1 Memory Management Background Logical/Virtual Address Space vs Physical Address Space Swapping Contiguous Memory Allocation Segmentation Goals

More information

Chapter 8: Memory Management Strategies

Chapter 8: Memory Management Strategies Chapter 8: Memory- Management Strategies, Silberschatz, Galvin and Gagne 2009 Chapter 8: Memory Management Strategies Background Swapping Contiguous Memory Allocation Paging Structure of the Page Table

More information