Upload
james-smith
View
213
Download
1
Tags:
Embed Size (px)
Citation preview
5
The Shell, the IOCS, and the File System
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.1 The components of a modern operating system.
User interfaceDevice
managementFile
management
Memorymanagement
Processor(or process)management
Communicationservices
Operating system layer
Application program layer
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 layer
Other operating system layers
Hardware layer
Application program layer
Systemoperator
User
Operating system layer
Commands Commands
API
Userinterface
© 2005 Pearson Addison-Wesley. All rights reserved
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.
User interface layer
Other operating system layers
Operating system
Linecommandinterface
Graphic userinterface
Voice-activatedinterface
© 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
Figure 5.5 The user interface links to a number of routines, each of which performs a single service.
Memory
Operating system
Application programs
User interface layer
Other operating system layers
Launchprogram
Close program Create file
Open file Close file Format disk
List directory Check disk Other functions
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.6 Launching an application program.
Memory
Operating system
RUN MYPGM
User interface layer
Other operating system layers
Launchprogram
Close program Create file
Open file Close file Format disk
RUN MYPGM
MYPGM
a. The user selects the program.
© 2005 Pearson Addison-Wesley. All rights reserved
b. The user interface calls the launch program routine.
Memory
Operating system
RUN MYPGM
User interface layer
Other operating system layers
Close program Create file
Open file Close file Format disk
RUN MYPGM
MYPGM
Launchprogram
© 2005 Pearson Addison-Wesley. All rights reserved
c. The application program is loaded into memory and started.
Memory
Operating system
MYPGM
User interface layer
Other operating system layers
Close programLaunchprogram
Create file
Open file Close file Format disk
RUN MYPGM
MYPGM
© 2005 Pearson Addison-Wesley. All rights reserved
Figure 5.7 The file system layer.
The file system keeps track of the data and programs stored on disk.
User interface layer
Other operating system layers
Hardware
Operating system
File system layer
Application program layer
© 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