1 / 36

OS Concepts An Introduction

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 does, and what the major components of an operating system are. What is an Operating System?.

josie
Download Presentation

OS Concepts An Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OS ConceptsAn 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.

  3. What is an Operating System?

  4. EDSAC – the world’s first stored program computer, built at Cambridge University. It ran its first program in 1949.

  5. Early computers were fantastically expensive ($M) and were expensive to run and maintain. They were single user machines. Programmers dealt with the machine at a very low level. There was limited input and output. Input Device Output Device Computer

  6. This is not so different from your laptop or home computer. Your computer supports a single user at a time. Input usually comes from the keyboard and mouse, and output is usually the display. Input Device Output Device Computer

  7. IBM System Z Mainframe System Thousands of users, multiple applications and I/O devices

  8. User User User Application Programs Language Libraries and System Calls API Operating System Kernel CPU

  9. personal computer mainframe system smart phones game controllers tablets imbedded systems

  10. This program has no sense of sharing the system’s resources with other programs. It sees an Abstract Machinethat provides the resources that it needs. Executing Program Application Programs Language Libraries and System Calls Operating System Kernel CPU

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

  12. Computer System Organization

  13. cpu memory system bus . . . disk controller device controller device controller printer keyboard

  14. Key Concepts multiple applications share the cpu cpu memory cpu and devices must be able to work concurrently system bus . . . disk controller device controller device controller app app app printer keyboard

  15. cpu memory system bus . . . devices are managed by device controllers disk controller printer controller keyboard controller app app app they may be anything from a chip to a plug in board, to a stand alone unit. printer keyboard

  16. cpu memory system bus disk controller each device controller has a local buffer so it can work independent of the cpu . . . printer controller keyboard controller app app app buffer printer keyboard

  17. cpu memory system bus device controllers send interrupts to the cpu to tell it that they have finished an operation that the cpu told them to do disk controller . . . printer controller keyboard controller app app app buffer printer keyboard

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

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

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

  21. It would be really neat if we could let another application run while this one is waiting. requesting process Synchronous I/O waits 1. A process starts an I/O operation 2. The requesting process waits until the I/O completes device driver interrupt handler hardware data

  22. Processes A process is defined as a program in execution. It includes * The program itself (program segment) * The program’s data (data segment, stack, heap) * Any open files * The execution context (registers, status …)

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

  24. 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 abstract 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. Threads

  25. 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. Resources

  26. Responsibilities of the OS • 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. • * Devices • * Processes and threads • * Memory • * Files

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

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

  29. 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).

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

  31. 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 Design Issues

  32. 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) Processor Modes

  33. User Space User Process Kernel(trusted code) . . . fork( ); . . . Trap Instructions trap table Library Code SYS_FORK fork( ) { … trap SYS_FORK( ) . . . } interrupt sys_fork( ) { /* system function */ . . . return; } Going to the kernel is expensive!

  34. 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 OS Organization

  35. Monolithic or Microkernel 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.

  36. Libraries Utilities Apps Shell The Unix Kernel OS System Call Interface Device Driver Trap Table Device Driver • Monolithic Kernel Module • Process Mgt • Memory Mgt • File Mgt • Device Mgt Driver Interface

More Related