UNIT I Important Qns
UNIT I Important Qns
An operating system is a program that manages a computer’s hardware. It also provides a basis
for application programs and acts as an intermediary between the computer user and the computer
hardware.
An operating system is a program that manages the computer hardware. It acts as an intermediate
between a user of a computer and the computer hardware. It controls and coordinates the use of the
hardware among the various application programs for the various users.
An interrupt is a hardware-generated signal that changes the flow within the system. A trap is a
software-generated interrupt. An interrupt can be used to signal the completion of I/O so that the CPU
doesn't have to spend cycles polling the device. A trap can be used to catch arithmetic errors or to call
system routines.
Operations of the operating system are process management, memory management, device
management and file management.
Memory management: moving of processes from disk to primary memory for execution.
Device Management: an access all the I/O devices using the device drivers, which are device specific codes.
Batch Systems.
Operators batched together jobs with similar needs and ran through the computer as a group.
The operators would sort programs into batches with similar requirements and as system become
available, it would run each batch.
Describe API need to be used rather than system calls.
System calls are much slower than APIs (library calls) since for each system call, a context switch
has to occur to load the OS (which then serves the system call). Most details of OS interface hidden from
programmer by API Managed by run-time support library (Set of functions built into libraries included with
compiler.)
System programs.
System programs, also known as system utilities, provide a convenient environment for program
development and execution
• File management
• Status information
• File modification.
• Programming-language support
• Program loading and execution
• Communications.
• Background services.
A kernel is the core part of an operating system that manages hardware resources.
List out the operating system structure.
• Multiprogramming
• Job pool
• Time sharing
• Interactive computer system
• Response time
• Process
• Job scheduling
• CPU scheduling
• Swapping
• Physical and Logical memory
What is the main difficulty that a programmer must overcome in writing an operating system for a real-
time environment?
• The main difficulty is keeping the operating system within the fixed time constraints of a real-time
system.
• If the system does not complete a task in a certain time frame, it may cause a breakdown of the
entire system it is running.
• Therefore, when writing an operating system for a real-time system, the writer must be sure that
his scheduling schemes don’t allow response time to exceed the time constraint.
Discuss in detail about abstract view of the components of a computer system with a neat diagram.
Summarize the five major activities of an operating system with regard to process management?
Identify five services provided by an operating system. Explain how each provides convenience to the
users. Explain also in which cases it would be impossible for user-level programs to provide these
services.
• Program execution
• I/O operations
• File-system manipulation
• Communications
• Error detection
Discuss the three major activities of an operating system with regard to secondary-storage
management?
The three major activities are:
• Free-space management.
• Storage allocation.
• Disk scheduling.
Interpret the purpose of the command interpreter? Why is it usually separate from the kernel?
It reads commands from the user or from a file of commands and executes them, usually by
turning them into one or more system calls. It is usually not part of the kernel since the command
interpreter is subject to changes.a
It is much cheaper to buy a simple single processor system than a multiprocessor system. There
are multiple processors in a multiprocessor system that share peripherals, memory etc. So, it is much more
complicated to schedule processes and impart resources to processes
Explain the main advantage of the layered approach to system design? What are the disadvantages of
using the layered approach?
As in all cases of modular design, designing an operating system in a modular way has several
advantages. The system is easier to debug and modify because changes affect only limited sections of the
system rather than touching all sections of the operating system. Information is kept only where it is
needed and is accessible only within a defined and restricted area, so any bugs affecting that data must
be limited to a specific module or layer.
DMA (Direct Memory Access): Direct memory access (DMA) is a feature of computer systems that
allows certain hardware subsystems to access main memory (Random-access memory), independent of
the central processing unit (CPU).
Cache Memory: A cache is a smaller, faster memory, closer to a processor core, which stores copies of
the data from frequently used main memory locations. So, both DMA and cache are used for increasing
the speed of memory access.
In some computer systems, privileged mode of operation is not available in hardware. Can we find a
secure operating system for these computer systems? Explain it.
An operating system for a machine of this type would need to remain in control at all times. This
could be accomplished by two methods: a.Software interpretation of all user programs. This software
interpreter would provide, in software, what the hardware doesnot provide. b. Require meant that all
programs be written in high level language so that all object code is compiler produced. The compiler
would generate the protection checks that the hardware is missing.
Discuss in detail about the operating system structure.
A system as large and complex as a modern operating system must be engineered carefully
if it is to function properly and be modified easily. A common approach is to partition the task into small
components, or modules, rather than have one monolithic system. Each of these modules should be a well-
defined portion of the system, with carefully defined inputs, outputs, and functions. We have already
discussed briefly in Chapter 1 the common components of operating systems.
1.Simple Structure
2. Layered Approach
• With proper hardware support, operating systems can be broken into pieces that are smaller and
more appropriate
• The operating system can then retain much greater control over the computer and over the
applications that make use of that computer.
• Operating system is broken into a number of layers(levels). The bottom layer (layer 0) is the
hardware; the highest (layer N) is the user interface. The mid layers mostly comprising the OS
system and application programs This layering structure is depicted in Figure 2.13.
Advantage
• Simplicity of construction and debugging
• The first layer can be debugged without any concern for the rest of the system
• A layer does not need to know how these operations are implemented; it needs to know only what
these operations do. Hence, each layer hides the existence of certain data structures, operations,
and hardware-level layers.
Disadvantage
1. Careful planning on design is necessary
2. less efficient than other types. Each layer adds overhead to the system call. The net result is a system
call that takes longer than does oneon a nonlayered system.
Example VAX/VMS, Multics
3. Microkernels
• Researchers at Carnegie Mellon University developed an operating system called Mach that
modularized the kernel using the microkernel approach.
• Only essential Operating system functions like thread management, address space management,
inter-process communication are built in kernel
• All nonessential components from the kernel are removed and implemented as system and user-
level programs.
• The main function of the microkernel is to provide communication between the client program and
the various services that are also running in user space.
• Communication is provided through message passing,
Advantage
• It makes extending the operating system easier.
• All new services are added to user space and consequently do not require modification of the kernel.
• Its easier to port from one hardware design to another.
• Provides more security and reliability, since most services are running as user process—rather than
kernel process
• If a service fails, the rest of the operating system remains untouched
Disadvantage
The performance of microkernels can suffer due to increased system-function overhead.
Example: Mac OS X kernel (also known as Darwin) based onMach microkernel
4. Modules Approach
• The best current methodology for operating-system design involves using loadable kernel
modules
• The kernel has a set of core components and links in additional services via modules, either at boot
time or during run time. This type of design is common in modern implementations of UNIX, such
as Solaris, Linux, and Mac OS X, as well as Windows.
• The idea of the design is for the kernel to provide core services while other services are
implemented dynamically, as the kernel is running
• Linking services dynamically is preferable to adding new features directly to the kernel, which
would require recompiling the kernel every time a change was made.
Advantages
• Has defined, protected interfaces;
• More flexible than a layered system
• More efficient, because modules do not need to invoke message passing in order to communicate.
Example:Solaris
Android
The Android operating system was designed by the Open Handset Alliance (led primarily by Google) and
was developed for Android smartphones and tablet computers.
Android runs on a variety of mobile platforms and is open-sourced,
Android is similar to iOS in that it is a layered stack of software
State the operating system structure. Discuss the operating system operations in detail. Justify the
reason why the lack of a hardware supported dual mode can cause serious shortcoming in an
operating system?
An operating system is a construct that allows the user application programs to interact with the
system hardware. Since the operating system is such a complex structure, it should be created with utmost
care so it can be used and modified easily. An easy way to do this is to create the operating system in parts.
Each of these parts should be well defined with clear inputs, outputs and functions.
Simple Structure
There are many operating systems that have a rather simple structure. These started as small systems and
rapidly expanded much further than their scope. A common example of this is MS-DOS. It was designed
simply for a niche amount for people. There was no indication that it would become so popular.
An image to illustrate the structure of MS-DOS is as follows:
It is better that operating systems have a modular structure, unlike MS-DOS. That would lead to greater
control over the computer system and its various applications. The modular structure would also allow the
programmers to hide information as required and implement internal routines as they see fit without
changing the outer specifications.
Layered Structure
One way to achieve modularity in the operating system is the layered approach. In this, the bottom layer is
the hardware and the topmost layer is the user interface.
An image demonstrating the layered approach is as follows:
As seen from the image, each upper layer is built on the bottom layer. All the layers hide some structures,
operations etc from their upper layers.
One problem with the layered structure is that each layer needs to be carefully defined. This is necessary
because the upper layers can only use the functionalities of the layers below them.