Download download

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Matakuliah
Tahun
Versi
: H0344/Organisasi dan Arsitektur Komputer
: 2005
: 1/1
Pertemuan 14
Operating System 2
1
Learning Outcomes
Pada akhir pertemuan ini, diharapkan mahasiswa
akan mampu :
• Menghubungkan prinsip-prinsip memory
management proses komputasi
2
Outline Materi
• Memory Management
3
Memory management
• Swapping
• Partitioning
• Paging
• Virtual memory
• Translation lookaside buffer
• Segmentation
4
Memory management
Swapping
Disk storage
Disk storage
Main
memory
Operating
system
Long term
queue
(a) Simple job scheduling
Intermediate
queue
Completes jobs
and user sessions
Main
memory
Operating
system
Long term
queue
Completes jobs
and user sessions
(b) Swapping
5
Memory management
Fixed Partitioning
Operating system
8M
Operating system
8M
8M
2M
4M
6M
8M
8M
8M
8M
8M
8M
12 M
8M
8M
8M
(a) Equal size partitions
(b) Unequal size partitions
6
Memory management
Dynamic Partitioning
Operating
system
8M
Operating
system
8M
Operating
system
8M
Operating
system
8M
Process 1
20 M
Process 1
20 M
Process 1
20 M
Process 2
14 M
Process 2
14 M
22 M
Process 3
18 M
4M
(a)
(b)
(c)
Operating
system
8M
Operating
system
8M
Process 1
20 M
Process 1
20 M
14 M
Process 4
8M
Operating
system
Process 4
6M
Process 3
18 M
Process 3
4M
(e)
18 M
8M
Operating
system
8M
20 M
Process 2
14 M
Process 4
6M
8M
8M
6M
Process 3
4M
(f)
(d)
18 M
6M
Process 3
4M
(g)
18 M
4M
(h)
7
Memory management
Allocation of free frame
Free frame list
13
14
15
18
20
Process A
Page 0
Page 1
Page 2
Page 3
Free frame list
20
13
13
0 of A
14
14
1 of A
15
15
2 of A
16
In use
17
In use
18
3 of A
19
In use
16
17
In use
In use
18
19
Process A
Page 0
Page 1
Page 2
Page 3
In use
20
20
Process A
page table
(a) Before
13
14
15
18
(b) After
8
Memory management
Logical and physical address
Page
number
Logical
address
1
Relative address
within page
30
Main memory
Frame
number
Physical
address
14
Relative address
within frame
Page 0 of A
13
Page 1 of A
14
Page 2 of A
15
30
16
13
14
17
15
18
Page 3 of A
18
Process A page table
9
Memory management
Inverted Page Table Structure
Page #
Offset
Page table
Page #
Entry
Chain
Hash
Frame #
Page #
Hash table
Inverted page table
Offset
Real address
10
Memory management
Start
Return to faulted instruction
Operation of paging and
Translation Lookaside Buffer
CPU checks the TLB
Page table
entry in TLB?
Yes
No
Access page table
Page fault handling routine
OS instructions CPU
to read the page
from disk
No
Page in
main memory?
Yes
CPU activates
I/O hardware
Update TLB
CPU generates
physical address
Page transferred from
disk to main memory
Yes
Memory full?
No
Page table update
Page table update
11
Memory management
Translation Lookaside Buffer and cache operation
TLB operation
Virtual address
Page #
Offset
TLB
TLB miss
TLB hit
Cache operation
Real address
Tag
Hit
Remainder
Value
Cache
Miss
Value
Page table
Main
memory
12
Related documents