1 / 48

Chapter 1 Introduction to Operating System

Chapter 1 Introduction to Operating System. Bernard Chen Spring 2007. Outline. 1.1 What is OS 1.2 Computer System Organization 1.3 Computer System Architecture 1.4 OS Structure 1.5 OS Operations 1.6-1.8 Process, Memory, Storage management 1.9 Protection and Security 1.10~ Systems.

gina
Download Presentation

Chapter 1 Introduction to Operating System

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. Chapter 1Introduction to Operating System Bernard Chen Spring 2007

  2. Outline 1.1 What is OS 1.2 Computer System Organization 1.3 Computer System Architecture 1.4 OS Structure 1.5 OS Operations 1.6-1.8 Process, Memory, Storage management 1.9 Protection and Security 1.10~ Systems

  3. 1.1 What is Operating System? • An operating system is a program that manages the computer hardware. • It also provides a basis for application programs and acts as an intermediary between the computer user and computer hardware.

  4. What do Operating System do? • The computer system can be divided roughly into four components: • The hardware • The operating system • The application software • The Users

  5. USER View of OS • Ease to use (Home PCs) • Efficient resource utilization (Work stations)

  6. SYSTEM view of OS • OS is a resource allocator Manages all resources (CPU time, memory space, storage space, I/O and so on) Decides between conflicting requests for efficient and fair resource use • OS is a control program Controls execution of programs to prevent errors and improper use of the computer

  7. 1.2 Computer System Organization • Basic Organization • Storage Structure • I/O structure

  8. Computer Startup Bootstrap program is loaded at power up or reboot • Typically stored in ROM, generally known as firmware • Initialize all aspects of system • Loads operating system kernel and starts execution

  9. 1.2.1 Computer System Organization

  10. 1.2.1 Computer System Organization • I/O devices and the CPU can execute concurrently. • Each device controller is in charge of a particular device type. • Each device controller has a local buffer.

  11. Interrupt Timeline

  12. 1.2.2 Storage Structure Main Memory: • Main memory is the only large storage media that the CPU can access directly • Main memory is usually too small to store all needed programs and data • Main memory is a volatile storage device that loses its contents when power is off

  13. 1.2.2 Storage Structure • Therefore, most computer provide secondary storage as extension to store web browser, compliers, word processors…etc

  14. Storage Device Hierarchy

  15. 1.2.2 Storage Structure • Storage systems organized in hierarchy. Speed Cost Volatility • Caching–copying information into faster storage system; main memory can be viewed as a last cache for secondary storage.

  16. Performance of Various Levels of Storage

  17. Caching • Information in use copied from slower to faster storage temporarily • Important principle, performed at many levels in a computer (in hardware, operating system, software)

  18. Caching • Faster storage (cache) checked first to determine if information is there If it is, information used directly from the cache (fast) If not, data copied to cache and used there • Cache is usually smaller than storage being cached • Cache management is an important design problem • Cache size and replacement policy

  19. 1.3 Computer-System Architecture • 1.3.1 Single-Processor Systems • 1.3.2 Multiprocessor Systems • 1.3.3 Cluster Systems

  20. 1.3.1 Single-Processor Systems • On a single processor system, there is only one main CPU capable of executing a general purpose instruction set. • Some other special-purpose processors may also included. Such as: GPU Disk-controller microprocessor Keyboard microprocessor

  21. 1.3.2 Multiprocessor Systems • Also called Parallel Systems • Advantages: • Increase throughput • Economy of scale • Increase reliability (fault tolerant)

  22. 1.3.2 Multiprocessor Systems • Two types of multiprocessor systems: 1. Asymmetric multiprocessing (master and slave processors) 2. Symmetric multiprocessing (Shared memory system)

  23. 1.3.3 Clustered Systems • Clustered computers share storage and are closely linked via Local-area network (LAN) or a faster interconnection.

  24. 1.4 OS Architecture One of the most important aspect of OS is the ability to Multiprogramming • Single user cannot keep CPU and I/O devices busy at all times • One job selected and run via job scheduling • When it has to wait (for I/O for example), OS switches to another job

  25. Memory Layout for Multiprogrammed System

  26. Multiprogramming • Jobs are stored in “Job Pool” • Virtual memory is the useful technique for the limitation size of physical memory

  27. 1.5 OS operations • Interrupt (driven by hardware) vs. Trap (called by software or error) • Trap example: divide by 0; invalid memory access • We need to make sure that an error in a user program could cause problems only for the one program that was running (such as infinite loop)

  28. Dual Mode Operation • Dual-mode operation allows OS to protect itself and other system components • It contains user mode (mode bit:1) and Kernel mode (mode bit:0) • The operating system loaded user application starts in user mode. Whenever a trap or interrupt occurs, hardware switches to kernel mode.

  29. Transition from user to kernel mode

  30. C library handling of write() #include<stdio.h> Int main() { … printf(“hellow world”); … } User mode Standard C library Kernel mode Write() system call

  31. Dual Mode Operation • Privileged instructions: some machine instructions that may cause harm, can only be executed in kernel mode. • Such as instruction switch to user mode; I/O control; timer management, and interrupt management.

  32. Timer To prevent the OS out of control by CPU • Set interrupt after specific period • Operating system decrements counter • When counter zero generate an interrupt • Set up before scheduling process to regain control or terminate program that exceeds allotted time

  33. Process management • A process is a program in execution. It is a unit of work within the system. • Process needs resources to accomplish its task CPU, Memory, files, I/O devices • Process termination requires reclaim of any reusable resources

  34. Process management • Single-threaded process has one program counter (PC) specifying location of next instruction to execute Process executes instructions sequentially, one at a time until completion • Multi-threaded process has one program counter per thread

  35. Process management The operating system is responsible for the following activities in connection with process management: • Creating and deleting both user and system processes (Ch3) • Suspending and resuming processes (Ch5) • Providing mechanisms for process synchronization (Ch6) • Providing mechanisms for process communication (Ch4) • Providing mechanisms for deadlock handling(ch7)

  36. Memory Management • All data in memory before and after processing • All instructions in memory in order to execute • Memory management determines what is in memory when optimizing CPU utilization and computer response to users

  37. Memory management activities • Keeping track of which parts of memory are currently being used and by whom • Deciding which processes and data to move into and out of memory • Allocating and deallocating memory space as needed

  38. Storage Management OS provides uniform, logical view of information storage • file • Each medium is controlled by device (i.e., disk drive, tape drive)

  39. Storage Management File-System management • Files usually organized into directories • Access control on most systems to determine who can access what • OS activities include • Creating and deleting files and directories • Primitives to manipulate files and dirs • Mapping files onto secondary storage • Backup files onto stable (non-volatile) storage media

  40. Mass Mass-Storage Management • Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time. • OS activities • Free-space management • Storage allocation • Disk scheduling • Tertiary storage includes optical storage, magnetic tape • Varies between WORM (write-once, read-many-times) and RW (read-write)

  41. Protection and Security • Protection–any mechanism for controlling access of processes or users to resources defined by the OS (Ch14) • Security–defense of the system against internal and external attacks even when protection is activated (Ch15) (including denial-of-service, worms, viruses, identity theft, theft of service)

  42. Protection and Security Systems generally first distinguish among users, to determine who can do what • User identities (user IDs, security IDs) include name and associated number, one per user • User ID then associated with all files, processes of that user to determine access control • Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file • Privilege escalation allows user to change to effective ID with more rights

  43. Computing Environments Traditional computer • Used to be single system, then modems • Now firewalled, networked

  44. Client-Server computing • Many system now servers, responding request to clients

  45. Peer Peer-to to-Peer Computing • Another model of distributed system • P2P does not distinguish clients and servers • Instead all nodes are considered peers • May each act as client, server or both • Node must join P2P network

  46. Web-Based computing • Web has become ubiquitous • More devices becoming networked to allow web access, such as work stations, PDA, even cell phone

  47. Operating System Services • User interface • Program execution • File-system manipulation • Communication • Error detection • Resource allocation • Accounting • Protection and security

More Related