Anda di halaman 1dari 46

V 


|
Foundations of Computer Science × Cengage Learning
Objectives
After studying this chapter the student should be able
to:
J anderstand the role of the operating system.
J anderstand the process of bootstrapping to load the
operating system into memory.
J List the components of an operating system.
J Discuss the role of the memory manager.
J Discuss the role of the process manager.
J Discuss the role of the device manager.
J Discuss the role of the file manager in an operating system.
J anderstand the main features of three common operating
systems: a  Linux and Windows .
|
Ñ  
     

 


 

  

 

 
 

   
 

 

     
 

  
 
 
  


|
  
      


 


[Operating system


[Application programs

[Ñ
 
    

 
      
 
[   
  
 

   
  
|
Figure 7.1 A computer system
|
7-1  ODaCO

Ñ operating system       

 
  
 
!"     
  

J An operating system is an interface between the hardware


of a computer and the user (programs or humans).
humans).
J An operating system is a program (or a set of programs)
that facilitates the execution of other programs.
programs.
J An operating system acts as a general manager supervising
the activity of each component in the computer system.
system.

|
An operating system is an interface between the
hardware of a computer and the user
(programs or humans)
that facilitates the execution of other programs
and the access to hardware and software resources.

 
   
 
 
 




X officient use of hardware


hardware..
X oase of use of resources
resources..

||
ootstrap process

 
    

 
   

   
   !  
 #

[ 
 
   
[Ñ  
      
  $%



 

  bootstrap program
[u     "  &'   
          
 


        

[u 
  "  
     
       
   $Ñ%

|
Figure 7.2 he bootstrap process
|
7-2 o OLaO

    



( 

atch systems
atch operating systems      )*+, 
 
 
  
[Ñ 
 "   
 

['   
  
[   
[
    
 
  

[ -
 
 



[Ñ 
      
 

    


 
| 
ime-sharing systems
           "
` ``  
   
  
   
   

"



   
 
      

     




%
    
 time sharing
     
     "  

 


     
  
.
 
 
 


"  
 
     /
   
   
 
        

| 
âersonal systems
u  
      "  



 
        
0  
"    
   
DOS
(Disk Operating System)     

âarallel systems
    
         
parallel systems  &'  
 
 -

&'
       
 

 


"   
 
 
 
1
 
 
 

  
 
   
  
 
   
   
  
&' 
| 
Distributed systems
[1
 1 
 


   
  
[Ñ  
 
     

  
   
 


  


[0    
   

     

  
eal-time systems
[Ñ 
       

1 
  
  

[
    
 

 "   "
     
    
 
| 
7-3 COMâO o S


 
 
  

[Ñ    

      

 

[2  
 
(
  
 



   

[-
 

      

 

" 
    
 

  

 
 
[Ñ   
  

 
  
 
manager" process manager
memory manager" manager"" device
manager
 file manager
manager
| 
Figure 7.3 Components of an operating system
| 
aser interface
-
 
  

user interface
[Ñ 
 

      3   4

         


[Ñ   
   
  "  

'25" 

shell
[2  "  

window   
   

 

6'2 3

   
4


| 
Memory manager
      
    
memory management
[Ñ   (   
 

      
 "  
 (  




     
[%

    

  


      
[
 
      


   


[Monoprogramming


[Ë  


| |
Monoprogramming
2 monoprogramming"     

 
 
 
 
7 

 
    
  
  2   
"  

       u  

  "  


   




Figure 7.4 Monoprogramming


| 
Multiprogramming
2 
"  
  
   

 
 "
 
     " 
 &'   
    
 

Figure 7.5 Multiprogramming


| 
Figure 7.6 Categories of multiprogramming
| 
Figure 7.7 âartitioning
| 
Figure 7.8 âaging
| 
Figure 7.9 Demand paging
| 
Figure 7.10 Demand segmentation
| 
irtual memory
0
 

 
 
 
 
" 


     " 
   
   

 
    1  
 
"  
"

(  ), %.
   ), 
 " 
  ( 8 %."


  8, %. Ñ
 " ), %.   ),


  
 9, %.
   1  
 


  (  ), %." 


 (  8, %. : ;))    
irtual memory"    
 
" 


  "    
 
 
 



| 
Figure 7.11 irtual memory

| 
ârocess manager
Ñ     
 
    


"         "   
    

ârogram job and process


J Ñ  

         1
J Ñ 
  
º        
    
  
  





J Ñ   

    2 

 
 


 
   

| |
State diagrams
 
  

"


 
  
      

  


 
  
   
   



 

 
     
  
 
   

| 
Figure 7.12 State diagram with boundaries between program job and process
| 
Schedulers
 
      
 
" 
  

        º     

       

Figure 7.13 Job scheduler


| 
Figure 7.14 ârocess scheduler
| 
Àueuing
 
 

        
 
 
 2 
 " 
 
 
 

     
       
 
     
  "    


   3
   4 Ñ    1   
  1 
 
  
       

 1   
   

 
  
      

      
  1     
     
  

| 
Figure 7.15 Àueues for process management
| 
ârocess synchronization
   
   

  
 (            
u   
      
   
3   "  
4" 
 
  


    
 


| 
Figure 7.16 Deadlock

a
Deadlock occurs when the operating system does not
put resource restrictions on processes.

| 
Figure 7.17 Deadlock on a bridge
| 
Figure 7.18 Starvation
| |
Figure 7.19 he dining philosophers problem

Starvation is the opposite of deadlock. t can happen


when the operating system puts too many resource
restrictions on a process.
| 
Device manager
   

"   

"    

       
 
 
 
      



J he device manager monitors every input/output device


constantly to ensure that the device is functioning properly.
J he device manager maintains a queue for each input/output
device or one or more queues for similar input/output devices.
J he device manager controls the different policies for accessing
input/output devices.

| 
File manager

<  <
< <
<file manager < <

 <<  <Ñ< 
 <   < << <

<
 <
 <

  <1 < <
< <  <

 < <
 <   <
<
<  << < < <
1<< <

<

J controls access to files.


J supervises the creation deletion and modification of files.
J controls the naming of files.
J supervises the storage of files.
J is responsible for archiving and backups.

| 
7-4 A Sa o OF OâoA  SSoMS

2         


 


  
     
 u

    
  



 
     
   '25" 
 u 
u  

| 
a 
'25 

   )*=*   

$        $ 
  6
 .


  '25 
  
    
 2 


 
 

 

    

a  is a multiuser multiprocessing portable


operating system.
t is designed to facilitate programming text
processing and communication.

| 
Figure 7.20 Components of the a  operating system
| 
Linux
[2 )**)"  
 "
:   
 
'   ! 1
  " 

 
  
  1 



[ 
 1"   

 


   '25" 
 



  

[  9, 1" 
  )**;" 




 
 
 
[2 

 
 


 
| 
'25
Windows /2000/â

[2  
 )*>, %   "    
   0

" 
  
   

   
 % 0 3%    0 1

  4
[u   3 
      4 

  
[
    u   
  



  u  9,,,
[u  5& 35& 
  5& 4 

 
9,,)
[u   
     
u     


| 
Figure 7.21 he architecture of Windows 

|