Module 1 - 3 Opersyst
Module 1 - 3 Opersyst
Software is a program or set of instructions that tells the computer what to do.
1. Application Software – are programs that are used to accomplish specific or specialized task for computer users
such as creating and editing documents, making graphic presentations.
2. System Software – are programs that control the basic operations of a computer system such as saving files in
·
Examples: operating systems, communications control programs, interpreters, compilers, debuggers, text
editors, linkers, loaders
1. Document Production Software – these are the programs that help computer users in composing, editing,
printing, and electronically publishing documents.
2. Spreadsheet software – these programs allow users to enter and manipulate data into an electronic worksheet
of rows and columns.
3. Presentation software – through this kind of software, users are able to create slide shows for visual
presentation purposes.
4. Database management software – these enable the users to store, manipulate, and retrieve vast amounts of
data in an organized and structured manner.
5. Business Software – are programs that can provide users with tools for business management.
6. Multimedia Software – multimedia programs that can process pictures, sound, and video
7. Entertainment Software – these include music players, video players, and games.
1. They hide the ugly details of computer operations from the user.
2. Computer programmers can write programs without knowing the details on how the computer hardware works.
➢ Assemblers – a language translator that takes a source program written in assembly language and converts it to
an executable file that contains machine language instructions.
➢ Compilers – is a language translator that takes a source program written in a high level programming language
and converts it to an executable file that contains machine language instructions.
➢ Interpreters – converts a program written in a high level programming language to machine code so that it can
be executed by a computer.
➢ Linkers - system program that links or combines object modules together with the libraries needed by these
· I
➢ Loaders - System program that takes the load module from secondary storage and brings it into main memory
·
for execution; performs address binding
Address Binding
The process of assigning or mapping symbolic references to actual main memory addresses. These actual memory
addresses are often called physical addresses or absolute addresses.
Three techniques the loader may use in placing the load module in main memory:
1. Absolute Loading - the load module already contains actual memory addresses instead of symbolic variables.
2. Relocatable Loading - the load module is generated before load module is loaded and load module can be loaded
anywhere in the main memory based on the available main memory location.
3. Dynamic Run Time Loading - Absolute address is not generated when loaded, but when it is needed by the CPU;
the loader places the load module into the main memory without converting the relative addresses to absolute
addresses.
Operating System
It is a system software that allows users and the application programs they are using to interact with the computer
-
• It creates a virtual machine interface between the user, application program and hardware.
-
➢ Kernel – is the heart and soul of operating system. It is responsible in controlling the computer hardware and
.
performing many of the services being offered by the operating system.
➢ Shell – is the part of the operating system that serves as the interface between users and kernel. It is often called
the command interpreter.
➢ Command Line Interface (CLI) – requires user to type the commands at a prompt. This type of shell is seen in the
old DOS and many Linux Systems.
➢ Graphical User Interface (GUI) – user enter commands by either using drop-down menus or by clicking on icons
using a mouse pointer.
• Program Execution
• System Access
• Error Handling
• Communication
Core Components of OS
➢ Process Manager – this component is also called the Process Scheduler or CPU Scheduler, which is responsible for
determining which among the program will execute first and determining runtime duration.
➢ Memory Manager – responsible for making sure that programs are given sufficient memory space to execute
effectively.
➢ File Manager – organizes the files stored in secondary storage and presents an interface to the users.
➢ I/O Manager – also called as Device Manager, it manage the different I/O devices of the entire computer system.
During the late 1940’s and early 1950’s, computer were massive, expensive, slow, and very primitive. These mainframes
have the following characteristics:
3. There were no keyboards during this time, user commands enter by using toggle switches.
·
4. After this, high-level programming languages were developed and stored in punched cards.
• One solution to the inefficient use of expensive computer during the serial processing period is to group similar
-
• Multiprogramming, which means concurrent execution of two or more programs by single CPU was
implemented
Time Sharing Systems (Fourth Generation)
• Time sharing is simply an extension of multiprogramming. The operating system assigns the CPU to a user or to a
process for a certain period of time, usually in the range of a few milliseconds. This time period is often called
the time slice or time quantum.
• This is a multiprocessor system that has several, usually identical, processor that share a common main memory.
Because of this, SMP’s are also called Shared Memory Multiprocessors.
• In SMP, there is only one operating system and each processor runs a copy of that operating system. The main
characteristics of an SMP is that each processor may be assigned to perform any available task.
·
2. Asymmetric Multiprocessor (AMP)
• Also called Distributed Memory Multiprocessors, these systems also have multiple processors but each processor
has its own local memory.
• The main difference between an AMP and an SMP is that in the former, each processor is assigned certain tasks
only.
• Network operating systems allow the sharing of resources among computers connected in a network. This
type of operating system is responsible for managing the sharing resources and the actual communication
among the computers.
• Distributed Systems are very similar to network systems in the sense that they are also the interconnection
of independent computers that can share resources.
• In addition to managing resource sharing and communication among the computers, the goals of a distributed
operating system are:
o Transparency
o Parallelism
o Reliability
➢ Real Time Systems – are computers that operate on a very strict time constraint. They are literally required to
produce results immediately upon receipt of input data.
➢ Handheld Systems – are computers that are characterized by being battery powered, having slower processors
compared to PC’s and having smaller memory.
Process Management 3. CPU registers: Like the Program Counter
(CPU registers must be saved and
A process is a program in execution. For example, restored when a process is swapped in
when we write a program in C or C++ and and out of CPU)
compile it, the compiler creates binary code. The 4. Accounts information
original code and binary code are both programs. 5. I/O status information: For example,
When we actually run the binary code, it devices allocated to the process, open
becomes a process. files, etc.
A process is an ‘active’ entity, as opposed to a 6. CPU scheduling information: For
program, which is considered to be a ‘passive’ example, Priority (Different processes
entity. A single program can create many may have different priorities, for
example a short process may be assigned
processes when run multiple times; for example,
when we open a .exe or binary file multiple a low priority in the shortest job first
times, multiple instances begin (multiple scheduling)
processes are created). All the above attributes of a process are also
known as the context of the process.
What does a process look like in memory?
Every process has its own program control
block(PCB), i.e. each process will have a unique
PCB. All of the above attributes are part of the
PCB.
States of Process
1. New: Newly Created Process (or) being-
created process.
Pi is served first;
Firstly the process sets its “choosing” variable to
else Pj is served first. be TRUE indicating its intent to enter critical
section. Then it gets assigned the highest ticket
• The numbering scheme always generates number corresponding to other processes. Then
numbers in increasing order of enumeration; the “choosing” variable is set to FALSE indicating
i.e., 1, 2, 3, 3, 3, 3, 4, 5, … that it now has a new ticket number. This is in-
fact the most important and confusing part of
the algorithm.
Notation – lexicographical order (ticket #,
process id #) – Firstly the ticket number is It is actually a small critical section in itself ! The
compared. If same then the process ID is very purpose of the first three lines is that if a
compared next, i.e.- process is modifying its TICKET value then at that
time some other process should not be allowed
– (a, b) < (c, d) if a < c or if a = c and b < d to check its old ticket value which is now
– max(a [0], . . ., a [n-1]) is a number, k, such that obsolete. This is why inside the for loop before
k >= a[i] for i = 0, . . ., n - 1 checking ticket value we first make sure that all
Shared data – choosing is an array [0..n – 1] of other processes have the “choosing” variable as
boolean values; & number is an array [0..n – 1] of FALSE.
integer values. Both are initialized to False & Zero After that we proceed to check the ticket values
respectively. of processes where process with least ticket
Algorithm Pseudocode – number/process id gets inside the critical
section. The exit section just resets the ticket
repeat value to zero.
choosing[i] := true;
number[i] := max(number[0], number[1], ...,
number[n - 1])+1;
choosing[i] := false;
I a known synchronization
problem
Customer {
while(true) {
/* protects seats so only 1 customer tries to sit
in a chair if that's the case.*/
down(Seats); //This line should not be here.
if(FreeSeats > 0) {
/* sitting down.*/
FreeSeats--;
Process Control
An important function of the operating system is
to manage all the processes that exist within a
computer system.
Cooperating Processes
CPU Scheduling
Non-preemptive
CPU Scheduling
In non-preemptive scheduling, the CPU cannot
• Job scheduling- act of selecting which
be taken away from its executing process. The
processes in the job queue will be loaded
only time the CPU scheduler can assign the CPU
into main memory
to another process is when the currently
• Job scheduler - operating system module executing process terminates or enters into a
that is responsible for job scheduling. It is the blocked state.
one that determines and controls the degree
of multiprogramming
Pre-emptive Scheduling
• CPU scheduler - component of the operating
system that is responsible for CPU In preemptive scheduling, the CPU can be taken
scheduling away from its executing process. The currently
executing process is sent back to the queue and
the CPU scheduler assigns the CPU to another
process.
/
Priority Scheduling