You are on page 1of 40

Operating system

By:
Eng Ahmed awed
Week 2
‫ مقبول مالوش‬os ‫أي تعريف لل‬
Operating system ‫تعريف ثابت‬

A program that acts as an intermediary between a user of a


computer and the computer hardware

Make computer
Run User programs
widely used

Operating
system role

Use computer H.W


efficiently
Kernel
The kernel is the essential foundation of a computer's operating
system (OS). It is the core that provides basic services for all
other parts of the OS

System program : S.W used by the user like operating system,


networking system, web site server, data backup server etc.

Application program: provide software that is used directly by


kernel + system program، ‫ جواه‬OS the use like Email, web browsers, gaming software, word
processors, graphics software, media player
Computer
Organization

sw in os define the way


Device the computer hw dael
driver ‫ المعلومات بتتنقل من الذاكرة لل‬I/O devices by CPU
with device

Hw attached to I/o
Each device Device devices provide
controller interface between
computer and device I/O device
Mouse, Memory CPU Buffer
keyboard, Buffer
camera, printer (memory)
An interrupt is a signal sent by hardware or software to the processor for
processing

Interrupt
An interrupt is a necessary part of Computer System Organization as it is
triggered by hardware and software parts when they need immediate attention.
Device Program

interrupts ‫ ينظم الشغل بتاعه ويتحكم في‬OS ‫دى الحاجة اللى بتخلى ال‬

• The CPU saves the state of the ongoing process and shifts its attention to the
interrupt generated.
Interrupt handling
*ISR handles the request and sends it to the CPU. When the ISR is complete, the process
gets resumed.
I/O is from the device to local buffer of controller

The responsibility of I/O is to interface with external devices.

The responsibility of I/O is to interface with external devices.

I/O structure It’s operations : sensory input, control output, and data transfer

Memory management of I/O including buffering (storing data temporarily


while it is being transferred), caching (storing parts of data in faster storage for
performance), spooling (the overlapping of output of one job with input of
other jobs)

Device status table: in the os contains entry for each I/O device indicating its type,
address, and state

System calls : It acts as a link between the operating system and a process, allowing user-level
programs to request operating system services.
ROM
cash
memory

Memory RAM

Hard
Hard Disk
Drives (HDD)

Solid state
driver (SSD)
Computer types of storage
Bootstrap program : simple code to initialize the system, load the
kernel
Operating system
operations File management: os mange files and folders on the computer
(open, close, delete, copy, move)

Bootstrap Device management: os managing devices connected to a


computer, like allocating memory, processing input and output
requests, and managing storage devices.
File
management Process management: manage the processes running on your
computer.

Device Memory management: keeping track of all different applications


management and processes running on your computer and all the data they’re
using.

Process Operating system types


management Windows
Mac os
Memory Linux
management ……..
Operating system services
Def: a request from computer software to an
operating system's kernel

The Application Program Interface (API)


connects the operating system's functions to
System calls user programs. It acts as a link between the
operating system and a process,

APIs are Win32 for windows, POSIX-based systems


(mac, Linux), Java API

Simplest parameters stored in


registers

Block or table stored in memory


Types of dealing , and address stored in register
with os
Stack , os put and poll off data
from the stack
Process control

File management

System calls Device management

functions information
maintenance

Communications

Protection

security
Apps compiled on one system usually not
executable on other operating systems

Application Each operating system provides its own


unique system calls
programs
Apps can be multi-operating system if
written in high level language like python

Application Binary Interface : defines how


different components of binary code can
interface for a given operating system
Multiple CPUs are linked together so that a job
Multiprocessors can be divided and executed more quickly.

 Asymmetric Multiprocessing: each processor


responsible for special tasks
 Symmetric Multiprocessing : each processor
performs all tasks

Dual core is a CPU that has two distinct


processors that work simultaneously in the same
integrated circuit. This type of processor can
function as efficiently as a single processor but can
perform operations up to twice as quickly.
is a type of operating system that allows
multiple users to use it at the same time,
without direct communication between
them.

Single user can’t occupy the CPU

Batch system
OS organize jobs for the CPU

the CPU process one job only at the


same time
If job needs to wait os switch to
another job

User 1
User 2

User n

prevent infinite loop


Timer interrupt the computer after some time period
Virtualization is the process of running a virtual instance of a computer system in a layer
abstracted from the actual hardware

Application Virtualization, Network Virtualization, Desktop Virtualization, Storage


Virtualization, Server Virtualization.
Personal Computing Environment: stand-
alone machine like laptops, mobiles, printers,
computer systems, scanners

Time-Sharing Computing Environment :


multiple users share system simultaneously Public cloud –
available via Internet
to anyone willing to
Computing Client Server : A server can provide service pay
environment to multiple clients at a time • Private cloud – run
by a company for the
company ’ s own use
Cloud Computing : Delivers computing, • Hybrid cloud –
storage, even apps as a service across a includes both public
network and private cloud
components

Real-time embedded system:


Week 3
PROCESS
The program is divided to process that run sequentially

Text section—the
executable code

Data section—global variables


PROCESS in memory
Heap section—memory
allocated for the program

Stack section—temporary data


storage when invoking functions
(such as function parameters, return
addresses, and local
variables)
On the CPU
• How OS control the process?
Each process is represented in the operating system by a process control block
(PCB)—also called a task control block .
What is the content of process control block (PCB)?
‫حالة العملية ايه‬
Process state
Program counter : contain the address of the next instruction
for this process. ‫أماكن الذاكرة المسؤولة عن تنفيذ العملية‬

CPU registers This information includes a process priority, pointers to


scheduling queues, and any other scheduling parameters.
CPU-scheduling information the value of the base and limit registers
Memory-management information and the page tables, or the segment tables.
includes the amount of CPU and real time used, time limits, account
Accounting information numbers, job or process numbers, on
includes the list of I/O devices allocated to the. process, a list of open files, and s
I/O status information on.
Process scheduler: selects among available processes for
next
execution on CPU core.

Goal: Maximize CPU use, quickly switch processes onto CPU


Process scheduling core

scheduling queues : maintains process in the memory


need execution

Ready queue : set of all


processes residing in main Wait queues: set of
memory, processes waiting for an event
ready and waiting to execute
‫‪Context switch:‬‬
‫‪When OS switches to another process, it must save the‬‬
‫‪state of the old process and load the saved state for the‬‬
‫‪new process via a context switch‬‬

‫ال يستفيد مشغل النظام وال يقوم بأى مهام اثناء تغيير ال ‪process‬‬

‫كلما كان نظام التشغيل معقد كلما اخذ تغيير الوظائف وقت اطول‬

‫تغيير العمليات الى وحدة التحكم يعتمد على الهاروير بعض األنظمة تساعد على سرعة تغيير الوظائف‬
‫باستخدام ‪register‬‬
The creating process is called a parent process, and
Operation on process the new processes are called the children of that
process.

When a process creates a new process:


• Continuous work with its children
Process creation • * wait until children terminated

The new process :


• Similar to patient
• Different has a new program

Process When finish execution

termination

Wait some event


Process waiting

You might also like