Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 70 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
70
Dung lượng
1,07 MB
Nội dung
Chapter OS OVERVIEW Introduction 1 What is an Operating System? • A program that manages the computer hardware • Provides a basis for application programs • Acts as an intermediary between the computer user and hardwares 1.2 What Operating System A computer system can be divided into four components: the hardsware, the operating system, the application programs and users • User view • System view Figure 1.1 Abstract view of the components of a computer system 1.2.1 User View The user’s view of the computer varies according to the interface being used • One user to monopoly resource • Many users access the computer • Many users sit at workstations connected to networks of other workstation and servers • Handheld computer • Embedded computer in home devices and automobiles 1.2.2 System View • An operating system is the program most intimately involved with the hardware An operating system as a resource allocator-> the manager of the resource • An operating system is a control program that manages the execution of the user programs to prevent errors and improper use of the computer • It is especially concerned with the operation and control of I/O devices 1.3 Computer System Organnization •One or more CPUs Figure 1.2 A modern coputer system •Device controller connected to common bus that provides access to share memory •CPU and device controller can execute concurrently •Memory controller provides whole synchronize access to the memory function is to 1.3.1 Computer System Operation • When it is power up or reboot- it needs to have an initial program or bootstrap program to run Bootstrap program is stored in ROM • Bootstrap program initalizes all aspects of the system, from CPU register to device controllers to memory contend • To load the operating system and start executing the system, bootstrap program must locate and load into memory the operating system kernel • The operating system then starts executing the first process-”init” and wait for some event to occur • The occurrence of an event is usually signaled by an interrupt from either the hardware or the software Hardware may trigger an interrupt at any time by sending a signal to the CPU, usually by way of the system bus Software may trigger an interrupt by executing a special operation called a system call (also called a monitor call) • When the CPU is interrupted, it stops what it is doing and immediately transfers execution to a fixed location The fixed location usually contains the starting address where the service routine for the interrupt is located The interrupt service routine executes; on completion, the CPU resumes the interrupted computation Figure 1.3 Interrupt time line for a single process doing output 1.3.2 Storage Structure • Computer programs must be in main memory (RAM) to be executed • RAM is only storage area that the processor can access directly • RAM forms an array of memory words Each word has its own address • Interaction is achieved through a sequence of load or store instruction to specific memory address • The load moves a word from RAM to an internal register within the CPU, whereas the store instruction moves the contend of a register to RAM • RAM is usually too small to store all needed program and data permanently • RAM is volatine storage device that loses its contends when power is turned off or otherwise lost • The most computer system provide secondary storage as an extension of main memory • The wide variety of storage system in a computer system can be organized in a hierarchy according to speed and cost – Higher levels are expensive, fast – Move down: cost per bit decreases, access time increases 1.9.3 Caching • Cashing is an important principle of computer system Information is normally kept in some storage system (such as main memory) As it is used, it is copied into a faster storage system-the cashe-on a temporary basis • When we need a particular piece of information, we first check whether it is in the cash If it is, we use the information directly from the cashe; if it is not, we use the information from the source, putting a copy in the cashe under the assumption that we will need it again soon • Because caches have limit size, cache management is an important design problem Careful selection of the cashe size and of a replacement policy can result in greatly increated performance Hình 1.9 Performance of various levels of storage 1.10 Protection and security If a computer system has multiple users and allows the execution of multiple process, then access to data must be regulated For that purpose, mechanisms ensure that files, memory segments, CPU, and other resources can be operated on by only those processes that have gained proper authorization from the operating system • Protection is any mechanism for controlling the access of processes or user to the resources defined by a computer • A system can have adequate protection but still be prone to failure and allow inappropriate access Consider a user whose authentication information is stolen Her data could be copied or deleted, even though file and memory protection are working • Security is that to defend a system from external and internal attacks Such attack thread across a huge range and include viruses and worms denial-of-service, theft of service (unauthorized use of a system)… • Protection and security require the system to be able to distinguish among all its users Most operating systems maintain a list of user names and associated user identifier (user IDs) 1.11 Operating System Evolution Operating System Structures (Reference) 2.1.Operating System Services 2.2.User Operating System Interface 2.3.System Calls 2.4.Type Of System Calls 2.5.System Program 2.6.Operating System Struture 2.7.Virtual Machine 2.8.Operating System Generation 2.9.System Boot 2.1.Operating System Services Figure 2.1 Operating System Services 2.2.User Operating System Interface • Command Line Interface (CLI) or command interpreter allows direct command entry • Graphical User Interfaces (GUI) – Usually mouse, keyboard, and monitor – Icons represent files, programs, actions, etc – Various mouse buttons over objects in the interface cause various actions (provide information, options, execute function, open directory (known as a folder) • Many systems now include both CLI and GUI interfaces 2.3 System Calls • Programming interface to the services provided by the OS • Typically written in a high-level language (C or C++) • Mostly accessed by programs via a high-level Application Program Interface (API)rather than direct system call use • Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) • Why use APIs rather than system calls? 2.4.Type Of System Calls • • • • • • Process control File management Device management Information maintenance Communications Protection 2.5.System Program • Provide a convenient environment for program development and execution • File management -Create, delete, copy, rename, print, dump, list, and generally manipulate files and directories • Status information • File modification • Programming-language support -Compilers, assemblers, debuggers and interpreters sometimes provided • Program loading and execution-Absolute loaders, relocatableloaders, linkage editors, and overlay-loaders, debugging systems for higher-level and machine language • Communications -Provide the mechanism for creating virtual connections among processes, users, and computer systems 2.6.Operating System Struture • Simple structure • Layered Approach • Microkernels • Modules 2.7.Virtual Machine 2.8.Operating System Generation • Operating systems are designed to run on any of a class of machines; the system must be configured for each specific computer site • SYSGEN program obtains information concerning the specific configuration of the hardware system • Booting–starting a computer by loading the kernel • Bootstrap program–code stored in ROM that is able to locate the kernel, load it into memory, and start its execution 2.9.System Boot • An operating system must be made available to hardware so hardware can start it Reference: Silberschatz-Galvin-Gagne, Operating System Concepts, USA, 2005 (http://www.os-book.com) ... application to run on any host that is attached to the SAN If the host fails, then any other host can take over 1.4.4 Distributed Systems • A distributed system is a collection of loosely coupled processors... one main CPU capable of execute a generalpurpose instruction set, including instruction from user process • Almost all system have other special-purpose processors as well They may come in the... applications The hotstandby host machine does nothing but monitor the active server If the server fails, the hot-standby host becomes the active server • In symmetric mode, two or more hosts are running