Operating System - Introduction, Structures - Simple Batch, Multiprogrammed, Time-shared, Personal Computer, Parallel, Distributed Systems, Real-Time Systems, System components, Operating System services, System Calls. Operating System – Introduction ➢Computer System = Hardware + Software ➢Software = Application Software + System Software(OS) ➢System Software: System software is a set of computer programs that is designed to manage system resource (central processing unit (CPU), computer memory, file storage, input/output (I/O) devices, and network connections.). It is also helps application programs to execute correctly. ➢Examples : Operating System, Programming Language Translators, Device Drivers. Application Software : Application software is a computer program designed to help people perform an activity. Depending on the activity for which it was designed, an application can manipulate text, numbers, audio, graphics, and a combination of these elements. ➢It acts as a mediator between the end-user and system software. ➢Examples: Education softwares, Entertainment softwares, Data base Softwares…etc. Operating System Definition: • An Operating System is a system Software that acts as an intermediary/ interface between a user of a computer and the computer hardware. Examples: Windows OS, Linux OS, MS-DOS ,Android OS, Mac OS..etc. Operating system goals or Objectives: ➢Ability to evolve: Execute user programs and make solving user problems easier ➢Convenience: Make the computer system convenient to use ➢Efficiency: Use the computer hardware in an efficient manner Advantage of Operating System: ➢Offers an environment in which a user may execute programs/ applications ➢The operating system must make sure that the computer system convenient to use ➢Operating System acts as an intermediary among applications and the hardware components ➢It provides the computer system resources with easy to use format. Disadvantages of Operating System ➢If any issue occurs in OS, you may lose all the contents which have been stored in your system ➢It is never entirely secure as a threat can occur at any time. conceptual view of a computer system: ➢An OS is an important part of every computer system. ➢A computer system can be divided roughly in to 4 components. The hardware, OS,The application programs and the user. ➢The hardware consists of memory, CPU, ALU, I/O devices, Storage devices,Peripheral devices. ➢System software consists of compilers, loaders,editors,OS etc. ➢Application software consists of business programs, data base programs. Operating system performs the following functions: 1. Booting : Booting is a process of starting the computer operating system starts the computer to work. It checks the computer and makes it ready to work. 2. 3. 4. 5. 6. 7. Memory Management :It is also an important function of operating system. The memory cannot be managed without operating system. Different programs and data execute in memory at one time. if there is no operating system, the programs may mix with each other. The system will not work properly. Loading and Execution: A program is loaded in the memory before it can be executed. Operating system provides the facility to load programs in memory easily and then execute it. Data security Data is an important part of computer system. The operating system protects the data stored on the computer from illegal use, modification or deletion. Disk Management : Operating system manages the disk space. It manages the stored files and folders in a proper way. Process Management : CPU can perform one task at one time. if there are many tasks, operating system decides which task should get the CPU. Device Controlling: operating system also controls all devices attached to computer. The hardware devices are controlled with the help of small software called device drivers. Operating System Mode: ➢The User Mode is concerned with the actual interface between the user and the system. ➢It controls things like running applications and accessing files. ➢The Kernel Mode is concerned with everything running in the background. ➢It controls things like accessing system resources, controlling hardware functions and processing program instructions. Kernel: ➢A Kernel is the central component of an Operating System. ➢The Kernel is also said to be the heart of the Operating System. It is responsible for managing all the processes, memory, files, etc. OS Structures or Approaches ➢OS can be implemented with the help of various structures. The structure of the OS depends mainly on how the various common components of the OS are interconnected and melded into the kernel. ➢Depending on this we have following structures of the operating system: 1.Simple Structure 2.Layered Structure 3.Micro-Kernel 4.Modular Structure 1. Simple Structure: ➢There are many operating systems that have a rather simple structure. ➢First started as small systems and rapidly expanded much further than their scope. Example: MS-DOS ➢MS_DOS interfaces and levels of functionality are not well separated. ➢In MS-DOS application programs are able to access the basic I/O routines. ➢These type of OS cause the entire system to crash if one of the user programs fails. Advantages of Simple structure: ➢It delivers better application performance because of the few interfaces between the application program and the hardware. ➢Easy for kernel developers to develop such an operating system. Disadvantages of Simple structure: ➢The structure is very complicated as no clear boundaries exists between modules. ➢It does not enforce data hiding in the operating system. 2. Layered Structure: ➢Layered Structure is a type of system structure in which the different services of the operating system are split into various layers(levels), where each layer has a specific well-defined task to perform. ➢The bottom layer (layer 0) is the hardware, and the topmost layer (layer N) is the user interface. ➢These layers are so designed that each layer uses the functions of the lower-level layers only. It simplifies the debugging process as if lowerlevel layers are debugged, and an error occurs during debugging. The error must be on that layer only as the lower-level layers have already been debugged. Details about the six layers are: ➢Hardware: This layer interacts with the system hardware and coordinates with all the peripheral devices. ➢CPU Scheduling: This layer deals with scheduling the processes for the CPU. There are many scheduling queues that are used to handle processes. ➢Memory Management: Memory management deals with memory and the moving of processes from disk to primary memory for execution and back again. ➢Process Management: This layer is responsible for managing the processes i.e assigning the processor to a process at a time. This is known as process scheduling. ➢I/O Buffer or Device Management: I/O devices are very important in the computer systems.This layer handles the buffers for the I/O devices and makes sure that they work correctly. ➢User Programs:This layer deals with the many user programs and applications that run in an operating system such as word processors, games, browsers etc. Advantages of Layered Structure: ➢1.Easy update: A modification made in a particular layer will not affect the other layers. ➢2.No direct access to hardware: The hardware layer is the innermost layer present in the design. So a user can use the services of hardware but cannot directly modify or access it. ➢3.Easy debugging: Suppose an error occurs in the CPU scheduling layer. The developer can only search that particular layer to debug. Disadvantages of Layered Structure: 1.Communication: No communication between non-adjacent layers. 2.Slower in execution: If a layer wants to interact with another layer, it requests to travel through all the layers present between the two interacting layers. Thus it increases response time. 3. Micro-Kernel Kernel: ➢It is the central component of an OS that handles system resources. It also acts as a bridge between the computer's application and hardware. ➢It is in charge of various activities, including task management, disk management, and memory management. Microkernel: ➢This structure designs the OS by removing all non-essential( functions, data) components from the kernel and executing them in user mode.This result in a smaller kernel called the “ Micro-Kernel”. Example: Mac OS Advantages of Microkernel: ➢Microkernels are modular and the different modules can be replaced, reloaded, modified, changed etc. as required. This can be done without even touching the kernel. ➢Microkernels are small so these can be tested effectively. Disadvantage of Microkernel: ➢To write a microkernel more code is required. ➢If a service crashes, it does effects on working on the microkernel. 4. Modular Structure or Modular Kernel ➢It is considered as the best approach for an OS. ➢It is a type of kernel in which some parts of system core will get allocated in independent files called modules. This can be added to system at run time. It usually requires small amount of time of load modules. If one needs a new module, then they won't have to recompile. Example: Solaris OS ➢Modular OS design uses OOPS techniques to create a modular kernel. Advantages ➢Efficient ➢Easy to maintained ➢Easy to debug and update ➢ Disadvantages ➢It may lose stability ➢Less security Types of Operating Systems ➢ Following are some of the most widely used types of OS (Operating System): 1. Simple Batch Operating System 2. Multiprogramming Operating System 3. Multitasking/Time Sharing Operating System 4. Distributed Operating System 5. Real Time Operating System 6. Personal Computer Operating System 7. Parallel or tightly coupled or Multiprocessing Operating System. 1. Simple Batch Operating System ➢The users of a batch operating system do not interact with the computer directly. ➢There is an operator which takes similar jobs having the same requirement and group them into batches. ➢Batch means set of jobs/processes with similar needs. ➢Firstly, user prepares his job using punch cards. ➢Then, he submits the job to the computer operator. ➢Operator collects the jobs from different users and sort the jobs into batches with similar needs. ➢Then, operator submits the batches to the processor one by one. ➢All the jobs of one batch are executed together. Example: Bank Statements Advantages of Batch Operating System: ➢Multiple users can share the batch systems. ➢The idle time for the batch system is very less. ➢It is easy to manage large work repeatedly in batch systems. ➢ Disadvantages of Batch Operating System: ➢Batch systems are hard to debug. ➢It is sometimes costly. ➢The other jobs will have to wait for an unknown time if any job fails. 2. Multiprogramming Operating System ➢This type of OS is used to execute more than one jobs simultaneously by a single processor(CPU). ➢A program in execution is called a "Process", "Job" or a "Task". ➢Each process needs two types of system time: CPU time and IO time. ➢Example: User can use MS-Excel , download apps, transfer data from one point to another point, Firefox or Google Chrome browser, and more at a same time. ➢Multiprogramming operating systems use the mechanism of job scheduling and CPU scheduling. Advantages of Multiprogramming OS ➢Throughout the system, it increased as the CPU always had one program to execute. ➢Response time can also be reduced. Disadvantages of Multiprogramming OS ➢If it has a large number jobs, then long-term jobs will require a long wait. ➢Memory management is needed in the os because all types of tasks are stored in the main memory. 3. Multitasking/Time Sharing Operating System ➢The multitasking operating system is a logical extension of a multiprogramming system. ➢The operating system that runs more than one task at a time is known as a multitasking operating system (MOS). MOS can be desktop or mobile operating system (OS). ➢Different tasks run in the OS are MS Word, MS Excel, email application, browser, media player, OS services etc. End users use all these programs at the same time. ➢In the diagram above, three tasks are running on the computer. CPU gives 10 nanoseconds to each task. Time is shared between task 1, task 2 and task 3. If task 1 is not completed in 10 nanoseconds then task 1 have to wait until task 2 and task 3 are given time. ➢Note :that one processor (CPU) can only run one process (task) at a time. CPU gives small time to each process and switch to another process. ➢Main Difference between the multiprogramming and multitasking is Multiprogramming takes maximum time to execute any process, whereas multitasking takes minimum time to execute any process. Advantages : 1. Timesharing: 2.Handle multiple users 3. Programs can run in the background Disadvantages: 1. Limitation of memory: ➢When a computer user opens many programs at a time, the computer becomes slow. The reason behind is that many programs are loaded into main memory and CPU cannot give good time for each program and response time of completing the job becomes higher. Computers with low RAM usually face this problem. One solution to this is to increase your RAM capacity. 2.CPU heat up: ➢By doing multitasking, the processor becomes busy all the time and CPU heats up. ➢ 4.Distributed Operating System ➢A distributed operating system (DOS) is an essential type of operating system. ➢The processors(CPU) communicate with one another through various communication lines (such as high-speed buses or telephone lines). These are referred as loosely coupled systems or distributed systems. ➢It connects multiple computers via a single communication channel. Furthermore, each of these systems has its own processor and memory. Advantages of Distributed OS: ➢The distributed operating system provides sharing of resources. ➢Reliability, high fault tolerance: A system crash on one server does not affect other servers. ➢Scalability: In distributed computing systems you can add more machines as needed. ➢Flexibility: It makes it easy to install, implement and debug new services. Disadvantages of Distributed Systems: ➢Some messages and data can be lost in the network while moving from one node(computer) to another. ➢The database connected to the distributed systems is quite complicated and difficult to handle as compared to a single user system. 5. Real Time Operating System ➢ In Real-Time Systems, each job carries a certain deadline within which the job is supposed to be completed, otherwise, the huge loss will be there, or even if the result is produced, it will be completely useless. ➢ Example: washing machine, Rocket to lunching, flight control ➢ There are two types of real-time operating systems. 1) Hard real-time systems: ➢ In Hard RTOS, the deadline is handled very strictly which means that given task must start executing on specified scheduled time, and must be completed within the assigned time duration. Example:Missile launching system, Aircraft systems, etc. 2) Soft Real Time systems: ➢It accepts some delays by the Operating system. In this type of RTOS, there is a deadline assigned for a specific job, but a delay for a small amount of time is acceptable. So, deadlines are handled softly by this type of RTOS. Example: Online Transaction system. Advantages of Real-time operating system: ➢Easy to layout, develop and execute real-time applications under the real-time operating system. ➢Task Management: A real time operating system typically takes less amount of time to shift from one task to another. Disadvantages of Real-time operating system: ➢Real-time operating systems are very costly to develop. ➢The algorithms are very complex and difficult for the designer to write on. 6.Personal Computer Operating System ➢Personal computer operating system are made only for personal. You can say that your laptops, computer systems, tablets etc. are your personal computers and the operating system such as windows 7, windows 10, android, etc. are your personal computer operating system. 7.Parallel or tightly coupled or Multiprocessing Operating System ➢Multiprocessor operating systems are also known as parallel OS or tightly coupled OS. ➢Such operating systems have more than one processor in close communication that sharing the computer bus, the clock and sometimes memory and peripheral devices. ➢It executes multiple jobs at the same time and makes the processing faster. ➢If one processor fails then other processor should retrieve the interrupted process state so execution of process can continue. System components ➢A system component is a process, program, utility, or another part of a computer's operating system that helps to manage different areas of the computer. ➢An operating system is a large and complex system that can only be created by partitioning into small pieces. These pieces should be a well defined portion of the system, which carefully defined inputs, outputs, and functions. ➢Although Mac, Unix, Linux, Windows, and other OS do not have the same structure, most of the operating systems share similar OS system components like File, Process, Memory, I/O device management. ➢The components of an operating system play a key role to make a variety of computer system parts work together. ➢There are the following components of an operating system, such as: 1. Process Management 2. File Management 3. Network Management 4. Secondary Storage Management 5. I/O Device Management 6. Security Management 1. Process Management: ➢A process is basically a program in execution. ➢When a program is loaded into the memory and it becomes a process. ➢The process management component is a procedure for managing the many processes that are running simultaneously on the operating system. Every software application program has one or more processes associated with them when they are running. Example: when you use a browser like Google Chrome, there is a process running for that browser program. The OS also has many processes running, which performing various functions. ➢ ➢ i. ii. iv. All these processes should be managed by process management, which keeps processes for running efficiently. It also uses memory allocated to them and shutting them down when needed. The execution of a process must be sequential so, at least one instruction should be executed on behalf of the process. Functions of process management: Process creation and deletion. Suspension and resumption. iii. Synchronization process Communication process 2. File Management: ➢A file is collection of specific information stored in the memory of computer system. ➢ ➢ Data files can be alphabetic, numeric, or alphanumeric. ➢A file management system is used for file maintenance (or management) operations. It is is a type of software that manages data files in a computer system. ➢A file management system has limited capabilities and is designed to manage individual or group files, such as special office documents and records. Functions : ➢File and directory creation and deletion. ➢For manipulating files and directories. ➢ Mapping files onto secondary storage. 3.Network Management ➢ ➢ ➢Network management is the process of administering and managing computer networks. ➢It includes performance management, provisioning of networks, fault analysis, and maintaining the quality of service. ➢ The computers in the network are connected through a communication network, which can configure in many different ways. The network can fully or partially connect in network management, which helps users design routing and connection strategies that overcome connection and security issues. A distributed system is a collection of computers or processors that never share their memory and clock. Functions: ➢A distributed system also offers the user access to the various resources the network shares. ➢ ➢ ➢It helps to access shared resources that help computation to speed up or offers data availability and reliability. 4.Secondary Storage Management ➢The most important task of a computer system is to execute programs. These programs help you to access the data from the main memory during execution. This memory of the computer is very small to store all data and programs permanently. ➢The computer system offers secondary storage to back up the main memory. ➢Today modern computers use hard drives/SSD as the primary storage of both programs and data. However, the secondary storage management also works with storage devices, such as USB flash drives and CD/DVD drives. ➢ ➢ Functions: ➢Storage allocation ➢Free space management ➢Disk scheduling 5. I/O Device Management ➢OS manages I/O devices & make the I/O process effectively. ➢OS accepts the input from the input device(keyboard)stores it in main memory, and ask the CPU to process it & finally provides the result to the output devices(screens/printers)for output. Functions: ➢It offers a buffer caching system ➢It provides general device driver code ➢It provides drivers for particular hardware devices. ➢I/O helps you to know the individualities of a specific device. ➢ ➢ 6. Security Management ➢Security refers to providing a protection system to computer system resources such as CPU, memory, disk, software programs and most importantly data/information stored in the computer system. ➢If a computer program is run by an unauthorized user, then he/she may cause severe damage to computer or data stored in it. So a computer system must be protected against unauthorized access, malicious access to system memory, viruses, worms etc.

视频信息