Lecture 1 Computer Operating Systems
Lecture 1 Computer Operating Systems
Technical Elective 1
Purpose
Provide an environment in which a user can execute programs in a convenient and efficient manner.
Thus,
the primary goal of an OS is to make the computer system convenient to use A secondary goal is to use the computer hardware in an efficient manner.
Computer System
Can be divided roughly into four components:
1. 2. 3. 4. The hardware The operating system (OS) The application programs (APs) And the users
User 1
User 2
User 3
. . .
User n
compiler
assembler
Text editor
. . .
Database systems
The Application programs define the ways in w/c these resources are used to solve the computing problems of the users.
1. 2. 3. 4. word processors spreadsheets, compilers, webbrowsers
The operating system (OS) controls and coordinates the use of the hardware among the various application programs for the various users.
1. 2. 3. 4. Windows Linux Mac OS etc
The users
1. 2. 3. 4. Encoder Programmer Analyst Etc
Control program
Controls the execution of user programs to prevent errors and improper use of the computer. It is especially concerned with the operation and control of the I/O devices
Note:
In general, there is no completely adequate definition of an OS (accdg to: Siberschatz, Galvin, Gagne) A more common definition is that OS is the one program running at all times on the computer (usually called the kernel), with all else being application programs.
Batch Systems
- To speed up processing, operators batched together jobs with similar needs and ran them through the computer as a group. - Early computers were (physically) enormously large machines run from a console. - Common input devices were card readers and tape drives and line printers, tape drives, and card punches for output devices. Operating systems User program area
cont
The introduction of disk technology allowed the OS to keep all jobs on a disk, rather than a in a serial card reader. With direct access to several jobs, it could do job scheduling to use resources and perform tasks efficiently. The most important aspect of job scheduling is the ability to multiprogram. A single user cannot, in general, keep either the CPU or the I/O devices busy at all times. Multiprogramming increases CPU utilization by organizing jobs such that the CPU always has one to execute.
cont
0 Operating systems
Job 1 Job 2 Job 3 512K Job 4
..cont,
The OS keeps several jobs in memory simultaneously (fig 3) This set of jobs is a subset of the jobs kept in the job pool (since the number of jobs that can be kept simultaneously in memory is usually much smaller than the number of jobs that can be in the job pool). The OS picks up and begins to execute one of the jobs in the memory. Eventually, the job may have to wait for some task, such as an I/O operation to complete. In a non-multiprogrammed system, the CPU would sit idle. In a multiprogramming system, the OS simply switches to and executes another job.
...cont
When that job needs to wait, the CPU is switched to another job and so on. Eventually, the first job finishes waiting and gets the CPU back. As long as there is always at least one job to execute, the CPU is never idle. Multiprogramming is the first instance where the OS must make decisions for the users. Multiprogrammed OS are therefore fairly sophisticated. All the jobs that enter the system are kept in the job pool. This pool consists of all processes residing on the disk awaiting allocation of main memory.
cont
If several jobs are ready to be brought into memory, and there is not enough room for all of them, then the system must choose among them. Making this decision is job scheduling. When the OS selects a job from the job pool, it loads that job into memory for execution. Having several programs in memory at the same time requires some form of memory management. In addition, if several jobs are ready to run at the same time, the system must choose among them. Making this decision is CPU scheduling. Multiple jobs running concurrently require that their ability to affect one another be limited in all phases of the OS, including process scheduling, disk storage, and memory management.
cont
Time-shared OS allows the many users to share the computer simultaneously. As the system switches rapidly from one user to the next, each user is given the impression that the entire computer system is dedicated to her use, whereas actually one computer is being shared among many users. A time-shared system uses CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared computer. Each user has at least one separate program in memory.
cont
A program that is loaded into memory and is executing is commonly referred to as a process. When a process executes, it typically executes for only a short time before it either finishes or needs to perform I/O. I/O may be interactive; that is, output is to a display for the user and input is from a user keyboard, mouse, or other device. Since interactive I/O typically runs at people speeds, it may take a long time to complete.
cont
Time-sharing systems are even more complex than are multiprogrammed OS. In both, several jobs must be kept simultaneously in memory, so the system must have memory management and protection. So that a reasonable response time can be obtained, jobs may have to be swapped in and out of main memory to the disk that now serves as a backing store for main memory. A common method of achieving this goal is virtual memory, w/c is a technique that allows the execution of a job that may not be completely in memory.
cont
Obvious advantage of this scheme is that programs can be larger than physical memory. Further, it abstracts main memory into a large, uniform array of storage, separating logical memory as viewed by the user from physical memory. This arrangement frees programmers from concern over memory-storage limitations.
cont
Time-sharing systems must also provide a file system. The file system resides on a collection of disks; hence, disk management must be provided. Time-sharing systems must also provide a mechanism for concurrent execution, w/c requires sophisticated CPU-scheduling schemes To ensure orderly execution, the system must provide mechanisms for job synchronization and communication, and it may ensure that jobs do not get stuck in a deadlock, forever waiting for one another.
cont
Idea of time-sharing was demonstrated as early as 1960, but since TS systems are difficult and expensive to build, they did not become common until 1970s. Although batch processing is still done, most systems today are time-sharing. Multiprogramming and time-sharing are the central themes of modern OS.
contd
These systems include PCs running Microsoft Windows, and the Apple Macintosh. MS- DOS from Microsoft has been superseded by multiple flavors of Microsoft Windows, and IBM has upgraded MS DOS to the OS/2 multitasking system Apple Macintosh OS has been ported to more advanced software, and now includes new features, such as virtual memory and multi-tasking Linux, a UNIX-like OS available for PCs, has also become popular Overall, an examination of OS for mainframes and microcomputers shows that features that were at one time available on only mainframes have been adopted by microcomputers
Parallel Systems
Most systems to date are single-processor systems; that is, they have only one main CPU. However, there is trend toward multiprocessor systems Such systems have more than one processor in close communication, sharing the computer bus, the clock, and sometimes memory and peripheral devices referred as tightly coupled systems.
contd
Advantages:
Increased throughput Less expensive Increased reliability
Graceful degradation (a.k.a. fault tolerant)
contd
Symmetric multiprocessing
Each processor runs an identical copy of the OS, and these copies communicate with one other as needed.
Asymmetric Multiprocessing
Each processor is assigned a specific task. A master processor controls the system; the other processors either look to the master for instruction or have predefined tasks This scheme defines a master-slave relationship. The master processor schedules an allocates work to the slave processors.
contd
The difference between symmetric and asymmetric multiprocessing may be the result of either hardware/software. Special hardware can differentiate the multiprocessors, or the software can be written to allow only one master and multiple slaves. Example, Suns OS SunOS version 4 provides asymmetric multiprocessing, whereas Version 5 (Solaris 2) is symmetric on the same hardware.
contd
As microprocessor (P) become less expensive and more powerful, additional OS functions are off-loaded to slave processor, or back-ends. Example, it is fairly easy to add a P with its own memory to manage a disk system The P could receive a sequence of requests from the main CPU and implement its own disk queue and scheduling algorithm. This arrangement relieves the main CPU of the overhead of disk scheduling PCs contain a P in the KB to convert the key strokes into codes to be sent to the CPU.
contd
Systems that control scientific experiments, medical imaging systems, industrial control systems, and certain display systems are real-time systems Also included are some automobile-engine fuel injection systems, home appliance controllers, and weapon systems. A real-time system has well defined, fixed time constraints. Contrast this requirement to a time-sharing system, where it is desirable (but not mandatory) to respond quickly, or to a batch system, where they may be no time constraints at all.
Distributed Systems
Growth of computer networks-especially the internet and the WWW PCs & workstations are capable of running a web browser for accessing a hypertext document in a web Inclusion of system software such as TCP/IP and PPP that enables a computer to access the internet Loosely coupled systems, or distributed systems, processors do not share memory or a clock, instead each processor has its own local memory Processors communicate with one another although various communication lines, such as high-speed buses or telephone lines