🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

chapter1 OS.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Document Details

FreshLearning9511

Uploaded by FreshLearning9511

Tags

operating systems computer architecture system management

Full Transcript

CHAPTER 1 INTRODUCTION TO OPERATING SYSTEM Topics  Describe the definition of OS.  Identify the basic functions of OS.  Describe the various type of OS structure.  Describe various architecture of OS used in different platforms.  Identify various product of OS.  Describe the foll...

CHAPTER 1 INTRODUCTION TO OPERATING SYSTEM Topics  Describe the definition of OS.  Identify the basic functions of OS.  Describe the various type of OS structure.  Describe various architecture of OS used in different platforms.  Identify various product of OS.  Describe the following concepts in relation to OS.  Describe the components of OS.  Describe the interaction by using graphical representation between applications and the OS.  Identify the different interfaces of OS.  Describe the relationship between system calls and API. DEFINITION OF OPERATING SYSTEM OS IS THE SOUL OF ♦ A program that acts as an intermediary THE COMPUTER between a user and the computer hardware ♦ An operating system, or OS, is a software program that enables the computer hardware to communicate and operate with the computer software. Without a computer operating system, a computer would be useless ♦ OS can also be considered to be managers of the resources. An OS determines which computer resources will be utilized for solving which problem and the order in which they will be used ♦ Software controlling the overall operation of a multipurpose computer system, including such tasks as memory allocation, input and output distribution, interrupt processing, and job scheduling. Cont…  Software program that controls the hardware.  Definition of an OS can be seen in 4 aspects: 1) A group of program that acts as an intermediary between a user and the computer hardware 2) Controls and co-ordinates the use of computer resources among various application programs and user 3) Acts as a manager 4) Allow the program to communicate with one another MAIN RESPONSIBILITY OF OS 3 main responsibilities of OS: 1) Perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers. 2) Ensure that different programs and users running at the same time do not interfere with each other. 3) Provide a software platform on top of which other programs (i.e., application software) can run. BASIC FUNCTIONS OF OS 5 Basic Functions of OS Managing Provide a Running Resources User Interface Application Support for Control to the Built-In Utility Computer Programs Hardware 1) Managing Resources  These programs coordinate all the computer’s resources including keyboard, mouse, printer, monitor, storage devices and memory.  An operating system creates a file structure on the computer hard drive where user data can be stored and retrieved. When a file is saved, the operating system saves it, attaches a name to it, and remembers where it put the file for future use.  The way an operating system organizes information into files is called the file system. Most operating systems use a hierarchical file system, which organizes files into directories (folders) under a tree structure.  The beginning of the directory system is called the root directory. Screenshot of tree structure when using Windows Explorer. 2) Providing a user interface  Users interact with application programs and computer hardware through a user interface. Almost all operating systems today provide a windows-like Graphical User Interface (GUI) in which graphic objects called icons are used to represent commonly used features. 3) Running applications  These programs load and run applications such as word processors and spreadsheets. Most operating systems support multitasking, or the ability to run more than one application at a time.  When a user requests a program, the operating system locates the application and loads it into the primary memory or RAM of the computer.  As more programs are loaded, the operating system must allocate the computer resources. 4) Support for built-in utility programs  The operating system uses utility programs for maintenance and repairs.  Utility programs help identify problems, locate lost files, repair damaged files, and backup data. The figure here shows the progress of the Disk Defragmenter, which is found in Programs > Accessories > System Tools. 5) Control to the computer hardware  The operating system sits between the programs and the Basic Input Output System (BIOS).  The BIOS controls the hardware. All programs that need hardware resources must go through the operating system.  The operating system can either access the hardware through the BIOS or through the device drivers. OS STRUCTURE 1.Monolithic 2.Layered 3.Microkernel 4.Networked & Distributed 1) Monolithic ♦ This system considered as “ The big mess” because this structure is no structure actually ♦ The components of monolithic system are unorganized ♦ Any module can call any other module without any reservation. ♦ The system is a collection of procedures ♦ Each procedure can call any other procedure ♦ No information hiding ♦ A system call interface (main program, sys calls, utility functions) ♦ Example system : Linux, Windows, CP/M (Control Program for Microcomputers) & MS-DOS Cont. Monolithic  Pros 1) Shared kernel space 2) Good performance  Cons 1) No information hiding 2) Inflexible 3) Chaotic 4) Difficult to understand Monolithic Operating System ♦When a user mode program calls a system service, the processor traps the call and switches the calling thread to kernel mode. ♦ Completion of system service, switches the thread back to the user mode, by the OS and allows the caller to continue. A simple structuring model for a monolithic system ♦ A main program that invokes the requested service procedure. ♦ A set of service procedures that carry out the system calls. ♦ A set of utility procedures that help the services procedures. 2) Layered Generalization of previous scheme Organization into a hierarchy of layers Layer n+1 uses services (exclusively) supported by layer n Easier to extend and evolve ♦The OS is divided into a number of layers (levels), each built on top of lower layers. ♦This system had 6 layers. The Structure of the THE (Dijkstra,1968) operating system ♦ Layer 0 dealt with allocation of the processor, switching between processes when interrupts occurred or timers expired. Layer 0 provided the basic multiprogramming of the CPU. ♦ Layer 1 did the memory management. It allocated space for processes in main memory and on a 512k word drum used for holding parts of processes (pages)for which there was no room in main memory. The layer 1 software took care of making sure pages were brought into memory whenever they were needed. ♦ Layer 2 handled communication between each process and the operator console. Above this layer each process effectively had its own operator console. ♦ Layer 3 took care of managing the I/O devices and buffering the information streams to and from them. ♦ Layer 4 was where the user programs were found. They did not have to worry about process, memory, console, or I/O management. ♦Layer 5 The system operator process was located in layer 5. ♦Example system: VAX /VMS, MULTICS, UNIX 3) Microkernel Moves as much as possible from the kernel into “user” space Communication takes place between user modules using message passing Benefits: - easier to extend a microkernel - easier to port the operating system to new architectures - more reliable (less code is running in kernel mode) - more secure (a server crashing in userspace) Not clear what should go into the microkernel Example: Mach, QNX, NT, L4 Monolithic vs. Microkernel Monolithic tend to be easier to design, therefore faster development cycle and more potential for growth Monolithic tend to be more efficient due to use of shared kernel memory (instead of IPC) – However, very efficient micro kernels have been designed in research and laboratory settings Microkernel tend to be used for embedded systems (e.g. robotic, medical etc.) In Microkernel, Many OS components reside in their own, private protected address space (not possibly in Monolithic designs) Monolithic Microkernal 1. easier to design, therefore faster 1.Micro. tend to be used for embedded development cycle and more systems (e.g.,.robotic, medical etc.) potential for growth (see Linux). 2. Many OS components reside in their 2. more efficient due to use of shared own, private protected address space kernel memory. (not possibly in Monolithic designs) 3. Functionality of the OS is invoked 3. Microkernal provide minimal with simple function calls within the process and memory management, kernel, which is one large program. and a communications facility. 4. It runs every basic system service 4. Communication between like process and memory components of the OS is provided by message passing management, interrupt handling and I/O communication, file system, etc. 5. Communication takes place in kernel space. between user modules using message passing 5. This system considered as “ The big mess” because this structure is no structure actually 4) Network  A network operating system (NOS) is a software program that controls other software and hardware that runs on a network.  It also allows multiple computers, also known as network computers, to communicate with one main computer and each other, so as to share resources, run applications, and send messages, among other things.  A computer network can consist of a wireless network, local area network (LAN), a wide area network (WAN), or even two or three computer networks.  The heart of any of these networks, however, is the network operating system. – Designed to work on network servers – Such machines often have multiple processors and fault-tolerance built into them – High level of reliability is required – Eg. Windows NT Server, Windows Server 2003, Unix/Linux for servers,Novell Netware Distributed An operating system which manages a collection of independent computers and makes them appear to the users of the system as a single computer. ARCHITECTURE OF OS USED IN DIFFERENT PLATFORMS 1. Single-processor systems  System that execute the one process at the time and the next job when process is completed.  A single processor is one which the system has single CPU. In a single processor system there will never be more than one running process.  If there are more processes, the rest will have to wait until the CPU is free. Cont…  A uniprocessor system is defined as a computer system that has a single central processing unit that is used to execute computer tasks.  Most desktop computers are now shipped with multiprocessing architectures. 2. Multiprocessor systems - Multiprocessor OS refers to the use of two or more central processing units (CPU) within a single computer system. - These multiple CPUs are in a close communication sharing the computer bus, memory and other peripheral devices. - These systems are referred as tightly coupled systems. 3. Clustered systems  Cluster consists of a set of loosely connected or tightly connected computers that work together so that in many respects they can be viewed as a single system.  The components of a cluster are usually connected to each other through fast local area networks ("LAN"), with each node (computer used as a server) running its own instance of an OS.  Computer clusters emerged as a result of convergence of a number of computing trends including the availability of low cost microprocessors, high speed networks, and software for high performance distributed computing. DIFFERENCES BETWEEN CLOSED SOURCE SYSTEM AND OPEN SOURCE SYSTEM Closed Source Open Source 1)Closed-source model source 1)Open-source operating code is not released to the systems use code that is freely- public. Traditionally, they are distributed sold for a profit. 2)Closed-source operating 2) Open-source operating systems use code that is systems code is available to proprietary and kept secret to anyone to use, even for prevent its use by other commercial purposes. entities. 3)Closed-source operating 3) Examples of computer open- systems include Microsoft source operating systems Windows, Solaris Unix and OS X. include Linux, FreeBSD and Open Solaris. VARIOUS PRODUCT /TYPES OF OS IN TODAY’S MARKET SUN / SOLARIS MICROSOFT WINDOWS LINUX MAC OS VARIOUS VERSIONS OF WINDOWS OPERATING SYSTEM WINDOWS 95 WINDOWS 98 WINDOWS 2000 WINDOWS ME WINDOWS XP WINDOWS VISTA WINDOWS 7 DISTRIBUTIONS OF LINUX OPERATING SYSTEM UBUNTU LINUX SUSE LINUX RED HAT LINUX CENTOS LINUX DEBIAN LINUX FEDORA LINUX TURBO LINUX Multitasking Caching Multiprogramming CONCEPTS IN RELATION TO OS Time Spooling Sharing Buffering Multitasking  The ability to execute more than one task at the same time, a task being a program.  In multitasking, only one CPU is involved, but it switches from one program to another so quickly that it gives the appearance of executing all of the programs at the same time.  There are two basic types of multitasking: preemptive and cooperative.  In preemptive multitasking, the operating system parcels out CPU time slices to each program.  In cooperative multitasking, each program can control the CPU for as long as it needs it. If a program is not using the CPU, however, it can allow another program to use it temporarily.  OS/2, Windows 95, Windows NT, the Amiga operating system and UNIX use preemptive multitasking  Microsoft Windows 3.x and the MultiFinder (for Macintosh computers) use cooperative multitasking. Multiprogramming  The multiprogramming operating system could manage resources more efficiently. More than one user’s program can be resident in main memory at one time.  In this system, multiple jobs are loaded into the central memory, and each is allotted some CPU-TIME, a tiny fraction of a second during which it receives the CPU’s attention.  When a job’s CPU-TIME is up, it is suspended and control passes to the next job, which can continue from where it left off before.  In simpler terms the CPU is switched rapidly between the different programs. This means the system does not have to wait for one job to be completed before starting the next. BUFFERING  A buffer is a region of memory used to temporarily hold data while it is being moved from one place to another.  Typically, the data is stored in a buffer as it is retrieved from an input device (such as a keyboard) or just before it is sent to an output device (such as a printer).  However, a buffer may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication.  Buffers can be implemented in either hardware or software, but the vast majority of buffers are implemented in software.  Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler. Spooling  Spooling refers to the process of placing data in a temporary working area for another program to process.  Spooling is useful because devices access data at different rates. Spooling allows one program to assign work to another without directly communicating with it.  The most common spooling application is print spooling: documents formatted for printing are stored usually into an area on a disk and retrieved and printed by a printer at its own rate. Printers typically can print only a single document at a time and require seconds or minutes to do so. With spooling, multiple processes can write documents to a print queue without waiting.  As soon as a process has written its document to the spool device, the process can perform other tasks, while a separate printing process operates the printer. Caching  A process where the component transparently stores data so that future requests for that data can be served faster. COMPONENTS OF OS Kernel which represents the operating system's basic functions such as management of memory, processes, files, main inputs/outputs and communication functionalities. Shell allowing communication with the operating system via a control language, letting the user control the peripherals without knowing the characteristics of the hardware used, management of physical addresses, etc. File system allowing files to be recorded in a tree structure. INTERACTION BETWEEN APPLICATIONS AND THE OS Standard Relationship between Hardware, Operating System, and Applications INTERFACES OF OS  Every computer that is to be operated by an individual requires a user interface.  The user interface requests services from the operating system that will acquire data from input hardware devices, such as a keyboard, mouse or credit card reader, and requests operating system services to display prompts, status messages and such on output hardware devices, such as a video monitor or printer.  User interfaces have different types:  Command line interface  Voice-actuated interface  Graphical User Interface  Web-form interface 1. Command Line Interface Command Line Interface, where the user provides the input by typing a command string with the computer keyboard and the system provides output by printing text on the computer monitor. Used by programmers and system administrators, in engineering and scientific environments, and by technically advanced personal computer users. Problem with Command Line Interface Users have to learn and remember a command language. Command interfaces are therefore unsuitable for occasional/novices users Users make errors in command. An error detection and recovery system is required System interaction is through a keyboard so typing ability is required Example of Command Line Interface An example of the command line. Each command is typed out after the 'prompt', and then its output appears below, working its way down the screen. The current command prompt is at the bottom. 2. Voice User Interfaces Voice user interfaces, which accept input and provide output by generating voice prompts. The user input is made by pressing keys or buttons, or responding verbally to the interface. 3. Graphical User Interfaces (GUI) Graphical user interfaces (GUI) accept input via devices such as computer keyboard and mouse and provide articulated graphical output on the computer monitor. Most users of business systems interact with these systems through graphical interfaces although, in some cases, legacy text-based interfaces are still used. Advantages of GUI They are easy to learn and use. - Users without experience can learn to use the system quickly. The user may switch quickly from one task to another and can interact with several different applications. - Information remains visible in its own window when attention is switched. Fast, full-screen interaction is possible with immediate access to anywhere on the screen Example of GUI An example of a graphical user interface. Programs take the form of images on the screen, and the files, folders, and applications take the form of icons and symbols. A mouse is used to navigate the computer. 4. Web Based Form Interface Web based form interface accept input and provide output by generating web pages which are transmitted via the internet and viewed by the user using a web browser. Users can fill in all the particulars required in the form provided by the web browser. Example: Student registration form Borrowing books form(library) online Example of Web Based Form Interface NE W BOOK Title ISBN Author Price Publication Publisher date Number of Edition copies Classification Loan status Date of Order purchase status OS How it works? Example Interfaces It is a mechanism for interacting with a Microsoft command a) command computer operating prompt system or software by typing commands line Linux terminal to perform specific tasks. It involves a voice command A mobile phones with b) voice device where the device is controlled by voice- actuated the human voice. activated dialling. A user interface that allows the user to c) Graphical activate operating system commands by GUI of Windows / Linux User Interface clicking on a desktop icon using a Ubuntu / Macintosh pointing device such as a mouse or (GUI) touch screen. Login page /online A place where user can enter the input, registration form / d) Web Form such as username, and it will be sent to online shopping / online the database of the server. fund transfer. 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 System Call Implementation  User programs are not allowed to access system resources directly. They must ask the OS to do that for them.  OS provides a set of functions that can be called by user programs to request for OS services. These functions are called “system calls”  System calls run in kernel mode.  They can be called by executing a special instruction (trap or software interrupt) which causes processor to switch to the kernel mode and jump to a previously defined location in the kernel.  When the system call finishes, processor returns to the user program and runs in user mode. Application Programming Interface (API)  An API is a set of functions provided by an operating system or other system software.  An application program calls the functions to request the services.  An API clearly defines how to call functions and what the results are. (API is specification, not implementation)  Examples: APIs for file system, graphics user interface, networking, etc. API and System Calls Diagram Cont…  Portability  User programs that follow the API’s definition are portable.  An API can provide a common interface for different implementations of a service.  For example, the UNIX file system API is the same for all kinds of devices.  Using an API allows upgrading system software without changing user programs RELATIONSHIP BETWEEN SYSTEM CALLS AND API The user application use open() system call to request kernel providing service. The system call table will be searched and find the corresponding system call number. The real implementation is in kernel space. When execution accomplished, there is a result return to user mode. 60

Use Quizgecko on...
Browser
Browser