Operating System-Notes
Operating System-Notes
Operating System-Notes
➢ An Operating System is the interface between the computer hardware and the end-user.
➢ Processing of data, running applications, file management and handling the memory is
all managed by the computer OS.
➢ Examples: Windows, Mac, Android, Chrome etc.
Functions:
➢ It helps with memory management. It keeps a track of the files being saved in the Main
memory and the primary memory of the computer device
➢ Whenever a computer is turned on, the Operating system automatically starts to work.
Thus, the booting and rebooting process of a computer device is also an important
function of the OS
➢ It provides a user interface
➢ Managing of basic peripheral devices is done by the operating system
➢ Using the password protection option of an operating system, the data in the device can
be kept secure
➢ It coordinates with the software and the user
➢ Easy navigation and organisation of files and programs are managed by the OS
➢ If any kind of error or bug is found during the program is detected using the operating
system
Components:
1. Process Management
2. File Management
3. Network Management
4. Main Memory Management
5. Secondary Storage Management
6. I/O Device Management
7. Security Management
8. Command Interpreter System
Concurrent Execution:
➢ It is execution of the multiple instruction sequences at the same time.
➢ It happens in the operating system when there are several process threads running in
parallel.
➢ The running process threads always communicate with each other through shared
memory or message passing.
➢ Adv: Running of multiple applications, Better resource utilization, Better performance,
Better average response time
➢ Dis adv:
o It is required to protect multiple applications from one another.
o It is required to coordinate multiple applications through additional
mechanisms.
o Sometimes running too many applications concurrently leads to severely
degraded performance.
Multiprocessing:
Multi programming:
FILE
➢ A file can be defined as a data structure which stores the sequence of records.
➢ Attributes: Name, Identifier, Type, Location, Size, Protection, Time and Date
FRAGMENTATION
➢ Fragmentation is an unwanted problem in the operating system in which the processes
are loaded and unloaded from memory, and free memory space is fragmented.
➢ Processes can't be assigned to memory blocks due to their small size, and the memory
blocks stay unused.
➢ As programs are loaded and deleted from memory, they generate free space or a hole in
the memory. These small blocks cannot be allotted to new arriving processes, resulting
in inefficient memory use.
➢ The conditions of fragmentation depend on the memory allocation system.
➢ As the process is loaded and unloaded from memory, these areas are fragmented into
small pieces of memory that cannot be allocated to incoming processes. It is
called fragmentation.
➢ TYPES:
o Internal Fragmentation: When a process is allocated to a memory block, and if
the process is smaller than the amount of memory requested, a free space is
created in the given memory block. Due to this, the free space of the memory
block is unused, which causes internal fragmentation.
PCB
➢ Process Control Block is a data structure that contains information of the process
related to it.
➢ Also known as a task control block.
➢ Structure: The process control stores many data items that are needed for efficient
process management.
1. Process State: This specifies the process state i.e. new, ready, running, waiting or
terminated.
2. Process Number: This shows the number of the particular process.
3. Program Counter:This contains the address of the next instruction that needs to be
executed in the process.
4. Registers:This specifies the registers that are used by the process.
5. List of Open Files: These are the different files that are associated with the process
6. CPU Scheduling Information: The process priority, pointers to scheduling queues
etc. is the CPU scheduling information that is contained in the PCB. This may also
include any other scheduling parameters.
7. Memory Management Information: The memory management information includes
the page tables or the segment tables depending on the memory system used. It also
contains the value of the base registers, limit registers etc.
8. I/O Status Information: This information includes the list of I/O devices used by the
process, the list of files etc.
9. Accounting information: The time limits, account numbers, amount of CPU used,
process numbers etc. are all a part of the PCB accounting information.
10. Location of the Process Control Block
The process control block is kept in a memory area that is protected from the normal
user access. This is done because it contains important process information. Some
of the operating systems place the PCB at the beginning of the kernel stack for the
process as it is a safe location.