Download OPERATING SYSTEM (013022) Chapter 1 Introductions

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Copland (operating system) wikipedia , lookup

Spring (operating system) wikipedia , lookup

Process management (computing) wikipedia , lookup

Distributed operating system wikipedia , lookup

VS/9 wikipedia , lookup

CP/M wikipedia , lookup

Paging wikipedia , lookup

Transcript
http://www.pass.ps
Lazar El Sharafi
Contents ‫المحتويات‬
 What Operating Systems Do?
 Computer-System Organization
 Computer-System Architecture
 Operating-System Structure
 Operating-System Operations
 Process Management
 Memory Management
 Storage Management
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 2
Objectives ‫اهداف المحاضرة‬
 To provide a tour of the major operating systems components
 To provide coverage of basic computer system organization
Note: Some slides and/or pictures in the following are
adapted from slides Silberschatz, Galvin, and Gagne & John Kubiatowicz
sildes.
5/6/2017
Lec 1 - 3
Goal of Today ‫هدف اليوم‬
 What is an Operating System?
 And – what is it not?
 Examples of Operating Systems design?
 Why study Operating Systems?
Interactive is important!
Feel free to ask Questions!
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 4
Technology Trends: Moore’s Law ‫قانون مورف‬
Moore’s Law
2X transistors/Chip Every 1.5
years Called “Moore’s Law”
Gordon Moore (co-founder of
Intel) predicted in 1965 that the
transistor density of
semiconductor chips would
double roughly every 18 months.
5/6/2017
Microprocessors have become
smaller, denser, and more
powerful.
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 5
Societal Scale Information Systems
‫انظمة المعلومات‬
• The world is a large parallel system
– Microprocessors in everything
– Vast infrastructure behind them
Internet
Connectivity
Massive Cluster
Gigabit Ethernet
Clusters
Scalable, Reliable,
Secure Services
Databases
Information Collection
Remote Storage
Online Games
Commerce
…
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 6
People-to-Computer Ratio Over Time
‫نسبة الحواسيب للبشر بالنسبة للوقت‬
From David Culler
• Today: Multiple CPUs/person!
– Approaching 100s?
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 7
New Challenge: Slowdown in Joy’s law of
Performance ‫قانون جوي المتعلق باالداء‬
10000
Performance (vs. VAX-11/780)
From Hennessy and Patterson, Computer Architecture: A
Quantitative Approach, 4th edition, Sept. 15, 2006
??%/year
1000
52%/year
100
10
25%/year
Sea change in chip design: multiple
“cores” or processors per chip
1
1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 2002 2004 2006
• VAX
: 25%/year 1978 to 1986
• RISC + x86: 52%/year 1986 to 2002
• RISC + x86: ??%/year 2002 to present
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 8
Just for your information !!! ‫معلومات اضافية‬
 A teraflop is one trillion floating point
operations per second.
 This measure of compute capacity describes
how many multiplications can be performed
within one second.
 Computer vendors and computer resource
providers typically list the computing
performance of their systems in terms of the
number of gigaflops (billion floating point
operations per second).
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 9
ManyCore chips: The future is here ‫المستقل في‬
‫الشرائح المتعددة النواة‬
• Intel 80-core multicore chip (Feb 2007)
– 80 simple cores
– Two FP-engines / core
– Mesh-like network
– 100 million transistors
• Intel Single-Chip Cloud
Computer (August 2010)
– 24 “tiles” with two cores/tile
– 24-router mesh network
– 4 DDR3 memory controllers
• “ManyCore” refers to many processors/chip
– 64? 128? Hard to say exact, How Many?
• How to program these? Or what to do with these huge CPU’s????
– Use 2 CPUs for video/audio
– Use 1 for word processor, 1 for browser
– 76 for virus checking???
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 10
Another challenge: Power density ‫كثافة الطاقة‬
• Moore’s Law:
– Potential power density reaching amazing levels!
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 11
Increasing software complexity ‫زيادة تعقيد‬
‫البرمجيات‬
From MIT’s 6.033 course
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 12
Course Administration & Text book
‫ وكتاب المادة‬،‫ادارة المادة‬
 Instructor : Hani iwidat ([email protected])
 Office hours (2:00 pm – 3:30pm)
 Class Time: Sat, Mon, 103 Hall
 Please come to class. Lecture notes do not have everything in them.
The best part of class is the interaction!
 Also: 10% of the grade is from class participation (section and class)
 Text: Operating Systems Concepts, 8th Edition Silbershatz, Galvin,
Gagne
 Question: do I need to read from 8th edition?
 No, but has new material that we may cover Completely reorganized
 You can read from both the 7th and 8th.
 Or any other books.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 13
Grading ‫العالمات‬
 First examination
 Second examination
 Final examination
 Final project
 Check offs. & Participation
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 14
Group project simulates industrial environment
 Project teams have 3 or 4 members in same discussion section
 Must work in groups in “the real world”
 Communicate with colleagues (team members)
 Communication problems are natural
 What have you done?
 What answers you need from others?
 You must document your work!!!
 Everyone must keep an on-line notebook
 Communicate with supervisor
 How is the team’s plan?
 Short progress reports are required:


5/6/2017
What is the team’s game plan?
What is each member’s responsibility?
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 15
Attention
Typical Lecture Format ‫صيغة المحاضرة النموذجية‬
•
•
•
•
•
•
•
30 min. Break 30 min. Break 20 min. “In Conclusion, ...”
3 min
3 min
Time
1-Minute Review
30-Minute Lecture
3- Minute Break
30-Minute Lecture
3-Minute Break
20Minute Lecture
NOTE: Instructor will come to class early & stay after to answer questions
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 16
Lecture Goal ‫هدف المحاضرة‬
Interactive!!
‫التفاعل‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 17
What does an Operating System do?
‫ماذا يستطيع نظام التشغيل ان يفعل؟‬
 Silerschatz and Gavin:
“An OS is Similar to a government”
 But the question is : does a government do anything useful by itself?
 Coordinator and Traffic Cop:
 Manages all resources
 Settles conflicting requests for resources
 Prevent errors and improper use of the computer
 Facilitator:
 Provides facilities that everyone needs
 Standard Libraries, Windowing systems
 Make application programming easier, faster, less error-prone
 Some features reflect both tasks:
 E.g. File system is needed by everyone (Facilitator)
 But File system must be Protected (Traffic Cop)
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 18
What is an operating system……Really?
‫ما هي حقيقة نظام التشغيل؟‬
 Most Likely:
 Memory Management
 I/O Management
 CPU Scheduling
 Communications? (Does Email belong in OS?)
 Multitasking/multiprogramming?
 What about?
 File System?
 Multimedia Support?
 User Interface?
 Internet Browser? 
 Is this only interesting to Academics??
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 19
What if we didn’t have an operating system?
‫ماذا لو لم يكن لدينا نظام تشغيل؟‬
 Source CodeCompilerObject CodeHardware.
 If there is no OS many questions popup!!!!
 How do you get object code onto the hardware?
 How do you print out the answer?
 Once upon a time, had to Toggle in program in binary and read out answer
from LED’s
As a result
The OS is very useful
things in term is giving
you an access to the
hardware
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 20
Computer System Structure
‫هيكلية نظام الكمبيوتر‬
 Computer system can be divided into four components:
 Hardware – provides basic computing resources
CPU, memory, I/O devices
 Operating system
 Controls and coordinates use of hardware among various applications
and users
 Application programs – define the ways in which the system resources are
used to solve the computing problems of the users
 Word processors, compilers, web browsers, database systems, video
games
 Users
 People, machines, other computers

5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 21
Four Components of a Computer System
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 22
Operating System Definition ‫تعريف نظام التشغيل‬
 OS is a resource allocator
 Manages all resources
 Decides between conflicting requests for efficient and fair resource use
 OS is a control program
 Controls execution of programs to prevent errors and improper use of the
computer
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 23
Operating System Definition (Cont.)
)‫تعريف نظام التشغيل ( تكملة‬
 No completely adequate definition of an operating system.
“No universally accepted definition of what is part of the operating system”!!!!
 “Everything a vendor ships when you order an operating system” is good
approximation
 But varies wildly
 “The one program running at all times on the computer” is the kernel.
Everything else is either a system program (ships with the operating system) or
an application program.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 24
Operating System Existence & Goal
‫سبب وجود نظام التشغيل واهدافة‬
 Operating systems exist because they offer a reasonable way to solve the
problem of creating a usable computing system.
 The fundamental goal of computer systems is to execute user programs and to
make solving user problems easier.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 25
Computer startup ‫بدء الحاسوب‬
 bootstrap program is loaded at power-up or reboot
 Typically stored in ROM or EEPROM, generally known as firmware
 Initializes all aspects of system
 Loads operating system kernel and starts execution
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 26
Computer System Organization
‫منظومة نظام الحاسوب‬
 Computer-system operation:
 One or more CPUs, device controllers connect through common bus
providing access to shared memory.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 27
Computer-System Operation ‫عمليات نظام الحاسوب‬
 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.
 CPU moves data from/to main memory to/from local buffers.
 I/O is from the device to local buffer of controller.
 Device controller informs CPU that it has finished its operation by
causing an interrupt.
Device Controller ?
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 28
The Device Controller & Device Driver
‫ضابط االجهزة و تعاريف االجهزة‬
Device Controller
A device controller is the hardware
interface between the computer and a
peripheral device. Sometimes a
controller handles several devices.
Device Driver
To handle requests made by the kernel
with regard to a particular type of
device.
Figure: Place of a Device Driver & controller in UNIX
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 29
The Device Driver ‫تعريف االجهزة‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 30
Common Functions of Interrupts ‫المقاطعة‬
 Def: Interrupts is an asynchronous signal indicating the need for
attention <in hardware> or a synchronous event in software indicating
the need for a change in execution <in Software> .
‫هي عبارة عن إرسال إشارة أو حدث للمعالج تحتاج الي عناية فورية و هذا يعني وقف مؤقت لتنفيذ‬
.‫البرنامج او العملية الحالية من أجل تنفيذ عملية أخري لها أولوية أكبر‬
 Interrupt transfers control to the interrupt service routine generally,
through the interrupt vector, which contains the addresses of all the
service routines.
 Interrupt 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.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 31
Interrupt Handling ‫معالجة المقاطعة‬
 For understanding how interrupt work, It is like taking a walk through
the park. Actually, a good analogy is boarding an airplane for a trip.
 Determines which type of interrupt has occurred:
 A hardware interrupt causes the processor to save its state of
execution and begin execution of an interrupt handler.
‫عبارة عن اشارة من جهاز خارجي تستعدي حفظ عنوان االشارة الحالية و البدء بمعالجة االشارة الجديدة‬
 A Software interrupts are usually implemented as instructions in the
instruction set, which cause a context switch to an interrupt handler
similar to a hardware interrupt.
‫عبارة عن اشارة من جهاز داخلي و يتم تحويلها الي جدول المهام ويمكن عمل اكثر من اشارة في نفس‬
‫الوقت‬
‫ فوائد المقاطعة‬
‫ حيث يقوم بتنفيذ جزء من وظيفة ثم يتركها‬- ‫جعل المعالج يقوم بتنفيذ أكثر من وظيفة في نفس الوقت‬
.‫ من أجل الحصول على سرعة أعلى‬-‫ليذهب لتنفيذ وظيفة أخرى في حالة حدوث مقاطعة وهكذا‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 32
Interrupt Timeline ‫المقاطعة بالنسبة للزمن‬
 Each computer design has its own interrupt mechanism, but several
functions are common. The interrupt must transfer control to the
appropriate interrupt service routine.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 33
Storage Structure ‫هيكلية التخزين‬
 Main memory – only large storage media that the CPU can access directly
(millions to billions of bytes). RAM
 Secondary storage – extension of main memory that provides large non-
volatile storage capacity.
‫الذاكرة الثانوية هي متفرعة من الذاكرة الرئيسية و لكنها غير متقلبة اي ال تفقد محتوياتها‬
 Magnetic disks –glass platters covered with magnetic recording material.
 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
Interaction is achieved by (Load or moves)
The load instruction moves a word from main memory  an internal
register within the CPU, whereas the store instruction moves the content
of a register  main memory.
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 34
Storage Structure (cont.)
 Why the programs and data can not reside in main memory
permanently? ‫لماذا البرامج والبيانات ال يمكن أن تتواجد في الذاكرة الرئيسية بشكل دائم؟‬
1. Main memory is usually too small to store all needed programs and data
permanently. .‫عادة ما تكون صغيرة جدا لتخزين جميع البرامج والبيانات الالزمة بشكل دائم‬
2. Main memory is a volatile storage device that loses its contents when
power is turned off or otherwise lost.
‫الذاكرة الرئيسية هي عبارة عن جهاز متقلب أي أنها تفقد‬
‫محتواها بمجرد انقطاع التيار الكهربائي‬
Von Neumann architecture
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 35
Storage-Device Hierarchy ‫التسلسل الهرمي لالجهزة‬
‫التخزين‬
The main differences
among the various storage
systems lie in speed, cost,
size, and volatility.
Fast
Expensive
volatile
Caching – copying
information into faster
storage system;
main memory can be
viewed as a last cache for
secondary storage
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 36
Data Storage
‫تخزين البيانات‬
Various forms of storage,
divided according to their
distance from the central
processing unit (CPU).
‫ وتنقسم‬،‫أشكال مختلفة من التخزين‬
CPU ‫وفقا لبعدها عن‬
Cache:
used by the CPU to reduce the average
time to access memory.
‫ لتخفيض متوسط الوقت للوصول الي‬CPU ‫تستخدم من‬
.‫الذاكرة‬
Registers:
Are memory cells built right into the
CPU that contain specific data needed by
the CPU, particularly the ALU.
‫ تحتوي علي‬CPU ‫عبارة عن خاليا ذاكرة تبني داخل‬
CPU‫معلومات معينة يحتاجها ال‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 37
I/O Structure ‫هيكلية عمليات االدخال واالخراج‬
 A large portion of operating system code is dedicated to managing I/O, both
because of its importance to the reliability and performance of a system and
because of the varying nature of the devices.
‫ وذلك بسبب أهميتها الداء النظام‬،I / O ‫جزء كبير من التعليمات البرمجية لنظام التشغيل وجدت إلدارة‬
‫وبسبب اختالف طبيعة االجهزة‬
 To start an I/O operation:
1.
the device driver loads the appropriate registers within the device controller.
2.
3.
4.
5.
6.
5/6/2017
The device controller, in turn, examines the contents of these registers to
determine what action to take (such as "read a character from the
keyboard”).
The controller starts the transfer of data from the device to its local buffer.
Once complete, the device controller informs the device driver via an
interrupt that it has finished its operation.
The device driver then returns control to the operating system.
For other operations, the device driver returns status information.
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 38
‫هيكلية عمليات االدخال واالخراج ‪I/O Structure‬‬
‫‪ ‬للبدء بعمليات االدخال و االخراج ‪-:‬‬
‫‪.1‬‬
‫‪.‬يقوم ‪ D/D‬بتحميل السجالت المطلوبة لل‪. D/C‬‬
‫‪.2‬‬
‫يقوم ‪ D/C‬بالبحث في محتويات هذه السجالت لمعرفة ما هي االجراءات المطلوب اتخاذها‪.‬‬
‫(مثل قراءة حرف من الكيبورد )‪.‬‬
‫يقوم ال‪ D/C‬بنقل البيانات من الجهاز ( الكيبورد مثال ) الي وحدة المعالجة‪.‬‬
‫عند إكتمال العملية و انتهاء وحدة المعالجة من االمر يقوم ‪ D/C‬بإخبار ‪ D/D‬بان العملية‬
‫انجزت‪.‬‬
‫يقوم ‪ D/D‬باعادة ‪ D/C‬الي وضعية استقبال اوامر اخري ‪.‬‬
‫للعمليات االخري يقوم ‪ D/D‬باعادة معلومات الحالة لل‪. D/C‬‬
‫‪.3‬‬
‫‪.4‬‬
‫‪.5‬‬
‫‪.6‬‬
‫‪Lec 1 - 39‬‬
‫‪Dr. Hani Iwidat 013022 © PASS Fall 2010‬‬
‫‪5/6/2017‬‬
How a Modern Computer Works ‫كيفية عمل‬
‫الحواسيب الحديثة‬
Direct Memory Access (DMA)
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 40
Computer-System Architecture ‫بناء انظمة الحاسوب‬
 Most systems have special-purpose processors as well.
 Run a limited instruction set or Do
not run user processes.
 Most systems use a single-processor system (PDA’s through mainframes).
(If there is only one general-purpose CPU, then the system is a single-processor system).
 Multiprocessors systems growing in use and importance.
 Advantages include : ‫المزايا‬



Increased throughput (ex. N CUP, more work done in less time) ‫زيادة االنتاجية‬
Economy of scale (ex. share peripherals, mass storage, and power supplies.) ‫اقتصادي‬
Increased reliability & fault tolerance (ex. one of ten processor failure, others working)
‫زيادة الموثوقية ومواجهة األعطال‬
 Two types


Asymmetric Multiprocessing (Master-slave relationship) ‫متعدد المعالجة غير المتماثلة‬
Symmetric Multiprocessing (This is common) (All processors are peers; no slave master
relationship) ex. Solaris, from Sunmicrosystem ‫متعدد المعالجة المتماثلة‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 41
Symmetric Multiprocessing Architecture ‫بناء‬
‫المعاجات المتعددة المتماثلة‬
Symmetric Multiprocessing Architecture
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 42
A Dual-Core Design ‫تصميم ثنائي النواه‬
Multiprocessor chips can be more
efficient than multiple chips with a
single core.
‫رقائق المعالجات المتعددة أكثر فعالية من رقائق‬
.‫متعددة مع جوهر واحد‬
- On-chip communications faster than
between-chip communication.
-use less power
‫التواصل مع رقاقة واحدة أسرع من التواصل بين‬‫الرقاقات الذي يؤدي الي استخدام طاقة أقل‬
Suit for server system ex: web server &
database server
.‫فعال النظمة السرفرات‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 43
‫تراكيب أنظمة التشغيل ‪Operating System Structure‬‬
‫نحتاجها لزيادة الكفاءة ‪ Multiprogramming needed for efficiency.‬‬
‫‪ Single user cannot keep CPU and I/O devices busy at all times‬‬
‫المستخدم الواحد ال يمكنه حجز وحدة المعالجة المركزية و وحدات االدخال و االخراج مشغولين طوال الوقت‪.‬‬
‫‪ Multiprogramming organizes jobs (code and data) so CPU always has one‬‬
‫‪to execute.‬‬
‫تقوم بتنظيم االعمال بحيث تكون وحدة المعالجة المركزية دائما لديها عمل واحد تقوم به‪.‬‬
‫‪ A subset of total jobs in system is kept in memory.‬‬
‫مجموع المهام في النظام دائما يتم حفظه في الذاكرة‬
‫‪ One job selected and run via job scheduling‬‬
‫يتم اختيار وظيفة واحدة من جدول الوظائف‬
‫‪ When it has to wait (for I/O for example), OS switches to another job.‬‬
‫عندما يكون في وضع االنتظار ( وحدات االدخال و االخراج علي سبيل المثال ) نظام التشغيل يقوم بالتحويل الي‬
‫وظيفة اخري من جدول الوظائف‪.‬‬
‫‪Lec 1 - 44‬‬
‫‪Dr. Hani Iwidat 013022 © PASS Fall 2010‬‬
‫‪5/6/2017‬‬
Operating System Structure (Cont.)
 Timesharing (multitasking) is logical extension of multiprogramming.
. ‫ هو عبارة عن امتداد منطقي لنظام متعدد البرامج‬: ‫متعدد المهام‬
 In which CPU switches jobs so frequently that users can interact with each job
while it is running, creating interactive computing. ‫يمكن للمستخدم التفاعل مع كل وظيفة‬
.‫خالل عملها‬
 Response time should be < 1 second ‫وقت االستجابة‬
 Each user has at least one program executing in memory process
 If several jobs ready to run at the same time  CPU scheduling ‫جدولة‬
 If processes don’t fit in memory, swapping moves them in and out to run
 Virtual memory allows execution of processes not completely in memory
 I/O may take a long time to complete. Why?
 Since interactive I/O typically runs at "people speeds," it may take a long time
to complete.
A program loaded into memory and executing is called a process
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 45
Memory Layout for Multiprogrammed System
‫تخطيط الذاكرة في نظام متعدد البرامج‬
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 46
Time-sharing & multiprogramming Cases
‫مشاركة الوقت وحاالت متعددة البرامج‬
job pool
Job 5
Job 6
Job 7
Job N
Programs & Data
Disk
Pool: consists of all processes residing on disk awaiting
allocation of main memory.
Job scheduling: choose among them when there is not
enough room in memory
Memory management: Several programs in memory
at the same time requires some form of management
Running multiple jobs concurrently:
Swapping: (reasonable response time), where
processes are swapped in and out of RAM to the disk
Virtual Memory: a technique that allows the execution
of a process that is not completely in memory
Advantage : To run programs (Larger) physical memory.
Protecting resources: from inappropriate use
Disk manage
5/6/2017
Sync & Communication
Dr. Hani Iwidat 013022 © PASS Fall 2010
Deadlock
Lec 1 - 47
Transition from User to Kernel Mode
‫التحويل من حالة المستخدم الى حالة النظام او المراقب‬
 Timer to prevent infinite loop / process hogging resources and the OS
maintains control over CPU.
 Set interrupt after specific period (ex. 1/60 millisecond or 1 millisecond to 1 second )
 Operating system decrements counter (when clock ticks , counter is decremented)
 When counter zero generate an interrupt (the control back to the OS)
 Control is back to OS via an Interrupts , a trap, or a system call
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 48
Process Management ‫ادارة العمليات‬
 Def: A process is a program in execution. It is a unit of work within the
system. A program by itself is not a process;
 Process needs resources to accomplish its task (CPU, memory, I/O, files…)
 Single-threaded process has one program counter specifying location of next
instruction to execute (executes instructions sequentially, one at a time) .
 Multi-threaded process has one program counter per thread.
 Typically system has many processes, some user, some operating system
running concurrently on one or more CPUs.
 OS activities in connection with process management (see T.B. page 24)
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 49
Memory Management ‫ادارة الذاكرة‬
 Memory is the only large storage, CPU able to address & access directly
 All data in memory before and after processing
 All instructions in memory in order to execute
 Memory management determines what is in memory and when
 Optimizing CPU utilization and computer response to users
(keeping several program in memory for memory management)
 OS activities in connection with memory management (See T.B. page 25)
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 50
Storage Management ‫ادارة التخزين‬
 OS provides uniform, logical view of information storage
 Each medium is controlled by device (i.e., disk drive, tape drive)

Varying properties include access speed, capacity, data-transfer rate,
access method (sequential or random).
 File-System Management
 Files usually organized into directories.
 Access control on most systems to determine who can access what.
 Mass-Storage Management
 Usually disks used to store data that does not fit in main memory or data that must
be kept for a “long” period of time.
 Proper management is of central importance.
 Entire speed of computer operation depend on disk subsystem and its algorithms.
 OS activities in connection with storage management (See T.B. page 26)
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 51
Why study operating system? ‫لماذا ندرس نظام‬
‫التشغيل‬
 Learn how to build complex systems:
 How can you manage complexity for future projects?
 Engineering issues:
 Why is the web so slow sometimes? Can you fix it?
 How do large distributed systems work? (Kazaa, etc)
 Buying and using a personal computer:




Why different PCs with same CPU behave differently
How to choose a processor (Opteron, Itanium, Celeron, Pentium, Hexium)?
Should you get Windows XP, 2000, Linux, Mac OS …?
Why does Microsoft have such a bad name? and apple a good name?
 Business issues:
 Should your division buy thin-clients vs. PC?
 Security, viruses, and worms
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 52
In conclusion ‫في الختام‬
 Operating systems coordinate resources and protect users from each other.
 Operating systems simplify application development by providing standard
services
 Operating systems can provide an array of fault containment, fault tolerance,
and fault recovery
5/6/2017
Dr. Hani Iwidat 013022 © PASS Fall 2010
Lec 1 - 53