OS - C1 - Introduction To OS
OS - C1 - Introduction To OS
FAC U LT Y O F I N F O R M AT I O N T E C H N O L O G Y
Chapter 1
Introduction to OS
Instr uctor : VU THI MY HANG, Ph.D.
TA / La b : LE QUOC H OA , M. S c .
HCM, 2024
Plan
OPERATING SYSTEM 2
Plan
OPERATING SYSTEM 3
WHAT and WHY?
operating system
computer hardware
OPERATING SYSTEM 5
WHAT and WHY?
OPERATING SYSTEM 6
WHAT and WHY?
OPERATING SYSTEM 7
WHAT and WHY?
Read file
“abc.txt”
working with
working with files track, sector, etc.
OS
OPERATING SYSTEM 8
Plan
OPERATING SYSTEM 9
Classification
OPERATING SYSTEM 11
Classification
Multiprogramming OS
Batch system vs. Multiprogramming system
Batch
CPU P1 Idle P1 P2 Idle P2
I/O P1 P2
Multiprogramming
CPU P1 P2 P1 P2
I/O P1 P2
OPERATING SYSTEM 12
Classification
OPERATING SYSTEM 13
Classification
OPERATING SYSTEM 14
Classification
OPERATING SYSTEM 15
Classification
OPERATING SYSTEM 16
Classification
OPERATING SYSTEM 18
Main components (QUẢN LÝ TIẾN TRÌNH VÀ TIỂU TRÌNH/LUỒNG)
OPERATING SYSTEM 19
Main components (QUẢN LÝ BỘ NHỚ)
Memory Management
• In a multiprogramming system, many programs to be executed
(i.e., process) are resident in memory simultaneously.
• OS deals with:
ü Memory allocation, deallocation, and protection (against invalid access)
ü Virtual memory management
o To have more space ...
o Programs loaded into memory partially ...
OPERATING SYSTEM 20
Main components (QUẢN LÝ TẬP TIN VÀ Ổ ĐĨA)
OPERATING SYSTEM 21
Main components (QUẢN LÝ HỆ THỐNG NHẬP/XUẤT)
I/O Management
• OS acts as an intermediary between I/O request and physical
devices (e.g., mouse, keyboard, screen, printer)
• OS deals with:
ü I/O hardware communication (e.g., device controller, DMA, polling,
interrupt I/O)
ü I/O software, which allows accessing and managing I/O operations (e.g.,
device driver, interrupt handler)
OPERATING SYSTEM 22
Main components
OPERATING SYSTEM 23
Main components
System Call
User
Application programs
mode Mode transition made via a
system call
System Call Interface
KERNEL
(NHÂN HỆ ĐIỀU HÀNH)
Kernel
mode Device drivers
System Call
C program calls “printf” function, which Windows and Unix System Calls
invokes “write” system call
OPERATING SYSTEM 25
Main components
OPERATING SYSTEM 26
Main components (HỆ THỐNG BẢO VỆ VÀ BẢO MẬT)
i n g
e a rn
-l
S e lf
OPERATING SYSTEM 27
Plan
OPERATING SYSTEM 28
OS structure (KIẾN TRÚC ĐƠN GIẢN)
Simple structure
• OS components are not well separated (e.g., MS-DOS)
• Application programs can access computer hardware directly
J Simple and easy to extend
L Vulnerable
ü What if an application program fails?
OPERATING SYSTEM 29
OS structure (KIẾN TRÚC MỘT KHỐI)
Monolithic structure
• OS components are combined into one single module (e.g.,
traditional UNIX systems)
• Each procedure (function) can call any other procedures
J Simple and fast
L Difficult to implement and maintain
User
Kernel
OPERATING SYSTEM 30
OS structure (KIẾN TRÚC PHÂN TẦNG)
Layered structure
• OS components are structured into layers (e.g., MULTICS)
• Each layer uses services (operations, functions) prepared by its
lower adjacent layer
ü layer N calls services defined in layer N-1
J Easier to implement and maintain than monolithic structure
L How to group services into layers? based on
functionality?
L When invoking a system call, a user program
may need to pass through many layers
à efficiency?
OPERATING SYSTEM 31
OS structure
Module structure
• A system consists of core kernel and additional services
implemented as modules linked dynamically (e.g., Solaris)
J Easier to add new service than modify the kernel
J Security
L Not a clear design
OPERATING SYSTEM 32
OS structure (VI NHÂN)
Microkernel structure
• Kernel only stores essential components of OS (e.g., Mach)
• Other components are implemented as user programs
J Easy to manage, extend and build new architecture
J Security and Reliability Application
Program
File
System
Device
Driver
user
User
mode
Interprocess memory
managment
CPU
scheduling
Kernel
kernel
Communication mode
microkernel
hardware
OPERATING SYSTEM 33
OS structure (KIẾN TRÚC LAI)
Hybrid structure
• A combination of various structures to address performance,
security and usability
• Common design in many modern OS (e.g., Linux, Mac OS X,
Windows, Android)
36
References
OPERATING SYSTEM 37
Topic 1