BcaStudy
OPERATING SYSTEM

SHORT NOTES ON OPERATING SYSTEM

Operating system

An operating system (OS) is the program that, after being initially loaded into the computer by a boot program, manages all of the other application programs in a computer

Types of Operating Systems

Batch processing operating systems are designed to execute a large number of similar jobs or tasks without user intervention.

Multiprogramming OS is the type of operating system in which several jobs are executed at a time on a single CPU machine. In batch operating system, the process might stay without executing a task. In multiprogramming OS, processor always execute a task.

A time shared operating system uses CPU scheduling and multi-programming to provide each user with a small portion of a shared computer at once.

Parallel systems deal with the simultaneous use of multiple computer resources that can include a single computer with multiple processors, a number of computers connected by a network to form a parallel processing cluster or a combination of both.

Distributed System is a collection of autonomous computer systems that are physically separated but are connected by a centralized computer network that is equipped with distributed system software.

A real-time operating system (RTOS) is a special-purpose operating system used in computers that has strict time constraints for any job to be performed

Swapping is a technique used by operating systems to move less frequently used memory pages from RAM to a hard disk.

Paging is a storage mechanism used in OS to retrieve processes from secondary storage to the main memory as pages

Fragmentation :- The process of dividing a computer file, such as a data file or an executable program file, into fragments that are stored in different parts of a computer’s storage medium, such as its hard disc or RAM, is known as fragmentation in computing.

Segmentation is a memory management technique whereby data items are stored in segments on the storage media. It divides the process or user-accessible space into fixed-sized blocks, called segments.

Demand Paging is a method of moving data from secondary memory to the main memory on specific demand

page replacement is referred to a scenario in which a page from the main memory should be replaced by a page from secondary memory.

Page Replacement Algorithms:
  1. First In First Out (FIFO): When a page needs to be replaced page in the front of the queue is selected for removal.
  2. Optimal Page replacement: In this algorithm, pages are replaced which would not be used for the longest duration of time in the future.
  3. Least Recently Used: In this algorithm, page will be replaced which is least recently used. 
  4. Most Recently Used (MRU): In this algorithm, page will be replaced which has been used recently. Belady’s anomaly can occur in this algorithm. 

Allocation of frames: The main memory of the operating system is divided into various frames. The process is stored in these frames, and once the process is saved as a frame, the CPU may run it.

Thrashing in os is a phenomenon that occurs in computer systems when the system spends an excessive amount of time on page swapping rather than executing useful work.

UNIT-2

A process is a running program that serves as the foundation for all computation

Process scheduling is the activity of the process manager that handles the removal of the running process from the CPU and the selection of another process on the basis of a particular strategy.

  1. Long Term or job scheduler: It brings the new process to the ‘Ready State’.
  2. Short-term or CPU scheduler:
    It is responsible for selecting one process from the ready state for scheduling
  3. Medium-term scheduler:
    It is responsible for suspending and resuming the process. It mainly does swapping (moving processes from main memory to disk and vice versa)
  • Preemptive Scheduling: Preemptive scheduling is used when a process switches from running state to ready state or from the waiting state to the ready state.
  • Non-Preemptive Scheduling: Non-Preemptive scheduling is used when a process terminates , or when a process switches from running state to waiting state.

Processes Synchronization or Synchronization is the way by which processes that share the same memory space are managed in an operating system. It helps maintain the consistency of data by using variables or hardware so that only one process can make changes to the shared memory at a time.

The critical section problem is to make sure that only one process should be in a critical section at a time. When a process is in the critical section, no other processes are allowed to enter the critical section

Synchronization hardware is a hardware-based solution to resolve the critical section problem

Semaphores are integer variables that are used to solve the critical section problem by using two atomic operations, wait and signal that are used for process synchronization. The wait operation decrements the value of its argument S, if it is positive. If S is negative or zero, then no operation is performed.

Classical problems of Synchronization

  1. Bounded-buffer (or Producer-Consumer) Problem,
  2. Dining-Philosophers Problem,
  3. Readers and Writers Problem,
  4. Sleeping Barber Problem

UNIT-3

Deadlock is a situation where a set of processes are blocked because each process is holding a resource and waiting for another resource acquired by some other process. 

Comments

Comments take few seconds to update

Resource to learn

Message
If you want your notes and pdf on website send me google drive link