1-2 Mark Os
1-2 Mark Os
-> to provide communication facility between the client program and various services running in user
mode , communication is achieved by message passing
-> the process which spends more time in i/o operation than computation ( time spends with cpu ) is i/o
bound process
-> A thread is a unit of concurrency within a process and has access to the entire code and data of the
process. Therefore, threads within the same process can share their code and data.
1. Execution of Tasks: A thread is responsible for executing instructions within a process, enabling tasks
to be carried out independently or concurrently with other threads in the same process.
2. Resource Sharing: Threads within the same process share the process's memory, code, and data,
allowing efficient communication and resource utilization.
-> "The kernel is the innermost and central part of the operating system, controlling and providing basic
services for all other parts of the system."
FUNCTION :-
1. Process Management: The kernel manages the creation, scheduling, and termination of processes,
ensuring that CPU time is allocated efficiently.
2. Resource Management: It manages system resources such as the CPU, memory, and I/O devices,
ensuring proper allocation and access for programs and users.
• A bootstrap loader is a small program that loads the operating system kernel into memory and
starts its execution during the boot process. It is the first program that runs when a computer is
powered on.
1. Locates and Loads the Kernel: The bootstrap loader locates the operating system kernel and loads it
into the system's main memory (RAM) to initiate system startup.
2. Starts Kernel Execution: Once the kernel is loaded into memory, the bootstrap loader starts its
execution, which allows the operating system to take control of the system.
6) BOOTING SYSTEM
-> Booting the system is done by loading the kernel into main memory and starting its execution. The
process of starting a computer by loading the kernel is known as system booting.
7) BOOTSTRAPPING
-> Bootstrapping is the process of starting a computer system by loading the operating system kernel
into memory and initiating its execution. It begins when the computer is powered on and continues until
the system is fully operational.
SHELL -> A shell is a software that provides an interface for user of an operating system access the
services of a kernel
TIMER -> A timer interrupts the system after a set time to prevent programs from running indefinitely. It
uses a counter that decrements with each clock tick and triggers an interrupt when it reaches zero.
DEFINITION -> An os is defined as " an organized collection of programs that controls the execution of
the application program and acts as interface between computer system and computer hardware
ROLE OF OS :-
1. To provide an environment for running application software, helping applications use system services
to perform tasks.
2. To manage computer hardware, act as an interface between the user and the computer, and allocate
resources to different tasks.
FUNCTION OF OS:-
9. job accounting
TYPES OF OS:-
1. Batch Operating System 2. multiprogramming os
7. distributed os 8. network os
-> Spooling stands for Simultaneous Peripheral Operations On Line. It refers to putting data from various
I/O jobs into a buffer, which is a special area in memory or on a hard disk accessible to I/O devices.
5. communication
1. Interface between User and Kernel: A system call provides a programmatic interface for user
applications to request services from the operating system's kernel, such as accessing files or managing
processes.
2. Resource Management: It allows user programs to request system resources, like memory or I/O
devices, and ensures the proper execution of these tasks in kernel mode, ensuring security and resource
allocation.
12) SCHEDULER
-> A scheduler is a system software responsible for managing the execution of processes. It selects which
processes will run on the CPU, determining the order and allocation of CPU time for efficient process
execution.
-> A context switch is the process of saving the state of the current process and loading the state of the
next process when the CPU switches between them.
-> Process scheduling is a key function in multiprogramming operating systems, allowing multiple
processes to be loaded into memory at the same time. The operating system allocates CPU time to each
process through time multiplexing, enabling efficient execution of multiple processes.
The dispatcher is the module of the operating system responsible for setting up and starting the
execution of the selected process on the CPU.
ROLE OF DISPATCHER :-
3. restart the program by jumping to the proper location in the user program
1. FCFS (First-Come, First-Served) is a CPU scheduling algorithm where processes are executed in the
order they arrive. The first process to request the CPU is the first to be allocated it. It is simple to
implement using a queue data structure for the ready queue.
2. SJF (Shortest Job First) is a CPU scheduling algorithm that selects the process with the shortest burst
time to execute next. It aims to minimize waiting time by prioritizing processes that require the least CPU
time. It is also known as Shortest Process Next (SPN) or Shortest Request Next (SRN).
18) TAT
Turnaround Time (TAT) is the total time taken from the submission of a process to its completion,
including time spent waiting in the ready queue, executing on the CPU, and performing I/O operations.
19) PROCESS
PROCESS IS DEFINED AS " an entity which represents the basic unit of work to be implemented in the
system" .
20) PCB
PCB is a data structure that stores information about a particular process . a pcb keeps all the
information needed to keep track of a process
A ready queue contains processes that are in main memory, ready to execute but waiting for CPU time. A
new process is added to this queue once it is loaded into memory.
• irix
• solaris 2
-> the time taken by dispatcher to stop one process and start another process to run is called dispatch
latency
a semaphore is a variable used to control access to a common resource by multiple processes and avoid
critical section problem
-> A race condition occurs when multiple processes access and modify the same data at the same time,
and the result depends on the order in which the processes run.
-> Mutual exclusion means that if one process is working in its critical section, no other process can work
in the same critical section at the same time.
-> A logical address is the address generated by the CPU when a program is running. It is used to access
data in memory, but it doesn't represent the actual location in physical memory.
• First Fit
• Best Fit
• Worst Fit
• The set of all logical addresses generated by a program is known as logical address
space.
-> An address generated by the CPU is commonly known as logical address or virtual
address.
-> Virtual memory is a memory management technique that allows processes to run even if they are not
completely loaded into main memory, giving the illusion of a larger memory space.
1. Paging is a memory management technique that divides the physical memory into fixed-size blocks
called pages and allows non-contiguous allocation of memory to processes.
2. Swapping is a memory management technique where processes are temporarily moved from main
memory to secondary memory (disk) to free up space for other processes.
Fragmentation occurs when free memory is broken into small, non-contiguous pieces, making it difficult
to allocate memory to processes.
1. External fragmentation happens when there is enough total free memory, but it's scattered in small
blocks, preventing allocation of larger processes.
2.Internal fragmentation occurs when memory allocated to a process is larger than needed, leaving
unused space within allocated blocks.
34) SEGMENTATION
Segmentation is a memory management scheme that divides a process into segments, such as code,
data, and stack, based on the user's view of memory. It allows the logical separation of memory, unlike
the physical memory layout, enabling more flexible memory allocation.
35) WHAT IS MEAN BY PAGE REPLACEMENT ?
Page replacement is a process in which the operating system swaps out a page from main memory to
make space for a new page when a page fault occurs and there is not enough free memory.
The valid-invalid bit is used in demand paging to indicate whether a page is in memory or on disk. A valid
bit means the page is in memory, while an invalid bit indicates the page is either not in memory or is
stored on disk, requiring a page fault to load it into memory.
37) COMPACTION
-> the collection of free space multiple non-contiguous blocks into one large free block in a system's
memory is called compaction
-> A critical section is a part of a program where shared resources or variables are accessed, and it must
be executed by only one process at a time to avoid race conditions and ensure data consistency.
39) STATE THE ROLE OR PRIMARY FUNCTION ALL TERM PROCESS SCHEDULER ?
-> The primary functions of the different types of process schedulers are:
• Selects processes from the job pool in secondary storage and loads them into memory for
execution.
• Controls the degree of multiprogramming by determining which programs are admitted to the
system.
• Selects a process from the ready queue and allocates CPU time to it.
• Invoked very frequently, as it makes decisions on which process should execute next.
Medium-term Scheduler:
1. Preemptive Scheduling:
In preemptive scheduling, a running process can be interrupted and replaced by a higher priority
process. The operating system can stop the currently running process and transfer control to a higher
priority process.
2. Preemptive Scheduling:
In non-preemptive scheduling, once a process is assigned the CPU, it runs to completion or until it
voluntarily releases the CPU. The system does not interrupt the process once it starts executing.
-> It’s the alternating cycle where a process uses the CPU for calculations (CPU burst) and waits for I/O
operations (I/O burst).
-> POSIX Pthreads is a standard for managing threads in Unix-like OS. It allows multiple threads to run in
a single process, improving performance.
43) SYNCHRONIZATION
-> Synchronization is a technique used in operating systems to ensure that multiple processes or threads
can access shared resources without conflicts, ensuring data consistency and preventing race conditions.
PAGE HIT -> A page hit happens when the computer finds the requested page in memory, so it doesn't
need to load it from the disk.
PAGE FAULT -> When the page (data) requested by a program is not available in the memory, it is