Figure 5.1 The components of a modern operating system.

Download Report

Transcript Figure 5.1 The components of a modern operating system.

5
The Shell, the
IOCS, and
the File System
Figure 5.1 The components of a modern
operating system.
Application program layer
Operating system layer
User interface
File
management
Device
management
Processor
(or process)
management
Memory
management
Communication
services
Hardware layer
© 2005 Pearson Addison-Wesley. All rights reserved
Operating System Functions
• User interface
– Mechanism for communicating with OS
• File system
– Manipulate files by name
• Device management
– Communicate with peripherals
© 2005 Pearson Addison-Wesley. All rights reserved
Operating System Functions
• Processor management
– Manage the processor’s time
• Memory management
– Manage memory space
• Communication support
– Inter-computer communication
• See Chapter 6
© 2005 Pearson Addison-Wesley. All rights reserved
The Application Program’s Interfaces
• User interface part of application program
– Active when program running
• Application programming interface
– Link to operating system
– Library of system calls
– Referenced in source code
© 2005 Pearson Addison-Wesley. All rights reserved
The Operating System’s User
Interface
• Allows user to issue commands to OS
• Types of user interfaces
–
–
–
–
–
Command line interface or shell
Menu interface
Graphical user interface
Voice-activated interface
Web-form interface
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.2 The user
interface accepts,
interprets, and
carries out
commands.
User
interface
Application program layer
User
Commands
API
User interface layer
Other operating system layers
Operating system layer
Hardware layer
© 2005 Pearson Addison-Wesley. All rights reserved
System
operator
Commands
Figure 5.3 A graphical user interface.
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.4 The user interface layer can
support several different interfaces.
Operating system
User interface layer
Line
command
interface
Graphic user
interface
Voiceactivated
interface
Other operating system layers
© 2005 Pearson Addison-Wesley. All rights reserved
The Command Language
• Command language
– The set of available commands and syntax rules
– Each command activates a specific service
• Batch file
– A set of pre-defined commands stored in a file
© 2005 Pearson Addison-Wesley. All rights reserved
Memory
Operating system
Figure 5.5 The user
interface links to a
number of routines,
each of which
performs a single
service.
User interface layer
Launch
program
Close program
Create file
Open file
Close file
Format disk
List directory
Check disk
Other functions
Other operating system layers
Application programs
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.6 Launching an application
program.
Memory
Operating system
User interface layer
a. The user selects
the program.
Launch
program
Close program
Create file
Open file
Close file
Format disk
Other operating system layers
RUN MYPGM
RUN MYPGM
MYPGM
© 2005 Pearson Addison-Wesley. All rights reserved
b. The user interface calls the launch
program routine.
Memory
Operating system
User interface layer
Launch
program
Close program
Create file
Open file
Close file
Format disk
Other operating system layers
RUN MYPGM
RUN MYPGM
MYPGM
© 2005 Pearson Addison-Wesley. All rights reserved
c. The application program is loaded into
memory and started.
Memory
Operating system
User interface layer
Launch
program
Close program
Create file
Open file
Close file
Format disk
Other operating system layers
RUN MYPGM
MYPGM
MYPGM
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.7 The file system layer.
Application program layer
The file system
keeps track of the
data and programs
stored on disk.
User interface layer
File system layer
Other operating system layers
Operating system
Hardware
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.8 The location of every file stored
on a disk can be found by searching the
disk’s directory.
The disk directory
© 2005 Pearson Addison-Wesley. All rights reserved
Launching a Program
• User issues a launch command
– Command names target program
•
•
•
•
•
File system reads directory
File system searches directory
File system extracts program address
Device management layer loads program
Operating system starts program
© 2005 Pearson Addison-Wesley. All rights reserved
Open and Close
• Open
– New file – create directory entry
– Existing file – retrieve directory
– Make file available
• Close
– Update directory
– Make file unavailable
© 2005 Pearson Addison-Wesley. All rights reserved