0% found this document useful (0 votes)
20 views10 pages

OS Notes

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 10

OS

1. What is OS?
Ans: - OS is a software that works as an interface between hardware and
user.
Features of OS: -
• Manage process
• Manage memory
• Manage resources
• Error handling
• Security

2. Types of OS.
Ans: -
• Multi-programmed OS: - windows, Linux etc.
• Timesharing OS
• Distributed OS
• Realtime OS
3. Multiprocessor vs Multitasking.
Ans: -
MultiProcessor MultiTasking

Two or more processes of same Two or more task is executed at


program is running simultaneously. same time on a single processor
using context switching.
It has multiple CPUs. It has 1 CPU only.

It is fast. It is slow.

More reliable. Less reliable


4. Context Switching: - Context switching is a process of saving the context of
one process and loading the context of another process. This helps in
achieving multitasking on a single processor system.

5. What is GUI?
Ans: - Graphical User Interface, is a type of user interface that uses graphics
to interact with OS.
Features: -
• User-friendly
• Less complex
• Easy to understand
6. What is Pipe and when it is used?
Ans: -
• pipe is a mechanism through which process can communicate with
each-other.
• Pipe is a mechanism that provides interprocess communication.
• It is used to send output of one process to another process.

7. What is semaphore?
Ans: - Semaphore is a technique to manage concurrent processes using an
integer value called semaphore.
• It is shared between threads.
• It has two operation Wait () and Signal ().
Types: -
• Binary semaphore – value is between 0 and 1, also known as Mutex
locks as they provide mutual exclusion.
• Counting Semaphore – suppose there are multiple instances of a
resource, then multiple process can use instances of same
resource.
8. What is Bootstrap?
Ans: -
• It is program that initializes OS during startup.
• It is first code that is executed when an OS starts.
• OS loaded through bootstrapping process is called booting.
• It is stored in boot blocks in fixed location in hard-disk.
Q. What is paging?
Ans: - Paging is a memory management technique used to store and retrieve
program from secondary memory to primary memory.

9. What is demand paging?


Ans: - it is a method that load pages into memory on demand. This method is
mostly used in virtual memory. In this a page is brought into memory when a
location is referenced during execution.

10. What is RTOS?


Ans: - Real-Time Operating System, it is a system used for real-time
applications.
Types: -
• Hard real-time
• Firm real-time
• Soft real-time
Eg: - Air traffic control system, Anti-brake lock system, Pacemaker etc.

11.What is Process Synchronization?


Ans: - process synchronization is basically a way to coordinate process that
uses shared resources or data. It is necessary to maintain data consistency.

12. What is IPC?


Ans: - IPC allows different processes to communicate with each-other. It is
used for exchanging data between various processes.
13. Difference between Main Memory and Secondary Memory.
Ans: -
Main Memory Secondary Memory
Also known as RAM in computers. Also known as hard disk in
computer.
It is volatile. It is not volatile.
Directly connected to cache and Directly connected to Main memory.
then cache to CPU.
Faster than secondary memory. Slower than main memory.
Costlier Less costly
Less storage High storage

To execute a program, first it is bought to RAM from hard disk then from
RAM to CPU.

14.What are Overlays?


Ans: - Overlays is a programming method that divides processes into pieces
so that only necessary parts of the process can be loaded into memory. Using
this technique, we can run program bigger than main memory.

15. What is Virtual Memory?


Ans: - it is a memory management technique that creates illusion to users of
a larger main memory. It is simply a space where greater number of
programs can be stored in form of pages.

Q. How virtual memory works?


Ans: - it uses some memory from hard disk to store the parts of programs
that memory is called Page File. When RAM needs that part, it accesses from
it and use it. This helps in running program greater than the capacity of main
memory. It increases performance, promotes multitasking.
16. What are threads?
Ans: - Threads are the smallest unit of a process.
It is composed of: -
• Thread id
• Program counter
• Stack
• Set of register

17.What is a process?
Ans: - A program in execution is called process.
Types of process: -
• OS process
• User process
Different states of process: -
• New
• Ready
• Waiting
• Running
• Terminate

18. What is scheduling algorithm?


Ans: - a scheduling algorithm is a technique to schedule process execution to
maximize CPU utilization and provide minimum waiting time.
In simple it is used to allocate resource between various tasks.
Eg: - FCFS, Round Robin, SJF, LRU priority etc.

19.Reentrancy – it is a program where client can use and share a single copy of
a program at same time.

20. Paging: - it is a memory management technique that allows OS to retrieve


process from secondary memory to main memory.
Segmentation: - it is a memory management technique that divides process
into modules of different sizes, these modules are known as segments.

21. What is thrashing in OS?


Ans: - Thrashing occurs when CPU does more swapping than processing. By
evaluating the CPU utilization, a system can detect thrashing. It occurs when
process doesn’t have enough pages due to which page fault is increased.

22. What is multiprogramming?


Ans: - it is ability to perform more than one program on a single processor
machine. The main objective is to have some process running all the time.
It reduces CPU underutilization.

23. What are sockets?


Ans: - sockets are endpoints of IPC by which two process can communicate
with each other for resource or data sharing.
It makes it easy to create network-enabled programs.

24.What is Zombie Process?


Ans: - The process which is completed or terminated but still holding the
resources called Zombie Process.

25. Cascading Termination – It is a process termination in which if the parent


process is terminated then child process will also get terminated.

26. Starvation – It occurs when process is not able to get required resources for
a long time so that it can finish its execution.
Aging – it is a technique to overcome starvation, it increases the priority of
other processes with time.
27.Kernel – it is basically a program considered as central component of OS.
it is responsible for handling, managing and controlling all operations of
computer system and hardware.
• Whenever the system starts, kernel is loaded first
• All functions of OS.
Types: -
• Monolithic
• Micro
• Hybrid
• Nano
• Exo

28. Difference between micro kernel and monolithic kernel?


Ans: - micro kernel – it executes only important functions of OS.
Monolithic – resource management, memory, file etc.

29. Difference between Kernel and OS?


Ans: - Kernel controls all the programs running on system while OS provides
interface to users to operate the system.

30. Difference between Process and Thread.


Ans: - thread is smallest unit of process. A process can be further divided into
many threads.

Process Threads
A program in execution. Smallest unit of process.
Heavy weight operations Light Weight operations.
It has its own memory space. It uses the memory of the process it
belongs to.
It doesn’t share data. It shares data among threads.
It can be further divided. It cannot be further divided.
31. What is Deadlock in OS?
Ans: - Deadlock is a situation occurs when a two or more processes eg: p1 is
waiting for some resources which is held by p2 process which requires the
resource held by p1.

Necessary conditions for deadlocks: -


• Mutual exclusion
• Hold and wait
• No pre-emption
• Circular wait

Methods for handling Deadlock: -


• Prevention – not let the system in deadlock.
• Detection and recovery – using pre-emption we can recover from
deadlock.
• Ignore – since deadlock is rare, we can reboot the system to remove
it like windows and Linux do.

32. Belady’s anomaly – Generally when we increase number of frames, the page
fault decreases or we can say they have inverse relationship, but in FIFO
there is a situation occurs when increasing number of frames also increases
page faults.

33. What is booting?


Ans: - Booting refers to the starting of a computer and loading OS into
memory.
Steps in booting: -
• Power-On Self-Test - When you turn on a computer, the hardware
components go through a self-diagnostic process called POST.

• BIOS/UEFI Initialization - These are firmware interfaces that provide low-


level control over the computer's hardware. They contain the instructions
necessary to start the boot process.
• Boot Loader - The BIOS or UEFI then locates and loads a small program
called the boot loader from the computer's storage device (usually the hard
drive or a solid-state drive). The boot loader is responsible for loading the
operating system into memory.

• Operating System Kernel Loading - The boot loader transfers control to the
operating system's kernel, which is the core component of the operating
system. The kernel is loaded into memory, and it takes over the control of
the computer.

• Operating System Initialization: Once the kernel is in control, the operating


system is initialized. This involves setting up essential system processes,
device drivers, and other components needed for the computer to
function.

• User Interface: Finally, the user interface is presented, and the user can
interact with the computer.

34.What are system calls?


Ans: - System calls are interfaces used by user to request services from
Kernel.
E.g.: - open (), close (), fork (), wait () etc.
Fork () – fork is a system call used to create a copy of a running process.
The new process created is called child process and existing is called parent.
It creates child process and assign a separate memory space from parent.

35. If you are facing issues with internal server error, how will you troubleshoot?
Ans: - Troubleshooting an internal server can be a systematic process to
tackle this problem.
• Checking server logs.
• Software update logs.
• Code changes logs.
36. ps aux | grep <process_name> - linux command for getting details about a
process.
37. Top - Display real-time usage of resources including CPU usage.
38. Star – It is used to create or extract an archive.

You might also like