SlideShare a Scribd company logo
Universiti Malaysia Perlis (UniMAP) 
 
1 
EKT423: OPERATING SYSTEM
TUTORIAL 02
1. Suppose that you wish to design a virtual memory system with the following characteristics:
• The size of a page table entry is 4 bytes.
• Each page table must fit into a single physical frame.
• The system must be able to support virtual address spaces as large as bytes (256 GB).
Suppose that you decide to use a multi-level paging scheme with no more than two levels of page
tables. What is the minimum page size that your system must have?
Answer:
Page table entry 4 bytes = 22
bytes
Virtual address space = 238
bytes
Page size, 2P
= ?
Here,
1- level page needs 1 physical frame
2- level page needs 1 physical frame
Multi- level page needs 1 physical frame
As we know, for two-level page table,
(2p
-2) (2p
-2) (2p
) = 238
Hence, (P-2) + (P-2) + P =38
Or, 3P - 4 =38
Or, 3P = 38 + 4 =42
Or, P = 14
So, Page size = 214
bytes
Universiti Malaysia Perlis (UniMAP) 
 
2 
2. Measurements of a certain system have shown that the average process runs for a time T before
blocking on I/O. A process switch requires a time S, which is effectively wasted (overhead). For
round-robin scheduling with quantum Q, give a formula for the CPU efficiency for each of the
following:
(a) Q = ∞ (b) Q≥T (c) S <Q< T (d) Q = S (e) Q nearly 0
Answer:
Here, T = Average Process Running Time
S = Process Switching time
And Q = Quantum
The CPU efficiency is the useful CPU time divided by the total CPU time. When Q ≥ T, the basic
cycle is for the process to run for T and undergo a process switch for S.
The CPU efficiency here is then
*a) Q = ∞
CPU efficiency = Efficient running time / Total Time
= T / (T+S)
*b) Q ≥T
Hence,
CPU efficiency = Efficient running time / Total Time
= T / (T+S)
*c) S < Q < T
When the quantum is shorter than T, each run of T will require T /Q process switches, wasting a
time is ST /Q.
Hence,
CPU efficiency = Efficient running time / (Total Time + Total wasting time)
= T / (T+ST/Q)
= T / T(1 + S/Q)
= Q /(Q+S)
*d) Q=S
We just substitute Q for S and find that the efficiency is 50%.
Universiti Malaysia Perlis (UniMAP) 
 
3 
*e) Finally, as Q → 0 the efficiency goes to 0.
3. Suppose that an operating system supports two kinds of sequential processes: high-priority
interactive processes, and low-priority non-interactive processes. The behavior of the high-priority
processes is to alternate between periods of computation of duration and periods of blocking
(waiting for input) of duration . The behavior of the low-priority processes is to compute
constantly, with no blocking. The operating system’s scheduling policy is prioritized round-robin
with a quantum q, where < q. Scheduling decisions are made only when a quantum expires, or
when the running process blocks. The scheduler selects a low-priority process to run only if no high-
priority processes are ready. Suppose there is one high-priority process and one low-priority process
in the system, and that both processes will run for a long time. For what fraction of the time does the
low-priority process run?
Answer:
Once the high priority process blocks (after running for time tc), the low priority process will
run for a quantum. If the high priority process is still blocked after that quantum, the low priority
process will receive another.
When the high priority process unblocks, the low priority process will finish out the current
quantum, at which point the scheduler will give the processor to the high priority process.
Thus, for every tc time the high priority process runs the low priority process and will run for
[tb/q]q units of time. The fraction of CPU time used by the low priority process is
[tb/q]q
--------------
[tb/q]q + tc
4. Can a process make a transition from the Ready state to the Blocked state? Why or why not?
Answer:
No, cannot. A process can become blocked, only then it issues a request for a resource that is not available
and it can make such a request only when it is executing.
5. Explain the distinction between a real address and a virtual address.
Universiti Malaysia Perlis (UniMAP) 
 
4 Answer:
A virtual address refers to a memory location in virtual memory. That location is on disk and at
some times in main memory. A real address is an address in main memory.
6. Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two
jobs, each of which needs 10 minutes of CPU time, start simultaneously. Assume 50% I/O wait.
a)How long will the last one take to complete if they run sequentially?
b) How long if they run in Parallel?
Answer:
If each job has 50% I/O wait, then it will take 20 minutes to complete in the absence of
competition.
If run sequentially, the second one will finish 40 minutes after the first one starts.
With two jobs, the approximate CPU utilization is (1 - 0.52
) or 0.75. Thus each one gets 0.375 CPU
utilization per minute of real time.
To accumulate 10 minutes of CPU time, a job must run for (10/0.375) or about 26.67 minutes.
Thus,
a) Running sequentially the jobs finish after 40 minutes.
b) Running in parallel they finish after 26.67 minutes.
7. Explain the difference between a monolithic kernel a microkernel and a real-time kernel.
A. Monolithic Kernel
A monolithic kernel is a large kernel containing virtually the complete operating system, including
scheduling, file system, device drivers, and memory management. All the functional components
of the kernel have access to all of its internal data structures and routines. Typically, a monolithic
kernel is implemented as a single process, with all elements sharing the same address space.
Universiti Malaysia Perlis (UniMAP) 
 
5 
Figure A: Architecture of monolithic kernel
Monolithic kernels have a distinction between the user and kernel space. When software runs in
the user space normally it cannot access the system hardware nor can it execute privileged
instructions. Using special entry points (provided by hardware), an application can enter the
kernel mode from user space. The user space programs operate on a virtual address so that they
cannot corrupt another application’s or the kernel’s memory. However, the kernel components
share the same address space; so a badly written driver or module can cause the system to crash.
Figure A, shows the architecture of monolithic kernel where the kernel and kernel sub modules
share the same address space and where the applications each have their private address spaces.
B. Microkernel
A microkernel is a small privileged operating system core that provides process scheduling,
memory management, and communication services and relies on other processes to perform some
of the functions traditionally associated with the operating system kernel.
Figure B: Architecture of microkernel
These kernels have been subjected to lots of research especially in the late 1980s and were
considered to be the most superior with respect to OS design principles. However, translating the
theory into practice caused too many bottlenecks; very few of these kernels have been successful in
Universiti Malaysia Perlis (UniMAP) 
 
6 
the marketplace. The microkernel makes use of a small OS that provides the very basic service
(scheduling, interrupt handling, message passing) and the rest of the kernel (file system, device
drivers, networking stack) runs as applications. On the usage of MMU, the real-time kernels form
one extreme with no usage of MMU whereas the microkernels are placed on the other end by
providing kernel subsystems with individual address space. The key to the microkernel is to come
up with well-defined APIs for communication with the OS as well as robust message-passing
schemes. Figure B shows a microkernel architecture where kernel subsystems such as network
stack and file systems have private address space similar to applications. Microkernels have been
vigorously debated especially against the monolithic kernels. One such widely known debate was
between the creator of Linux, Linus Torvalds, and Andrew Tanenbaum who was the creator of
the Minix OS (a microkernel).
C. Real-Time Kernel
Traditional real-time kernels are meant for MMU-less processors. On these operating systems,
the entire address space is flat or linear with no memory protection between the kernel and
applications, as shown in Figure C. Figure C shows the architecture of the real-time executive
where the core kernel, kernel subsystems, and applications share the same address space.
Figure C: Architecture of traditional RT-kernel
These operating systems have small memory and size footprint as both the OS and applications
are bundled into a single image. As the name suggests, they are real-time in nature because there
is no overhead of system calls, message passing, or copying of data. Adding new software becomes
a not-so-pleasant action because it needs to be tested thoroughly that it brings down the entire
system. Also it is very difficult to add applications or kernel modules dynamically as the system
has to be brought down. Most of the proprietary and commercial RTOSs fall under this category.
Source: Raghavan, P., Lad, A., & Neelakandan, S. (2006). Embedded Linux System Design and
Development. New York: Auerbach Publications
8. What is the purpose of system calls, and how do system calls relate to the OS and to the concept of
dual-mode (kernel mode and user mode) operation?
Universiti Malaysia Perlis (UniMAP) 
 
7 
A system call is used by an application program to invoke a function provided by the operating
system. Typically, the system call results in transfer to a system program that runs in kernel
mode.

More Related Content

What's hot

(Slides) Task scheduling algorithm for multicore processor system for minimiz...
(Slides) Task scheduling algorithm for multicore processor system for minimiz...(Slides) Task scheduling algorithm for multicore processor system for minimiz...
(Slides) Task scheduling algorithm for multicore processor system for minimiz...
Naoki Shibata
 
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time SystemsSara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
knowdiff
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating system
Asma'a Lafi
 
FrackingPaper
FrackingPaperFrackingPaper
FrackingPaper
Collin Purcell
 
4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures
Islam Samir
 
Concurrent Programming
Concurrent ProgrammingConcurrent Programming
Concurrent Programming
Sithija Thewa Hettige
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
Munazza-Mah-Jabeen
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
theijes
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
iosrjce
 
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
Naoki Shibata
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
Geonyzl Alviola
 
Transfer Learning for Software Performance Analysis: An Exploratory Analysis
Transfer Learning for Software Performance Analysis: An Exploratory AnalysisTransfer Learning for Software Performance Analysis: An Exploratory Analysis
Transfer Learning for Software Performance Analysis: An Exploratory Analysis
Pooyan Jamshidi
 
Paper on experimental setup for verifying - &quot;Slow Learners are Fast&quot;
Paper  on experimental setup for verifying  - &quot;Slow Learners are Fast&quot;Paper  on experimental setup for verifying  - &quot;Slow Learners are Fast&quot;
Paper on experimental setup for verifying - &quot;Slow Learners are Fast&quot;
Robin Srivastava
 
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
IDES Editor
 
A study on dynamic load balancing in grid environment
A study on dynamic load balancing in grid environmentA study on dynamic load balancing in grid environment
A study on dynamic load balancing in grid environment
IJSRD
 
Nbvtalkatjntuvizianagaram
NbvtalkatjntuvizianagaramNbvtalkatjntuvizianagaram
Nbvtalkatjntuvizianagaram
Nagasuri Bala Venkateswarlu
 
Solution(1)
Solution(1)Solution(1)
Solution(1)
Gopi Saiteja
 
Dynamic load balancing in distributed systems in the presence of delays a re...
Dynamic load balancing in distributed systems in the presence of delays  a re...Dynamic load balancing in distributed systems in the presence of delays  a re...
Dynamic load balancing in distributed systems in the presence of delays a re...
Mumbai Academisc
 
Operating System
Operating SystemOperating System
Operating System
Subhasis Dash
 

What's hot (19)

(Slides) Task scheduling algorithm for multicore processor system for minimiz...
(Slides) Task scheduling algorithm for multicore processor system for minimiz...(Slides) Task scheduling algorithm for multicore processor system for minimiz...
(Slides) Task scheduling algorithm for multicore processor system for minimiz...
 
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time SystemsSara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
Sara Afshar: Scheduling and Resource Sharing in Multiprocessor Real-Time Systems
 
Memory allocation for real time operating system
Memory allocation for real time operating systemMemory allocation for real time operating system
Memory allocation for real time operating system
 
FrackingPaper
FrackingPaperFrackingPaper
FrackingPaper
 
4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures4838281 operating-system-scheduling-on-multicore-architectures
4838281 operating-system-scheduling-on-multicore-architectures
 
Concurrent Programming
Concurrent ProgrammingConcurrent Programming
Concurrent Programming
 
Processes and Threads
Processes and ThreadsProcesses and Threads
Processes and Threads
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
Efficient Dynamic Scheduling Algorithm for Real-Time MultiCore Systems
 
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
Task Scheduling Algorithm for Multicore Processor Systems with Turbo Boost an...
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Transfer Learning for Software Performance Analysis: An Exploratory Analysis
Transfer Learning for Software Performance Analysis: An Exploratory AnalysisTransfer Learning for Software Performance Analysis: An Exploratory Analysis
Transfer Learning for Software Performance Analysis: An Exploratory Analysis
 
Paper on experimental setup for verifying - &quot;Slow Learners are Fast&quot;
Paper  on experimental setup for verifying  - &quot;Slow Learners are Fast&quot;Paper  on experimental setup for verifying  - &quot;Slow Learners are Fast&quot;
Paper on experimental setup for verifying - &quot;Slow Learners are Fast&quot;
 
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
Preemptive Job Scheduling with Priorities and Starvation Avoidance CUM Throug...
 
A study on dynamic load balancing in grid environment
A study on dynamic load balancing in grid environmentA study on dynamic load balancing in grid environment
A study on dynamic load balancing in grid environment
 
Nbvtalkatjntuvizianagaram
NbvtalkatjntuvizianagaramNbvtalkatjntuvizianagaram
Nbvtalkatjntuvizianagaram
 
Solution(1)
Solution(1)Solution(1)
Solution(1)
 
Dynamic load balancing in distributed systems in the presence of delays a re...
Dynamic load balancing in distributed systems in the presence of delays  a re...Dynamic load balancing in distributed systems in the presence of delays  a re...
Dynamic load balancing in distributed systems in the presence of delays a re...
 
Operating System
Operating SystemOperating System
Operating System
 

Viewers also liked

My_CV
My_CVMy_CV
Presentacion ley especial contra los delitos informaticos
Presentacion ley especial contra los delitos informaticosPresentacion ley especial contra los delitos informaticos
Presentacion ley especial contra los delitos informaticos
04144618790
 
Elevate IT as a value centre
Elevate IT as a value centreElevate IT as a value centre
Elevate IT as a value centre
Wayne Fox
 
Cubiscan Internship
Cubiscan InternshipCubiscan Internship
Cubiscan Internship
Jacob Esch
 
Miami Art Park Highlights Beauty of Graffiti Art
Miami Art Park Highlights Beauty of Graffiti ArtMiami Art Park Highlights Beauty of Graffiti Art
Miami Art Park Highlights Beauty of Graffiti Art
Le Petit Papillon Montessori School
 
P3.p6
P3.p6P3.p6
School!
School!School!
School!
merIKTiskolan
 
Património cultural as aldeias do minho - lindoso - artur filipe dos santos
Património cultural   as aldeias do minho - lindoso -  artur filipe dos santosPatrimónio cultural   as aldeias do minho - lindoso -  artur filipe dos santos
Património cultural as aldeias do minho - lindoso - artur filipe dos santos
Artur Filipe dos Santos
 
A study on knowledge and practices of First Aid and CPR among Police Officer...
A study on knowledge and practices of First Aid and CPR among Police Officer...A study on knowledge and practices of First Aid and CPR among Police Officer...
A study on knowledge and practices of First Aid and CPR among Police Officer...
Bio-Inquirer
 
Practica no 4.parte 2. ´problema 2
Practica no 4.parte 2. ´problema 2Practica no 4.parte 2. ´problema 2
Practica no 4.parte 2. ´problema 2
Guillermo Madueño
 
Recursos gráficos para fortalecer el proceso de enseñanza
Recursos gráficos para fortalecer el proceso de enseñanzaRecursos gráficos para fortalecer el proceso de enseñanza
Recursos gráficos para fortalecer el proceso de enseñanza
JOSE MOLINA
 
Micología
MicologíaMicología
Micología
maninarubio
 

Viewers also liked (13)

BSc
BScBSc
BSc
 
My_CV
My_CVMy_CV
My_CV
 
Presentacion ley especial contra los delitos informaticos
Presentacion ley especial contra los delitos informaticosPresentacion ley especial contra los delitos informaticos
Presentacion ley especial contra los delitos informaticos
 
Elevate IT as a value centre
Elevate IT as a value centreElevate IT as a value centre
Elevate IT as a value centre
 
Cubiscan Internship
Cubiscan InternshipCubiscan Internship
Cubiscan Internship
 
Miami Art Park Highlights Beauty of Graffiti Art
Miami Art Park Highlights Beauty of Graffiti ArtMiami Art Park Highlights Beauty of Graffiti Art
Miami Art Park Highlights Beauty of Graffiti Art
 
P3.p6
P3.p6P3.p6
P3.p6
 
School!
School!School!
School!
 
Património cultural as aldeias do minho - lindoso - artur filipe dos santos
Património cultural   as aldeias do minho - lindoso -  artur filipe dos santosPatrimónio cultural   as aldeias do minho - lindoso -  artur filipe dos santos
Património cultural as aldeias do minho - lindoso - artur filipe dos santos
 
A study on knowledge and practices of First Aid and CPR among Police Officer...
A study on knowledge and practices of First Aid and CPR among Police Officer...A study on knowledge and practices of First Aid and CPR among Police Officer...
A study on knowledge and practices of First Aid and CPR among Police Officer...
 
Practica no 4.parte 2. ´problema 2
Practica no 4.parte 2. ´problema 2Practica no 4.parte 2. ´problema 2
Practica no 4.parte 2. ´problema 2
 
Recursos gráficos para fortalecer el proceso de enseñanza
Recursos gráficos para fortalecer el proceso de enseñanzaRecursos gráficos para fortalecer el proceso de enseñanza
Recursos gráficos para fortalecer el proceso de enseñanza
 
Micología
MicologíaMicología
Micología
 

Similar to Tutotial 2 answer

High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
EUDAT
 
Process Control Block (PCB) print 4.pdf
Process Control Block  (PCB) print 4.pdfProcess Control Block  (PCB) print 4.pdf
Process Control Block (PCB) print 4.pdf
fentahunmuluye23
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/A
Abdul Munam
 
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KITTIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
ijesajournal
 
Time critical multitasking for multicore
Time critical multitasking for multicoreTime critical multitasking for multicore
Time critical multitasking for multicore
ijesajournal
 
Multicore processor technology advantages and challenges
Multicore processor technology  advantages and challengesMulticore processor technology  advantages and challenges
Multicore processor technology advantages and challenges
eSAT Journals
 
operating system question bank
operating system question bankoperating system question bank
operating system question bank
rajatdeep kaur
 
In datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unitIn datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unit
Jinwon Lee
 
Embedded systems unit4
Embedded systems unit4Embedded systems unit4
Embedded systems unit4
baskaransece
 
UNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docxUNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docx
karthikaparthasarath
 
Pipelining in Computer System Achitecture
Pipelining in Computer System AchitecturePipelining in Computer System Achitecture
Pipelining in Computer System Achitecture
YashiUpadhyay3
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
AJAL A J
 
Computer arithmetic in computer architecture
Computer arithmetic in computer architectureComputer arithmetic in computer architecture
Computer arithmetic in computer architecture
ishapadhy
 
035
035035
Linux process management
Linux process managementLinux process management
Linux process management
Raghu nath
 
Process management
Process managementProcess management
Process management
Digpal Singh Jhala
 
Simulation of Heterogeneous Cloud Infrastructures
Simulation of Heterogeneous Cloud InfrastructuresSimulation of Heterogeneous Cloud Infrastructures
Simulation of Heterogeneous Cloud Infrastructures
CloudLightning
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
Rajan Kumar
 
Rtos
RtosRtos
K017617786
K017617786K017617786
K017617786
IOSR Journals
 

Similar to Tutotial 2 answer (20)

High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
High Performance & High Throughput Computing - EUDAT Summer School (Giuseppe ...
 
Process Control Block (PCB) print 4.pdf
Process Control Block  (PCB) print 4.pdfProcess Control Block  (PCB) print 4.pdf
Process Control Block (PCB) print 4.pdf
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/A
 
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KITTIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
TIME CRITICAL MULTITASKING FOR MULTICORE MICROCONTROLLER USING XMOS® KIT
 
Time critical multitasking for multicore
Time critical multitasking for multicoreTime critical multitasking for multicore
Time critical multitasking for multicore
 
Multicore processor technology advantages and challenges
Multicore processor technology  advantages and challengesMulticore processor technology  advantages and challenges
Multicore processor technology advantages and challenges
 
operating system question bank
operating system question bankoperating system question bank
operating system question bank
 
In datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unitIn datacenter performance analysis of a tensor processing unit
In datacenter performance analysis of a tensor processing unit
 
Embedded systems unit4
Embedded systems unit4Embedded systems unit4
Embedded systems unit4
 
UNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docxUNIT II - CPU SCHEDULING.docx
UNIT II - CPU SCHEDULING.docx
 
Pipelining in Computer System Achitecture
Pipelining in Computer System AchitecturePipelining in Computer System Achitecture
Pipelining in Computer System Achitecture
 
EMBEDDED OS
EMBEDDED OSEMBEDDED OS
EMBEDDED OS
 
Computer arithmetic in computer architecture
Computer arithmetic in computer architectureComputer arithmetic in computer architecture
Computer arithmetic in computer architecture
 
035
035035
035
 
Linux process management
Linux process managementLinux process management
Linux process management
 
Process management
Process managementProcess management
Process management
 
Simulation of Heterogeneous Cloud Infrastructures
Simulation of Heterogeneous Cloud InfrastructuresSimulation of Heterogeneous Cloud Infrastructures
Simulation of Heterogeneous Cloud Infrastructures
 
RTOS implementation
RTOS implementationRTOS implementation
RTOS implementation
 
Rtos
RtosRtos
Rtos
 
K017617786
K017617786K017617786
K017617786
 

Recently uploaded

TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
UReason
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
cannyengineerings
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
PKavitha10
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
Gino153088
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
AlvianRamadhani5
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
um7474492
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
Prakhyath Rai
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
co23btech11018
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
devtomar25
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
Dwarkadas J Sanghvi College of Engineering
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Introduction to verilog basic modeling .ppt
Introduction to verilog basic modeling   .pptIntroduction to verilog basic modeling   .ppt
Introduction to verilog basic modeling .ppt
AmitKumar730022
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
uqyfuc
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 

Recently uploaded (20)

TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
Data Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason WebinarData Driven Maintenance | UReason Webinar
Data Driven Maintenance | UReason Webinar
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1CEC 352 - SATELLITE COMMUNICATION UNIT 1
CEC 352 - SATELLITE COMMUNICATION UNIT 1
 
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
4. Mosca vol I -Fisica-Tipler-5ta-Edicion-Vol-1.pdf
 
5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf5G Radio Network Througput Problem Analysis HCIA.pdf
5G Radio Network Througput Problem Analysis HCIA.pdf
 
smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...smart pill dispenser is designed to improve medication adherence and safety f...
smart pill dispenser is designed to improve medication adherence and safety f...
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...Software Engineering and Project Management - Software Testing + Agile Method...
Software Engineering and Project Management - Software Testing + Agile Method...
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
Computational Engineering IITH Presentation
Computational Engineering IITH PresentationComputational Engineering IITH Presentation
Computational Engineering IITH Presentation
 
5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf5g-5G SA reg. -standalone-access-registration.pdf
5g-5G SA reg. -standalone-access-registration.pdf
 
Introduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.pptIntroduction to Computer Networks & OSI MODEL.ppt
Introduction to Computer Networks & OSI MODEL.ppt
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Introduction to verilog basic modeling .ppt
Introduction to verilog basic modeling   .pptIntroduction to verilog basic modeling   .ppt
Introduction to verilog basic modeling .ppt
 
一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理一比一原版(USF毕业证)旧金山大学毕业证如何办理
一比一原版(USF毕业证)旧金山大学毕业证如何办理
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 

Tutotial 2 answer

  • 1. Universiti Malaysia Perlis (UniMAP)    1  EKT423: OPERATING SYSTEM TUTORIAL 02 1. Suppose that you wish to design a virtual memory system with the following characteristics: • The size of a page table entry is 4 bytes. • Each page table must fit into a single physical frame. • The system must be able to support virtual address spaces as large as bytes (256 GB). Suppose that you decide to use a multi-level paging scheme with no more than two levels of page tables. What is the minimum page size that your system must have? Answer: Page table entry 4 bytes = 22 bytes Virtual address space = 238 bytes Page size, 2P = ? Here, 1- level page needs 1 physical frame 2- level page needs 1 physical frame Multi- level page needs 1 physical frame As we know, for two-level page table, (2p -2) (2p -2) (2p ) = 238 Hence, (P-2) + (P-2) + P =38 Or, 3P - 4 =38 Or, 3P = 38 + 4 =42 Or, P = 14 So, Page size = 214 bytes
  • 2. Universiti Malaysia Perlis (UniMAP)    2  2. Measurements of a certain system have shown that the average process runs for a time T before blocking on I/O. A process switch requires a time S, which is effectively wasted (overhead). For round-robin scheduling with quantum Q, give a formula for the CPU efficiency for each of the following: (a) Q = ∞ (b) Q≥T (c) S <Q< T (d) Q = S (e) Q nearly 0 Answer: Here, T = Average Process Running Time S = Process Switching time And Q = Quantum The CPU efficiency is the useful CPU time divided by the total CPU time. When Q ≥ T, the basic cycle is for the process to run for T and undergo a process switch for S. The CPU efficiency here is then *a) Q = ∞ CPU efficiency = Efficient running time / Total Time = T / (T+S) *b) Q ≥T Hence, CPU efficiency = Efficient running time / Total Time = T / (T+S) *c) S < Q < T When the quantum is shorter than T, each run of T will require T /Q process switches, wasting a time is ST /Q. Hence, CPU efficiency = Efficient running time / (Total Time + Total wasting time) = T / (T+ST/Q) = T / T(1 + S/Q) = Q /(Q+S) *d) Q=S We just substitute Q for S and find that the efficiency is 50%.
  • 3. Universiti Malaysia Perlis (UniMAP)    3  *e) Finally, as Q → 0 the efficiency goes to 0. 3. Suppose that an operating system supports two kinds of sequential processes: high-priority interactive processes, and low-priority non-interactive processes. The behavior of the high-priority processes is to alternate between periods of computation of duration and periods of blocking (waiting for input) of duration . The behavior of the low-priority processes is to compute constantly, with no blocking. The operating system’s scheduling policy is prioritized round-robin with a quantum q, where < q. Scheduling decisions are made only when a quantum expires, or when the running process blocks. The scheduler selects a low-priority process to run only if no high- priority processes are ready. Suppose there is one high-priority process and one low-priority process in the system, and that both processes will run for a long time. For what fraction of the time does the low-priority process run? Answer: Once the high priority process blocks (after running for time tc), the low priority process will run for a quantum. If the high priority process is still blocked after that quantum, the low priority process will receive another. When the high priority process unblocks, the low priority process will finish out the current quantum, at which point the scheduler will give the processor to the high priority process. Thus, for every tc time the high priority process runs the low priority process and will run for [tb/q]q units of time. The fraction of CPU time used by the low priority process is [tb/q]q -------------- [tb/q]q + tc 4. Can a process make a transition from the Ready state to the Blocked state? Why or why not? Answer: No, cannot. A process can become blocked, only then it issues a request for a resource that is not available and it can make such a request only when it is executing. 5. Explain the distinction between a real address and a virtual address.
  • 4. Universiti Malaysia Perlis (UniMAP)    4 Answer: A virtual address refers to a memory location in virtual memory. That location is on disk and at some times in main memory. A real address is an address in main memory. 6. Multiple jobs can run in parallel and finish faster than if they had run sequentially. Suppose that two jobs, each of which needs 10 minutes of CPU time, start simultaneously. Assume 50% I/O wait. a)How long will the last one take to complete if they run sequentially? b) How long if they run in Parallel? Answer: If each job has 50% I/O wait, then it will take 20 minutes to complete in the absence of competition. If run sequentially, the second one will finish 40 minutes after the first one starts. With two jobs, the approximate CPU utilization is (1 - 0.52 ) or 0.75. Thus each one gets 0.375 CPU utilization per minute of real time. To accumulate 10 minutes of CPU time, a job must run for (10/0.375) or about 26.67 minutes. Thus, a) Running sequentially the jobs finish after 40 minutes. b) Running in parallel they finish after 26.67 minutes. 7. Explain the difference between a monolithic kernel a microkernel and a real-time kernel. A. Monolithic Kernel A monolithic kernel is a large kernel containing virtually the complete operating system, including scheduling, file system, device drivers, and memory management. All the functional components of the kernel have access to all of its internal data structures and routines. Typically, a monolithic kernel is implemented as a single process, with all elements sharing the same address space.
  • 5. Universiti Malaysia Perlis (UniMAP)    5  Figure A: Architecture of monolithic kernel Monolithic kernels have a distinction between the user and kernel space. When software runs in the user space normally it cannot access the system hardware nor can it execute privileged instructions. Using special entry points (provided by hardware), an application can enter the kernel mode from user space. The user space programs operate on a virtual address so that they cannot corrupt another application’s or the kernel’s memory. However, the kernel components share the same address space; so a badly written driver or module can cause the system to crash. Figure A, shows the architecture of monolithic kernel where the kernel and kernel sub modules share the same address space and where the applications each have their private address spaces. B. Microkernel A microkernel is a small privileged operating system core that provides process scheduling, memory management, and communication services and relies on other processes to perform some of the functions traditionally associated with the operating system kernel. Figure B: Architecture of microkernel These kernels have been subjected to lots of research especially in the late 1980s and were considered to be the most superior with respect to OS design principles. However, translating the theory into practice caused too many bottlenecks; very few of these kernels have been successful in
  • 6. Universiti Malaysia Perlis (UniMAP)    6  the marketplace. The microkernel makes use of a small OS that provides the very basic service (scheduling, interrupt handling, message passing) and the rest of the kernel (file system, device drivers, networking stack) runs as applications. On the usage of MMU, the real-time kernels form one extreme with no usage of MMU whereas the microkernels are placed on the other end by providing kernel subsystems with individual address space. The key to the microkernel is to come up with well-defined APIs for communication with the OS as well as robust message-passing schemes. Figure B shows a microkernel architecture where kernel subsystems such as network stack and file systems have private address space similar to applications. Microkernels have been vigorously debated especially against the monolithic kernels. One such widely known debate was between the creator of Linux, Linus Torvalds, and Andrew Tanenbaum who was the creator of the Minix OS (a microkernel). C. Real-Time Kernel Traditional real-time kernels are meant for MMU-less processors. On these operating systems, the entire address space is flat or linear with no memory protection between the kernel and applications, as shown in Figure C. Figure C shows the architecture of the real-time executive where the core kernel, kernel subsystems, and applications share the same address space. Figure C: Architecture of traditional RT-kernel These operating systems have small memory and size footprint as both the OS and applications are bundled into a single image. As the name suggests, they are real-time in nature because there is no overhead of system calls, message passing, or copying of data. Adding new software becomes a not-so-pleasant action because it needs to be tested thoroughly that it brings down the entire system. Also it is very difficult to add applications or kernel modules dynamically as the system has to be brought down. Most of the proprietary and commercial RTOSs fall under this category. Source: Raghavan, P., Lad, A., & Neelakandan, S. (2006). Embedded Linux System Design and Development. New York: Auerbach Publications 8. What is the purpose of system calls, and how do system calls relate to the OS and to the concept of dual-mode (kernel mode and user mode) operation?
  • 7. Universiti Malaysia Perlis (UniMAP)    7  A system call is used by an application program to invoke a function provided by the operating system. Typically, the system call results in transfer to a system program that runs in kernel mode.