Presentation is loading. Please wait.

Presentation is loading. Please wait.

OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it.

Similar presentations


Presentation on theme: "OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it."— Presentation transcript:

1 OS Concepts An Introduction operating systems

2 At the end of this module, you should have a basic understanding of what an operating system is, what it does, and what the major components of an operating system are. operating systems

3 Why should I study operating systems? operating systems

4 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers Average Salary$71,020$79,300 Average Bonus$ 3,410 $ 3,940 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers Average Salary$71,020$79,300 Average Bonus$ 3,410 $ 3,940 operating systems

5 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers System Mainframe$74,100$80,840 Unix/Linux$76,100$84,100 Windows$71,000$79,300 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers System Mainframe$74,100$80,840 Unix/Linux$76,100$84,100 Windows$71,000$79,300 operating systems

6 operating systems Even as an application programmer, most real commercial applications will require that you Understand OS design issues and tradeoffs Performance Function Space Be able to exploit OS capabilities Multiple Processes Threads Synchronization Communication

7 What Is An Operating System CPU Operating System Kernel Language Libraries and System Calls API System and Application Programs User operating systems

8 personal computermainframe system cell phones Music players game controllers

9 Hardware Device Operating System Executing Program 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.

10 The Abstract Machine Modern computing systems are multi-user, multi-program systems. The fundamental task of an operating system in this environment is to give each running program a logical, abstract machine that contains all of the resources that it needs to do its job. Input/Output devices Memory CPU General purpose registers Status registers Stack Execution Context

11 Computer System Organization system bus cpu disk controller memory device controller printer device controller keyboard... app

12 Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... cpu and devices work concurrently

13 Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... each device controller is in charge of a particular device type

14 Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... Each device controller has a local buffer

15 Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... device controllers send interrupts to the cpu to tell it that they have finished an operation the cpu told them to do

16 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.

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

18 I/O Processing Asynchronous I/O 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 requesting process device driver interrupt handler hardware data

19 ProcessesProcesses A process is defined as a program in execution. It includes * The program itself (program segment) * The program’s data (data segment, stack, heap) * Open files * The execution context

20 For efficiency, modern operating systems allow many processes to be running concurrently. When one process has to wait for something, typically for an I/O operation to complete, the operating systems schedules another process to run. Many programs can be in memory at the same time. The operating system gives each process a slice of time in which to run.

21 ThreadsThreads A thread, or thread of execution, is the set of instructions being executed in a process. In a single thread system each process has exactly one execution engine (the logical machine). In a multi-thread environment, a process may have many execution engines, one for each thread. Thus, each thread has it’s own runtime stack, registers, and state information, but they all share the same address space in memory (program and data), and the same files. In new multi-core machines, each logical engine may run on a real engine.

22 ResourcesResources All of the components required for a program to do it’s job are called resources. * memory * cpu time * devices * files * network connection When a process needs to use a resource, it must ask the operating system for the resource before using it. Once a process asks for a resource, it suspends operation and waits until the resource is available.

23 Responsibilities of the OS 1.Create an abstract machine environment for each running process. 2. Manage the use of the physical components in the system, according to the policies of the system’s administrator or the system designer. * Device management * Process and thread management * Memory Management * File Management

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

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

26 Process & Resource 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.

27 Memory Management Maintains a unique address space in memory for each process. Works with the file and/or device managers to provide virtual memory (address space is larger than physical memory).

28 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.

29 Design Issues Performance: The OS must be as efficient as possible, maximizing the use of machine resources by applications. There is some overhead involved in providing OS services. If the overhead gets too large, it negates the value of the service. Exclusive Use of Resources: Each process must have the ability to have exclusive use of the system resources that it uses. A process must not be able to use a resource unless the OS has given it permission. Sharing of resources should also be allowed. * Protection Mechanisms * Security Policies

30 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)

31 Trap Instructions User Space User Process Library Code... fork( );... fork( ) { … trap SYS_FORK( )... } Kernel trap table SYS_FORK sys_fork( ) { /* system function */... return; } Expensive!

32 OS Organization Monolithic Kernels * All OS function resides in the kernel * Fast * difficult to maintain MicroKernels * The trusted OS software is as small as possible - only the essential OS functions * All other code is implemented in user space * Performance the major issue – many kernel calls required

33 The first king is very reclusive and sits in a small castle with high walls and a few top advisors. The king tells the advisors what to do and they go outside of the small (but well defended) castle and issue orders to the knights, merchants and common-folk. The king never leaves his castle and since only his most trusted advisors are allowed in the king is very safe from attack. However, because each advisor has to pass through several guard points it can sometimes take a little while before the king’s orders can go out or news can come in. The second king is much different. He doesn’t really live in a castle so much as it is a large mansion with beautiful grounds. Strongly defended walls encompass the entire city instead of just the castle. This makes the king and the populace very secure from outside attacks. And since this king is very friendly he goes throughout his city meeting and talking with all of his subjects. Any command he, or his many trusted aides, give are instantly obeyed. This makes his city very efficient. However, should any enemy agents manage to penetrate the outer walls, then they can quite easily assassinate the beloved king. In which case order breaks down and the entire city riots.

34 The Unix Kernel Trap Table Monolithic Kernel Module Process Mgt Memory Mgt File Mgt Device Mgt Driver Interface Device Driver OS System Call Interface LibrariesUtilitiesAppsShell


Download ppt "OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it."

Similar presentations


Ads by Google