Os Unit-I
Os Unit-I
Subject Code:20A05402T
• 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
• 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
+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.
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
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