You are on page 1of 19

222:

( Operating Systems: Internals and


Design Principles, 6/E, William Stallings)

7





.

.
.
.

.
.
!

,
..
.
,
.

/,

.
..
,

.
3


T ..
(Memory Manager).

,


,
(swapping)

.


,

:
(relocation).
(protection).
(sharing).
(logical organisation).
(physical organisation).
5


,

.



.
,
().



( ).
T


(
).
8



.
..


.




.
9


( )

bytes,

:
(modules),
, .

,
:
.

(.. ).
10



.



.

.
,

..
11

.
.

12



.

(
),
,
.

13

(fixed partitioning).
(dynamic partitioning).
(simple paging).
(simple segmentation).

(virtual memory paging).

(virtual memory segmentation).
14


M
..,
.


,
.
..

.

15



(overlays)


,
.

( ) : ..
,
.
H
16
, .

,
( )

.

(internal fragmentation).

17


.
,
16




,
.

18



(placement
algorithm)
:

.

19


1


. :


.

.
,



.
20


2
, ,

.
A ,

(

,

, , .).
21

22

O
.

,


.

, .
..
OS/MFT (Multiprogramming with
a Fixed number of Tasks) IBM.

23


.

, .
,
(
).
T
.
,
,
.

24

:
T




.

25

:
1




.

26

:
2



,
.

(external fragmentation).
O Knuth h
n
( h=n/2). T
50% (fifty percent rule)
.
27

:
3
M
..


.

(compaction)
KME.
.. 1 MB
1 byte/msec ( 1 MB / sec)

.
28

OS (8M)
P2
P1
(14M)
(20M)
Empty (6M)

Empty
P4(8M)
P2
(56M)
(14M)
Empty (6M)
P3
(18M)
Empty (4M)
29

7.4






.
O




.
30


O (first-fit)


.
A
.
,

.
31

M
(next-fit)

.
Bays

.

( ).

,
.
,

.
32


O (best-fit)

(
).
A ,
,


.

.
33


O
(worst-fit)



.

.
34


T,
(quick-fit)

.
A

,

.
35

36


,


.
..


, .
O ..



.
37

1
(buddy system)
Knuth Knowlton,
.
H 2N
bytes, 1, 2, 4, 8, 16 bytes
.
, 1 MB,
21 , 1 byte 1 MB.
, 1 MB.
A 100 K,

128 K.

38

, 1 MB
512 K,
128 K .
A 256 K,
.
H

,
,
.

.
,

Unix.
39

40

41





.
, ,
.


.

(relocation).
42


.

.

.

.

.

.
43

44

H (
)
:
(base register),
(limit, bounds register).

O
( ) .




.
130K
CALL 100, CALL 130K+100
.
45


.
.

46


7.1

(frame)

(page)

(segment)


.


(.. ).

.
47

H
(page frames).
(
)
.
,
.

(page table)
.
T .
bits
(.. , .)
.

.

48


A.0
A.1
A.2
A.3
D.0
B.0
D.1
B.1
D.2
B.2
C.0
C.1
C.2
C.3
D.3
D.4
49

50


T
:


.



.


,
.
T
.

51

A

,
(segmentation)
.
O

.



.

52

H
(, , ,
)
. ,
.
T
(, , )
.
.. ,
.

.
( )
.



( ,
(modular programming), .)

53

54

55

56

You might also like