Explain System Boot

Q1. What is System Boot?

Ans. The procedure of starting a computer by loading the kernel is known as booting the system. On most computer systems, a small piece of code known as the bootstrap program or bootstrap loader locates the kernel, loads it into main memory, and starts in execution.

Explain Types of System Calls

Q3. Explain in brief about each type of System Call.

Ans. System calls can be grouped roughly into five major categories:

  1. Process Control
  2. File Management
  3. Device Management
  4. Information Maintenance
  5. Communication


1. Process Control

  1. end, abort.
  2. load, execute.
  3. create process, terminate process.
  4. get process attributes, set process attributes.
  5. wait for time.
  6. wait event, signal event.
  7. allocate and free memory.


2. File Management  

1. create file, delete file.
2. open, close.
3. read, write, reposition.
4. get file attributes, set file attributes.


3. Device Management

1. request device, release device.
2. read, write, reposition.
3. get device attributes, set device attributes.
4. logically attach or detach devices.


4. Information Maintenance

1. get time or date, set time or date.
2. get system data, set system data.
3. get process, file, or device attributes.
4. set process, file, or device attributes.

5. Communications

1. create, delete communication connection.
2. send, receive messages.
3. transfer status information.
4. attach or detach remote devices.

Explain System Calls

Q1. What is meant by System Calls?

Ans. System calls provide an interface to the services made available by an operating system. These calls are generally available as routines written in C and C++, although certain low-level tasks (for example, tasks where hardware must be accessed directly), may need to be written using assembly language instructions.

Operating System as Virtual Machine

Q1. Explain how operating system acts as a Virtual Machine?

Ans. The fundamental idea behind a virtual machine is to abstract the hardware of a single computer (the CPU, memory, disk drives, network interface cards and so forth) into several different execution environments, thereby creating the illusion that each separate execution environment is running its own private computer.

By using CPU scheduling and virtual-memory techniques, an operating system can create the illusion that a process has its own processor with its own (virtual) memory.

There are several reasons for creating a virtual machine, all of which are fundamentally related to being able to share the same hardware yet run several different execution environments (that is, different operating system) concurrently.




Operating System as Virtual Machine

Figure: Virtual Machine

Operating System as Resource Manager

Q1. Explain how operating system acts as a Resource Manager?

Ans. Modern computers consist of processors, memories, timers, disks, mice, network interfaces, printers, and a wide variety of other devices. In the alternative view, the job of the operating system is to provide for an orderly and controlled allocation of the processors, memories, and input/output devices among the various programs competing for them.

When a computer (or network) has multiple users, the need for managing and protecting the memory, input/output devices, and other resources is even greater, since the users might otherwise interface with one another. In addition, users often need to share not only hardware, but information (files, databases, etc.) as well. In short, this view of the operating system holds that its primary task is to keep track of which programs are using which resources, to grant resource requests, to account for usage, and to mediate conflicting requests from different programs and users.

Resource management includes multiplexing (sharing) resources in two different ways:

  1. Time Multiplexing
  2. Space Multiplexing

1. Time Multiplexing

When the 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:

With only one CPU and multiple programs that want to run on it, operating system first allocates the CPU to one long enough, another one gets to use the CPU, then another and ten eventually the first one again.

Determining how the resource is time multiplexed – who goes next and for how long – is the task of the operating system.

2. Space Multiplexing

In space multiplexing, instead of the customers taking turns, each one gets part of the resource.

For example:

Main memory is normally divided up among several running programs, so each one can be resident at the same time (for example, in order to take turns using the CPU). Assuming there is enough memory to hold multiple programs, it is more efficient to hold several programs in memory at once rather than give one of them all of it, especially if it only needs a small fraction of the total. Of course, this raises issues of fairness, protection, and so on, and it is up to the operating system to solve them.


Explain Operating System Services

Q2. Explain how each operating system service provides convenience to the users.

Ans. An operating system provides an environment for the execution of programs. It provides certain services to programs and to the users of the programs. These operating system services are provided for the convenience of the programmer, to make the programming task easier.


Figure: Operating System Services

  1. Program execution

The system must be able to load a program into memory and to run the program. The program must be able to end its execution, either normally or abnormally (indicating error).

  1. Input/Output Operation

A running program may require input/output, which may involve a file or an input/output device. For efficiency and protection, users usually cannot control input/output devices directly. Therefore, the operating system must provide a means to do input/output.

  1. File-System Manipulation

Programs need to read and write files and directories. They also need to create and delete them by name, search for a given file, and list file information. Finally, some programs include permissions management to allow or deny access to files or directories based on file ownership.

  1. Resource Allocation

Where there are multiple users or multiple jobs running at the same time, resources must be allocated to each of them.

For instance, in determining how best to use the CPU, operating system have CPU-scheduling routines that takes into account the speed of the CPU, the jobs that must be executed, the number of registers available and other factors. There may also be routines to allocate printers, modems, USB storage drives, and other peripheral devices.

  1. Accounting

We want to keep track of which users use how much and what kinds of computer resources. This record keeping may be used for accounting or simply for accumulating usage statistics.

  1. Protection and Security

The owners of information stored in a multiuser or networked computer system may want to control use of that information. When several separate processes execute concurrently, it should not be possible for one process to interface with the others or with the operating system itself.

Protection involves ensuring that all access to system resources is controlled.

Security of the system from outsiders is also important. Such security starts with requiring each user to authenticate himself or herself to the system, usually by means of a password, to gain access to system resources.

Layered Approach

Q1. What is Layered Approach?

Ans. A system can be made modular in many ways. One method is the layered approach, in which the operating system is broken up into number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.


Figure: Layered Approach

The main advantage of the layered approach is simplicity of construction and debugging. The layers are selected so that each uses functions (operations) and services of only lower-level layers.

Smart Card Operating System

Q1. Write in short about Smart Card Operating System?

Ans. The smallest operating systems run on smart cards, which are credit card-sized devices containing a CPU chip. They have very severe processing power and memory constraints. Some are powered by contacts in the reader into which greatly limits what they can do. Some of them can handle only a single function, such as electronic payments, but others can handle multiple functions on the same smart card.

Some of these cards can handle multiple Java applets at the same time, leading to multiprogramming and the need to schedule them. Resource management and protection also become an issue when two or more applets are present at the same time. These issues must be handled by the operating system present on the card.


Embedded Operating System

Q1. What is Embedded Operating System?

Ans. Embedded systems run on the computers that control devices that are not generally thought of as computers and which do not accept user-installed software.

Typical examples are microwave ovens, TV sets, cars, DVD recorders, cell phones, MP3 players.

Systems such as QNX and VxWors are popular in this domain.