[go: up one dir, main page]

0% found this document useful (0 votes)
2 views8 pages

OS Notes Unit 1 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views8 pages

OS Notes Unit 1 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

9/1/2023

What is OS?
It is a collection of software that manages hardware
resources and provides common services for programs.
When we start using a Computer System, it is the OS which
acts as an interface between the hardware and us.
It is a low level Software which is categorized as a System
Operating System Software and supports a computer's basic functions,
such as memory management, tasks scheduling,
controlling peripherals, etc.
Unit 1 An OS is an interface between a computer user and
hardware. It is a software which performs all the basic
tasks like file management, memory management,
process management, handling input and output, and
controlling peripheral devices such as disk drives and
printers.

Four Components of a Computer System


Computer System
• Computer Users are the users who use the overall computer
system.

• Application Software are the software which users use directly to


perform different activities. These are simple and easy to use like
Browsers, Word, Excel, different Editors, Games etc. These are
usually written in high-level languages, such as Python, Java, and
C++.

• System Software are the software which are more complex in


nature and they are more near to hardware. These are written in
low-level languages like assembly language and
includes OSs (Microsoft Windows, macOS, and Linux), Compiler,
Assembler, etc.

• Computer Hardware includes Monitor, Keyboard, CPU, Disks,


Memory, etc.

1
9/1/2023

Memory Management
The Functions of OS • It refers to management of Primary Memory or Main
Memory. MM is a large array of words or bytes where each
• Process Management word or byte has its own address.
• I/O Device Management
• File Management • MM provides a fast storage that can be accessed directly by
• Network Management the CPU. For a program to be executed, it must in the MM. An
• Main Memory Management OS does the following ac vi es for memory management −
• Secondary Storage Management • Keeps tracks of MM, i.e., what part of it are in use by
• Security Management whom, what part are not in use.
• Command Interpreter System • In multiprogramming, the OS decides which process will
get memory when and how much.
• Control over system performance
• Allocates the memory when a process requests it to do so.
• Job Accounting
• De-allocates the memory when a process no longer needs
• Error Detection and Correction it or has been terminated.
• Coordination between other software and users

Processor Management Device Management


• In multiprogramming environment, the OS • An OS manages device communication via
decides which process gets the processor their respective drivers. It does the following
when and for how much time. This function is
called process scheduling. An OS does the ac vi es for device management −
following activities for processor management • Keeps tracks of all devices. Program
− responsible for this task is known as
• Keeps tracks of processor and status of the I/O controller.
process. The program responsible for this • Decides which process gets the device
task is known as traffic controller.
when and for how much time.
• Allocates the processor to a process.
• De-allocates processor when a process is no • Allocates the device in the efficient way.
longer required. • De-allocates devices.

2
9/1/2023

File Management Other Important Activities


• A file system is normally organized into • Security − By means of password and similar other
directories for easy navigation and usage. techniques, it prevents unauthorized access to programs
and data.
These directories may contain files and other • Control over system performance − Recording delays
directions. between request for a service and response from the
• An OS does the following activities for file system.
management − • Job accounting − Keeping track of me and resources used
by various jobs and users.
• Keeps track of information, location, uses, • Error detecting aids − Produc on of dumps, traces, error
status etc. The collective facilities are often messages, and other debugging and error detecting aids.
known as file system. • Coordination between other software and users −
• Decides who gets the resources. Coordination and assignment of compilers, interpreters,
assemblers, and other software to the various users of the
• Allocates the resources. computer systems.
• De-allocates the resources.

Batch OS Characteristics
• The users of a BOS do not interact with the • the CPU executes the jobs in the same sequence that they
are sent to it by the operator, which implies that the task
computer directly. Each user prepares his job on an sent to the CPU first will be executed first. It's known as
off-line device like punched cards and submits it to the 'first come, first serve'
the computer operator. To speed up processing, • The word job refers to the command or instruction that
jobs with similar needs are batched together and the user and the program should perform.
run as a group. The programmers leave their • A BOS runs a set of user-supplied instructions composed
programs with the operator and the operator then of distinct instructions and programs with several
sorts the programs with similar requirements into similarities.
batches. • When a task is successfully executed, the OS releases the
The problems with BOS are: memory space held by that job.
• The user does not interface directly with the OS in a BOS;
• Lack of interaction between the user and the job. rather, all instructions are sent to the operator.
• CPU is often idle, because the speed of the • The operator evaluates the user's instructions and creates
mechanical I/O devices is slower than the CPU. a set of instructions having similar properties.
• Difficult to provide the desired priority.

3
9/1/2023

Advantages Disadvantages
• It isn't easy to forecast how long it will take to • When a job fails once, it must be scheduled to be
completed, and it may take a long time to
complete a job; only batch system processors
complete the task.
know how long it will take to finish the job in line.
• Computer operators must have full knowledge of
• This system can easily manage large jobs again batch systems.
and again. • The batch system is quite difficult to debug.
• The batch process can be divided into several • The computer system and the user have no direct
stages to increase processing speed. interaction.
• When a process is finished, the next job from the • If a job enters an infinite loop, other jobs must
job spool is run without any user interaction. wait for an unknown period of time.
• CPU utilization gets improved.

Multiprogramming OS Two types of MOS


• A MOS may run many programs on a single processor computer.
If one program must wait for an I/O transfer in a MOS, the other • A multitasking OS enables the execution of two or more
programs are ready to use the CPU. As a result, various jobs may programs at the same time. The OS accomplishes this by
share CPU time. The execution of their jobs is not defined to be shifting each program into and out of memory one at a
at the same time period. time. When a program is switched out of memory, it is
temporarily saved on disk until it is required again.
• When a program is being performed, it is a "Task", "Process",
and "Job". Concurrent program executions improve system • A multiuser OS allows many users to share processing time
resource consumption and throughput as compared to serial on a powerful central computer from different terminals.
and batch OS. The OS accomplishes this by rapidly switching between
terminals, each of which receives a limited amount of
• The goal of multiprogramming is to manage the entire system's processor time on the central computer. The OS changes
resources. The components of a MOS are the file system, among terminals so quickly that each user seems to have
command processor, transient area, and I/O control system. As a continuous access to the central computer. If there are
result, MOSs are designed to store different programs based on many users on a system like this, the time it takes the
sub-segmenting parts of the transient area. The resource central computer to reply can become more obvious.
management routines are linked with the OS core functions.

4
9/1/2023

Advs of MOS Disadvs of MOS


• It provides less response time. • It is highly complicated and sophisticated.
• It may help to run various jobs in a single application • The CPU scheduling is required.
simultaneously.
• It helps to optimize the total job throughput of the • Memory management is needed in the OS
computer. because all types of tasks are stored in the main
• Various users may use the multiprogramming system at memory.
once.
• Short-time jobs are done quickly in comparison to long- • The harder task is to handle all processes and
time jobs. tasks.
• It may help to improve turnaround time for short-time • If it has a large number of jobs, then long-term
tasks.
jobs will require a long wait.
• It helps in improving CPU utilization and never gets idle.
• The resources are utilized smartly.

Multitasking
• Multitasking means working on multiple tasks simultaneously, such Multitasking
as using our computer while listening to music. Also, using a
browser, search for something on the internet and create a word
document that is our assignment. It appears that all of the tasks are Advantages
taking place at the same time. It is not all of the tasks happening
simultaneously; the processor moves between them at such a fast • It provides logical parallelism.
pace that we believe they are happening simultaneously.
• Multitasking is similar to multiprogramming in that the CPU is • It provides a shorter response time.
assigned to a process for a specified period of time, i.e., 'Time
quantum or time slice', after which the CPU 'Context switches' to • It provides CPU utilization.
another process. It runs various programs at the same time.
• The PC requires a huge memory to execute multitasking (RAM or
ROM). Its primary goal is to improve the timing of the CPU's
response. Users can engage with the system during multitasking, Disadvantages
for example, by typing a letter while the printing process is running.
• Multitasking is a highly complicated system. It is based on the time • It couldn't be executed on a slow-speed processor.
slice principle, which assigns a fixed amount of time to each activity
to be completed. It is especially useful when a program requires a • It needs a large amount of storage memory to do
high level of parallelism. It provides a set amount of time for each
program to run. the work.

5
9/1/2023

Timesharing OS
• The TOS allows several users to share
• A TOS allows several users to use a computer from various
locations simultaneously. An OS is a program that makes a computer resources simultaneously. Each user
connection between the user and the system h/w. The TOS takes less CPU time because each command
is built on multiprogramming concepts, in which multiple
jobs are completed simultaneously by constantly switching or action in a time-shared system is short. The
between them. Its switching is lightning quick, allowing TOS use strategic CPU scheduling and
users to interact with every program because it runs
without sharing the system. multiprogramming to offer every user a small
time-shared system. Every user interacts with
• TOS use an interactive computer to allow direct interaction at least one separate program in memory
between the user and the system. The
term 'interactive' refers to the user's direct instructions to during execution, known as a process.
the system or program via an i/p device. The results will be
shown on the o/p devices by the system. The results are
generated faster, and the response time must be shorter
than one second.

Real-time OS
Advantages • A RTOS is a type of OS designed to serve real-time
• It helps to reduce the CPU idle time. applications that process data as it arrives. It completes a
task within a specific time. The logical result of computation
• It offers the benefits of a fast response. and the time required to produce the result determine the
correctness of the system output. It includes methods for
• It avoids the duplication of software. real-time task scheduling. It is primarily used on embedded
• Each job gets an equal opportunity. systems. It is highly useful for timing applications or
activities that are performed within a particular time limit.
It uses strict time limits to drive task execution in an
external environment.
Disadvantages
• Data communication happens in the time- • RTOSs require accurate results and timely results, which
sharing operating system. means that the results must be produced within a certain
time limit, or the system will fail. It is primarily used in
• It has the problem of reliability. control device applications like automobile-engine fuel
injection systems, industrial control systems, weapon
systems, medical imaging systems, etc.

6
9/1/2023

Advantages Disadvantages:
• A RTOS often takes less time to shift from one task to another. Tasks are • A RTOS constantly experiences signal interruptions. As a result,
typically switched in 3 microseconds or less. This type of expedited task the needed drivers must be loaded on the computer in order to
management ensures that key processes are performed on time. get consistent speed. With the help of drivers, an RTOS will be
• An RTOS is a system that is available 24/7 because it produces maximum able to respond quickly whenever an interruption occurs.
results. As a result, it is suited for applications that must run at all times.
Apart from that, an RTOS system can support different MCU systems. • An RTOS focuses on only one application at a time. It is used to
• RTOSs, particularly those based on hard RTOS, are completely error-
maintain accuracy and reduce errors. All other low-priority
free. It ensures a more effective way of handling the errors. applications need to be on waiting.
Furthermore, operating systems experience with jitter, an issue in which • Although a RTOS can focus on specific applications, it is not the
the number of errors between loops is measured. A correctly same as multitasking. They are only designed to run some of the
programmed RTOS can be optimized so that it suffers fewer jitters. tasks.
• An RTOS ensures that the system consumes more resources while • Program crashes may often be experienced while using a RTOS.
keeping all devices active. As a result, a system using RTOS experiences
very little downtime. And also hosting companies to exhibit maximum Unlike a regular OS, an RTOS may not efficiently separate
results while using RTOS. memory domains. As a result, processes would have a problem
• A RTOS focuses on one application at a time. This application will often addressing them.
be the one that is already executing. All others in a queue will be held in • Complex algorithms are behind an RTOS interface. These
a holding pattern. As a result, critical tasks may be performed on time algorithms will be difficult to write for a typical user. Only a
and within the specified deadline to achieve the exact results needed. professional developer will be able to write and understand
them.

System Software • Compiler : a program that translates source code


• Assembler: it is a program that converts the assembly from a HLL to a LL computer understandable
language into machine code. language (e.g. assembly language, object code, or
• The output of an assembler is called an object file, which machine code) to create an executable program
contains a combination of machine instructions as well as • It is more intelligent than interpreter because it goes
the data required to place these instructions in memory. through the entire code at once
• Assembly Language is a low-level programming language in • It can tell the possible errors and limits and ranges.
which there is a very strong correspondence between the
instructions in the language and the hardware's machine • But this makes it’s operating time a little slower
code instructions. • It is platform-dependent
• Machine Code are machine language instructions, which • It help to detect error and get displayed after reading
are used to control a CPU. Each instruction causes the CPU the entire code by compiler.
to perform a very specific task, such as a load, a store, a
jump, or an ALU operation on one or more units of data in • “Compilers turns the HLL to binary language or
the CPU's registers or memory. machine code at once”.

7
9/1/2023

• Interpreter: a program like compiler that converts • Linker


assembly language into machine Code
• For a code to run we need to include a header
• But an interpreter goes through one line of code at a
time and executes it and then goes on to the next line file or a file saved from the library which are pre-
of the code and then the next and keeps going on defined if they are not included in the beginning
until there is an error in the line or the code has of the program then after execution the compiler
completed. will generate errors, and the code will not work.
• It is 5 to 25 times faster than a compiler but it stops • Linker is a program that holds one or more
at the line where error occurs and then again if the
next line has an error too. object files which is created by compiler,
• Where as a compiler gives all the errors in the code at combines them into one executable file. Linking
once. is implemented at both time, load time and
• Also, a compiler saves the machine codes for future compile time. Compile time is when HLL is turns
use permanently but an interpreter doesn’t, but an to machine code and load time is when the code
interpreter occupies less memory. is loaded into the memory by loader.

Linker is of two types: • Loader : a program that loads the machine codes
• 1. Dynamic Linker:- of a program into the system memory.
• It is implemented during run time.
• It requires less memory.
• It is responsible for loading the program. It is the
• There are many chances of error and failure. bare beginning of the execution of a program.
• Linking stored the program in virtual memory to save • Loading a program involves reading the contents
RAM, so we have need to share library.
of an executable file into memory. Only after the
• 2. Static Linker:- program is loaded on OS starts the program by
• It is implemented during compilation of source program. passing control to the loaded program code. All
• It requires more memory. the OS that supports loading have loader and
• Linking is implemented before execution in static linking. many have loaders permanently in their memory.
• It is faster and portable.
• In static linking there are less chances to error and no
chances to failure.

You might also like