Operating system revision, Study notes of Operating Systems

Very important Operating system questions and answers

Typology: Study notes

2022/2023

Available from 05/30/2023

michael-medhat
michael-medhat 🇪🇬

3 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems 1 Revision Sheet Part 1-2
Answers
Topic 1: Introduction
1.1 What are the operating system goals?
• Execute user programs and make solving user problems easier.
• Make the computer system convenient to use.
• Use the computer hardware in an efficient manner.
1.2 What are the four components of the computer system?
Hardware – provides basic computing resources
- CPU, memory, I/O devices
Operating system
- Controls and coordinates use of hardware among various
applications and users.
Application programs – define the ways in which the system
resources are used to solve the computing problems of the users
- Word processors, compilers, web browsers, database systems,
video games.
Users
- People, machines, other computers.
1.3 What is the bootstrap program function?
bootstrap program is loaded at power-up or reboot.
• Typically stored in ROM or EPROM, generally known as
firmware
• Initializes all aspects of the system
• Loads operating system kernel and starts execution
1.4 What is the Operating System Definition?
The Operating System (OS) acts as a mediator between a
computer user and the hardware. It manages all resources, decides
.. ةدابع كتركاذ
م
..ةينلا صلخاف
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Operating system revision and more Study notes Operating Systems in PDF only on Docsity!

Operating Systems 1 Revision Sheet Part 1- 2

Answers

➢ Topic 1: Introduction

1.1 What are the operating system goals?

  • Execute user programs and make solving user problems easier.
  • Make the computer system convenient to use.
  • Use the computer hardware in an efficient manner. 1.2 What are the four components of the computer system?
  • Hardware – provides basic computing resources
  • CPU, memory, I/O devices
  • Operating system
  • Controls and coordinates use of hardware among various applications and users.
  • Application programs – define the ways in which the system resources are used to solve the computing problems of the users
  • Word processors, compilers, web browsers, database systems, video games.
  • Users
  • People, machines, other computers. 1.3 What is the bootstrap program function? bootstrap program is loaded at power-up or reboot.
  • Typically stored in ROM or EPROM, generally known as firmware
  • Initializes all aspects of the system
  • Loads operating system kernel and starts execution 1.4 What is the Operating System Definition? The Operating System (OS) acts as a mediator between a computer user and the hardware. It manages all resources, decides .. ذاكرتك عبادةم فاخلص النية..

between conflicting requests for efficient and fair resource use, controls program execution to prevent errors and improper use of the computer, and serves as a resource allocator. 1.5 What are the differences between a trap and an interrupt? 1.6 Why is Direct Memory Access (DMA) used?

  • Used for high-speed I/O devices able to transmit information at close to memory speeds.
  • Device controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.
  • Only one interrupt is generated per block, rather than the one interrupt per byte. 1.7 Describe the multiprocessor and its Advantages and differences between symmetric and asymmetric multiprocessing? A multiprocessor is a computer system that contains multiple processors, each with its own set of registers and cache memory,

1.9 What is the difference between kernel and user mode?

  • In kernel mode: the operating system has full control over the system resources and can execute any instructions and access any resources.
  • In user mode: the operating system restricts the access of applications to system resources and allows only a limited set of instructions and a restricted set of system resources. **1.10 What is the difference between Protection and Security?
  • Protection – any mechanism for controlling access of processes or users to resources defined by the OS.
  • Security – defense of the system against internal and external attacks. 1.11 Consider a computer system that has cache memory, main memory (RAM) and disk, and an operating system that uses virtual memory. It takes 1 nsec to access a word from the cache, 10 nsec to access a word from the RAM, and 10 msec to access a word from the disk. If the cache hit rate is 95% and main memory hit rate (after a cache miss) is 99%, what is the average time to access a word? (Self-Study)** To calculate the average time to access a word, we need to consider the time taken for each possible case: When the word is found in the cache: 1 nsec When the word is not found in the cache but is found in RAM: a. Time to access RAM after cache miss: 10 nsec b. Probability of this case: (1 - cache hit rate) * main memory hit rate = 0.05 * 0.99 = 0. c. Average time for this case: 10 nsec * 0.0495 = 0.495 nsec

When the word is not found in the cache or RAM and is on disk: a. Time to access disk after RAM miss: 10 msec b. Probability of this case: (1 - cache hit rate) * (1 - main memory hit rate) = 0.05 * 0.01 = 0. c. Average time for this case: 10 msec * 0.0005 = 5 usec Now we can calculate the overall average time to access a word: Average time = (cache hit rate * time for case 1) + (probability of case 2 * time for case 2) + (probability of case 3 * time for case 3) Average time = (0.95 * 1 nsec) + (0.0495 * 10 nsec) + (0.0005 * 10 msec) Average time = 1.00045 nsec or approximately 1 nsec (rounded to the nearest whole number) Therefore, the average time to access a word in this computer system is approximately 1 nanosecond.

➢ Topic 2: Process

2.1 Distinguish between Program and process.

2. 4 Describe the differences between I/O-bound

programs from CPU-bound programs?

  • I/O-bound process – spends more time doing I/O than

computations, many short CPU bursts.

  • CPU-bound process – spends more time doing

computations; few very long CPU bursts.

2. 5 Describe the actions taken by a kernel to context-

switching between processes.

1. The kernel saves the context of the currently running

process, including the program counter, CPU registers,

and other process-specific data, into its PCB.

2. The kernel selects the next process to run from the ready

queue.

3. If the next process is not currently in memory, the kernel

uses the memory management unit to load it into memory

from disk.

4. The kernel restores the saved context of the next process

from its PCB, including the program counter, CPU

registers, and other process-specific data.

5. The kernel updates its data structures to reflect the change

in the running process, including the process state and

scheduling information.

6. Finally, the kernel resumes execution of the next process

from the point at which it was interrupted, effectively

switching the CPU's execution context from the old

process to the new process.

➢ Topic 3: CPU Scheduling

3.1 Describe how the process takes place in the CPU scheduling decisions.

  • CPU scheduling decisions may take place when a process:
  1. Switches from running to waiting state
  2. Switches from running to ready state
  3. Switches from waiting to ready
  4. Terminates
  • For situations 1 and 4 , there is no choice in terms of scheduling. A new process (if one exists in the ready queue) must be selected for execution.
  • For situations 2 and 3 , however, there is a choice. 3.2 Differentiate between Preemptive and Non-preemptive Scheduling. 3.3 Discuss the Scheduling Criteria

4.2 Explain the difference between logical addresses, physical address. 4.3 Describe the usage of Memory-Management Unit (MMU) The Memory-Management Unit (MMU) maps logical addresses to physical addresses at runtime, ensuring that user programs do not directly access physical memory addresses. 4.4 Given five memory partitions of 100 KB, 500 KB, 200 KB, 300 KB, and 600 KB (in order), how would each of the first-fit, best-fit, and worst-fit algorithms place processes of 212 KB, 417 KB, 112 KB, and 426 KB (in order)? Which algorithm makes the most efficient use of memory? First-fit: 212K is put in 500K partition 417K is put in 600K partition. 112K is put in 288K partition (new partition 288K = 500K - 212K) 426K must wait. يكفي أنه يستوعب العملية.. أول جزء من الذاكرة اقابله

Best-fit: 212K is put in 300K partition 417K is put in 500K partition. 112K is put in 200K partition. 426K is put in 600K partition. Worst-fit: 212K is put in 600K partition. 417K is put in 500K partition. 112K is put in 388K partition (new partition 388K = 600K - 212K) 426K must wait. In this example, Best-fit turns out to be the best. 4.5 Explain the difference between external and internal fragmentation.

  • External Fragmentation – total memory space exists to satisfy a request, but it is not contiguous.
  • Internal Fragmentation – allocated memory may be slightly larger than requested memory; this size difference is memory internal to a partition, but not being used. استعن باهلل وال تعجز.. جزء من الذاكرة اقابله يكفي أنه يستوعب العملية.. صغرأ جزء من الذاكرة اقابله يكفي أنه يستوعب العملية.. كبرأ

4.7 Describe the Concept of paging?

Paging is a memory management technique that involves dividing physical and logical memory into fixed-sized blocks called frames and pages respectively. This technique avoids external fragmentation and problems with varying sized memory chunks. To run a program, free frames are located, and the program is loaded. A page table is set up to translate logical to physical addresses. The backing store is also split into pages. However, paging still results in internal fragmentation.

4.8 Differentiate between Paging and Segmentation.

افهمها صح https://youtu. be/wzWIoPlIT 1Y معذرة ً كل شوية عارف لكن حقًا أخوك يحتاج الدعاء سونا من صالحال تن ..دعائكم