Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Operating System Concepts – 10th dition Silberschatz, Galvin and Gagne ©2018 Operating-System Structures Operating System Services User and Operating System-Interface System Calls System Services Linkers and Loaders Why Applications are Operating System Specific Operating-System Design and Implementation Operating System Struct re Operating System Concepts – 10th dition 2!2 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Chapter Objectives Identify services provided !y an operating system Illustrate how system calls are sed to provide operating system services Compare and contrast monolithic, layered# microkernel, modular, and hybrid strategies for designing operating systems Apply tools for monitoring operating system performance Operating System Concepts – 10th dition 2!" Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Operating System Services 1 Operating systems provide an environment for e$ecution of programs and services to programs and users One set of operating-system services provides functions that are helpful to the user% $ser inter%ace - Almost all operating systems have a ser interface &$&'( )aries bet"een Command'(ine )C(&*# Graphical $ser &nter%ace )G$&*# to+ch'screen, ,atch -rogram execution - *he system must be able to load a program into memory and to run that program# terminate execution, either normally or abnormally &indicating error'( &/O operations - A running program may require I,O# "hich may involve a file or an I,O device; OS must provide interface to I,O subsystems. Operating System Concepts – 10th dition 2!# Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Operating System Services 2 .ore operating-system services that are helpful to the user % 1ile'system manip+lation - *he file system is of particular interest( /rograms need to read and "rite files and directories# create and delete them# search them# list file Information, permission management( Comm+nications 0 /rocesses may exchange information, on the same computer or bet"een computers over a net"ork Communications may !e via shared memory or through message passing &packets moved by the OS' rror detection 0 OS needs to be constantly aware of possible errors .ay occur in the C/U and memory hardware, in I,O devices, in user program 1or each type of error# OS should take the appropriate action to ensure correct and consistent computing Debugging facilities can greatly enhance the user2s and programmer2s abilities to efficiently use the system Operating System Concepts – 10th dition 2!0 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Operating System Services 3 Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing 3eso+rce allocation ' When multiple users or multiple 4obs running concurrently# resources must be allocated to each of them .any types of resources - C/U cycles# main memory# file storage, I,O devices. (ogging ' *o keep track of "hich users use ho" much and "hat kinds of computer resources -rotection and sec+rity ' *he o"ners of information stored in a multiuser or net"orked computer system may "ant to control use of that information# conc rrent processes should not interfere "ith each other -rotection involves ensuring that all access to system resources is controlled Security of the system from outsiders requires user authentication, e$tends to defending external I,O devices from invalid access attempts Operating System Concepts – 10th dition 2!2 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 A View of Operating System Services Operating System Concepts – 10th dition 2!4 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 User Operating System Interface - CLI CLI or command line interpreter allows direct command entry Sometimes implemented in kernel, sometimes !y systems program Sometimes multiple programs implemented – shells (sh, bash,csh, tcsh, zsh) Primarily reads a command entered by ser and executes it Sometimes commands are built-in# sometimes just names of programs If the latter, adding new features doesn’t require shell modification Operating System Concepts – 10th dition 2!8 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Bourne Shell Command Interpreter Operating System Concepts – 10th dition 2!5 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 User Operating System Interface - GUI User-friendly desktop metaphor interface Usually mouse (or touchpad'# keyboard# and monitor Icons represent files, programs, actions, etc Various mouse !uttons over objects in the interface cause various actions (provide information# options, execute f nction# open directory (also known as a folder' Invented at Xero$ PARC Many systems now include both CLI and GUI interfaces Microsoft Windows is GUI with CLI 8command9 shell Apple .ac OS X is 8Aqua9 GUI interface with UNIX kernel nderneath and shells available Uni$ and Linu$ have CLI with optional GUI interfaces (CDE, KD;# G:OME' Operating System Concepts – 10th dition 2!10 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Touchscreen Interfaces Touchscreen devices require new interfaces .ouse not possible or not desired Actions and selection based on gestures )irtual keyboard for te$t entry )oice commands Operating System Concepts – 10th dition 2!11 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 The Mac OS X GUI Operating System Concepts – 10th dition 2!12 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 System Calls Programming interface to the services provided !y the OS Typically written in a high-level language (C or C==' Mostly accessed !y programs via a high-level Application Programming Interface )7-&* rather than direct system call use Three most common APIs are Win>? API for Windows, POSIX API for /OSIX-based systems (including virt ally all versions of UNIX, Linu$# and Mac OS X), and Java API for the Java virtual machine &@).' :ote that the system-call names used throughout this text are generic Operating System Concepts – 10th dition 2!1" Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Example of System Calls System call sequence to copy the contents of one file to another file Operating System Concepts – 10th dition 2!1# Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Example of Standard API Operating System Concepts – 10th dition 2!10 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 System Call Implementation Typically, a number associated with each system call System-call interface maintains a table indexed according to these numbers The system call interface invokes the intended system call in OS kernel and ret rns stat s of the system call and any return values The caller need know nothing about how the system call is implemented @ st needs to obey API and understand what OS "ill do as a result call Most details of OS interface hidden from programmer by API Managed !y run-time support library (set of functions built into libraries included with compiler) Operating System Concepts – 10th dition 2!12 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 API – System Call – OS Relationship Operating System Concepts – 10th dition 2!14 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 System Call Parameter Passing Often, more information is required than simply identity of desired system call Exact type and amount of information vary according to OS and call Three general methods sed to pass parameters to the OS Simplest: pass the parameters in registers In some cases# may be more parameters than registers Parameters stored in a block, or table, in memory, and address of block passed as a parameter in a register This approach taken by Linux and Solaris Parameters placed, or pushed, onto the stack by the program and popped off the stack !y the operating system Block and stack methods do not limit the number or length of parameters being passed Operating System Concepts – 10th dition 2!18 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Parameter Passing via Table Operating System Concepts – 10th dition 2!15 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Types of System Calls Process control create process, terminate process end, abort load, execute get process attri! tes, set process attributes wait for time wait event, signal event allocate and free memory Dump memory if error Debugger for determining bugs, single step execution Locks for managing access to shared data !etween processes Operating System Concepts – 10th dition 2!20 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Types of System Calls (cont.) File management create file# delete file open, close file read, write, reposition get and set file attributes Device management request device# release device read, write, reposition get device attributes, set device attributes logically attach or detach devices Operating System Concepts – 10th dition 2!21 Silberschatz, Galvin and Gagne ©2018, revised by S. Weiss 2020 Types of System Calls (Cont.) Information maintenance get time or date, set time or date get system data, set system data get and set process# file, or device attri! tes Communications create# delete communication connection send, receive messages if message passing model to host name or process name 1rom client to server Shared-memory model create

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    57 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us