Question-1 What is operating System? Explain the abstract view of the components of a computer system.
An operating system (OS) is a collection of software that manages computer
hardware resources and provides various services for computer programs. It acts as an
intermediary between the user of a computer and the computer hardware.
check Figure below
The placement of the operating system is shown in Fig. above At the bottom is the hardware, which, consists of integrated circuit chips, wires, disks, a key board, a monitor and similar physical devices.
- On the top of the hardware is the software.
- Operating system runs on the bare hardware and it provides base for the rest of the software.
- Most computers have two modes of operation: kernel mode and user mode.
- The operating system is the most fundamental piece of software and runs in kernel mode.
- In this mode it has complete access to all the hardware and can execute any instruction that the machine is capable of executing.
- The rest of the software runs in user mode, in which only a subset of the machine instructions is available. Here we find the command interpreter (shell), compilers, editors, and other system programs.
- Finally, above the system programs are the application programs. These programs arepurchased or written by the users to solve their particular problems, such as word processing, spreadsheets, web browser or music player.
- To hide complexity of hardware, an operating system is provided. It consists of a layer of software that (partially) hides the hardware and gives the programmer a more convenient set of instructions to work with.
Question-2 Give the view of OS as an extended machine.
Operating systems perform two basically unrelated functions: providing a clean abstract set of resources instead of the messy hardware to application programmers and managing
these hardware resources.
Operating System as an Extended Machine
- The architecture (instruction set, memory, I/O, and bus structure) of most computers at the machine level language is primitive and awkward to program, especially for input / output operations.
- Users do not want to be involved in programming of storage devices.
- Operating System provides a simple, high level abstraction such that these devices contain a collection of named files.
- Such files consist of useful piece of information like a digital photo, e mail messages, or web page.
- Operating System provides a set of basic commands or instructions to perform various operations such as read, write, modify, save or close.
- Dealing with them is easier than directly dealing with hardware.
- Thus, Operating System hides the complexity of hardware and presents a beautiful interface to the users.
- Just as the operating system shields (protect from an unpleasant experience) the programmer from the disk hardware and presents a simple file-oriented interface, it also conceals a lot of unpleasant business concerning interrupts, timers, memory management, and other low level features.
- In each case, the abstraction offered by the operating system is simpler and easier to use than that offered by the underlying hardware.
- In this view, the function of the operating system is to present the user with the equivalent of an extended machine or virtual machine that is easier to work with than the underlying hardware.
- The operating system provides a variety of services that programs can obtain using special instructions called system calls.
Question-3 Give the view of OS as a Resource Manager
The concept of an operating system as providing abstractions to application programs is a top down view.
- Alternatively, bottom up view holds that the OS is there to manage all pieces of a complex system.
- A computer consists of a set of resources such as processors, memories, timers, disks, printers and many others.
- The Operating System manages these resources and allocates them to specific programs.
- As a resource manager, Operating system provides controlled allocation of the processors, memories, I/O devices among various programs.
- Multiple user programs are running at the same time.
- The processor itself is a resource and the Operating System decides how much processor time should be given for the execution of a particular user program.
- Operating system also manages memory and I/O devices when multiple users are working.
- The primary task of OS is to keep the track of which programs are using which resources, to grant resource requests, to account for usage, and to resolve conflicting requests from different programs and users.
- An Operating System is a control program. A control program controls the execution of user programs to prevent errors and improper use of computer.
- Resource management includes multiplexing (sharing) resources in two ways: in time and in space.
- When a resource is time multiplexed, different programs or users take turns using it. First one of them gets to use the resource, then another, and so on.
- For example, CPU and printer are time multiplexed resources. OS decides who will use it and for how long.
- The other kind of multiplexing is space multiplexing, instead of the customers taking turns, each one gets part of the resource.
- For example, both primary and secondary memories are space multiplexed. OS allocates them to user programs and keeps the track of it.
Question-4 Explain different types of tasks done by OS. OR Write different services provided by operating system.
Operating system services and facilities can be grouped into following areas:
- Operating system provides editors and debuggers to assist (help) the programmer in creating programs.
- Usually these services are in the form of utility programs and not strictly part of core operating system. They are supplied with operating system and referred as application program development tools.
- A number of tasks need to be performed to execute a program, such as instructions and data must be loaded into main memory. I/O devices and files must be initialized.
- The operating system handles these scheduling duties for the user.
Access to I/O devices
- Each I/O devices requires its own set of instruction for operations.
- Operating system provides a uniform interface that hides these details, so the programmer can access such devices using simple reads and writes.
- Operating System manages memory hierarchy.
- It keeps the track of which parts of memory are in use and free memory.
- It allocates the memory to programs when they need it.
- It de-allocates the memory when programs finish execution.
Controlled access to file
- In the case of file access, operating system provides a directory hierarchy for easy access and management of files.
- OS provides various file handling commands using which users can easily read, write, and modify files.
- In case of system with multiple users, the operating system may provide protection mechanism to control access to file.
- In case of public systems, the operating system controls access to the system as a whole.
- The access function must provide protection of resources and data from unauthorized users.
Error detection and response
- Various types of errors can occur while a computer system is running, which includes internal and external hardware errors. For example, memory error, device failure error and software errors as arithmetic overflow.
- In case, operating system must provide a response that clears error condition with least impact on running applications.
- A good operating system collects usage for various resources and monitor performance parameters.
- On any system, this information is useful in anticipating need for future
Protection & Security
- Operating systems provides various options for protection and security purpose.
- It allows the users to secure files from unwanted usage.
- It protects restricted memory area from unauthorized access.
- Protection involves ensuring that all access to system resources is controlled.