Beruflich Dokumente
Kultur Dokumente
Course Title
Operating Systems
- An operating system (OS) is the interface between the user and the
hardware. Acts as an intermediary between a user of a computer
and the computer hardware.
- The goals Operating system are:
Execute user programs and make solving user problems easier.
Make the computer system convenient to use.
Use the computer hardware in an efficient manner.
Computer system components
- The computer systems components divided in to :
Hardware: provides basic computing resources (CPU, memory,
I/O devices).
Operating system: controls and coordinates the use of the
hardware among the various application programs for the various
users.
Red Sea University Engineering Faculty
Resources Sharing.
Computation speed up means load sharing.
Reliability.
Communications.
10
(Computer-System Architecture)
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 and the incoming interrupts are disabled while another
interrupt is being processed to prevent a lost interrupt.
Interrupt may be a hardware interrupt or software. Hardware may
trigger an interrupt at any time by sending a signal to the CPU by
way of the system bus. Software trigger an interrupt is executing a
special operation called a system call.
(Interrupt system)
Red Sea University Engineering Faculty
11
12
13
(Device-Status Table)
Storage Structure
Storage refers to the memory used in the computer systems to store
all data for computation and arranged in hierarchy depending on
the speed, capacity, cost and Volatility.
Main memory is only large storage media that the CPU can access
directly. And Secondary storage is extension of main memory that
provides large nonvolatile storage capacity.
Magnetic disks are rigid metal or glass platters covered with
magnetic recording material. In magnetic disk, disk surface is
logically divided into tracks, which are subdivided into sectors.
The disk controller determines the logical interaction between the
device and the computer.
14
(Storage-Device Hierarchy)
15
16
17
18
19
System Components:
Process Management.
Main Memory Management.
File Management.
I/O System Management.
Secondary Management.
Networking.
Protection System.
Command-Interpreter System.
Operating System Services.
System Calls.
System Programs.
System Structure.
Virtual Machines.
System Design and Implementation.
System Generation.
System Components (Process Management)
20
21
22
23
24
25
The types of system calls divided into five operations, they are;
Process control.
File management.
Device management.
Information maintenance.
Communications.
(MS-DOS Execution)
26
(Communication Model)
(UNIX Running
Multiple Programs)
System Programs and structures
27
28
29
Benefits:
Easier to extend a microkernel.
Easier to port the operating system to new architectures.
More reliable (less code is running in kernel mode).
More secure.
30
(System Models)
The advantages and disadvantages of Virtual Machines are:
The virtual-machine concept provides complete protection of
system resources since each virtual machine is isolated from all
other virtual machines. This isolation, however, permits no direct
sharing of resources.
A virtual-machine system is a perfect vehicle for operating systems
research and development. System development is done on the
virtual machine, instead of on a physical machine and so does not
disrupt normal system operation.
31
32
33
Process Concept.
Process Scheduling.
Operations on Processes.
Cooperating Processes.
Inter-process Communication.
Communication in Client-Server Systems.
Process Concept
34
Process state.
Program counter.
CPU registers.
CPU scheduling information.
Memory-management information.
Accounting information.
I/O status information.
35
36
37
38
39
Information sharing.
Computation speed-up.
Modularity.
Convenience.
40
41
42
43
(RMI {JAVA})
(BASIC ISSUES/ Threads);
Overview.
Multithreading Models.
Overview
Thread is a basic unite of CPU utilization run as a section of
control, shares with other threads a thread ID, resources, address
spacing, program counter, register set and stack. A process has a
multiple threads of control it can be perform more than one task at
a time. Thread may be single or multiple threads.
Red Sea University Engineering Faculty
44
45
46
Basic Concepts.
Scheduling Criteria.
Scheduling Algorithms.
Multiple-Processor Scheduling.
Real-Time Scheduling.
CPU Scheduling
47
48
Burst Time
24
3
3
49
Arrival Time
0.0
2.0
4.0
5.0
Burst Time
7
4
1
4
50
51
Burst Time
53
17
68
24
52
53
System Model.
Deadlock Characterization.
Methods for Handling Deadlocks.
Deadlock Prevention.
Deadlock Avoidance.
Deadlock Detection.
Recovery from Deadlock.
Introduction
54
55
56
57
58
Background.
Swapping.
Contiguous Allocation.
Paging.
Segmentation.
Segmentation with Paging.
Background
59
60
61
62
63
(Process allocation)
- A Dynamic Storage Allocation Problem is how to satisfy a request
of size n from a list of free holes.
First-fit: Allocate the first hole that is big enough.
Best-fit: Allocate the smallest hole that is big enough; must search
entire list, unless ordered by size. Produces the smallest leftover
hole.
Worst-fit: Allocate the largest hole; must also search entire list.
Produces the largest leftover hole.
First-fit and best-fit better than worst-fit in terms of speed and
storage utilization.
Red Sea University Engineering Faculty
64
65
(Paging Example)
Red Sea University Engineering Faculty
66
Before allocation
After allocation
(Free Frames)
67
68
Background.
Demand Paging.
Page Replacement.
Thrashing.
Background
69
(Page demanding)
- With each page table entry a validinvalid bit is associated (1
means in-memory, 0 means not-in-memory), but initially valid
invalid but is set to 0 on all entries. During address translation, if
validinvalid bit in page table entry is 0 means page fault.
- In case of Page Fault the OS looks at another table to decide,
Invalid reference means abort or just not in memory. Then may
take one of the decisions below;
Red Sea University Engineering Faculty
70
71
72
73
74
75