OS - Chap 1 - Eng - 2023
OS - Chap 1 - Eng - 2023
Đỗ Quốc Huy
[email protected]
Department of Computer Science
School of Information and Communication Technology
Course Info
Prerequisite:
• Introduction to information technology, Data structure
and algorithm
• C programming skill
Course Info
Objectives:
• Know clearly the components of a computer system,
problems and solutions in the history of computing system
development
• Master the algorithms used in the OS, be able to evaluate
algorithms, as well as be able to apply them to solve real-
life problems
• Understand basic Oss 'services (related to processes, threads,
network, memory, directories, files)
• Grasp knowledge of data structures used in OS, improve
concurrency programming capabilities, and system-level
programming
Course Outline
Chapters:
1.Introduction (2.5 weeks)
2.Process Management (5.5 weeks)
3.Memory Management (3 weeks)
4.Files Systems (2 weeks)
5.IO Management (1 week)
Group Projects
Course Info
Text book:
• Operating System Concepts – Abraham Siblerschatz
• Modern Operating System – Andrew Tanenbaum
• Bài giảng Hệ Điều Hành – Nguyễn Thanh Tùng
• Nguyên lý Hệ Điều Hành – Đỗ Văn Uy
• Others universities’ textbook
Class Expectations
Lectures
– Come! Cannot guarantee content will be identical to previous years.
– Meet your fellow students, they are your future teammate or
colleagues!
– Electronic devices used only for note taking.
Exams
– Attendance mandatory
Communication Policy
-Communicate with lecturer, classmate through Teams rather than
email
Chapter 1 Operating System
Overview
Bus
Processor
• 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.
Chapter 1. Operating System Overview
1. Definition of operating system
1.1. Layered structure of a computing system
Objectives
• Operating system lies between the system’s hardware and user’s
program
• Help programs not violating each other → a program which does not
work would not damage the whole system
• The OS has to manage the resource so that the computer can work in
the most effective way.
Chapter 1. Operating System Overview
1. Definition of operating system
1.2. Operating system’s functions
view of change
• 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
paper tape
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
Multi programming
• Hardware: memory space larger and cheaper => Some programs can
run simultaneously -> multi programming
1970-1981 :
• Computers prices about 10.000$ ⇒ used widely for
different jobs
1970-1981 :
• User perform different works (text editor, chat, program
debugging,..) ⇒ require system to be exploited effectively
1981-1995 :
• Computers prices about 1000$;
• Human labor 100K $/year
1981-1995 :
• 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 1 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
Distributed systems
• Development time of networking and distributed
operating systems
Distributed systems
• Problems
• Transmission delay; bandwidth,
reliable...
• Virus (love letter virus
05/2000),..
• >45 millions computers
were infected
• Stole information
• Auto send emails from
contact list
• Download Trojan
Chapter 1. Operating System Overview
2.History of Operating Systems
2.2. History of Operating Systems
Mobile devices
Mobile devices become
more popular
• Phone, Laptop, PDA . . .
• Small, changeable and
cheap → More
computers/human
• Limited ability: speed,
memory,...
Mobile devices
Conclusion
⚫Definitions
⚫Classifications
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
Observer’s perspective
❖User
❖Manager
❖Technical perspective
❖System engineer perspective
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
User’s perspective:
“A system of
programs that help
exploit the
computing system
conveniently”
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
Manager’s perspective
“A system of programs that help manage the computing
system’s resources effectively”
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
Technician's perspective
“A system of programs equipped for a specific computer to
make a new logic computer with new resources and new
abilities”
Chapter 1. Operating System Overview
3. Operating System definition and classification
3.1. Definition of operating system
⚫Definitions
⚫Classifications
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...
Distributed system
Distributed system
• Process
• System’s resources
• Shell
• Kernel
• System calls
Chapter 1 Operating System Overview
4. Notions in operating systems
4.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.
Chapter 1 Operating System Overview
4. Notions in operating systems
• System’s resources
• Processor
• Memory
• Peripheral devices
Chapter 1 Operating System Overview
4. Notions in operating systems
4.2 System’s resources
Notion
• Memory
• Distinguished by: Storage size, directly access,
sequent access
• Levelled by main memory/internal; extend, external
Chapter 1 Operating System Overview
4. Notions in operating systems
4.2 System’s resources
Resource’s classification
• Resource’s types
• Physical : physical devices
• Logical: variable; virtual devices
• Sharing ability
• Sharable: at a specific time, it can be allocated for different
processes. Example: Memory
• Non-sharable but dividable: Processes use the resource
follow an order; Example: processor
• Non-sharable and non-dividable : at a specific time, only one
process can use the resource. Example: Printer
Chapter 1 Operating System Overview
4. Notions in operating systems
4.2 System’s resources
Virtual resource
• Shell waits until the process finishes and then receive new
command
Kernel
Chapter 1 Operating System Overview
4. Notions in operating systems
⚫Process
⚫System’s resources
⚫Shell
⚫Kernel
⚫System calls
Chapter 1 Operating System Overview
4. Notions in operating systems
4.5 System calls
Example
• 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
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
Process management
• Process: A running program
• utilize system’s resources to complete its task
• Resources are allocated when process created or while it’s
running
• Process terminates, resources are returned
File management
System’s protection
User interface
User interface
• Selection table
• Menu
• Popup
• Menu_popup: 2
method: on and
onselect
Chapter 1 Operating System Overview
6. Operating System structures
6.1 System’s components
• Symbol
window, icon, desktop
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
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
System call
Chapter 1 Operating System Overview
6. Operating System structures
6.3 System call
System call
Provide an interface between process and operating system
a number is
associated
with each
system call
Chapter 1 Operating System Overview
6. Operating System structures
6.3 System call
System call
Example of how system calls are used in file copying
System call
⚫System’s components
⚫Operating system’s services
⚫System calls
⚫Operating system’s structures
Chapter 1 Operating System Overview
5. Operating System structures
5.4 Operating system’s structures
Layered Approach
Chapter 1 Operating System Overview
5. Operating System structures
5.4 Operating system’s structures
Layered Approach
Ex: Structure of THE (Technische Hogeschool Eindhoven), 1968
Layer Function
5 The operator
4 User programs
3 Input/output management
2 Operator-process communication
VMWare architecture
Chapter 1 Operating System Overview
5. Operating System structures
5.4 Operating system’s structures
• High reliability
• Secure
• Effectiveness
• General overtime/ Inherit and adaption
• Convenience
Chapter 1 Operating System Overview
6. Basic Properties of Operating Systems
High reliability
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
6. Basic Properties of Operating Systems
• High reliability
• Secure
• Effectiveness
• General overtime/ Inherit and adaption
• Convenience
Chapter 1 Operating System Overview
6. Basic Properties of Operating Systems
Security
• High reliability
• Secure
• Effectiveness
• General overtime/ Inherit and adaption
• Convenience
Chapter 1 Operating System Overview
6. Basic Properties of Operating Systems
Effectiveness
• High reliability
• Secure
• Effectiveness
• Generalizable overtime/ Inherit and adaption
• Convenience
Chapter 1 Operating System Overview
6. Basic Properties of Operating Systems
Generalizable overtime
• High reliability
• Secure
• Effectiveness
• General overtime/ Inherit and adaption
• Convenience
Chapter 1 Operating System Overview
6. Basic Properties of Operating Systems
Convenience
• Easy to use
• Modular
• Relativity in positioning
• Macroprocessor
• Initialization in the installation
• Functional repetition
• Standard values
• Multi-levels protection
Chapter 1 Operating System Overview
7. Principles of Operating Systems
⚫ Modular principle
I0 O0 I1 O1 In On
m0 m1 mn
Chapter 1 Operating System Overview
7. Principles of Operating Systems
Macroprocessor
Chapter 1 Operating System Overview
7. Principles of Operating Systems
Multi-levels protection
Physical Protection
Access Right
Encryption
Firewall
Access
Login
Data
Chapter 1 Operating System Overview
Summary
① Definition of Operating system ⑤ Notions of Operating system
⚫ Layering structure of OS ⚫ Process and Thread
⚫ OS’s functions
⚫ System’s resources
② History of Operating system
⚫ History of computers ⚫ Shell
⚫ History of Operating system ⚫ System calls
③ Definition and classification of OS
⚫ Definitions
⚫ Classification ⑥ Operating system’s structure
④ Basic properties of OS ⚫ OS’s components
⚫ High reliability
⚫ Security ⚫ OS’s services
⚫ Effective ⚫ System calls
⚫ Generalize overtime ⚫ System’s structures
⚫ Convenience
⑦ Principles of Operating System