Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Operating Systems Concepts

Similar presentations


Presentation on theme: "Introduction to Operating Systems Concepts"— Presentation transcript:

1 Introduction to Operating Systems Concepts
Chapters 1 and 2 These slides include text, figures, and information from Operating Systems Concepts, by Silberschatz, Galvin, and Gagne. They also include material from the slides that accompany that textbook and from slides made by Dr. Roger deBry.

2 Four components of a computer system
Users User User User Four components of a computer system Programs System and Application Programs API: Language Libraries and System Calls OS Operating System Kernel Hardware CPU

3 OS as an abstract machine
This program does not need to have information about the particular hardware in the computer system. It sees the computer as an abstract machine. Executing Program Operating System Details of the actual hardware and devices are hidden. Hardware Device Device Device

4 OS as a resource manager
This program has no sense of sharing the system’s resources with other programs. It sees an abstract machine that has all of the resources that it needs. Executing Program Resources Memory CPU General purpose registers Status registers Stack Input/Output devices Execution Context Operating System Hardware Device Device Device

5 Computer system organization
app app app cpu memory system bus . . . disk controller device controller device controller printer keyboard

6 Computer system operation
app app app cpu memory The CPU and devices work concurrently. system bus Each device controller is in charge of a particular device type. . . . disk controller device controller device controller printer keyboard

7 Interrupts An interrupt causes control to branch to an interrupt service routine through an interrupt vector. The address of the interrupted instruction is saved. Incoming interrupts are disabled while an interrupt is being processed. A trap is a software generated interrupt. An operating system is interrupt driven. The operating system saves the state of the CPU (registers, PC), handles the interrupt, and then resumes where it left off.

8 von Neumann architecture

9 I/O Processing Synchronous Asynchronous requesting process
device driver wait interrupt handler hardware data requesting process device driver interrupt handler hardware data

10 I/O Processing Synchronous I/O requesting process
device driver wait interrupt handler hardware data 1. A process starts an I/O operation 2. The requesting process waits until the I/O completes

11 I/O Processing Asynchronous I/O requesting process
device driver interrupt handler hardware data 1. A process starts an I/O operation. 2. An acknowledgement is returned. 3. The process continues execution. 4. The device interrupts the process when the I/O is complete.

12 Storage-device hierarchy
Speed Cost Volatility Caching Device drivers

13 Performance of various levels of storage
Silberschatz Figure 1.11

14 Processor Modes Modern computing hardware provides multiple modes of operation: User Mode Cannot execute all machine instructions (e.g. I/O). Can only access memory allocated to the process. Privileged Mode Executes any instruction in the repertoire. Can access protected memory. Only executes trusted software (The OS kernel).

15 Dual-mode operation User mode Kernel mode
Protect the OS and other system components User mode Kernel mode System calls Privileged instructions

16 Process management Schedules the processor so that each thread/process receives an equitable fraction of the available time, and maintains the execution context for each thread (stack, registers, etc) Allocates resources to processes when they are requested and keeps track of resources when a thread is finished with them. Isolates access to resources or allows sharing of resources as required.

17 Threads A thread, or thread of execution, is the set of instructions being executed in a process. Single-threaded environment Multi-threaded environment Each thread has its own runtime stack, registers, and state information, but they all share the same address space in memory (program and data), and the same files.

18 Memory management Keeps track of which parts of memory are currently being used and by whom. Decides which processes (or parts thereof) and data to move into and out of memory. Allocates and deallocates memory space as needed. Provides virtual memory (address space larger than physical memory).

19 File Management Works with the device managers to give applications a logical view of storage (byte stream, indexed data, text files, etc), and manage the flow of information between the actual storage device and the program.

20 Device Management The OS manages the allocation, isolation, and sharing of devices. * Terminals * Disk Drives * Printers * Networks * Keyboard * etc

21 Device Drivers Device Independent Part
Application Programming Interface Device Independent Part Device Driver Interface Vendor Specific Part Vendor Specific Part Vendor Specific Part

22 Operating system services

23 Command interpreter CLI or command interpreter allows direct command entry Sometimes implemented in kernel, sometimes by systems program Sometimes multiple flavors implemented – shells Primarily fetches a command from user and executes it Sometimes commands built-in, sometimes just names of programs If the latter, adding new features doesn’t require shell modification

24 System calls

25 System calls

26 Standard C library example

27 Operating System Structure
Monolithic: MS-DOS, Unix Layered: iOS Microkernel: Mach (used in macOS) Modules: Solaris, Linux

28 Monolithic: MS-DOS

29 Monolithic: Unix

30 Layered iOS

31 Microkernel: Mach Move as much as possible from kernel space into user space. Message passing

32 macOS

33 Modules: Solaris Kernel modules are loaded as needed.
Modules communicate with each other over known interfaces.

34 Structure summary Structure Examples Advantages Disadvantages
Monolithic Unix, MS-DOS, Windows Performance Hard to implement and maintain Layered iOS Modular, easy to implement and debug Hard to define layers, less efficient Microkernel Mach, macOS Easy to extend, easy to port, more stable Performance is not as good Modules Hybrids that include modules: Linux, Solaris, and Windows Modular, more flexible

35 System boot Bootstrap loader stored in ROM or
ROM code loads bootstrap loader from boot block Bootstrap loader loads kernel and starts it running


Download ppt "Introduction to Operating Systems Concepts"

Similar presentations


Ads by Google