You are on page 1of 7

HỆ ĐIỀU HÀNH

CHAPTER 1
-Have 4 component of a Computer system

-OS is a resource allocator


control program
extended machine
-The one program running at all times on the computer is the kernel
-Dual mode operation
-User mode (application)
-kernel mode (OS kernel)
-Transition between user/kernel mode
interrupt-HW device requests OS services
trap-userprogram requests OS services
exception-error handling
-Bootstrap program is loaded at power-up or reboot
ROM
filmware
EPROM
-There are two other types of programs: system
programs, application programs

-A trap is a software-generated interrupt caused either by an error or a


user request
An operating system is interrupt driven
- 2 Type of interrupt has occurred
Polling
vectored
-Storage-Device Hierarchy
-Multiprocessor Systems:
Advantages include: 1. Increased throughput
2. Economy of scale
3. Increased reliability graceful degradation or fault tolerance
Two types:
1. Asymmetric MultiProcessing (AMP)
2. Symmetric MultiProcessing (SMP)
AMP
Chia sẽ công viêc->phụ thuộc vào boss
Each processor is assigned a specific task(mỗi bộ xử lí cv cụ thể)
A boss processor controls the systems, schedules and allocates work to
processors
The other processors look to the boss for instruction or have predefined
tasks(tìm kiếm sự chỉ dẫn của boss or có các nv được xác định trước)
SMP - The most common multiprocessor systems use
Tự chủ->quá tải
Each processor performs all tasks within the OS(mỗi bộ xử lí thực hiện all nv
trong os)
No boss-worker relationship
All processors share physical memory
-Clustered
Provides a high-availability service which survives failures
Asymmetric clustering has one machine in hot-standby mode
Symmetric clustering has multiple nodes running applications, monitoring each other
-Dual-mode operation allows OS to protect itself and other system component
-Network is a communications path
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
-6 type of cloud compting: Public, private, hyvate cloud, soft as a service, planform as a
service, infrastructures

CHAPTER 2 Operating System Structures


-Tiến trình xuất hiện khi có chương trình đang thực thi
-Operating system service
Protection (insider): involves ensuring that all access to system resources
is controlled
Security (outsider)of the system from outsiders requires user
authentication, extends to defending external I/O devices from invalid access
attempts
-System Calls
Mostly accessed by programs via a high-level Application Program
Interface (API) rather than direct system call use
System calls can be grouped roughly into six major categories: process control, fil
management, device management, information maintenance, communications
(message passing, shared memory mode), and protection.
-Operating System Design and Implementation
-User goals and System goals
User goals operating system should be convenient to use, easy to learn, reliable, safe,
and fast
System goals operating system should be easy to design, implement, and
maintain, as well as flexible, reliable, error-free and efficient
Mechanisms determine how to do something;
Policies determine what will be done.
-Simple structure
MS-DOS written to providethe most functionality in the least space (vì bị giưới hạn
bởi phần cứng đang chạy)-4 phần
UNIX limited by hardware functionality, the original UNIX operating system had
limited structuring. The UNIX OS consists of two separable parts Systems programs-2
phần:system call, kernel
The kernel : consist of every thing below the system and above the physical hardware, provice
file system, cpu scheduling,..
-Layered approach
Tầng cao sử dụng dv do tầng dưới cung cấp
The operating system is divided into a number of layers
(levels), each built on top of lower layers.

Advantages: Tính modules (đơn giảng hoá việc gõ rối và kiểm tra hệ thống)
Disadvantages: Định nghĩa các tầng, kém hiệu quả (ineffective), mất thời gian thực hiện lâu
hơn khi thực hiện trên hệ thống không phân tầng

CHAPTER 3 Processes
A process include: program counter, stack, data section
One program can be several processes
Process state:
5 trạng thái: new, running, waiting, ready, terminated
Process Scheduling
Maintains scheduling queues of processes: Job queue, ready queue, device queue(tuỳ
vào số thiết bị sẽ có có device tương ứng)
Witch: giảm chi phí chuyển ngữ cảnh-reduce the cost of context witching
Long-term in job queue (The long-term scheduler controls the degree of
multiprogramming)
Short-term in ready queue
Processes can be described as either: I/O bound(có khuynh hướng ko sd cpu), CPU
bound(tiến trình có khuynh hương sd cpu đến khi ht thời gian giành cho nó)
A process that has terminated, but whose parent has not yet called wait(), is
known as a zombie process.
Now consider what would happen if a parent did not invoke wait() and
instead terminated, thereby leaving its child processes as orphans
Two models of IPC: shared memory, message passing
CHAPTER 4 CPU Scheduling
Dispatch latency time it takes for the dispatcher to stop one
process and start another running
Turnaround time of submission of a process to the time of completion (từ lúc tới cho đến khi
hoàn thành công việc)
Waiting time amount of time that a process spends waiting in the ready
Responsen time is the time from the submission of a request until the first response is
produced

-Priority Scheduling
Problem=Starvation low priority processes may never execute
A major problem with priority scheduling algorithms is indefinit blocking, or
starvation

Solution=Aging as time progresses increase the priority of the process


A solution to the problem of indefinite blockage of low-priority processes is
aging

CHAPTER 5 Process Sychronization


Race condition: conditions: when two or more processes/threads
are reading or writing some shared data and the final
results depends on who runs precisely when:Interrupts, interleaved
operations/execution
Mutual exclusion & critical regions (CS)
Mutual exclusion: make sure if one process is using a shared variable or
file, the other processes will be excluded
Critical regions/sections: the part of the program where the share
memory is accessed
4 conditions to provide mutual exclusion
No 2 processes simultaneously in critical region
No assumptions made about speeds or numbers of CPUs
No process running outside its critical region may block another process
No process must wait forever to enter its critical region
Each process must ask permission to enter critical section in entry section(Especially
challenging with preemptive kernels)
Những gì thực hiện bên trong CS mang tính chất nguyên tử(atomic)-tức phải thực hiện cho
xog công việc

-Solution to Critical Section Problem


Mutual Exclusion- tại 1 thời điểm chỉ có 1 tiến trình
Progress-không có quy trình nào đang thực thi và có 1 tiến trình muốn vào=>xem xét
để cho vào
Bounded Waiting- No process must wait forever to enter its critical region
Counting semaphores- có thể âm, trị tuyệt đối của chính nó cho biết bao nhiêu tiến trình đang
đợi tài nguyên
Busy waiting: ngồi đợi cho đến khi được sd tài nguyên=>tốn tài nguyên
Non- Busy waiting: go somewhere to do something until được sd tài nguyên

CHAPTER 6 Deadlocks
-4 conditions for Deadlock
Mutual exclusion
Hold and wait
No preemption
Circular wait
Đồ thị cấp phát tài nguyên(1 tn-1 th.hiện)
Cách phát hiện deadlocks Banker’s(1tn-nhiều thể hiện)
If graph contains no cycles no deadlock
if only one instance per resource type, then deadlock
if several instances per resource type, possibility of deadlock
Ensure that the system will never enter a deadlock state:
Deadlock prevention
Deadlock avoidance
Deadlock Prevention
Mutual Exclusion
Hold and Wait
No Preemption
Circular Wait

You might also like