0% found this document useful (0 votes)
48 views65 pages

Os Unit-I

The document provides an overview of operating systems including: 1. It describes the functions of an operating system such as acting as an interface between the user and computer hardware and providing an environment for executing programs. 2. It discusses the different layers of an operating system including the hardware, operating system, application programs, and users. 3. It provides examples of popular open-source operating systems like Linux, Unix, and Solaris.

Uploaded by

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

Os Unit-I

The document provides an overview of operating systems including: 1. It describes the functions of an operating system such as acting as an interface between the user and computer hardware and providing an environment for executing programs. 2. It discusses the different layers of an operating system including the hardware, operating system, application programs, and users. 3. It provides examples of popular open-source operating systems like Linux, Unix, and Solaris.

Uploaded by

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

OPERATING SYSTEMS

Subject Code:20A05402T

• UNIT - I Operating Systems Overview, System


Structures
• Operating Systems Overview: Introduction, Operating
system functions, Operating systems operations, Computing
environments, Open-Source Operating Systems
• System Structures: Operating System Services, User and
Operating-System Interface, systems calls, Types of System
Calls, system programs, Operating system Design and
Implementation, Operating system structure, Operating system
debugging, System Boot.
• 1.What is Operating System.
• 2.Layers of Operating(Computer) System.
• 3.Operating systems-Available in Market
• 4.User's View of the computer
• 5.System's view of the computer
• 6.Kernal, System Program, Application program
and Middleware
• https://www.cs.odu.edu/~price/cs471/
public_html/spring17/lectures/introduction.htm
1.What is Operating System.
• Operating system acts as an interface between
the user and computer hardware.
• OS provides an environment for executing
user application programs and makes it easier
for the user.
• The purpose of the operating system is to
control computer hardware and set up
programs for the user.
2.Layers of Operating(Computer) System.
Layer
• The four layers of computer system are
• 1.Hardware: provides basic computing resources of the
system(CPU,memory,I/O devices)
• 2.Operating System: -controls and coordinates the use of
hardware among the various application programs for the
various users.
• 3.Application program:define the ways in which the
system resources are used to solve the computing problems
of the users(compilers, database system, video games,
business programs).
• 4.Users:--(people, machines, other computers).
Operating Systems- Available in Market:

• OS is classified by Technology, ownership,


licensing, working state, usage and many
other categories.
Operating System

• User View
• System View
User's view of the computer
• Many users having laptop or a PC consisting of a monitor,
keyboard and mouse.
• Such a systems are designed for
single user
• The goal is to maximize the work that the user is
performing
• In this case, the OS is designed mostly for ease of use(user
friendly), with some attention paid to performance and
security and note paid to resource utilization-How various
hardware and software resources are shared.
Mobile Devices

• many users interact with mobile devices such as smartphones and


tablets.
• These devices are typically connected
to networks through cellular or other wireless
technologies.
• The mobile computers generally features a
touch screen, where the user interacts with the
system by pressing and swiping fingers across the
screen rather than the using a physical keyboard
and mouse.
• Many mobile devices allow users to interact through a voice
recognition interface.
From the Computer's Point of View

• From computer's point of view the OS will act as


• Resource allocator
Resource controller
Resource manager
• A computer system has many resources that may be required
to solve a problem: CPU, memory, storage, I/O devices, and so
on.
• The OS must decide how to allocate resources to specific
programs and users, os that is can operate the computer
system efficiently and fairly.
• The OS is the program(Software), acts as Resource allocator.
• OS also need to control the various I/O devices
and user programs, to avoid conflicts in
resource request.
• Hence OS acts as a Resource controller.
• A control program manages the operation and
control of I/O devices and execution of user
programs to prevent errors and improper use
of the computer.
• The OS acts as a Resource manager.
Kernel, System Program, Application Program
and Middleware
• Kernel is central and core component of an
operating system that manages operations of
computer and hardware(CPU,Memory).
• Kernel acts as a bridge between applications
and hardware

System software
• System software is designed to run a
computer hardware and application programs.
• These programs are associated with the
operating system but are not part of the
kernel.
Middleware software
• Middleware is a type of computer software
that sits between the application layer and
operating system layer.
• Middleware provides services to software
applications beyond those available from the
operating system.
Operating systems operations
• Computer System Organization,
• Common Functions of Interrupts
• Interrupt Handling,
• Interrupt Timeline
• I/O Structure
• DMA Structure
Computer system organization
One or more CPU's
device controllers
connect through
common bus
providing access to
shared memory.
Concurrent execution
of CPUs and devices
competing for
memory cycles.
Common Functions of Interrupts
• I/O devices and the CPU can execute concurrently.
• Each device controller is in charge of a particular device type.
• Each device controller has a local buffer
• Each device controller type has an operating system device driver to
manage it
• CPU moves data from/to main memory to/from local buffers
• I/O is from the device to local buffer of controller
• Device controller infrom CPU that it has finished its operation by causing
an interrupt.
Common Function for Interrupts

• Interrupt transfers control to the interrupt service


routine generally, through the interrupt vector.
• Interrupt vector contains the addresses of all the
service routines
• Interrupt architecture must save the address of the
interrupted instruction
• A trap or execption is a software-generated
interrupt caused either by an error or a user request
• An operating system is interrupt driven system.
Interrupts Handling
• The operating system preserves the state of the
CPU by storing registers and the program counter
• OS Determines which type of interrupt has
occurred:
• Polling, Priority handling
• Vectored interrupt system
• Separate segments of code, determine what
action should be taken for each type of interrupt.
Interrupt Timeline
I/O Structure

• After I/O starts, control returns to user program only upon I/O completion
• Wait instruction, idles the CPU, until the next interrupt
• At most one I/O request is outstanding at a time, no simultaneous I/O processing
• After I/O starts, control returns to user program without waiting for I/O completion.
• System call-request to the OS to allow user to wait for I/O completion.
• Device-status table contains entry for each I/O device indicating its type, address and state.
• OS indexes into I/O device table, to determine device status and to modify table entry to
include interrupt.
Direct Memory Access Structure
· Used for high-speed I/O devices to transmit
information at close to memory speeds
· Device controller transfers blocks from
buffers directly to main memory without CPU
intervention
· Only one interrupt is generated per block,
rather than one interrupt per byte
DMA Structure continue
Free and Open Source Operating System

• Open Source and Closed Source OS


• Benefits of Open source Operating System.
• Linux
• Unix
• Solaris
Open Source Operating Systems
• Open Source Operating Systems are those available in
source-code format rather than as compile binary code.
– Linux is the most famous open source operating system,
– while Microsoft windows is a well-know example of the
opposite closed-source approach.
– Apple's Mac OS X and iOS operating system comprise a
hybrid approach.
• With the source code of OS, a student can modify the OS
and then compile and run the code to try out those
changes.
• which is an excellent learning tool.
Benefits of Open source Operating System.

• A community of interested programmers who contribute to the


code, by helping to debug it, analyze it, provide support, and
suggest changes.
• Open source code is more secure than closed-source because
many more eyes are viewing the code
• open-source code has bugs, but that can be found and fixed
faster
• Companies that earn revenue from selling their programs often
hesitate to open source their code,
• Red Hat and a myriad
• Revenue can be generated through support, contracts and the
sale of hardware on which the software runs.
Linux
• An open source operating system, consider
GNU/Linux.
• produced many UNIX-compatible tools, including
compilers, editors, and utilities, but never released
a kernel.
• Anyone interested could download the source
code, modify it, and submit the changes.
• Releasing updates once a week, hence Linux
operating system to grow rapidly, and enhanced by
several thousand programmers.
Run Linux on a Windows System
• You can run Linux on a windows system using the following
simple, free approach:
• 1. Download the free "VMwarePlayer" tool from
• http://www.vmware.com/downlaod/player/
• and install it on your system.
• 2. Choose a Linux version from among the hundreds of
"appliances", or virtual machine images, available from VMware
at
• http://www.vmware.com/appliances/
• These images are preinstalled with operating systems and
applications and include many flavors of Linux.
• 3.Boot the virtual machine within VM ware Player
BDS UNIX
• Unix is a stable, multitasking, multi user computer OS for
Servers, desktops and laptops, developed in AT&T laboratory in
the year 1971.
• Unix systems also have a graphical user interface similar to
Microsoft Windows which provides an easy to use environment.
• The most popular variants of UNIX are Sun Solaris, GNU/Linux
and MaxOS X.
• The UNIX operating system is made up of three parts:
• the kernel,
• the shell and
• the programs
Solaris
• Solaris is a Unix based operating system that
was developed by Sun Microsystems and then
purchased by Oracle, it is known as Oracle
Solaris.
• It is known for its scalability and its innovative
features such as DTrace, ZFS, Time Slider etc.
• Solaris is a microkernel design.
• The source code is available at
• http://src.opensolaris.org/source.
• User and Operating-System Interface
• 1. Command-line interface(CUI)
• 2. Graphical user interface(GUI)
• 3. Touchscreen Interface
User and Operating-System Interface

• There are several ways for users to interface with the


operating system.
• The most fundamental approaches are
• Command-line interface(CLI) or command interpreter
Communicates the user with console based
operating system
• Graphical user interface(GUI)
Communicates the user with graphical based
operating system
• Very simple and easy to access system components
System Software – Operating Systems

Computer Organization By: H. Ateeq Ahmed


Application Softwares

Computer Organization By: H. Ateeq Ahmed


Performance of a Computer

Computer Organization By: H. Ateeq Ahmed


Performance of a Computer

Computer Organization By: H. Ateeq Ahmed


Multiprocessors vs Multicomputers

Computer Organization By: H. Ateeq Ahmed


• 1. Large computers that contain a number of
processor units are called multiprocessor
system
• 2.Each processor element doesnot have own
individual memory.
• 3.Memory and input and output resources are
called shared memory multiprocessor.
• 4. communication between processing and
element is must
• Def: performing multiple task.
• 1. Multicomputer system is a cluster of
computers
• 2.Each processor element has its own
individual memory.
• 3.Memory and input and output resources are
called distributed memory multicomputer.
• 4. communication between processing and
element is not mandatory.
• Def: perform computational task.
Machine Instructions and Programs

Number, Arithmetic Operations, and programs.


3 major representations:
I. Sign and magnitude
II. One’s complement
III. Two’s complement
 Assumptions:
4-bit machine word
16 different values can be represented Roughly half are positive,
half are negative

Computer Organization By: H. Ateeq Ahmed


Binary Sign and magnitude
Number Representation
+0 0000 0000

+1 0001 0001

+2 0010 0010

+3 0011 0011

+4 0100 0100

+5 0101 0101

+6 0110 0110

+7 0111 0111
Binary Sign and magnitude
Number Representation
-0 0000 1000

-1 0001 1001

-2 0010 1010

-3 0011 1011

-4 0100 1100

-5 0101 1101

-6 0110 1110

-7 0111 1111
One’s Complement
Representation
-0 +0
-1 111 1 000 0 +1
-2 111 0 000 1
+2 +
110 001
1 0
-3 110 0 1 00 = +
001 1 +3
0 4
-4 101 010 +4 1 0 11 = -
1 0 4
101 0
-5 010 1 -
100 +5
1 100 0 011 0
-6 011 1 +6
+7
-7
 The ones' complement of a binary number is the
value obtained by inverting (flipping) all the bits in the
binary representation of the number.
1’s and 2’s Complement of Numbers
 The 1's complement of a binary number is obtained by inverting all its bits.
 The 2's complement of a binary number is obtained by adding 1 to the 1's
complement of the number.

Computer Organization By: H. Ateeq Ahmed


Binary
Number Representation 1’s complement

0 0000 1111

1 0001 1110

2 0010 1101

3 0011 1100

4 0100 1011

5 0101 1010

6 0110 1001

7 0111 1000
Two’s Complement
Representation
-1 +0
-2 111 1 000 0 +1
-3 111 0 000 1
+2 +
like 1's comp 110 001
1 0
except shifted -4 110 0 1 00 = +
one position 001 1 +3
0 4
clockwise -5 101 010 +4 1 1 00 = -
1 0 4
101 0
-6 010 1 -
100 +5
1 100 0 011 0
-7 011 1 +6
+7
-8
Arithmetic operations.
simpler calculation for bits.

0 0 1 1
0 1 0 1
---- ---- ---- ----
0 1 1 10
Addition and Substraction – 2’s
Complement
4 0100 -4 1100
+3 0011 + (-3) 1101
If carry-in to the high
order bit = 7 0111 -7 11001
carry-out then ignore
carry

if carry-in differs from 4 0100 -4 1100


carry-out then overflow
-3 1101 +3 0011
1 10001 -1 1111

Simpler addition scheme makes twos complement the most common


choice for integer number systems within digital systems
2’s-Complement Add and
Subtract Operations
0010 ( + 2) 0100 ( + 4)
(a) ( + 3) (b) - 6
+ 0011 + 1010
Page 31 0101 ( + 5) 1110 - 2
(c) 1011 - 5 (d) 0111 ( + 7)
+ 1110 - 2 + 1101  - 3
1001 - 7 0100 ( + 4)
(e) 1101 - 3 1101
+ 0111
- 1001 - 7

(f) 0010 ( + 2) 0100 ( + 4)


- 0100 ( + 4) 0010
+ 1100
(g) 0110 ( + 6)
- 0011 ( + 3) 1110  - 2
0110
(h) 1001  - 7 + 1101
- 1011 - 5
01
1 0 1 01 (- +23)
(i) 1001 - 7 1001
1001
+ 0101
- 0001 ( + 1) + 1111

1000
 - 8
(j) - 10100110 + 00001110
( -+32)

0101 ( + 5)
Figure 2.4. 2's-complement Add and Subtract operations.
Instructions and Instruction
Sequencing
A computer must have instructions capable of
performing four types of operations.
• Data transfers between the memory and the
processor registers
• Arithmetic and logic operations on data
• Program sequencing and control
• I/O transfers
Data Transfer Notations
(i) Register Transfer Notation: We need to transfer the info. From one location in the
computer to another possible location.
That may be involved in such transfer are memory locations, processor registers.
Example:
Thus, the expression
R1 [LOC]
Means that the contents of memory location LOC are transferred into processor
register R1.
(ii) Assembly Language Notation: To represent machine instruction and programs.
Example:
Add R1, R2, R3
MOVE LOC, R1
(iii) Basic Instructions: High level lang representation.
c=a+b

Computer Organization By: H. Ateeq Ahmed


• a) Three address Instruction
• An instruction having 3 operands.
• Syntax:
• opcode source1,source2,destination
• ADD A,B,C { C A+B }
• b) Two address Instruction
• An instruction having 2 operands.
• Syntax:
• opcode source1,destination
MOVE B,C
ADD A,C { C A+B }
• c) one address Instruction
• An instruction having 1 operand.
• Syntax:
• opcode source1
• LOAD A
STORE A

d) ZERO address Instruction


Use stack and ques
Addressing Modes
• In Generally program operate in a data
in computer memory of student data to
use data structure, list, linked list,
pointers etc..
• As a Programer are written in high level
lang. that enable to use global variables,
local variables, constants and arrays.
• It is useful to determine operand of the
effective address.
• IMPLEMENTATION OF VARIABLE AND CONSTANTS:-
• Variables and constants are the simplest data types and are found in almost
every computer program.
• A variable is represented by allocating a register or a memory location to
hold its value of the variable. Thus, the value can be changed as needed
using appropriate instructions.
• A constants is represented by using sharp sign preceding (#) preceding's to
the value of constants .
• Operation, Operand
• Register mode:
• MOVE R1,R2
ADD R1,R2
• Absolute/Direct mode:
MOVE LOC,R1
ADD num,R2

• Immdeiate direct mode:


MOVE #400, R1
Addressing Modes

Computer Organization By: H. Ateeq Ahmed


Addressing Modes

Computer Organization By: H. Ateeq Ahmed


Stack
“A Stack is also known as LIFO.”
Example of Stack
Queue
“A Queue is also known as FIFO.”
Subroutines
 In computer programming, a subroutine is a sequence of program instructions
that performs a specific task, packaged as a unit.
 In different programming languages, a subroutine may be called a routine,
subprogram, function, method, or procedure.

Computer Organization By: H. Ateeq Ahmed


Basic Input Output Operations

Computer Organization By: H. Ateeq Ahmed


Yo u
a n k
T h

You might also like