Operating Systems
(Principles of Operating Systems)
Đỗ Quốc Huy
huydq@soict.hust.edu.vn
Department of Computer Science
School of Information and Communication Technology
Text book:
Operating System Concepts – Abraham
Siblerschatz
Modern Operating System – Andrew
Tanenbaum
Group Projects
Course Info
① Notion of operating system
② History of operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1. Operating System Overview
1. Notion of operating system
① Notion of operating system
Layered structure of a computing system
Operating system’s functions
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
A computer system’s structure
 One/ many CPUs, controlling devices are linked by a common bus
system to access a shared memory.
 Controlling devices and CPU operate simultaneously and compete
with each other.
Input Output
System
Memory
Bus
Processor
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
A computer system’s structure
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
Operating systems turn ugly hardware into beautiful abstractions
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
 A computer system’s components (Silberschatz 2002)
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
 A computer system’s components (Tanenbaum 2001)
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
 A computing system’s components
 Hardware: Provides basic computing resources (CPU, memory, input-
output devices)
 Operating system: controls and cooperates hardware using works for
application programs of different users.
 Application programs: (compiler, database system, game...) utilizes
computer’s resource to handle users’ requests.
 Users: People who work/operate the machines or computers
Chapter 1. Operating System Overview
1. Notion of operating system
1.1. Layered structure of a computing system
 Objectives
 Operating system lies between the system’s hardware and application
program
 Objectives: To provide an environment which helps user run application program
and use the computer system easier, more conveniently and effectively.
 Standardize the user interface for different hardware systems
 Utilize hardware resource effectively and exploit the hardware performance
optimally.
Chapter 1. Operating System Overview
1. Notion of operating system
① Notion of operating system
Layered structure of a computing system
Operating system’s functions
Chapter 1. Operating System Overview
1. Notion of operating system
1.2. Operating system’s functions
① Simulate a virtual computer machine
② Manage system resources
Chapter 1. Operating System Overview
1. Notion of operating system
1.2. Operating system’s functions
Simulate a virtual computer machine
Help hide detailed works and exploit computer hardware’s functions easier
and more effectively.
 Simplify programming problem
 No need to work with binary sequences
 Each program thinks that it own the whole computer’s memory, CPU time,
devices...
 Help communicating with devices easier than with original device. Ex: Ethernet
card: Reliable communication, ordered (TCP/IP)
 Extend the system’s abilities: The system seem to have desired resources
(virtual memory, virtual printer...)
 Help programs not violating each other → a program which does not
work would not damage the whole system
 Useful for operating system’s development
 If the experimental operating system get errors, only limited in the virtual
machine
 Help verifying other programs in the operating system
Chapter 1. Operating System Overview
1. Notion of operating system
1.2. Operating system’s functions
Simulate a virtual computer machine
Non virtual machine With virtual machine
Chapter 1. Operating System Overview
1. Notion of operating system
1.2. Operating system’s functions
System’s resources management
 System’s resources (CPU, memory, IO devices, files...) are utilized by
program to perform a determined task.
 Programs require resources: time (CPU-usage) and space (memory)
 The operating system has to manage the resource so that the computer
can work in the most effective way.
 Provide resource for program when it’s necessary.
 Competition handling
 Decide the order of resource providing for the programs’ requirements
 Example: memory resource management (limited)
 Many program can operate at the same time.
 Avoid illegal access
 Data protection (memory sharing: file)
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1. Operating System Overview
2.History of Operating Systems
Operating systems development’s history
History of electronic computer
Operating systems development’s history
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 1936 - A. Turing & Church present logic computing model and prove the
existence of a computer: Turing machine
Model of a character processing device;
Simple but able to perform all the
computer’s algorithm
A Turing machine that is able to
simulate any other Turing machine -> a
universal Turing machine
Turing is considered as the father of
computer science and artificial intelligence
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 1941- Konrad Zuse (German) Constructed world's first programmable
computer; the functional program-controlled Turing-complete Z3
Z3: use binary system
Has separated memory and
controller
Mechanical technique
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 1946 ENIAC based on electric bulbs
 18000 vacuum tube
 70000 resistance
 5 million metal connector
Faster but least reliable
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 plug board
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 1950-1958 Transistor
 1959-1963 Semiconductor
 1964-1974 Integrated Circuit (IC)
Chapter 1. Operating System Overview
2.History of Operating Systems
2.1. History of electronic computer
Development history of electronic computers
 1974-1990 Large scale IC:
Allow CPU, main memory or similar device to be produced in a single integrated
circuit
-> new class of smaller, cheaper computer and parallel processor with multi CPUs
 1990-now Very large scale IC, smart IC
Chapter 1. Operating System Overview
2.History of Operating Systems
Operating systems development’s history
History of electronic computer
Operating systems development’s history
 1948-1970 : Hardware expensive; human labor cheap
 1970-1981 : Hardware cheap; human labor expensive
 1981- : Hardware very cheap; human labor very expensive
 1981- : Distributed system
 1995- : Mobile devices
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 1948-1970 :
 Computer 1-5 M$ : Nation ‘s property, mainly used for military’s
purposes ⇒ Require optimization for using hardware effectively
 Lack of human-machine interact
 User, programmer; operator are same group of people
 One user at a single time
 User wrote program on punched cards
 First card is bootstraps loader is loaded into memory and executed
 Instructions in bootstraps loader fetch into memory and execute
instructions on other later cards (application program)
 Check light bulb for results, debug
 Debugging is difficult
 Waste processor time
 Solution: batch processing
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 1948-1970 :
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Batch processing and professional operator
 Programmer give program to operator
 Operator group program into a single pack (batch)
 Computer read and run each program consequently
 Operator take the result, print out and give to programmer
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Reduce waiting time between jobs
 Input/output problem
 Computer getting faster
 Card reader still slow
⇒CPU has to wait for card reading/writing
 Replace card reader by tape ⇒ Independent external computers for
reading/writing data
 External devices are designed to be able to Direct Memory Access, using
interrupt and i/o channel
 OS request I/O device then continue its work
 OS receive interrupt signal when I/O devices finishes
 ⇒Allow overlap between computing and I/O
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems

 CPU is reprogrammed to be switch easily between programs
 Hard ware: memory space larger and cheaper Some program can run
simultaneously -> multi programming
 More overlap between computing and I/O
 Require memory protection between programs and keep one crashed program
from damaging the system
 Problem: OS has to manage all interaction ⇒ out of control (OS360: 1000
error)
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 1970-1981 :
 Computers prices about 10.000$ ⇒ used widely for different jobs
 OS technology became stable.
 Using cheap terminal device (1000$) allow many user to interact
with the system at the same time
 User perform different works (text editor, chat,
program debugging,..) ⇒ require system to be exploited effectively
Example: a PC: 10M calculation/s; typing speed 0.2s/1 character
=> lost 2M calculation per one typing
⇒ Time sharing operating system
 Problem: system’s response time
 Computer network was born (ARPANet : 1968) Communication
between computer; Protection against network attack
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
Time sharing system
[FAIZAL MOHAMAD – Introduction to operating system]
 1981-1995 :
 Computers prices about 1000$; human labor 100K $/year ⇒
Computer are used more widely for working more effectively
 Personal computing
 Cheap computer, single person can afford (PC).
 OS on PC
 Hardware resources are limited (Early : 1980s)
 OS become library of available procedures
 Run One program at a time (DOS)
 PC become more powerful
 OS meet complex problems: multi tasking, memory protection...
(WINXP)
 Graphical user interface (MAC, WIN,..)
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 DOS User interface
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Macintosh User interface
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Distributed systems
 Development time of networking and distributed operating
systems
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Local area network
 Computers share resources: printer, File servers,..
 Client / Server model
 Services
 Computing, storage
 Services provided through Internet.
 Problems
 Transmission delay; bandwidth, reliable...
 Virus (love letter virus 05/2000),..
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 >45 millions computers
were infected
 Stole information
 Auto send emails from
contact list
 Download Trojan
 Mobile devices
 Mobile devices become more popular
 Phone, Laptop, PDA . . .
 Small, changeable and cheap → More computers/human
 Limited ability: speed, memory,...
 Wide area network, wireless network
 Traditional computer divided into many components (wireless
keyboards, mouse, remoting storage)
 peer-to-peer system
 Devices with the same role working together
 “Operating system’s” components are spread globally
 Cloud computing
 Cloud operating system
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
 Conclusion
 The development of the operating systems are strongly
connected with the computers’ development
 Operating system development pulled the development of
computers
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1. Operating System Overview
3. Operating System definition and classification
Operating System definition and classification
Definitions
Classifications
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
Observer’s perspective
 Different objects have different requirements for operating
system
 Different observing perspectives ⇒ different definitions
User: A system of programs that help exploiting the computing
system conveniently
Manager: A system of programs that help managing computing
system’s resource effectively
Technical perspective: A system of programs equipped for a
specific computer to make a new logic computer with new resource
and new ability
System engineer perspective: A system of programs that modelize,
simulate the operation of computer, user and operators. It work in a
communicating mode in order to make a convenient environment
for exploiting the computer system and maximum resource
management.
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
System engineer’s perspective
Simulate 3 roles ⇒ require 3 types of languages
 Machine language
 The only working language of the
system
 All other languages have to be
translated into machine language
 System operation’s language
 OS commands (DOS: Dir, Del..; Unix:
ls, rm,..)
 Translated by the Shell
 Algorithm language
 Programming language
 Compiler
Mac-
hine
User
Ope-
rator
Simulate the operation of
Machine + User+ Operator
Commu-
nication
Operating System
Chapter 1. Operating System Overview
3. Operating System definition and classification
Operating System definition and classification
Definitions
Classifications
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
 Batch processing single program system
 Batch processing multi program system
 Time sharing system
 Parallel system
 Distributed system
 Real-time processing system
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Batch processing single program system
 Programs are performed consequently follow predetermined
instructions
 When a program finished, the system auto run the next program
without any external intervention
 Require a supervisor process the sequence of jobs and the supervisor
has to stay permanent in the memory
 Need to organize a job queue
 Problem: when a program access an I/O device, processor has to wait
xong việc 1 thì load và làm việc 2, và tiếp tục
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Batch processing multi program system
 Allow many programs to run at the same time
 Load one part of code and data of the programs into the memory (the
remaining parts will be loaded at proper moments). The program are
ready to run
 Run the program similar to single program system
 If the current program perform an IO, processor will be change to
another program
 Save memory (no need to load all the program into the memory)
 Reduce processor spare-time
 High cost for processor scheduling. Which program can use processor
next?
 Solve the memory sharing problem between programs
phải đợi giữa các program thì sẽ tốn time
phần còn lại thì laod trong external memory
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Time sharing system
 Processor’s usage allowance time is shared among ready-to-run
programs
 Similar to batch processing multi program system (only load part of the
programs)
 Processor is issued mainly by the operating system ⇒ how ? ⇒ Chapter
2
 Swapping times between program are small -> programs seem to run
parallel
 Usually called: Multi tasking operating system (Windows)
laod memory all off users to memory
sử dụng chung CPU - giống như colab
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Parallel system
 Constructed for system that has many processors
 Many processors, works are done faster
 More reliable: one processor breaks down will not affect the system
 Advantage over single processor computer due to memory, peripheral
devices sharing...
 Symmetric multi processing (SMP: symmetric)
 Each processor run a single program
 Processors communicate via a shared memory
 Fault tolerance mechanism and optimal load balance
 Problem: processor synchronization
 Example: WinNT operating system Khi 1 processor bị lỗi , thì dùng procesork
khác
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Parallel system
 Asymmetric multi processing (ASMP: asymmetric)
 One processor controls the whole system
 Other processors follow the main processor’s commands or predetermined
instructions
 This model has the master-slave relation form: The main process will make
schedule for other processors
 Example: IBM System/360
sẽ có một processor lmaf việc chính
còn các cái khác làm việc phụ
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Distributed system
 Each processor has a local memory and communicate via transmission
lines
 Processors are different from sizes to functions (personal machine,
workstation, mini computer,..)
 Distributed system is used for
 Resource sharing : provide a mechanism for file sharing, remote
printer...
 Increase computing speed: One computing operation is divided into
smaller parts and performed on different places at the same time.
 Safety: One position get problem, others can continue working
có nhiều máy tính, mỗi máy tính có local memory
trong, CPU và disk trong nó
mỗi máy tính một chức năng reieng trong mạng
mạng thường là vòng tròn
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.2. Operating System Classification
Real-time processing system
 Used mainly in controlling field.
 Solve a problem no late than a specific time.
 Each problem has a deadline
 The system must generate correct result in a
determined time period
 This OS requires highly cooperate between software
and hardware.
controller của wahsing machine
hard - deadline: nghĩa là k pass dealdine thì hậu
quả khong thuờg
soft - deadline thì k pas thì k sao
vD: 2 giây để trách osbtacle, nhưng quá lâu, lúc xử
lý xong thì dâm r
phải săp xếp lịch trình, cái nào quan tọng hơn thì làm trước
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Basic Properties of Operating Systems
High reliability
Secure
Effectiveness
General overtime/ Inherit and adaption
Convenience
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
High reliability
Every actions, notations have to be accurate
Only provide information when it’s surely correct
When error happens: notify and stop the proceed
or let the user decide
Require support from device
Example: C:/>COPY C:/F.TXT A:
Bởi vì hgiht reliablity là khả năng câu lệnh đựo thực hiện chính xác, vậy thì
Làm thế nào để check được nó thựuc hiện chính xác?
xem phía dưới
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
High reliability
Example: C:/>COPY C:/F.TXT A:
Check the syntax of command copy
Check I/O card (motor, drive accessibility)
Check for file F.TXT existence in C drive
Check A drive
Check if file F.TXT already existed in A drive
Check if there is enough space in A
Check if the disk is write protection
Check written information (if required)
....
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Basic Properties of Operating Systems
High reliability
Secure
Effectiveness
General overtime/ Inherit and adaption
Convenience
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Security
Data and programs have to be protected
No unwanted modification in every working mode
Secure from illegal access
Different resources have different protection
requirements
Many levels protections with various of tools
Important for multi tasking system
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Basic Properties of Operating Systems
High reliability
Secure
Effectiveness
General overtime/ Inherit and adaption
Convenience
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Effectiveness
Resources are exploited thoroughly;
Resource that is limited still able to handle complex
requirement.
The system need to maintain the synchronization;
Slow devices do not affect the whole system operation
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Basic Properties of Operating Systems
High reliability
Secure
Effectiveness
Generalizable overtime/ Inherit and adaption
Convenience
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Generalizable overtime
System must be Inheritable
Operations, notification can not change
If changed: notify and with detailed guide
(chkdsk/scandisk)
Help keeping and increasing users
System must have ability to adapt to changes that
may happen
 Example: Y2K problem; FAT 12/16/32
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Basic Properties of Operating Systems
High reliability
Secure
Effectiveness
General overtime/ Inherit and adaption
Convenience
Chapter 1 Operating System Overview
4. Basic Properties of Operating Systems
Convenience
Easy to use
Various effective levels
Have many assisting system
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1 Operating System Overview
5. Notions in operating systems
Notions in operating systems
Process and Thread
System’s resources
Shell
System calls
Chapter 1 Operating System Overview
5. Notions in operating systems
5.1. Process and Thread
Process
A running program
Codes: Program’s executable instruction
Program’s data
Stack, stack pointer, registers
Information that is necessary for running
program
Process >< program
 Program: a passive object, contains computer’s
instructions to perform a specific task
 Process: program’s active state.
code được load vào internal memory để chạy
code được laod vào external memory
Chapter 1 Operating System Overview
5. Notions in operating systems
5.1. Process and Thread
Multi-process timesharing system:
Periodically: OS pause one process and start
another process
Need to store processes’ information ⇒ process table
One process can start other process
Ex: OS’s Shell start a process to perform the
command; when the command is done, terminate the
started process
Process can exchange information
 One process can include many threads
Chapter 1 Operating System Overview
5. Notions in operating systems
5.1. Process and Thread
Thread
A sequence/thread of instructions executed in the
program
Executable code, data
Instruction pointer, stack, registers
Heavyweight Process: process contains one thread
Lightweight process: contains more than one thread
Multi_Threading model:
Threads running parallel, sharing process’s global variables
thread là phàn nhỏ của prcoess
process nặng thì chỉ làm đc 1 thread 1 lần
process nhẹ thì làm được nhiều thread 1 lần
trong web browser:
- Mở trang web
- Download dataa
- Hiện thị data to user`
Chapter 1 Operating System Overview
5. Notions in operating systems
5.1. Process and Thread
Chapter 1 Operating System Overview
5. Notions in operating systems
Notions in operating systems
Process and Thread
System’s resources
Shell
System calls
Chapter 1 Operating System Overview
5. Notions in operating systems
5.2 System’s resources
Definition
 Everything that is necessary for a program to be performed
 Space: System’s storage space
 Time: Instruction executing time, data accessing time
 System’s resources
 Memory
 Distinguished by: Storage size, directly access, sequent access
 Levelled by: main memory/internal; extend, external
 Notions’ distinguish: memory (physical area that contain data) and memory
access (the process of searching for the data’s location in memory)
là mọi thứ trong máy cần để chạy program
Chapter 1 Operating System Overview
5. Notions in operating systems
5.2 System’s resources
 System’s resources
 Memory
 Processor
 System’s most important component
 Access level: instruction
 Processing time
 Multi-processor system: each processor’s time is managed and scheduled
independently
 Peripheral devices
 Retrieve, output information (I/O device)
 Attached to the system via controller
 Commonly considered peripheral devices-controller devices
Chapter 1 Operating System Overview
5. Notions in operating systems
5.2 System’s resources
Resource’s classification
 Resource’s types
Physical resource: physical devices
Logic resource: variable; virtual devices
 Sharing ability
Sharable resource: at a specific time, it can be allocate for
different processes. Example: Memory
Non-sharable but dividable resource: Processes use the resource
follow an order; Example: processor
Non-sharable and non-dividable resource: at a specific time, only
one process can use the resource. Example: Printer
logical resources
chỉ có một process mới được cùng tài nguyen này 1 lần, xong rồi mới chuyển
dùng schedule
kiểu một cái máy in chỉ được in 1 prcess 1 lần, do đó cần một virtual printer để in ảo trước, sau đó dùng 1 cáii printer
daemon chứa process chuỷen 1 by 1 to real printer để in
Chapter 1 Operating System Overview
5. Notions in operating systems
5.2 System’s resources
Virtual printer
 Resource allocated for user’s program in a changed form
 Only appear when the system requires or when the system
creates it
 Automatically disappear then the system terminate or more
precisely, when the process that works with this resource
terminates
Example: Virtual printer
Chapter 1 Operating System Overview
5. Notions in operating systems
Notions in operating systems
Process and Thread
System’s resources
Shell
System calls
Chapter 1 Operating System Overview
5. Notions in operating systems
5.3 Shell
 A special process: user and OS communication environment
 Task
Receive user’s command
Analysis received command
Generate new process to perform command’s requirement
 Receives command from command’s line or graphical interface
 Single task environment (MS-DOS):
Shell will wait until one process finishes and then receive new
command
 In multi-tasking system (UNIX, WINXP,. . .) After creating and
running new process, Shell can receive new command
command line, graphical use interface là sheel
parser để check parameter, behavior properly or not, kiểu check syntax
Chapter 1 Operating System Overview
5. Notions in operating systems
5.3 Shell
Chapter 1 Operating System Overview
5. Notions in operating systems
Notions in operating systems
Process and Thread
System’s resources
Shell
System calls
Kernel: là một tập con của shell
Kernal là phần mềm để kết nối giữa shell và phần cứng
là computer program
kernel cần dược bảo vệ để tránh lỗi từ người dùng tác động vào.
Chapter 1 Operating System Overview
5. Notions in operating systems
5.4 System calls
 Provides environment for interacting between user’s program and
the operating system
 Programs utilize system calls to request services from operating system
 Create, delete, use other software objects operated by the operating
system
 Every single system call is corresponding to a library of sub-programs
(functions)
 System calls are done in the form of
 Instructions in low-levels programming languages
 Interrupt requests (Int) in assembly language
 API functions calls in Windows
 Input parameters for the services and returned results are located in
special memory areas
 For example: when making request for an interrupt, the function name is
stored in the register AH
 Int 05 : print to monitor ; Int 13/AH=03h : DISK – WRITE/ DISK SECTOR
Chapter 1 Operating System Overview
5. Notions in operating systems
5.4 System calls
Example
Func BOOL WINAPI ExitWindowsEx(int uFlags, int dwReason);
uFlags Shutdown types
EWX_LOGOFF
EWX_POWEROFF
EWX_ REBOOT
End process and exit Windows
Shutdown system and turn off computer
Shutdown and restart computer
dwReason Reason for shutdown
API là một hàm có cá argurment để chạy mọt cái gì đó
homework write donw program, try it on computer
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1 Operating System Overview
6. Operating System structures
System’s components
Operating system’s services
System calls
Operating system’s structures
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
Process management
Main memory management
Input Output system management
Files management
Storage memory management
Data transmission system (network)
Protection system
User interface
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Process: A running program
 Process utilize system’s resources to complete its task
 Resources are allocated when process created or while it’s running
 Process terminates, resources are returned
 It is possible for many processes to exist in the system at the same time
 System process
 User process
 The tasks of OS in process management
 Create and terminate user’s process and system’s process
 Block or re-execute a process
 Provide mechanism for process synchronization
 Provide method for processes’ communication
 Provide mechanism for controlling deadlock among processes
Process management
k
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Main memory: an array of byte(word); Each element has an
address; where data are accessed by CPU
 To be executed, a program must be given an absolute address
and loaded into main memory. When the program is running,
the system access instructions and data in main memory.
 To optimize CPU time and computer’s speed, some processes
are kept in memory
 The role of OS in main memory management
Store information about used areas in memory and who used
them
Decide which process will be fetched into main memory when the
memory is available.
Allocate and retrieve memory when it’s necessary
Main memory management
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Objective: hide physical devices' details from users to help
them operate easier.
 Input-Output system management includes
Memory management of buffering, caching, spooling
Communicate with device drivers.
Controller for special hardware devices. Only device driver
understand its associated-device’s specific structure
Input-Output system management
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Computer can store information on many types of storage
devices
 File: storage unit
 File management task
Creates/ deletes a file/directory
Provides operations over files and directory
Reflects file on secondary storage system
Backs up file system on storage devices
File management
file explorer
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Program is stored in secondary memory (magnetic disk) until
it’s fetched into main memory and executed.
 Disk is utilized for storing data and processed result.
 Data and result can be stored temporarily on disk: virtual
memory
 The role of operating system in disk management
Unused area management
Provide storage area as requested
Schedule disk accessing effectively
Storage memory management
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Distributed system combined of set of processor (sym/asym)
without common clock and memory. Each processor has a local
memory.
 Processor connected via transmission network
 Transmission is performed via protocols (FTP, HTTP...)
 Distributed system allow user to access different resource
 Access to sharing resources will allow
Increase computing speed
Increase data availability
Increase the system reliable
Data transmission system (Distributed system)
muốn chyeenr file từ máy này sang máy khác thì phải có FTP
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Multi users operate with the system at the same time ⇒
Processes have to be protected from other processes’
activities
 Protection is a controlling mechanism of program or user’s
access to system or resource
 Protection mechanism will require
Distinguish between legal or illegal usage
Set imposed controls
Provide tools for imposing
System’s protection
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
 Perform user’s command. Commands are provide for
operating system ‘s command controller to
 Create and manage process
 Manage main memory and storage memory
 Access file system
 Protect
 Network system
 . . .
 User interface can be command line (DOS, UNIX) or more
friendly with graphical interface (Windows, MacOS)
User interface
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
Some forms of human-computer interact
 Command line
 Simple but organized
 Do not require complex system specification
 Easy to add parameter
 Selection table
 Menu
 Popup
 Menu_popup: 2 method: on and onselect
 Symbol
window, icon, desktop
User interface
Chapter 1 Operating System Overview
6. Operating System structures
System’s components
Operating system’s services
System calls
Operating system’s structures
Chapter 1 Operating System Overview
6. Operating System structures
6.2 Operating system’s services
 Program execution: the system is able to load the program into
memory and execute it. Program must be finish execution in a
normal or abnormal (has error) way.
 Input-output operations: To increase the performance, programs
do not directly access IO devices. The OS has to provide means to
perform I/O.
 File system operations: Program is able to read, write, create or
delete file.
 Communication: Information exchange between running process
on the same computer or different computer in the network.
 Communication is performed via sharing memory or message
transferring technique.
 Error detection: Confirm work correctly by showing an error is
from CPU, memory, in devices or in programs. Each type of error,
OS has a corresponding way to handle.
Main and basic services
Chapter 1 Operating System Overview
6. Operating System structures
6.2 Operating system’s services
Not for user but for operate the system effectively
 Provide resources Allocate resource for many users or tasks
to perform at the same time
 Report statistics Store information of types and amount of
used resources for computing (usage cost), research
(system improvement)
 Protection Ensure all access to system resources are
controlled
Support services
Chapter 1 Operating System Overview
6. Operating System structures
System’s components
Operating system’s services
System calls
Operating system’s structures
Chapter 1 Operating System Overview
6. Operating System structures
6.3 System call
Provide an interface between process and operating system
System call
Chapter 1 Operating System Overview
6. Operating System structures
6.3 System call
Process management: initialize, terminate process..
Memory management: allocate and free memory...
File management: create, delete, read and write
file...
Input Output device management: perform
input/output...
Exchange information with the system. Example
get/set time/date...
Inter process communication
System call
Chapter 1 Operating System Overview
6. Operating System structures
System’s components
Operating system’s services
System calls
Operating system’s structures
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
MS-DOS structure (Silberschatz 2002)
phần mềm stay vĩnh viễn trong RAM
dùng layering struture vì nó
dễ debug so với thê hệ đùa
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
UNIX structure (Silberschatz 2002)
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
OS/2 structure (Silberschatz 2002)
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
Virtual machine(Silberschatz 2002)
VMWare architecture
VM coi os gióng như app khác
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
Client-Server Model (Tanenbaum 2001)
Chapter 1 Operating System Overview
6. Operating System structures
6.4 Operating system’s structures
Client-Server model in distributed OS (Tanenbaum 2001)
① Operating system notion
② History of Operating Systems
③ Definition and Classifications
④ Basic Properties of Operating Systems
⑤ Notions in operating systems
⑥ Operating System structures
⑦ Principles of Operating Systems
Chapter 1 Operating System
Overview
Chapter 1 Operating System Overview
7. Principles of Operating Systems
Principles of Operating Systems
Modul principles
Relatively localization principle
Macroprocessor principle
Initialization when start-up principle
Function overlap principle
Standard value principle
Multi-level protections principle
Summary
① Notion of Operating system
 Layering structure of OS
 OS’s functions
② History of Operating system
 History of computers
 History of Operating system
③ Definition and classification of OS
 Definitions
 Classification
④ Basic properties of OS
 High reliability
 Security
 Effective
 Generalize overtime
 Convenience
Chapter 1 Operating System Overview
⑤ Notions of Operating system
 Process and Thread
 System’s resources
 Shell
 System calls
⑥ Operating system’s structure
 OS’s components
 OS’s services
 System calls
 System’s structures
⑦ Principles of Operating
System
Operating System-Chap 1-EnglishHust-20231

More Related Content

PPT
unit1 part1.ppt
PPTX
Principles of operating system
PDF
01.osdoc
PPTX
The Brain Behind Your Device: A Deep Dive into Operating Systems
PPTX
Nt introduction(os)
PPT
OSLec1&2.ppt
PPT
Module-1 Introduction to operating system.ppt
PPTX
Operating_Systems_UNIT_Concept of an Operating System1.pptx
unit1 part1.ppt
Principles of operating system
01.osdoc
The Brain Behind Your Device: A Deep Dive into Operating Systems
Nt introduction(os)
OSLec1&2.ppt
Module-1 Introduction to operating system.ppt
Operating_Systems_UNIT_Concept of an Operating System1.pptx

Similar to Operating System-Chap 1-EnglishHust-20231 (20)

PPTX
Operating system-1
PPTX
OS - BACKGROUND HANDLING
PPTX
Operating system concept
PPT
CSE 370 - Introduction to Operating Systems
PPT
Section01-Overview.ppt
PPT
Operting system
PDF
os_1.pdf
PPT
Chapter - 1
PPT
An Overview of Operating Systems and algorithms.ppt
PPTX
Introduction _to_ OperatingSystem_1.pptx
PDF
1 intro and overview
PPT
Unit I OS CS.ppt
PDF
PPT
Operating System
PPT
Understanding Operating system concepts
PPTX
Unit 1 introduction to os
PDF
operating system notes by madhavi.pdf
PDF
ch01-2024-24010623999992525-bcc5755c.pdf
PPT
OS-ch01-2024.ppt
DOC
Operating Systems Unit One - Fourth Semester - Engineering
Operating system-1
OS - BACKGROUND HANDLING
Operating system concept
CSE 370 - Introduction to Operating Systems
Section01-Overview.ppt
Operting system
os_1.pdf
Chapter - 1
An Overview of Operating Systems and algorithms.ppt
Introduction _to_ OperatingSystem_1.pptx
1 intro and overview
Unit I OS CS.ppt
Operating System
Understanding Operating system concepts
Unit 1 introduction to os
operating system notes by madhavi.pdf
ch01-2024-24010623999992525-bcc5755c.pdf
OS-ch01-2024.ppt
Operating Systems Unit One - Fourth Semester - Engineering
Ad

Recently uploaded (20)

PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
STKI Israel Market Study 2025 version august
PPT
What is a Computer? Input Devices /output devices
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PPTX
Chapter 5: Probability Theory and Statistics
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PDF
Unlock new opportunities with location data.pdf
PDF
Architecture types and enterprise applications.pdf
PDF
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
Hindi spoken digit analysis for native and non-native speakers
PDF
August Patch Tuesday
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
A novel scalable deep ensemble learning framework for big data classification...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
A contest of sentiment analysis: k-nearest neighbor versus neural network
Benefits of Physical activity for teenagers.pptx
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
STKI Israel Market Study 2025 version august
What is a Computer? Input Devices /output devices
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Univ-Connecticut-ChatGPT-Presentaion.pdf
Chapter 5: Probability Theory and Statistics
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
sustainability-14-14877-v2.pddhzftheheeeee
Unlock new opportunities with location data.pdf
Architecture types and enterprise applications.pdf
Transform Your ITIL® 4 & ITSM Strategy with AI in 2025.pdf
A review of recent deep learning applications in wood surface defect identifi...
Group 1 Presentation -Planning and Decision Making .pptx
Hindi spoken digit analysis for native and non-native speakers
August Patch Tuesday
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
Ad

Operating System-Chap 1-EnglishHust-20231

  • 1. Operating Systems (Principles of Operating Systems) Đỗ Quốc Huy huydq@soict.hust.edu.vn Department of Computer Science School of Information and Communication Technology
  • 2. Text book: Operating System Concepts – Abraham Siblerschatz Modern Operating System – Andrew Tanenbaum Group Projects Course Info
  • 3. ① Notion of operating system ② History of operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 4. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 5. Chapter 1. Operating System Overview 1. Notion of operating system ① Notion of operating system Layered structure of a computing system Operating system’s functions
  • 6. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system A computer system’s structure  One/ many CPUs, controlling devices are linked by a common bus system to access a shared memory.  Controlling devices and CPU operate simultaneously and compete with each other. Input Output System Memory Bus Processor
  • 7. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system A computer system’s structure
  • 8. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system Operating systems turn ugly hardware into beautiful abstractions
  • 9. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system  A computer system’s components (Silberschatz 2002)
  • 10. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system  A computer system’s components (Tanenbaum 2001)
  • 11. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system  A computing system’s components  Hardware: Provides basic computing resources (CPU, memory, input- output devices)  Operating system: controls and cooperates hardware using works for application programs of different users.  Application programs: (compiler, database system, game...) utilizes computer’s resource to handle users’ requests.  Users: People who work/operate the machines or computers
  • 12. Chapter 1. Operating System Overview 1. Notion of operating system 1.1. Layered structure of a computing system  Objectives  Operating system lies between the system’s hardware and application program  Objectives: To provide an environment which helps user run application program and use the computer system easier, more conveniently and effectively.  Standardize the user interface for different hardware systems  Utilize hardware resource effectively and exploit the hardware performance optimally.
  • 13. Chapter 1. Operating System Overview 1. Notion of operating system ① Notion of operating system Layered structure of a computing system Operating system’s functions
  • 14. Chapter 1. Operating System Overview 1. Notion of operating system 1.2. Operating system’s functions ① Simulate a virtual computer machine ② Manage system resources
  • 15. Chapter 1. Operating System Overview 1. Notion of operating system 1.2. Operating system’s functions Simulate a virtual computer machine Help hide detailed works and exploit computer hardware’s functions easier and more effectively.  Simplify programming problem  No need to work with binary sequences  Each program thinks that it own the whole computer’s memory, CPU time, devices...  Help communicating with devices easier than with original device. Ex: Ethernet card: Reliable communication, ordered (TCP/IP)  Extend the system’s abilities: The system seem to have desired resources (virtual memory, virtual printer...)  Help programs not violating each other → a program which does not work would not damage the whole system  Useful for operating system’s development  If the experimental operating system get errors, only limited in the virtual machine  Help verifying other programs in the operating system
  • 16. Chapter 1. Operating System Overview 1. Notion of operating system 1.2. Operating system’s functions Simulate a virtual computer machine Non virtual machine With virtual machine
  • 17. Chapter 1. Operating System Overview 1. Notion of operating system 1.2. Operating system’s functions System’s resources management  System’s resources (CPU, memory, IO devices, files...) are utilized by program to perform a determined task.  Programs require resources: time (CPU-usage) and space (memory)  The operating system has to manage the resource so that the computer can work in the most effective way.  Provide resource for program when it’s necessary.  Competition handling  Decide the order of resource providing for the programs’ requirements  Example: memory resource management (limited)  Many program can operate at the same time.  Avoid illegal access  Data protection (memory sharing: file)
  • 18. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 19. Chapter 1. Operating System Overview 2.History of Operating Systems Operating systems development’s history History of electronic computer Operating systems development’s history
  • 20. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  1936 - A. Turing & Church present logic computing model and prove the existence of a computer: Turing machine Model of a character processing device; Simple but able to perform all the computer’s algorithm A Turing machine that is able to simulate any other Turing machine -> a universal Turing machine Turing is considered as the father of computer science and artificial intelligence
  • 21. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  1941- Konrad Zuse (German) Constructed world's first programmable computer; the functional program-controlled Turing-complete Z3 Z3: use binary system Has separated memory and controller Mechanical technique
  • 22. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  1946 ENIAC based on electric bulbs  18000 vacuum tube  70000 resistance  5 million metal connector Faster but least reliable
  • 23. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  plug board
  • 24. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  1950-1958 Transistor  1959-1963 Semiconductor  1964-1974 Integrated Circuit (IC)
  • 25. Chapter 1. Operating System Overview 2.History of Operating Systems 2.1. History of electronic computer Development history of electronic computers  1974-1990 Large scale IC: Allow CPU, main memory or similar device to be produced in a single integrated circuit -> new class of smaller, cheaper computer and parallel processor with multi CPUs  1990-now Very large scale IC, smart IC
  • 26. Chapter 1. Operating System Overview 2.History of Operating Systems Operating systems development’s history History of electronic computer Operating systems development’s history
  • 27.  1948-1970 : Hardware expensive; human labor cheap  1970-1981 : Hardware cheap; human labor expensive  1981- : Hardware very cheap; human labor very expensive  1981- : Distributed system  1995- : Mobile devices Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 28.  1948-1970 :  Computer 1-5 M$ : Nation ‘s property, mainly used for military’s purposes ⇒ Require optimization for using hardware effectively  Lack of human-machine interact  User, programmer; operator are same group of people  One user at a single time  User wrote program on punched cards  First card is bootstraps loader is loaded into memory and executed  Instructions in bootstraps loader fetch into memory and execute instructions on other later cards (application program)  Check light bulb for results, debug  Debugging is difficult  Waste processor time  Solution: batch processing Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 29.  1948-1970 : Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 30.  Batch processing and professional operator  Programmer give program to operator  Operator group program into a single pack (batch)  Computer read and run each program consequently  Operator take the result, print out and give to programmer Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems  Reduce waiting time between jobs  Input/output problem  Computer getting faster  Card reader still slow ⇒CPU has to wait for card reading/writing
  • 31.  Replace card reader by tape ⇒ Independent external computers for reading/writing data  External devices are designed to be able to Direct Memory Access, using interrupt and i/o channel  OS request I/O device then continue its work  OS receive interrupt signal when I/O devices finishes  ⇒Allow overlap between computing and I/O Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 32.   CPU is reprogrammed to be switch easily between programs  Hard ware: memory space larger and cheaper Some program can run simultaneously -> multi programming  More overlap between computing and I/O  Require memory protection between programs and keep one crashed program from damaging the system  Problem: OS has to manage all interaction ⇒ out of control (OS360: 1000 error) Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 33.  1970-1981 :  Computers prices about 10.000$ ⇒ used widely for different jobs  OS technology became stable.  Using cheap terminal device (1000$) allow many user to interact with the system at the same time  User perform different works (text editor, chat, program debugging,..) ⇒ require system to be exploited effectively Example: a PC: 10M calculation/s; typing speed 0.2s/1 character => lost 2M calculation per one typing ⇒ Time sharing operating system  Problem: system’s response time  Computer network was born (ARPANet : 1968) Communication between computer; Protection against network attack Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 34. Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems Time sharing system [FAIZAL MOHAMAD – Introduction to operating system]
  • 35.  1981-1995 :  Computers prices about 1000$; human labor 100K $/year ⇒ Computer are used more widely for working more effectively  Personal computing  Cheap computer, single person can afford (PC).  OS on PC  Hardware resources are limited (Early : 1980s)  OS become library of available procedures  Run One program at a time (DOS)  PC become more powerful  OS meet complex problems: multi tasking, memory protection... (WINXP)  Graphical user interface (MAC, WIN,..) Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 36.  DOS User interface Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems  Macintosh User interface
  • 37. Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 38.  Distributed systems  Development time of networking and distributed operating systems Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems  Local area network  Computers share resources: printer, File servers,..  Client / Server model  Services  Computing, storage  Services provided through Internet.  Problems  Transmission delay; bandwidth, reliable...  Virus (love letter virus 05/2000),..
  • 39. Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems  >45 millions computers were infected  Stole information  Auto send emails from contact list  Download Trojan
  • 40.  Mobile devices  Mobile devices become more popular  Phone, Laptop, PDA . . .  Small, changeable and cheap → More computers/human  Limited ability: speed, memory,...  Wide area network, wireless network  Traditional computer divided into many components (wireless keyboards, mouse, remoting storage)  peer-to-peer system  Devices with the same role working together  “Operating system’s” components are spread globally  Cloud computing  Cloud operating system Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 41.  Conclusion  The development of the operating systems are strongly connected with the computers’ development  Operating system development pulled the development of computers Chapter 1. Operating System Overview 2.History of Operating Systems 2.2. History of Operating Systems
  • 42. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 43. Chapter 1. Operating System Overview 3. Operating System definition and classification Operating System definition and classification Definitions Classifications
  • 44. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.1. Definition of operating system Observer’s perspective  Different objects have different requirements for operating system  Different observing perspectives ⇒ different definitions User: A system of programs that help exploiting the computing system conveniently Manager: A system of programs that help managing computing system’s resource effectively Technical perspective: A system of programs equipped for a specific computer to make a new logic computer with new resource and new ability System engineer perspective: A system of programs that modelize, simulate the operation of computer, user and operators. It work in a communicating mode in order to make a convenient environment for exploiting the computer system and maximum resource management.
  • 45. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.1. Definition of operating system System engineer’s perspective Simulate 3 roles ⇒ require 3 types of languages  Machine language  The only working language of the system  All other languages have to be translated into machine language  System operation’s language  OS commands (DOS: Dir, Del..; Unix: ls, rm,..)  Translated by the Shell  Algorithm language  Programming language  Compiler Mac- hine User Ope- rator Simulate the operation of Machine + User+ Operator Commu- nication Operating System
  • 46. Chapter 1. Operating System Overview 3. Operating System definition and classification Operating System definition and classification Definitions Classifications
  • 47. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification  Batch processing single program system  Batch processing multi program system  Time sharing system  Parallel system  Distributed system  Real-time processing system
  • 48. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Batch processing single program system  Programs are performed consequently follow predetermined instructions  When a program finished, the system auto run the next program without any external intervention  Require a supervisor process the sequence of jobs and the supervisor has to stay permanent in the memory  Need to organize a job queue  Problem: when a program access an I/O device, processor has to wait xong việc 1 thì load và làm việc 2, và tiếp tục
  • 49. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Batch processing multi program system  Allow many programs to run at the same time  Load one part of code and data of the programs into the memory (the remaining parts will be loaded at proper moments). The program are ready to run  Run the program similar to single program system  If the current program perform an IO, processor will be change to another program  Save memory (no need to load all the program into the memory)  Reduce processor spare-time  High cost for processor scheduling. Which program can use processor next?  Solve the memory sharing problem between programs phải đợi giữa các program thì sẽ tốn time phần còn lại thì laod trong external memory
  • 50. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Time sharing system  Processor’s usage allowance time is shared among ready-to-run programs  Similar to batch processing multi program system (only load part of the programs)  Processor is issued mainly by the operating system ⇒ how ? ⇒ Chapter 2  Swapping times between program are small -> programs seem to run parallel  Usually called: Multi tasking operating system (Windows) laod memory all off users to memory sử dụng chung CPU - giống như colab
  • 51. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Parallel system  Constructed for system that has many processors  Many processors, works are done faster  More reliable: one processor breaks down will not affect the system  Advantage over single processor computer due to memory, peripheral devices sharing...  Symmetric multi processing (SMP: symmetric)  Each processor run a single program  Processors communicate via a shared memory  Fault tolerance mechanism and optimal load balance  Problem: processor synchronization  Example: WinNT operating system Khi 1 processor bị lỗi , thì dùng procesork khác
  • 52. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Parallel system  Asymmetric multi processing (ASMP: asymmetric)  One processor controls the whole system  Other processors follow the main processor’s commands or predetermined instructions  This model has the master-slave relation form: The main process will make schedule for other processors  Example: IBM System/360 sẽ có một processor lmaf việc chính còn các cái khác làm việc phụ
  • 53. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Distributed system  Each processor has a local memory and communicate via transmission lines  Processors are different from sizes to functions (personal machine, workstation, mini computer,..)  Distributed system is used for  Resource sharing : provide a mechanism for file sharing, remote printer...  Increase computing speed: One computing operation is divided into smaller parts and performed on different places at the same time.  Safety: One position get problem, others can continue working có nhiều máy tính, mỗi máy tính có local memory trong, CPU và disk trong nó mỗi máy tính một chức năng reieng trong mạng mạng thường là vòng tròn
  • 54. Chapter 1. Operating System Overview 3. Operating System definition and classification 3.2. Operating System Classification Real-time processing system  Used mainly in controlling field.  Solve a problem no late than a specific time.  Each problem has a deadline  The system must generate correct result in a determined time period  This OS requires highly cooperate between software and hardware. controller của wahsing machine hard - deadline: nghĩa là k pass dealdine thì hậu quả khong thuờg soft - deadline thì k pas thì k sao vD: 2 giây để trách osbtacle, nhưng quá lâu, lúc xử lý xong thì dâm r phải săp xếp lịch trình, cái nào quan tọng hơn thì làm trước
  • 55. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 56. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Basic Properties of Operating Systems High reliability Secure Effectiveness General overtime/ Inherit and adaption Convenience
  • 57. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems High reliability Every actions, notations have to be accurate Only provide information when it’s surely correct When error happens: notify and stop the proceed or let the user decide Require support from device Example: C:/>COPY C:/F.TXT A: Bởi vì hgiht reliablity là khả năng câu lệnh đựo thực hiện chính xác, vậy thì Làm thế nào để check được nó thựuc hiện chính xác? xem phía dưới
  • 58. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems High reliability Example: C:/>COPY C:/F.TXT A: Check the syntax of command copy Check I/O card (motor, drive accessibility) Check for file F.TXT existence in C drive Check A drive Check if file F.TXT already existed in A drive Check if there is enough space in A Check if the disk is write protection Check written information (if required) ....
  • 59. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Basic Properties of Operating Systems High reliability Secure Effectiveness General overtime/ Inherit and adaption Convenience
  • 60. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Security Data and programs have to be protected No unwanted modification in every working mode Secure from illegal access Different resources have different protection requirements Many levels protections with various of tools Important for multi tasking system
  • 61. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Basic Properties of Operating Systems High reliability Secure Effectiveness General overtime/ Inherit and adaption Convenience
  • 62. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Effectiveness Resources are exploited thoroughly; Resource that is limited still able to handle complex requirement. The system need to maintain the synchronization; Slow devices do not affect the whole system operation
  • 63. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Basic Properties of Operating Systems High reliability Secure Effectiveness Generalizable overtime/ Inherit and adaption Convenience
  • 64. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Generalizable overtime System must be Inheritable Operations, notification can not change If changed: notify and with detailed guide (chkdsk/scandisk) Help keeping and increasing users System must have ability to adapt to changes that may happen  Example: Y2K problem; FAT 12/16/32
  • 65. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Basic Properties of Operating Systems High reliability Secure Effectiveness General overtime/ Inherit and adaption Convenience
  • 66. Chapter 1 Operating System Overview 4. Basic Properties of Operating Systems Convenience Easy to use Various effective levels Have many assisting system
  • 67. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 68. Chapter 1 Operating System Overview 5. Notions in operating systems Notions in operating systems Process and Thread System’s resources Shell System calls
  • 69. Chapter 1 Operating System Overview 5. Notions in operating systems 5.1. Process and Thread Process A running program Codes: Program’s executable instruction Program’s data Stack, stack pointer, registers Information that is necessary for running program Process >< program  Program: a passive object, contains computer’s instructions to perform a specific task  Process: program’s active state. code được load vào internal memory để chạy code được laod vào external memory
  • 70. Chapter 1 Operating System Overview 5. Notions in operating systems 5.1. Process and Thread Multi-process timesharing system: Periodically: OS pause one process and start another process Need to store processes’ information ⇒ process table One process can start other process Ex: OS’s Shell start a process to perform the command; when the command is done, terminate the started process Process can exchange information  One process can include many threads
  • 71. Chapter 1 Operating System Overview 5. Notions in operating systems 5.1. Process and Thread Thread A sequence/thread of instructions executed in the program Executable code, data Instruction pointer, stack, registers Heavyweight Process: process contains one thread Lightweight process: contains more than one thread Multi_Threading model: Threads running parallel, sharing process’s global variables thread là phàn nhỏ của prcoess process nặng thì chỉ làm đc 1 thread 1 lần process nhẹ thì làm được nhiều thread 1 lần trong web browser: - Mở trang web - Download dataa - Hiện thị data to user`
  • 72. Chapter 1 Operating System Overview 5. Notions in operating systems 5.1. Process and Thread
  • 73. Chapter 1 Operating System Overview 5. Notions in operating systems Notions in operating systems Process and Thread System’s resources Shell System calls
  • 74. Chapter 1 Operating System Overview 5. Notions in operating systems 5.2 System’s resources Definition  Everything that is necessary for a program to be performed  Space: System’s storage space  Time: Instruction executing time, data accessing time  System’s resources  Memory  Distinguished by: Storage size, directly access, sequent access  Levelled by: main memory/internal; extend, external  Notions’ distinguish: memory (physical area that contain data) and memory access (the process of searching for the data’s location in memory) là mọi thứ trong máy cần để chạy program
  • 75. Chapter 1 Operating System Overview 5. Notions in operating systems 5.2 System’s resources  System’s resources  Memory  Processor  System’s most important component  Access level: instruction  Processing time  Multi-processor system: each processor’s time is managed and scheduled independently  Peripheral devices  Retrieve, output information (I/O device)  Attached to the system via controller  Commonly considered peripheral devices-controller devices
  • 76. Chapter 1 Operating System Overview 5. Notions in operating systems 5.2 System’s resources Resource’s classification  Resource’s types Physical resource: physical devices Logic resource: variable; virtual devices  Sharing ability Sharable resource: at a specific time, it can be allocate for different processes. Example: Memory Non-sharable but dividable resource: Processes use the resource follow an order; Example: processor Non-sharable and non-dividable resource: at a specific time, only one process can use the resource. Example: Printer logical resources chỉ có một process mới được cùng tài nguyen này 1 lần, xong rồi mới chuyển dùng schedule kiểu một cái máy in chỉ được in 1 prcess 1 lần, do đó cần một virtual printer để in ảo trước, sau đó dùng 1 cáii printer daemon chứa process chuỷen 1 by 1 to real printer để in
  • 77. Chapter 1 Operating System Overview 5. Notions in operating systems 5.2 System’s resources Virtual printer  Resource allocated for user’s program in a changed form  Only appear when the system requires or when the system creates it  Automatically disappear then the system terminate or more precisely, when the process that works with this resource terminates Example: Virtual printer
  • 78. Chapter 1 Operating System Overview 5. Notions in operating systems Notions in operating systems Process and Thread System’s resources Shell System calls
  • 79. Chapter 1 Operating System Overview 5. Notions in operating systems 5.3 Shell  A special process: user and OS communication environment  Task Receive user’s command Analysis received command Generate new process to perform command’s requirement  Receives command from command’s line or graphical interface  Single task environment (MS-DOS): Shell will wait until one process finishes and then receive new command  In multi-tasking system (UNIX, WINXP,. . .) After creating and running new process, Shell can receive new command command line, graphical use interface là sheel parser để check parameter, behavior properly or not, kiểu check syntax
  • 80. Chapter 1 Operating System Overview 5. Notions in operating systems 5.3 Shell
  • 81. Chapter 1 Operating System Overview 5. Notions in operating systems Notions in operating systems Process and Thread System’s resources Shell System calls Kernel: là một tập con của shell Kernal là phần mềm để kết nối giữa shell và phần cứng là computer program kernel cần dược bảo vệ để tránh lỗi từ người dùng tác động vào.
  • 82. Chapter 1 Operating System Overview 5. Notions in operating systems 5.4 System calls  Provides environment for interacting between user’s program and the operating system  Programs utilize system calls to request services from operating system  Create, delete, use other software objects operated by the operating system  Every single system call is corresponding to a library of sub-programs (functions)  System calls are done in the form of  Instructions in low-levels programming languages  Interrupt requests (Int) in assembly language  API functions calls in Windows  Input parameters for the services and returned results are located in special memory areas  For example: when making request for an interrupt, the function name is stored in the register AH  Int 05 : print to monitor ; Int 13/AH=03h : DISK – WRITE/ DISK SECTOR
  • 83. Chapter 1 Operating System Overview 5. Notions in operating systems 5.4 System calls Example Func BOOL WINAPI ExitWindowsEx(int uFlags, int dwReason); uFlags Shutdown types EWX_LOGOFF EWX_POWEROFF EWX_ REBOOT End process and exit Windows Shutdown system and turn off computer Shutdown and restart computer dwReason Reason for shutdown API là một hàm có cá argurment để chạy mọt cái gì đó homework write donw program, try it on computer
  • 84. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 85. Chapter 1 Operating System Overview 6. Operating System structures System’s components Operating system’s services System calls Operating system’s structures
  • 86. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components Process management Main memory management Input Output system management Files management Storage memory management Data transmission system (network) Protection system User interface
  • 87. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Process: A running program  Process utilize system’s resources to complete its task  Resources are allocated when process created or while it’s running  Process terminates, resources are returned  It is possible for many processes to exist in the system at the same time  System process  User process  The tasks of OS in process management  Create and terminate user’s process and system’s process  Block or re-execute a process  Provide mechanism for process synchronization  Provide method for processes’ communication  Provide mechanism for controlling deadlock among processes Process management k
  • 88. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Main memory: an array of byte(word); Each element has an address; where data are accessed by CPU  To be executed, a program must be given an absolute address and loaded into main memory. When the program is running, the system access instructions and data in main memory.  To optimize CPU time and computer’s speed, some processes are kept in memory  The role of OS in main memory management Store information about used areas in memory and who used them Decide which process will be fetched into main memory when the memory is available. Allocate and retrieve memory when it’s necessary Main memory management
  • 89. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Objective: hide physical devices' details from users to help them operate easier.  Input-Output system management includes Memory management of buffering, caching, spooling Communicate with device drivers. Controller for special hardware devices. Only device driver understand its associated-device’s specific structure Input-Output system management
  • 90. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Computer can store information on many types of storage devices  File: storage unit  File management task Creates/ deletes a file/directory Provides operations over files and directory Reflects file on secondary storage system Backs up file system on storage devices File management file explorer
  • 91. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Program is stored in secondary memory (magnetic disk) until it’s fetched into main memory and executed.  Disk is utilized for storing data and processed result.  Data and result can be stored temporarily on disk: virtual memory  The role of operating system in disk management Unused area management Provide storage area as requested Schedule disk accessing effectively Storage memory management
  • 92. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Distributed system combined of set of processor (sym/asym) without common clock and memory. Each processor has a local memory.  Processor connected via transmission network  Transmission is performed via protocols (FTP, HTTP...)  Distributed system allow user to access different resource  Access to sharing resources will allow Increase computing speed Increase data availability Increase the system reliable Data transmission system (Distributed system) muốn chyeenr file từ máy này sang máy khác thì phải có FTP
  • 93. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Multi users operate with the system at the same time ⇒ Processes have to be protected from other processes’ activities  Protection is a controlling mechanism of program or user’s access to system or resource  Protection mechanism will require Distinguish between legal or illegal usage Set imposed controls Provide tools for imposing System’s protection
  • 94. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components  Perform user’s command. Commands are provide for operating system ‘s command controller to  Create and manage process  Manage main memory and storage memory  Access file system  Protect  Network system  . . .  User interface can be command line (DOS, UNIX) or more friendly with graphical interface (Windows, MacOS) User interface
  • 95. Chapter 1 Operating System Overview 6. Operating System structures 6.1 System’s components Some forms of human-computer interact  Command line  Simple but organized  Do not require complex system specification  Easy to add parameter  Selection table  Menu  Popup  Menu_popup: 2 method: on and onselect  Symbol window, icon, desktop User interface
  • 96. Chapter 1 Operating System Overview 6. Operating System structures System’s components Operating system’s services System calls Operating system’s structures
  • 97. Chapter 1 Operating System Overview 6. Operating System structures 6.2 Operating system’s services  Program execution: the system is able to load the program into memory and execute it. Program must be finish execution in a normal or abnormal (has error) way.  Input-output operations: To increase the performance, programs do not directly access IO devices. The OS has to provide means to perform I/O.  File system operations: Program is able to read, write, create or delete file.  Communication: Information exchange between running process on the same computer or different computer in the network.  Communication is performed via sharing memory or message transferring technique.  Error detection: Confirm work correctly by showing an error is from CPU, memory, in devices or in programs. Each type of error, OS has a corresponding way to handle. Main and basic services
  • 98. Chapter 1 Operating System Overview 6. Operating System structures 6.2 Operating system’s services Not for user but for operate the system effectively  Provide resources Allocate resource for many users or tasks to perform at the same time  Report statistics Store information of types and amount of used resources for computing (usage cost), research (system improvement)  Protection Ensure all access to system resources are controlled Support services
  • 99. Chapter 1 Operating System Overview 6. Operating System structures System’s components Operating system’s services System calls Operating system’s structures
  • 100. Chapter 1 Operating System Overview 6. Operating System structures 6.3 System call Provide an interface between process and operating system System call
  • 101. Chapter 1 Operating System Overview 6. Operating System structures 6.3 System call Process management: initialize, terminate process.. Memory management: allocate and free memory... File management: create, delete, read and write file... Input Output device management: perform input/output... Exchange information with the system. Example get/set time/date... Inter process communication System call
  • 102. Chapter 1 Operating System Overview 6. Operating System structures System’s components Operating system’s services System calls Operating system’s structures
  • 103. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures MS-DOS structure (Silberschatz 2002) phần mềm stay vĩnh viễn trong RAM dùng layering struture vì nó dễ debug so với thê hệ đùa
  • 104. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures UNIX structure (Silberschatz 2002)
  • 105. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures OS/2 structure (Silberschatz 2002)
  • 106. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures Virtual machine(Silberschatz 2002) VMWare architecture VM coi os gióng như app khác
  • 107. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures Client-Server Model (Tanenbaum 2001)
  • 108. Chapter 1 Operating System Overview 6. Operating System structures 6.4 Operating system’s structures Client-Server model in distributed OS (Tanenbaum 2001)
  • 109. ① Operating system notion ② History of Operating Systems ③ Definition and Classifications ④ Basic Properties of Operating Systems ⑤ Notions in operating systems ⑥ Operating System structures ⑦ Principles of Operating Systems Chapter 1 Operating System Overview
  • 110. Chapter 1 Operating System Overview 7. Principles of Operating Systems Principles of Operating Systems Modul principles Relatively localization principle Macroprocessor principle Initialization when start-up principle Function overlap principle Standard value principle Multi-level protections principle
  • 111. Summary ① Notion of Operating system  Layering structure of OS  OS’s functions ② History of Operating system  History of computers  History of Operating system ③ Definition and classification of OS  Definitions  Classification ④ Basic properties of OS  High reliability  Security  Effective  Generalize overtime  Convenience Chapter 1 Operating System Overview ⑤ Notions of Operating system  Process and Thread  System’s resources  Shell  System calls ⑥ Operating system’s structure  OS’s components  OS’s services  System calls  System’s structures ⑦ Principles of Operating System