









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A brief introduction to Operating System
Typology: Study notes
1 / 16
This page cannot be seen from the preview
Don't miss anything!










Introduction to Operating System
The objectives of OS are: (1) To make the computer system convenient and easy to use for the user. (2) To use the computer hardware in an efficient way. (3) To execute user programs and make solving user problems easier.
1. Hardware : such as CPU, memory and I/O devices. 2. Operating system : provides the means of proper use of the hardware in the operations of the computer system, it is similar to government. 3. Application programs : solve the computing problems of the user, such as : compilers, database systems and web browsers. 4. Users: peoples, machine, or other computer. Introduction to operating
and to start executing that system. To accomplish this goal, the bootstrap program must locate and load into memory the operating system kernel. The operating system then starts executing the first process, such as "init," and waits for some event to occur. Figure 2
Computer programs must be in main memory (also called RAM) to be executed. Main memory is the only large storage area that the processor can access directly. It forms an array of memory words. Each word has its own address. Interaction is achieved through a sequence of load or store instructions to specific memory addresses. The load instruction moves a word from main memory to an internal register within the CPU, whereas the store instruction moves the content of a register to main memory. The instruction-execution cycle includes:
3. I/O Structure
The programs and data are not resided in main memory permanently for the following two reasons:
Operating systems have been evolving through the years. Following table shows the history of OS. OS performs many functions such as:
The main categories of modern OS may be classified into three groups which are distinguished by the nature of interaction that takes place between the computer and the user:
In this type of OS, users submit jobs on regular schedule (e.g. daily, weekly, monthly) to a central place where the user of such system did not interact directly with computer system. To speed up the processing, jobs with similar needs were batched together and were run through the computer as a group. Thus, the programmer would leave the programs with the operator. The output from each job would send to the appropriate programmer. The major task of this type was to transfer control automatically from one job to the next. Disadvantages of Batch System
1. Turnaround time can be large from user standpoint. 2. Difficult to debug program. 2. Time-Sharing System This type of OS provides on-line communication between the user and the system, the user gives his instructions directly and receives intermediate response, and therefore it called interactive system. The time sharing system allows many user simultaneously share the computer system. The CPU is multiplexed rapidly among several programs, which are kept in memory and on disk. A program swapped in and out of memory to the disk. Time sharing system reduces the CPU ideal time. The disadvantage is more complex.
4. Multiprogramming In multiprogramming several programs are kept in main memory at the same time, and the CPU is switching between them , thus the CPU always has a program to be execute. The OS begins to execute one program from memory, if this program need wait such as an I/O operation, the OS switches to another program. Multiprogramming increases CPU utilization. Multiprogramming system provide an environment in which the various system resources are utilized effectively, but they do not provide for user interaction with the computer system. Advantages a) High CPU utilization. b) It appears that many programs are allotted CPU almost simultaneously. Disadvantages a) CPU scheduling is requires. b) To accommodate many jobs in memory, memory management is required. 5. Parallel system There are more than on processor in the system. These processors share the computer bus, clock, memory and I/O devices. The advantage is to increase throughput (the number of programs completed in time unit).
6. Distributed system Distribute the computation among several physical processors. It involves connecting 2 or more independent computer systems via communication link. So, each processor has its own O.S. and local memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines. Advantages of distributed systems: a) Resources Sharing – You can share files and printers. b) Computation speed up – A job can be partitioned so that each processor can do a portion concurrently (load sharing). c) Reliability – If one processor failed the rest still can function with no problem. d) Communications – Such as electronic mail, ftp 7. Personal computer Personal computers – computer system dedicated to a single user. PC operating systems were neither multi-user nor multi-tasking. The goal of PC operating systems were to maximize user convenience and responsiveness instead of maximizing CPU and I/O utilization. •Examples: Microsoft Windows and Apple Macintosh
Modern operating systems are interrupt driven. If there are no processes to execute, no I/O devices to service, and no users to whom to respond, an operating system will sit quietly, waiting for something to happen. Events are almost always signaled by the occurrence of an interrupt or a trap. A trap is a software-generated interrupt caused either by an error (for example, division by zero or invalid memory access) or by a specific request from a user program that an operating-system service be performed. For each type of interrupt, separate segments of code in the operating system determine what action should be taken. An interrupt service routine is provided that is responsible for dealing with the interrupt. Since the operating system and the users share the hardware and software resources of the computer system, we need to make sure that an error in a user program could cause problems only for the one program that was running. With sharing, many processes could be adversely affected by a bug in one program. A properly designed operating system must ensure that an incorrect (or malicious) program cannot cause other programs to execute incorrectly. A) Dual-Mode Operation We must be able to distinguish between the execution of operating-system code and user defined code. The approach is to separate the two modes of operation : user mode and kernel mode (also called supervisor mode, system mode, or privileged mode). A bit, called the mode bit is added to the hardware of the computer to indicate the current mode: kernel (0) or user (1). The dual mode of operation provides us with the means for protecting the operating system from errant users-and errant users from one another.
Management
1. Process Management Memory Management System calls provide the means for a user program to ask the operating system to perform tasks reserved for the operating system on the user program's behalf. B) Protection CPU To ensure that the operating system maintains must control over the CPU. We must prevent a user program from getting stuck in an infinite loop or not calling system services and never returning control to the operating system. To accomplish this goal, we can use a timer. A timer can be set to interrupt the computer after a specified fixed or variable period. The operating system components are : In multiprogramming environment, OS decides which process gets the processor when and how much time. The operating system is responsible for the following activities in regard to process management:
Example system call sequence System program provide basic function to users, so that they don’t need to write their own environment for program development (editors, compilers) and program execution (shells). Protection refers to mechanism that control the access of programs or users to the both system and resources. The protection mechanism must: