TOPIC 5 : OPERATING SYSTEMS 

5.1 	Operating System: Introduction

•	When the new computer comes off the factory assembly line, it can do nothing.
•	The hardware needs software to make it work.
•	Applications software, such as MS Word and MS Excel do not communicate directly with the hardware.
•	Between the applications software and the hardware is a software interface : an operating system.
•	An operating system is a set of programs that lies between applications software and the computer hardware.

Hardware

Operating System

Application programs

•	The most important program in the operating system is the program that manages the operating system, which is called the supervisor program.
•	Supervisor program remains in memory and is thus referred to as resident.
•	The supervisor controls the entire operating system. It loads other operating system into memory from disk storage only as needed.
•	An operating system has three main functions:
i.	Manage the computer’s resources, such as the central processing unit, memory, secondary storage devices, and various input / output devices like printers.
ii.	Establish a user interface.
iii.	Execute and provide services for applications software.
•	However, much of the work of an operating system is hidden from the user, many necessary tasks are performed behind the scenes. Such as managing the computer’s resources is taken care of without the user being aware of the detail. Furthermore, all input and output operations, although invoked by an applications program, are actually carried out by the operating system.
•	Operating systems for mainframe and other large computer’s are complex, since they must keep track of several programs from several users all running in the same time frame.

Network Operating Systems

•	An extension of operating systems for personal computers is a network operating system. (NOS)
•	It is designed to let computers on a network share resources such as hard-disks and printers.
•	Besides, NOS supports data security, troubleshooting and administrative control.
•	One of the NOS main tasks is to make the resource appear as if they are running from the client computer.

5.2 	Sharing Resources & managed shared resources

Resource Allocation

•	Resource allocation is the process of assigning computer resources to certain programs for their use. The resources are deallocated (remove) when the program using them is finished. Example : allocation of the CPU, memory

i) Sharing the CPU

•	The sharing process is controlled by the operating system. Two approaches are multiprogramming and time-sharing.
•	Multiprocessing refers to the use of a powerful computer with more than one CPU, multiple programs run simultaneously using its own processor.
•	Multiprogramming is an event-driven: programs share resources based on events that take place in the programs. Multiprogramming is implements through a system of interrupts. An interrupt is a condition that causes normal program processing to be suspended temporarily.
•	Time-sharing, a special case of multiprogramming, is usually time-driven rather than event-driven.
•	A common approach is to give each user a time-slice during which the computer works on a single user’s tasks.
•	Response time is the time between your  typed computer request and the computer’s reply. While waiting for the user request, the CPU will use this idle moment to serve another user. You may not notice that you have been deprived of service.
•	Giving the users the processor in turns is called round-robin scheduling. For example: Three users share the CPU , and they would be given time slices in order A-B-C-A-B-C….and so forth. However, sometimes there is special case that a user may have higher priority than others. For example: A-B-C-B-A-B-C-B-… where user B have a higher priority.
•	If the computer system is trying to serve too many users at the same time, response time may slow down noticeably.

ii)  Sharing Memory

•	Memory management is the process of allocating memory to programs and of keeping the programs in memory separate from each other.
•	The separate areas is called partition or regions. It is either fixed or variable size.
•	Large computers often divide their memory into foreground and background areas. The foreground is generally for programs that have higher priority and therefore receive more CPU time. The background is for programs with the lower priorities and less CPU time. Typical background programs are batch programs.
•	Many computer systems manage memory by using a technique called virtual storage.
•	The virtual storage concept means that part of the program is stored on disk and is brought into memory for execution only as needed. Since only part of the program is in memory at any given time, the amount of the memory needed for a program is minimized.
•	Memory is considered real storage, while the secondary storage holding the rest of the program is considered virtual storage.
•	Virtual storage can be implemented in a variety of ways. One of the methods is paging. Paging is the process of dividing a program into equal-size pieces called pages and storing them in equal-size memory called page frames.
•	All pages and page frames are the same size. The pages are stored in memory in noncontiguous locations- that is, locations not necessarily next to each other.
•	Even though the pages are not right next to each other in memory, the operating system is able to keep track of them by using  a page table.
•	A page table which like the index is the list of each page that is part of the program and the address where it has been placed.
•	Memory protection is the process of keeping one program from straying into another program.

5.3 UNIX Generic Operating Systems

•	Early operating system was considered a proprietary operating system because it was used exclusively with that type of hardware.
•	But the trend has changes to what is called a generic operating system, sometimes called a portable operating system. This operating system works with more than one manufacturer’s computer system.
•	One of the generic operating system is UNIX.
•	Early operating system was considered a proprietary operating system because it was used exclusively with that type of hardware.
•	But the trend has changes to what is called a generic operating system, sometimes called a portable operating system. This operating system works with more than one manufacturer’s computer system.
•	One of the generic operating system is UNIX.
5.4  Operating Systems For Personal Computers

•	Operating system for personal computers are MS DOS, MS Windows 95 (IBM compatible) and Macintosh operating system (for Apple Macintosh).
•	Macintosh and MS-DOS are entirely two different operating system. Most personal computers are limited to one of these two.
•	The operating systems are different because the central processing units are different.
•	Users do not set out to buy operating systems. However, since the operating system determines what software is available for a given computer, users also have to take into account this factor. 
•	Although operating systems differ, way of their basic functions are similar.

5.5  MS-DOS

When the computer is switched on, the operating system will be loaded from the hard-disk into the computer’s memory.
•	The process of loading the operating system into memory is called bootstrapping, or booting the system. This is done by a small program in ROM which automatically pulls up the basic components of the operating system from the hard-disk. when we switched on the computer.
•	The result of booting DOS is that the characters C:>, C refers to the disk drive, > is a prompt. At this point, you must give some instruction to the computer.
•	To execute a given DOS program, a user must issue a command. 
•	The default drive, also called the current drive, is the drive that the computer is currently using. Only one disk drive at a time can be the default drive.
•	Two kinds of disk drives are usually associated with a personal computer: diskette drives and hard disk drives. A third possibility is a CD-ROM drive. 

Types of Files
There are three types of files you may use are:
i.	system files - include the operating system program
ii.	application software files - needed for application, such as word processing 
iii.	data files - hold the data that is related to the application software, such as document you typed using word processing.

5.6 	
Operating Environments

•	Operating environment is another layer which has been added to separate the operating system and the user. 
•	This layer is often called a shell because it forms a “coating” over the operating system. When using an operating environment, users interact with pictures or icons instead of C:>.

Hardware

Operating System

Application programs

OPERATING ENVIRONMENT

Microsoft Windows : An Overview
•	Windows uses a colorful graphical interface that eases access to the operating system
•	The feature that makes Windows so easy to use is a graphical user interface (GUI) in which users work with on-screen pictures called icons and with menus

Multiprogramming / Multitasking

•	The computer usually has one processor, handle one instruction at a time.
•	The CPU sat idle while the other tasks were being accomplished.
•	To maximize the CPU use, the large computer ‘s operating system includes a feature called multiprogramming, which permits the running of several programs in the same time frame, or concurrently.
•	Multiprogramming permits several programs from many different users, to compete for the processor. ( Considered the large computers, such as supercomputers)
•	Concurrently, in fact means the program take turns using the CPU. For example, one program could be using the CPU while another program prints a record.
•	Personal computers using the MS-DOS operating system without ‘a shell’ (operating environment) are limited to only one user and one program at a time. Example: a user who is using a word processing software have to exit the word processing if he wants to use a spreadsheet software. He can’t open both software at the same time.
•	The solution to this problem is an approach called multitasking.
•	Multitasking is where several programs compete for the use of the CPU. It is possible to run many programs at once in a multitasking environment.
•	A key feature of Windows is its multitasking capability.