Вы находитесь на странице: 1из 12

1.What is an operating system?

What are the functions of an operating


system?

An operating system is a software on a mobile, computer etc that provides different


services to the user by controlling and managing the programs running on the
system. It acts as an interface between the user and the system.

Functions:-

It manages the programs running on the system.

Used to monitor performance of the different parts.

OS has different modules, libraries that helps to build an interface that brings the
user closer to the system

2.What is paging? Why paging is used?

Paging is a memory management technique in which the memory is divided into


fixed size pages. Paging is used for faster access to data. When a program needs a
page, it is available in the main memory as the OS copies a certain number of
pages from your storage device to main memory. Paging allows the physical
address space of a process to be noncontiguous

3.Difference between a process and a program

A process invokes or initiates a program. It is an instance of a program that can be


multiple and running the same application.

Example:- Notepad is one program and can be opened twice.

4.What is the meaning of physical memory and virtual memory?

Physical memory is the actual real memory used in RAM. Virtual memory as the
name suggests is not real. The OS uses virtual memory as a memory management
technique in which non-contiguous memory is presented to software as contiguous
memory. If the RAM falls short of memory to accommodate more running
processes, the OS allocates a portion of your hard drive to act as though it were
RAM. That's what is referred to as virtual memory.
5.What is the difference between socket and pipe?

A socket is a part of the OSI model that enables communication between different
layers. Pipes are used in processing in the CPU. Communication in socket is bi
directional while it’s unidirectional in pipes. Pipes increase productivity By
processing multiple processes simultaneously.

6.What are the difference between THREAD, PROCESS and TASK?

A process invokes or initiates a program. It is an instance of a program that can be


multiple and running the same application. A thread is the smallest unit of
execution that lies within the process. A process can have multiple threads running.
An execution of thread results in a task. Hence, in a multithreading environment,
multithreading takes place.

7.What is multiprogramming?

In multiprogramming, several programs run simultaneously on a single processor.


Although in reality there is no real simultaneous execution of different programs, it
gives a sense that they are executing simultaneously due to the part by part
execution of all the programs.

8.What is Multiprocessing?

In multiprocessing, one or more programs are run by more than one processors.

9.Explain the meaning of Kernal.

The kernel is the essential center of a computer operating system, the core that
provides basic services for all other parts of the operating system.

10. Difference between time sharing and multitasking systems?

Time Sharing: in this operating system OS assigns some time slots to each job.
Here each job is executed according to the alloted time slots.

Job1: 0 to 5

Job2: 5 to 10
Job3: 10 to 15

Multi-Tasking: in this operating system jobs are executed in parallel by the


operating system. But we can achieve this multi-tasking through multi-ple
processors (or) CPUs only.

CPU1: Job1

CPU2: Job2

CPU3: Job3

11. What is a binary semaphore? What is its use?

A binary semaphore is one, which takes only 0 and 1 as values. They are used to
implement mutual exclusion and synchronize concurrent processes.

12. What is thrashing?

It is a phenomenon in virtual memory schemes when the processor spends most of


its time swapping pages, rather than executing instructions. This is due to an
inordinate number of page faults.

13. List the Coffman's conditions that lead to a deadlock.

1. Mutual Exclusion: Only one process may use a critical resource at a time.
2. Hold & Wait: A process may be allocated some resources while waiting for
others.
3. No Pre-emption: No resource can be forcible removed from a process
holding it.
4. Circular Wait: A closed chain of processes exist such that each process
holds at least one resource needed by another process in the chain.

14. What are short, long and medium-term scheduling?

Long term scheduler determines which programs are admitted to the system for
processing. It controls the degree of multiprogramming. Once admitted, a job
becomes a process.
Medium term scheduling is part of the swapping function. This relates to
processes that are in a blocked or suspended state. They are swapped out of real-
memory until they are ready to execute. The swapping-in decision is based on
memory-management criteria.

Short term scheduler, also know as a dispatcher executes most frequently, and
makes the finest-grained decision of which process should execute next. This
scheduler is invoked whenever an event occurs. It may lead to interruption of one
process by preemption.

15. What are turnaround time and response time?

Turnaround time is the interval between the submission of a job and its
completion. Response time is the interval between submission of a request, and the
first response to that request.

16. What is the resident set and working set of a process?

Resident set is that portion of the process image that is actually in real-memory at a
particular instant. Working set is that subset of resident set that is actually needed
for execution. (Relate this to the variable-window size method for swapping
techniques.)

17. When is a system in safe state?

The set of dispatch able processes is in a safe state if there exists at least one
temporal order in which all processes can be run to completion without resulting in
a deadlock.

18. What is cycle stealing?

We encounter cycle stealing in the context of Direct Memory Access (DMA).


Either the DMA controller can use the data bus when the CPU does not need it, or
it may force the CPU to temporarily suspend operation. The latter technique is
called cycle stealing. Note that cycle stealing can be done only at specific break
points in an instruction cycle.

19. What are local and global page replacements?


Local replacement means that an incoming page is brought in only to the relevant
process address space. Global replacement policy allows any page frame from any
process to be replaced. The latter is applicable to variable partitions model only.

20. Define latency, transfer and seek time with respect to disk I/O.

Seek time is the time required to move the disk arm to the required track.
Rotational delay or latency is the time it takes for the beginning of the required
sector to reach the head. Sum of seek time (if any) and latency is the access time.
Time taken to actually transfer a span of data is transfer time.

21.What is time-stamping?

It is a technique proposed by Lamport, used to order events in a distributed system


without the use of clocks. This scheme is intended to order events consisting of the
transmission of messages. Each system 'i' in the network maintains a counter Ci.
Every time a system transmits a message, it increments its counter by 1 and
attaches the time-stamp Ti to the message. When a message is received, the
receiving system 'j' sets its counter Cj to 1 more than the maximum of its current
value and the incoming time-stamp Ti. At each site, the ordering of messages is
determined by the following rules: For messages x from site i and y from site j, x
precedes y if one of the following conditions holds....(a) if Ti<Tj or (b) if Ti=Tj
and i<j.

22. How are the wait/signal operations for monitor different from those for
semaphores?

If a process in a monitor signal and no task is waiting on the condition variable, the
signal is lost. So this allows easier program design. Whereas in semaphores, every
operation affects the value of the semaphore, so the wait and signal operations
should be perfectly balanced in the program.

23. In the context of memory management, what are placement and


replacement algorithms?

Placement algorithms determine where in available real-memory to load a


program. Common methods are first-fit, next-fit, best-fit. Replacement algorithms
are used when memory is full, and one process (or part of a process) needs to be
swapped out to accommodate a new program. The replacement algorithm
determines which are the partitions to be swapped out.
24. In loading programs into memory, what is the difference between load-
time dynamic linking and run-time dynamic linking?

For load-time dynamic linking: Load module to be loaded is read into memory.
Any reference to a target external module causes that module to be loaded and the
references are updated to a relative address from the start base address of the
application module.

With run-time dynamic loading: Some of the linking is postponed until actual
reference during execution. Then the correct module is loaded and linked.

25. What are demand-paging and pre-paging?

With demand paging, a page is brought into memory only when a location on that
page is actually referenced during execution. With pre-paging, pages other than the
one demanded by a page fault are brought in. The selection of such pages is done
based on common access patterns, especially for secondary memory devices.

26. Paging a memory management function, while multiprogramming a


processor management function, are the two interdependent?

Yes.

27. What is page cannibalizing?

Page swapping or page replacements are called page cannibalizing.

28. What has triggered the need for multitasking in PCs?

1. Increased speed and memory capacity of microprocessors together with the


support fir virtual memory and
2. Growth of client server computing

29. What are the four layers that Windows NT have in order to achieve
independence?

1. Hardware abstraction layer


2. Kernel
3. Subsystems
4. System Services.
30. What is process spawning?

When the OS at the explicit request of another process creates a process, this action
is called process spawning.

31. List out some reasons for process termination.

1. Normal completion
2. Time limit exceeded
3. Memory unavailable
4. Bounds violation
5. Protection error
6. Arithmetic error
7. Time overrun
8. I/O failure
9. Invalid instruction
10.Privileged instruction
11.Data misuse
12.Operator or OS intervention
13.Parent termination.

32. What are the reasons for process suspension?

1. swapping
2. interactive user request
3. timing
4. parent process request

33. What is process migration?

It is the transfer of sufficient amount of the state of process from one machine to
the target machine.

34. What are the facilities provides by the kernel ?

 Memory management
The kernel has full access to the system's memory and must allow processes
to access safely this memory as they require it.
 Device management
To perform useful functions, processes need access to the peripherals
connected to the computer, which are controlled by the kernel through
device drivers
 System calls
To actually perform useful work, a process must be able to access the
services provided by the kernel.

35.Waht are the types of Kernel:

 Monolithic kernels
Every part which is to be accessed by most programs which cannot be put in
a library is in the kernel space:
Device drivers
Scheduler
Memory handling
File systems
Network stacks
 Microkernls
In Microkernels, parts which really require to be in a privileged mode are in
kernel space:
-Inter-Process Communication,
-Basic scheduling
-Basic memory handling
-Basic I/O primitives

36.Explain the meaning of virtual memory.

Virtual memory is an approach to make use of the secondary storage devices


as an extension of the primary storage of the computer.

 It is the process of increasing the apparent size of a computer's RAM by


using a section of the hard disk storage as an extension of RAM.
 Logically-assigned memory that may or may not exist physically. Through
the use of paging and the swap area, more memory can be referenced and
allocated than actually exists on the system, thus giving the appearance of a
larger main memory than actually exists.
37.What is a command interpreter?

A command interpreter is a program which reads the instructions given by the user.
It then translates these instructions into the context of the operating system
followed by the execution. Command interpreter is also known as ‘shell’

38.What is a named pipe?

Answer
A connection used to transfer data between separate processes, usually on separate
computers.
Its a pipe that an application opens by name in order to write data into or read data
from the pipe.
They are placed in the /dev directory and are treated as special files.
Using a named pipe facilitates interprocess communications.

39.What is pre-emptive and non-preemptive scheduling?

Answer
Tasks are usually assigned with priorities. At times it is necessary to run a certain
task that has a higher priority before another task although it is running. Therefore,
the running task is interrupted for some time and resumed later when the priority
task has finished its execution. This is called preemptive scheduling.

Eg: Round robin


In non-preemptive scheduling, a running task is executed till completion. It cannot
be interrupted.
Eg First In First Out

40.What is pre-emptive and non-preemptive scheduling?

Preemptive scheduling: The preemptive scheduling is prioritized. The highest


priority process should always be the process that is currently utilized.

Non-Preemptive scheduling: When a process enters the state of running, the


state of that process is not deleted from the scheduler until it finishes its
service time.

41.Explain the basic functions of process management.


Answer
The basic functions of the OS wrt the process management are :

 Allocating resources to processes,


 enabling processes to share and exchange information,
 protecting the resources of each process from other processes and
 enabling synchronisation among processes.

42.What is a semaphore?

Answer
A semaphore is a variable. There are 2 types of semaphores:

Binary semaphores
Counting semaphores

Binary semaphores have 2 methods associated with it. (up, down / lock, unlock)
Binary semaphores can take only 2 values (0/1). They are used to acquire locks.
When a resource is available, the process in charge set the semaphore to 1 else 0.

Counting Semaphore may have value to be greater than one, typically used to
allocate resources from a pool of identical resources.

43.What are the different types of memory?

Answer
The types of memory in a computer system are:

 Cache Memory - This is a small amounts of memory used to speed up


system performance.
 Main memory - This is the RAM (random access memory)
 Secondary memory - This is a magnetic storage that keeps applications and
data available to be used, and may also serves as virtual memory depending
upon the operating system
44.What is a compiler?

A complier is a program that converts the programming language code to a


machine readable format. The code should meet the standards, syntax of the
programming language else the compiler will throw an error.

45.What do you mean by deadlock?

When two or more processes wait for a resource to be freed which is controlled by
another process, a deadlock situation occurs. It usually occurs in a multiprocessing
environment. Example, one client application needs access to a table to acquire a
lock which is held by another client application that in turn may attempt to obtain
the lock that is held by the first application.

46.What is a Real-Time System?

Real time systems respond to inputs immediately. For example a mobile phone
sends an email as soon as a phone call is made. They are called as real time
because they behave and respond as though in real life.

47.Describe different job scheduling in operating systems.

Job scheduling schedules or decides which process will get to acquire the resource
based on some parameters.

FIFO- The process that comes first is executed first.

Shortest job First- The time taken to complete the job of all processes is computed
and the shortest length process is executed first.

Round Robin- Each process gets a time “share” for running and is later prevented
to get the next process running.

Priority scheduling- here, the process on highest priority gets the resource

48.Differentiate between Complier and Interpreter

A complier converts the programming language code to machine readable form


during compilation. An interpreter converts each line of code to machine format at
run time. A complier is more used and efficient as it produces a complete machine
language program, which can then be executed
49.Explain loader and linker.

A loader loads the programs into the main memory from the storage device. The
OS transparently calls the loader when needed.

A linker links and combines objects generated by a compiler into a single


executable. A linker is also responsible to link and combine all modules of a
program if written separately.

50.What is page fault and when does it occur?

When the page (data) requested by a program is not available in the memory, it is
called as a page fault. This usually results in the application being shut down

51.Define Thread.

A thread is the smallest unit of execution. A single operating system can have
multiple threads running thereby creating a multithreading environment. Each
thread has a priority based on which the process is executed.

52.What are the advantages of using Thread?

Thread can be executed simultaneously. Multithreading allows the system to run


faster. Therefore, threads increase performance. Multiple threads can share a single
address space, all open files, and other resources. Threads usually reduce
complexity when the aim is to provide security.

Вам также может понравиться