Podcast
Questions and Answers
What is the view of a program represented in the diagram?
What is the view of a program represented in the diagram?
What is the purpose of a Segment Table?
What is the purpose of a Segment Table?
What is the term for the area of memory that is accessible by a program?
What is the term for the area of memory that is accessible by a program?
What is the relationship between a segment and the physical memory space?
What is the relationship between a segment and the physical memory space?
Signup and view all the answers
What is the term for a self-contained block of code that performs a specific task?
What is the term for a self-contained block of code that performs a specific task?
Signup and view all the answers
What is an example of a data structure used to store and organize variables?
What is an example of a data structure used to store and organize variables?
Signup and view all the answers
What is the primary advantage of using dynamic linking?
What is the primary advantage of using dynamic linking?
Signup and view all the answers
What is the main purpose of a backing store in swapping?
What is the main purpose of a backing store in swapping?
Signup and view all the answers
What is the term for storing the context or state of a process so that it can be reloaded when execution is resumed?
What is the term for storing the context or state of a process so that it can be reloaded when execution is resumed?
Signup and view all the answers
What is the average swap time if the transfer rate of the 10MB file to and from the memory is 40MB/sec and the average latency is 8ms?
What is the average swap time if the transfer rate of the 10MB file to and from the memory is 40MB/sec and the average latency is 8ms?
Signup and view all the answers
What is the purpose of the 'roll out, roll in' variant in swapping policy?
What is the purpose of the 'roll out, roll in' variant in swapping policy?
Signup and view all the answers
What is the primary benefit of using a fast disk as a backing store?
What is the primary benefit of using a fast disk as a backing store?
Signup and view all the answers
What is a limitation of flash memory in mobile systems?
What is a limitation of flash memory in mobile systems?
Signup and view all the answers
How does iOS handle low memory situations?
How does iOS handle low memory situations?
Signup and view all the answers
What is the purpose of the base register in contiguous memory allocation?
What is the purpose of the base register in contiguous memory allocation?
Signup and view all the answers
What is a characteristic of multiple-partition allocation?
What is a characteristic of multiple-partition allocation?
Signup and view all the answers
What happens to free partitions in multiple-partition allocation?
What happens to free partitions in multiple-partition allocation?
Signup and view all the answers
What is an example of static memory allocation?
What is an example of static memory allocation?
Signup and view all the answers
What is the purpose of the limit register in contiguous memory allocation?
What is the purpose of the limit register in contiguous memory allocation?
Signup and view all the answers
Why is swapping not typically used in mobile systems?
Why is swapping not typically used in mobile systems?
Signup and view all the answers
What is the physical memory address of 'b' or logical address 1?
What is the physical memory address of 'b' or logical address 1?
Signup and view all the answers
What is the purpose of the Translation Look-aside Buffers (TLB) in a paging system?
What is the purpose of the Translation Look-aside Buffers (TLB) in a paging system?
Signup and view all the answers
In a paging system, what is the number of bits in the logical address and physical address respectively for a logical address space of 64 pages of 1024 words each, mapped onto a physical memory of 32 frames?
In a paging system, what is the number of bits in the logical address and physical address respectively for a logical address space of 64 pages of 1024 words each, mapped onto a physical memory of 32 frames?
Signup and view all the answers
What is internal fragmentation in the context of paging?
What is internal fragmentation in the context of paging?
Signup and view all the answers
What is the function of the Page-Table Base Register (PTBR)?
What is the function of the Page-Table Base Register (PTBR)?
Signup and view all the answers
What is the page number and offset for the logical address 9467, given a page size of 1KB?
What is the page number and offset for the logical address 9467, given a page size of 1KB?
Signup and view all the answers
In a paging system, how many memory accesses are required to access data or instructions?
In a paging system, how many memory accesses are required to access data or instructions?
Signup and view all the answers
What is the number of pages and excess bytes required for a process of size 58,800 bytes, given a page size of 2,048 bytes?
What is the number of pages and excess bytes required for a process of size 58,800 bytes, given a page size of 2,048 bytes?
Signup and view all the answers
What is the purpose of the paging memory-management scheme?
What is the purpose of the paging memory-management scheme?
Signup and view all the answers
What is the size of each frame in paging?
What is the size of each frame in paging?
Signup and view all the answers
How is the physical memory address determined in a paging system?
How is the physical memory address determined in a paging system?
Signup and view all the answers
What is the page table used for in a paging system?
What is the page table used for in a paging system?
Signup and view all the answers
What is the purpose of breaking physical memory into frames?
What is the purpose of breaking physical memory into frames?
Signup and view all the answers
What is the size of the page table in the given example?
What is the size of the page table in the given example?
Signup and view all the answers
What is the logical address space in the given example?
What is the logical address space in the given example?
Signup and view all the answers
What is the purpose of the page offset in a paging system?
What is the purpose of the page offset in a paging system?
Signup and view all the answers
Study Notes
Dynamic Linking
- Uses shared libraries when compiling programs
- Useful for libraries
Swapping
- Mechanism where a process is swapped out of memory to a backing store
- Backing store: fast disk large enough to accommodate copies of all memory images for all users
- Must provide direct access to these memory images
- Roll out, roll in: variant in swapping policy
- Implemented in higher priority and low priority processes
Context Switch Time
- Involves storing the context or state of a process so that it can be reloaded when execution is resumed
- Example: transfer rate of a 10MB file to and from memory is 1/4 sec or 250 milliseconds
- Swap time: 258ms, swapping in and out: 516ms
Swapping on Mobile Systems
- Not typically supported due to:
- Flash memory based
- Small amount of space
- Limited number of write cycles
- Poor throughput between flash memory and CPU on mobile platform
- Instead, use other methods to free memory:
- iOS asks apps to voluntarily relinquish allocated memory
- Android terminates apps if low free memory, but first writes application state to flash for fast restart
Contiguous Memory Allocation
- Memory must accommodate user processes and the operating system
- 2 partitions of contiguous memory: resident OS and user process
- Lower memory: where the operating system is located
- High memory: for user processes
- Relocation registers used to protect user processes from each other and from changing operating-system code and data
- Base register contains value of smallest physical address
- Limit register contains range of logical addresses
- MMU maps logical address dynamically
Memory Mapping and Protection
- Hardware support for relocation and limit registers
Multiple Partition Allocation
- Multiple-partition allocation
- Degree of multiprogramming is limited by the number of partitions
- Variable-partition sizes for efficiency (sized to a given process’ needs)
- Hole: block of available memory; holes of various size are scattered throughout memory
- When a process arrives, it is allocated memory from a hole large enough to accommodate it
- Process exiting frees its partition, adjacent free partitions combined
- Operating system maintains information about:
- Allocated partitions
- Free partitions (hole)
Static and Dynamic Memory Allocation
- Static Memory Allocation: declaring variables before runtime
- Examples:
- Main program, procedure, function, method
- Object, local variables, global variables
- Common block, stack, symbol table, arrays
Segmentation
- Logical View of Segmentation:
- User space
- Physical memory space
- Segmentation:
- Main process
- Segment table
- Memory
- Segment size and address
Paging
- Memory-management scheme that permits the physical address space of a process to be noncontiguous
- Avoids external fragmentation
- Uses frames and pages
- Breaking physical memory into fixed-sized blocks called frames (size is a power of 2, between 512 bytes and 16 Mbytes)
- Breaking logical memory into blocks of the same size called pages
- Keeps track of all free frames
Paging: Address Translation Scheme
- Division of an address from the CPU:
- Page number (p) – used as an index into a page table which contains base address of each page in the physical memory
- Page offset (d) – combined with base address to define the physical memory address that is sent to the memory unit
Paging Hardware
- Hardware support for Paging
Paging Model of Logical and Physical Memory
- Example: logical memory has 4-byte page size and physical memory has 32 bytes (8 pages)
Free Frames
- Implementation of free frames before and after allocation
Page Table - Implementation
- PTBR (Page-Table Base Register) – points to the page table
- PTLR (Page Table Length Register) – specifies the size of the page table
- TLB (Translation Look-aside Buffers) - memory cache used to lessen the time to access a user memory location
- Also called Associative Memory
- Two Memory Accesses for data / instructions:
- Page table
- Data / instruction
Internal Fragmentation on Paging
- Example: page size = 2,048 (size = 2n), size of process = 58,800 bytes, no. of pages = 28 and excess bytes = 1,456
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Related Documents
Description
Learn about swapping mechanism in operating systems, including swapping policies and backing store. Also, understand dynamic linking and its application in shared libraries.