Saturday, 29 September 2012
Interrupt Handling
* The operating system
preserves the state of the CPU by storing registers and the program counter.
* Determines which type of
interrupt has occurred:
* polling
* vectored interrupt system
* Separate segments of
code determine what action should be taken for each type of interrupt
Common Functions of Interrupts
* Interrupt transfers
control to the interrupt service routine generally, through the interrupt
vector, which
contains the addresses of all the service routines.
* Interrupt architecture
must save the address of the interrupted instruction.
* Incoming interrupts are disabled while another interrupt
is being processed to prevent a lost interrupt.
* A trap is a software-generated
interrupt caused either by an error or a user request.
* An operating system is interrupt driven.
Monday, 24 September 2012
Real-Time Systems
Real-Time Systems
Often used as a control
device in a dedicated application such as controlling scientific experiments,
medical imaging systems, industrial control systems, and some display systems.
Well-defined fixed-time
constraints.
Real-Time systems may be
either hard or soft real-time.
Hard real-time:
Secondary storage limited or absent, data
stored in short term memory, or read-only memory (ROM)
Conflicts with time-sharing systems, not
supported by general-purpose operating systems.
Soft real-time
Limited utility in industrial control of
robotics
Useful in applications (multimedia,
virtual reality) requiring advanced operating-system features.
Clustered Systems
Clustering allows two or
more systems to share storage.
Provides high
reliability.
Asymmetric
clustering:
one server runs the application while other servers standby.
Symmetric
clustering:
all N hosts are running the application.
Distributed Systems
Distributed Systems
Distribute the
computation among several physical processors.
Loosely
coupled system –
each processor has its own local memory; processors communicate with one
another through various communications lines, such as high-speed buses or
telephone lines.
Advantages of
distributed systems.
Resources Sharing
Computation speed up – load sharing
Reliability
Communications
Requires networking
infrastructure.
Local area networks
(LAN) or Wide area networks (WAN)
May be either
client-server or peer-to-peer systems.
Parallel Systems
Parallel Systems
Multiprocessor systems
with more than on CPU in close communication.
Tightly
coupled system –
processors share memory and a clock; communication usually takes place through
the shared memory.
Advantages of parallel
system:
Increased throughput
Economical
Increased reliability
graceful
degradation
fail-soft
systems
Symmetric
multiprocessing (SMP)
Each processor runs and identical copy of
the operating system.
Many processes can run at once without
performance deterioration.
Most modern operating systems support SMP
Asymmetric
multiprocessing
Each processor is assigned a specific
task; master processor schedules and allocated work to slave processors.
More common in extremely large systems
Time-Sharing Systems–Interactive Computing
Time-Sharing Systems–Interactive Computing
The CPU is multiplexed
among several jobs that are kept in memory and on disk (the CPU is allocated to
a job only if the job is in memory).
A job swapped in and out
of memory to the disk.
On-line communication
between the user and the system is provided; when the operating system finishes
the execution of one command, it seeks the next “control statement” from the
user’s keyboard.
On-line system must be
available for users to access data and code.
Mainframe Systems
Reduce setup time by
batching similar jobs
Automatic job sequencing
– automatically transfers control from one job to another. First rudimentary operating system.
Resident monitor
initial control in monitor
control transfers to job
when job completes control transfers pack
to monitor
computer system components
Computer System Components
1. Hardware – provides basic computing resources (CPU, memory, I/O
devices).
2. Operating system – controls and coordinates
the use of the hardware among the various application programs for the various
users.
3. Applications programs – define the ways in
which the system resources are used to solve the computing problems of the
users (compilers, database systems, video games, business programs).
4. Users (people, machines, other computers).
http://sateeshbagadhi.blogspot.com
What is an Operating System?
A program that acts as
an intermediary between a user of a computer and the computer hardware.
Operating system goals:
Execute user programs and make solving
user problems easier.
Make the computer system convenient to
use.
Use the computer
hardware in an efficient manner.Sunday, 23 September 2012
http://sateeshbagadhi.blogspot.in
Program using OLE
Container control:
1. Select OLE control in Toolbox.
2. Place the control on the form with the required size.
3. As soon as OLE control is placed on the form, Insert
Object Dialog is displayed to allow you to either embed or link an object
into OLE Container.
4. The available options in insert dialog are - Create
New, where you select an Object Type and create an object using the
appropriate application, or Create from File, where you can create an
object by selecting a file from file system.
To embed a word document
into OLE Container control:
1. In Insert Object Dialog box select Create
from File radio button.
2. Click on Browse button and select a document
file. Click on Ok
3. An object is embedded into OLE Container control and a
part of document is displayed.
4. Run the project using F5.
5. Double click on OLE Container control. This action
will invoke MS-Word and run it in OLE Container control. When OLE Server runs
in OLE Client, it is called as In-Place Activation.
6. Make necessary changes using MS-Word.
7. Press ESC key to come out of In-Place activation.
Application for OLE drag
and drop manually:
1. Start a new project using File-> New Project
and select Standard EXE as the type of the project.
2. Place two textboxes along with labels and a command
button.
3. Arrange the controls on the form in a neat format.
4. Change the following properties.
Object
|
Property
|
Value |
Label1
|
Caption
|
Source
|
Text1
|
Name
|
txtsource
|
|
Text
|
""
|
|
OLEDragMode
|
0-Manual
|
|
OLEDropMode
|
2-Automatic.
|
Text2
|
Name
|
txtTarget
|
|
Text
|
""
|
|
OLEDragMode
|
1-Automatic
|
|
OLEDropMode
|
1-Manual
|
Form
|
Caption
|
OLE
Drag and Drop
|
Command1
|
Name
|
Cmdend
|
|
Caption
|
&END
|
DESIGN VIEW:
CODING:
Private Sub cmdend_Click()
End
End Sub
Private Sub
txtsource_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As
Single)
' start OLE dragging
txtsource.OLEDrag
End Sub
Private Sub
txtsource_OLECompleteDrag(Effect As Long)
If (Effect And vbDropEffectMove) <> 0
Then ' bitwise Anding
txtsource.Text = ""
End If
End Sub
Private Sub
txtsource_OLEStartDrag(Data As DataObject, AllowedEffects As Long)
' set allowed effects
AllowedEffects = vbDropEffectMove Or
vbDropEffectCopy
Data.SetData UCase(txtsource.Text)
End Sub
Private Sub
txttarget_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer,
Shift As Integer, X As Single, Y As Single)
Txttarget.Text = Data.GetData(vbCFText)
Effect = vbDropEffectMove
End Sub
1. Design the form.
2. Create a command Button
named as a Command1 and copy that and paste it 10 times. This will create a
control array.
3. Create a cmdoperator
control array using another Command Button named as Command2.
4. Place Command Button named
as Command3 and set its caption to ‘clear’.
5. Place Command Button named
as Command4 and set its caption to ‘=’.
6. place a Textbox for the
Display.
DESIGN VIEW:
CODING:
Private lastoperator As
String
Private firstpart As String
Private Sub Form_Load()
TxtResult.Enabled = False
Me.KeyPreview = True
End Sub
Private Sub
Form_KeyDown(KeyCode As Integer, Shift As Integer)
'number in main keyboard
If (KeyCode >= 48 And
KeyCode <= 57) Then
addDigits (Chr(KeyCode))
End If
'numbers in numpad
If (KeyCode >= 96 And
KeyCode <= 105) Then
addDigits (Chr(KeyCode - 48))
End If
'if backspace
If (KeyCode = 8) Then
If (TxtResult.Text <>
"") Then
TxtResult.Text =
Left(TxtResult.Text, Len(TxtResult.Text) - 1)
End If
End If
'for various operators
If (KeyCode = 111) Then
registerOperator ("/")
If (KeyCode = 106) Then
registerOperator ("*")
If (KeyCode = 109) Then
registerOperator ("-")
If (KeyCode = 107) Then registerOperator
("+")
End Sub
Private Sub
cmdoperator_Click(Index As Integer)
registerOperator
(cmdoperator(Index).Caption)
End Sub
Private Sub cmdclear_Click()
firstpart = ""
lastoperator = ""
TxtResult.Text = ""
End Sub
Private Sub Cmdequals_Click()
Select Case lastoperator
Case Is = "+"
TxtResult.Text = firstpart -
TxtResult.Text + TxtResult.Text + TxtResult.Text
Case Is = "-"
TxtResult.Text = firstpart -
TxtResult.Text
Case Is = "/"
TxtResult.Text = firstpart /
TxtResult.Text
Case Is = "*"
TxtResult.Text = firstpart *
TxtResult.Text
End Select
firstpart = ""
lastoperator = ""
End Sub
Private Sub
Command1_Click(Index As Integer)
addDigits
(Command1(Index).Caption)
End Sub
Private Sub addDigits(Digit
As String)
TxtResult.Text =
TxtResult.Text & Digit
End Sub
Private Sub
registerOperator(Operatortext As String)
lastoperator = Operatortext
firstpart = TxtResult.Text
TxtResult.Text = ""
End Sub
Program to Handle
Horizontal Scrollbar & Vertical Scrollbar:
Control
|
Property
|
Value
|
Vscroll 1
|
Min
|
1
|
Vscroll 1
|
max
|
100
|
Vscroll 1
|
Large change
|
10
|
Vscroll 1
|
Small change
|
1
|
Vscroll 1
|
value
|
50
|
Hscroll 1
|
Min
|
1
|
Hscroll 1
|
Max
|
100
|
Hscroll 1
|
Large change
|
10
|
Hscroll 1
|
Small change
|
1
|
Hscroll 1
|
value
|
50
|
Text 1
|
Font
|
MS Sans Serif, 12
|
Command 1
|
Caption
|
End
|
CODING:
Private Sub Command1_Click()
End
End Sub
Private Sub Form_Load()
VScroll1.Min = 1
VScroll1.Max = 100
VScroll1.LargeChange = 10
VScroll1.SmallChange = 1
VScroll1.Value = 50
HScroll1.Min = 1
HScroll1.Max = 100
HScroll1.LargeChange = 10
HScroll1.SmallChange = 1
HScroll1.Value = 50
End Sub
Private Sub HScroll1_Change()
Text1.Text =
"horizontalsetting:" & Str(HScroll1.Value)
End Sub
Private Sub VScroll1_Change()
Text1.Text =
"verticalsetting:" & Str(VScroll1.Value)
End Sub
OUTPUT:
Subscribe to:
Posts (Atom)
Oracle Reserved Words
Oracle Reserved Words The following words are reserved by Oracle. That is, they have a special meaning to Oracle and so cannot be redefi...
-
Create an employee database in ms-access as follows Write javascript code as follows ------------------------------------------ 1) Ad...
-
Program using OLE Container control: 1. Select OLE control in Toolbox. 2. Place the control on the form with the...
-
CPU Scheduler Ø Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them. Ø C...