COS 122 Operating Systems Tutorial 6 Exercises PDF

Summary

This document contains exercises on operating systems, focusing on memory management concepts such as the buddy system, dynamic partitioning, and paging. The exercises involve calculations and diagram analysis. The exercises are part of a tutorial for a computer science course (COS 122) at the University of Pretoria.

Full Transcript

Department of Computer Science COS 122 Operating Systems Tutorial 6 Exercises: Chapter 7 Exercises 1. Consider a system with 128KB of memory, initially empty. Requests are received for blocks of memory of 5K, 25K, 35K, and 20K. Show how the budd...

Department of Computer Science COS 122 Operating Systems Tutorial 6 Exercises: Chapter 7 Exercises 1. Consider a system with 128KB of memory, initially empty. Requests are received for blocks of memory of 5K, 25K, 35K, and 20K. Show how the buddy system would deal with each request, showing the memory layout at each stage. 2. The following diagram shows an example of memory configuration under dynamic partitioning, after a number of placement and swapping-out operations have been carried out. Addresses go from left to right; grey areas indicate blocks occupied by processes; white areas indicate free memory blocks. The last process placed is 2 Mbytes and is marked with an X. Only one process was swapped out after that. COS 122 Operating Systems 1 26 September 2023 a. What was the maximum size of the swapped-out process? b. What was the size of the free block just before it was partitioned by X? c. A new 3-Mbyte allocation request must be satisfied next. Indicate the intervals of memory where a partition will be created for the new process under the following four placement algorithms: best-fit, first- fit, next-fit, and worst-fit. For each algorithm, draw a horizontal segment under the memory strip and label it clearly. 3. Consider a computer system that uses paging with a page size of 4 KB. The logical address space for a process is 64 MB, and the physical memory size is 256 MB. a. Determine the total number of bits in the logical address. b. Calculate the number of bits required for the page number and the number of bits for the page offset. c. Find the total number of pages in the logical address space. d. Determine the maximum number of page frames available in the physical memory. COS 122 Operating Systems 2 26 September 2023

Use Quizgecko on...
Browser
Browser