Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Operating-System Services and Structure Something completely different... Operating Systems Autumn 2013 CS4023 Operating-System Services and Structure Something completely different... Outline 1 Operating-System Services and Structure OS Services: Assistance to the User OS Services: Efficient Operation OS Operations 2 Something completely different... CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Operating System Definition Intermediary between a user of a computer and the computer hardware Control program Controls execution of programs to prevent errors and improper use of the computer Resource allocator Manages all resources Decides between conflicting requests for efficient and fair resource use CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Operating System Design Design and Implementation of OS not “solvable”, but some approaches have proven successful Internal structure of different Operating Systems can vary widely Affected by choice of hardware, type of system User goals and System goals User goals: operating system should be convenient to use, easy to learn, reliable, safe, and fast System goals: operating system should be easy to design, implement, and maintain, as well as flexible, reliable, error-free, and efficient CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations A View of Operating System Services CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Outline 1 Operating-System Services and Structure OS Services: Assistance to the User OS Services: Efficient Operation OS Operations 2 Something completely different... CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations User Interfaces User interface (UI) Command-Line (CLI) Graphics User Interface (GUI) CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations User Interface – CLI CLI allows direct command entry Sometimes several alternatives implemented – shells Primarily fetches a command from user and executes it Sometimes commands built-in, sometimes just names of programs CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations User Interface – GUI User-friendly interface (desktop metaphor) Usually mouse, keyboard, and monitor Icons represent folders, files, programs, actions, etc. Various mouse buttons over objects in the interface cause various actions Many systems now include both CLI and GUI interfaces Linux, like all UNIXs has CLI and has additional GUI interfaces: KDE, Gnome Microsoft Windows is GUI with CLI “command” shell Apple Mac OS X has “Aqua” GUI interface with UNIX kernel underneath and shells available Solaris is CLI with optional GUI interfaces (Java Desktop) CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Further OS Services (Assistance) Program execution: OS must be able to load a program into memory, run that program, and end execution (either normally or abnormally) I/O operations: A running program (process) may require I/O, which may involve a file or an I/O device File-system manipulation: File system is of particular interest Processes need to read and write files and directories create and delete them search them list file information CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Further OS Services (Assistance) (contd.) Multiprogramming The CPU always has a process to execute; when the currently running process needs to wait (e.g., for I/O), OS allocates the CPU to another job Time-sharing (multitasking) Logical extension to multiprogramming; the CPU switches processes so frequently that users can interact with each process while it is running, creating interactive computing CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Further OS Services (Assistance) (contd.) Communications: Processes may exchange information, on the same computer or over a network Communications may be via shared memory or through message passing Error detection: OS needs to be constantly aware of possible errors May occur in the CPU and memory hardware, in I/O devices, in user program For each type of error, OS should take the appropriate action to ensure correct and consistent computing CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Outline 1 Operating-System Services and Structure OS Services: Assistance to the User OS Services: Efficient Operation OS Operations 2 Something completely different... CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations OS Services to Maintain Efficient Operation Resource allocation: When multiple users or multiple jobs running concurrently, resources must be allocated to each of them Many types of resources: some (such as CPU cycles, main memory, and file storage) may have special allocation protocol (specialist algorithms), others (such as I/O devices) may have general request and release protocol Accounting: To keep track of which users use how much and what kinds of computer resources CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations OS Services to Maintain Efficient Operation (contd.) Protection and security: to control use of shared data (on a multiuser system or a network) Protection involves ensuring that all access to system resources is controlled Security of the system from outsiders requires user authentication, extends to defending external I/O devices from invalid access attempts If a system is to be protected and secure, precautions must be instituted throughout – chain is only as strong as its weakest link CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Outline 1 Operating-System Services and Structure OS Services: Assistance to the User OS Services: Efficient Operation OS Operations 2 Something completely different... CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Supporting Typical OS Operations The interrupt mechanism: Supports several of the typical operations an OS must support: making a system call managing a timer Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Interrupts: System calls Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user Excellent discussion of dual mode here CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Making a System Call Transition from User to Kernel Mode CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Interrupts: Timer Timer to prevent infinite loop / process hogging resources 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 CS4023 Operating-System Services and Structure Something completely different... OS Services: Assistance to the User OS Services: Efficient Operation OS Operations Hierarchical Protection Domains Protection Rings Hierarchical Protection Domains, also known as protection rings Hardware supported rings were introduced by Multics However, most general-purpose UNIX systems use only two rings, even if the hardware it runs on provides more CPU modes than that Privilege rings for X86 processor family CS4023 Operating-System Services and Structure Something completely different... Funny Friday Lost in translation Introducing Rufus T. Firefly, President-to-be(?) of Freedonia CS4023