CS/COE 1550 Intro To Operating Systems

1y ago
14 Views
2 Downloads
1.95 MB
35 Pages
Last View : 16d ago
Last Download : 3m ago
Upload by : Arnav Humphrey
Transcription

CS/COE 1550Intro to Operating SystemsFall 2018Daniel Mossemosse@cs.pitt.edu6423 Sennott Square(Some slides are from Silberschatz, Galvin and Gagne 2013; some from Dr. Khattab)

Course Goal Learn about the internals of operating systems Make it easier to understand why processes run theway they do, and how to optimize systems More info atpeople.cs.pitt.edu/ mosse/courses/cs1550/ TA: Henrique Potter (hep37@cs.pitt.edu)Spring 20182

What is an Operating System?A program that acts as an intermediary between a userof a computer and the computer hardware3

What does an OS do? Manages (controls and arbitrates) resources Processors, Memory, Input/output devices, Communicationdevices, Storage, Software applications Conflicting goals: Performance vs. utilization Provides abstractions to application programs Ease of use Virtualization The one program running at all times on the computer isthe OS kernel. Everything else is either a system program (ships with the operating system) , oran application program.4

How to start everything?bootstrap program is loaded at power-up or reboot Typically stored in ROM or EPROM, generally knownas firmware Initializes all aspects of system Loads operating system kernel and starts executionSpring 2018CS/COE 1550 – Operating Systems – Sherif Khattab5

What does the OS manage?I/O devices6

I/O Devices I/O devices and the CPU can execute concurrently Device controller in charge of a particular device type has a local buffer CPU moves data from/to main memory to/from localbuffers I/O is from the device to local buffer of controller Device controller informs CPU that it has finished itsoperation by causing an interrupt Device Driver for each device controller Provides uniform interface between controller and kernel

Interrupts Interrupt transfers control to the interrupt serviceroutine (ISR) ISRs are segments of code determine what actionshould be taken for each type of interrupt The interrupt vector contains the addresses of allthe service routines A trap or exception is a software-generated interruptcaused either by an error or a user request

Storage Devices Let’s look at a particular type of I/O devices: storagedevices Storage systems organizedin hierarchy with severaltrade-offs Speed Cost Volatility Reliability etc9

OS and Computer System Architecture single general-purpose processorMulti-core special-purpose processors as erconnectcomputerClusteredstorage areanetwork10

OS and Computing Environments Traditional Stand-alone general purpose machines Massively and ubiquitously networked Mobile smartphones, tablets, etc. more OS features (GPS, sensors)11

Computing Environments - ernelVM1VM2VM3virtual machinemanagerhardware(b)12

Operating-System OperationsInterrupt driven (hardware and software)Hardware interrupt by one of the devicesSoftware interrupt (exception or trap):Request for operating system serviceSoftware error (e.g., division by zero)Other process problems include infinite loop, processes trying tomodify each other or the operating system13

Operating-System Operations (cont.) Dual-mode operation allows OS to protect itself andother system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user codeor kernel code Some instructions designated as privileged, only executable inkernel mode System call changes mode to kernel, return from call resets it touser Increasingly CPUs support multi-mode operations virtual machine manager (VMM) mode for guest VMs14

Transition from User to Kernel ModeTimer to prevent infinite loop / process hoggingresourcesTimer is set to interrupt the computer after some time periodOperating system set the counter (privileged instruction)When counter zero generate an interrupt15

Process Management A process is a program in execution. It is a unit ofwork within the system. Program is a passive entity,process is an active entity. Process needs resources to accomplish its task CPU, memory, I/O, files Initialization data Process termination requires reclaim of any reusableresources Single-threaded process has one program counterspecifying location of next instruction to execute Process executes instructions sequentially, one at a time,until completion16

Memory Management To execute a program all (or part) of the instructionsmust be in memory All (or part) of the data that is needed by theprogram must be in memory. Memory management determines what is in memoryand when Memory management activities Keeping track of which parts of memory are currentlybeing used and by whom Deciding which processes (or parts thereof) and data tomove into and out of memory Allocating and deallocating memory space as needed17

Storage Management OS provides uniform, logical view of informationstorage Abstracts physical properties to logical storage unit - file File-System management Files usually organized into directories Access control on most systems to determine who canaccess what OS activities include Creating and deleting files and directoriesPrimitives to manipulate files and directoriesMapping files onto secondary storageBackup files onto stable (non-volatile) storage media18

A View of Operating System Services19

System Calls Programming interface to the services provided bythe OS Typically written in a high-level language (C or C ) Mostly accessed by programs via a high-levelApplication Programming Interface (API) ratherthan direct system call use Three most common APIs are Win32 API forWindows, POSIX API for POSIX-based systems(including virtually all versions of UNIX, Linux, andMac OS X), and Java API for the Java virtualmachine (JVM)20

Example of System CallsSystem call sequence to copy the contents of one file toanother file21

System Call Implementation Typically, a number associated with each system call System-call interface maintains a table indexedaccording to these numbers The system call interface invokes the intendedsystem call in OS kernel and returns status of thesystem call and any return values The caller need know nothing about how the systemcall is implemented22

API – System Call – OS Relationship23

System Call Parameter Passing Three general methods used to pass parameters tothe 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, andaddress of block passed as a parameter in a register This approach taken by Linux and Solaris Parameters placed, or pushed, onto the stack by theprogram and popped off the stack by the operatingsystem Block and stack methods do not limit the number orlength of parameters being passed24

Parameter Passing via Table25

Types of System Calls Process control create process, terminate process end, abort load, execute get process attributes, 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 betweenprocesses26

Types of System Calls 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 devicesSpring 2018CS/COE 1550 – Operating Systems – Sherif Khattab27

Types of System Calls (Cont.) Communications create, delete communication connection send, receive messages if message passing model tohost name or process name From client to server Shared-memory model create and gain access tomemory regions transfer status information attach and detach remote devices28

Types of System Calls (Cont.) Protection Control access to resources Get and set permissions Allow and deny user access29

Examples of Windows and Unix System Calls30

Standard C Library ExampleC program invoking printf() library call, which callswrite() system call31

Operating System Design and Implementation Important principle to separate Policy: What will be done?Mechanism: How to do it? Mechanisms determine how to do something,policies decide what will be done The separation of policy from mechanism is a veryimportant principle, it allows maximum flexibility ifpolicy decisions are to be changed later (example –timer) Specifying and designing an OS is highly creativetask of software engineering

Operating System StructureGeneral-purpose OS is very large programVarious ways to structure OSsSimple structure – MS-DOSMore complex – UNIXLayered – an abstractionMicrokernel – Mach33

Traditional UNIX System StructureBeyond simple but not fully layered34

Microkernel System dware35

Memory Management To execute a program all (or part) of the instructions must be in memory All (or part) of the data that is needed by the program must be in memory. Memory management determines what is in memory and when Memory management activities Keeping track of which parts of memory are currently

Related Documents:

The degree of a polynomial is the largest power of xwith a non-zero coe cient, i.e. deg Xd i 0 a ix i! d if a d6 0 : If f(x) Pd i 0 a ixiof degree d, we say that fis monic if a d 1. The leading coe cient of f(x) is the coe cient of xd for d deg(f) and the constant coe cient is the coe cient of x0. For example, take R R.

Model: 1550-D Conveyor Feeding Asphalt Paver 1550-C Paver Operation Manual Rev 1.3 MATERIAL FEED OPERATION The 1550-D and 1500-C allow you to configure the auger and conveyor operation of the paver for both an Automatic mode and a Manual mode. Use the automatic mode whenever possible to

Model: 1550-C Conveyor Feeding Asphalt Paver 1550-C Paver Operation Manual Rev 1.2 MATERIAL FEED OPERATION The 1550-C and 1500-C allow you to configure the auger and conveyor operation of the paver for both an Automatic mode and a Manual mode. Use the automatic mode whenever possible to

Casio CTK-1500/CTK-1550 User Manual Home » Casio » Casio CTK-1500/CTK-1550 User Manual USER MANUAL Casio CTK-1500/CTK-1550 Piano / Keyboard. Contents [ hide 1 USER’S GUIDE 2 Important! 3 Included Accessories 4 General Guide 5 Back 6 Display 7 Timeout 8 Using the 10-key Pad (9) 9 Number Buttons

1 INQ 15-289 Robertson From: Centorino, Joseph (COE) Sent: Thursday, December 24, 2015 12:14 PM To: 'Ana Hernandez' Cc: Diaz-Greco, Gilma M. (COE); Perez, Martha D. (COE); Sanchez, Rodzandra (COE) Subject: INQ 15-289 Tom Robertson, Esq., Bercow Radell & Fernandez (Lobbyist Training) Ms. Hernandez: You have inquired on behalf of Attorney Tom Robertso

The Select RAM elements power up according to the initialization method used; see Initialization Parameters in Chapter 4 for detailed information. Specifying Memory Contents Using a COE File The initial contents of the memory can be defined using a text file known as a Coefficient (COE) file. COE files must have a .coe extension.

Publication 1398-5.2 – PDF 1997 Table of Contents IntroTable of Contents Table of Contents Intro-3 List of Figures Intro-9 List of Tables Intro-13 Preface Intro-17 Who Should Use this Manual.Intro-17 ULTRA 100 Series Product Receiving and Storage Responsibility. .

ART V02A Intro to Hist of Western Art I 3 ARHS 200 Art of Western World I 3 EHAP, TCNA ART V02B Intro to Hist of West Art II 3 ARHS 2XXX Intro to Hist of West Art II 3 EHAP, EHAP ART V02C Intro to Non-Western Art 3 ARHS 2XXX Intro to Non-Western Art 3 ART V02D Art of Ancient Mediterranean 3