04 Operating Systems

download 04 Operating Systems

of 14

  • date post

    24-Oct-2014
  • Category

    Documents

  • view

    461
  • download

    0

Embed Size (px)

Transcript of 04 Operating Systems

[4]

1

001:

. . . . . .

:2 3

(software) .

4

1

[4]

:4 5

: (system software) /. . . (applications software) . . .

..:

..: (word processor) (web browser)

:6 7

: (operating systems):Unix, Windows,Ubuntu,.. (device drivers): . (utilities):.. ,. , (assemblers, compilers):.. C++. : ..Emacs,Acrobat Reader, Firefox,Real Player, .. : .. ,, ,.. : .. MS Office, Lotus Notes.

2

[4]

8 9

(,operating system,OS) : /. /. . . /.

10 11

/.,(booting process): 4. . RAM / .

/.,(booting process): 1. ROM. 2. . RAM 3. , , .

ROM

ROM

3

[4]

12 13

:Windows

: / ; RAM

: . / ROM.

ROM

:Mac OS14 15

:Ubuntu

4

[4]

:Linux16 17

:Palm OS

:Symbian OS18 19

:Android OS

5

[4]

20 21

. .

: /,: 1. (single-user):PalmOS,SymbianOS. 2. (multi-user):Windows,Linux, MacOS. : 1. (single-tasking):PalmOS, SymbianOS. 2. (multi-tasking):Windows, Linux, MacOS.

: 22 23

: , (operator) /,. / . , .

6070,/,, ,. /. /, (punch cards) (). (, job).

6

[4]

: 24 25

: RAM

, (batches) ,. ,/ ,. (batch processing) .

#1 #4 #3 #2

/

ROM

: 1. . 2. #1. 3. #1 . . 4. #2. 5. #2 . 6.

:26 27

: RAM

RAM

: #2 . , #3 : (multi programming). i ) . (/), .

#2

#4 #3 #2 #1

ROM

ROM

..: 1. . 2. #1. 3. #1 . 4. #2. 5. #2 5 #2 . 6. (process).

7

[4]

:28 29

: RAM

RAM

: #2 , #3 . #3 : (time sharing). ., , ,...

. , . ,( ), . / (virtual machine).

#4 #3 #2 #1

#4 #3 #2 #1

ROM

ROM

:30 31

:

, : 1. , 2. (,/ ,/).

, Task Manager Windows.

8

[4]

:32 33

:: ; : . , (logical addresses):.. . , (physical addresses). (address binding).

LOAD 200 R1 LOAD 201 R2 +14 -10 RAM

70 71 200 201

,RAM 0. RAM, . . : ; ..,LOAD 200 R1 +14 200 ;

LOAD 200 R1 LOAD 201 R2 +14 -10 RAM

70 71 200 201

:34 35

:#4

RAM#1

, , RAM . (single contiguous memory management). .: : ; : ...

#5 #3 #2

RAM

#1

, . , . , . (partitioning).

9

[4]

:36 37

: : (pages). (frames),. . . (paging).

#4

#5

#2

RAM

#1

: , , ( ). , . : : ; : ,...

#4,.#5 #4,.#4 #3,.#2 #3,.#1 #4,.#3 #2,.#3 RAM #4,.#2 #2,.#2 #4,.#1 #2,.#1 #1

:38 39

: ; , .

#4,.#5 #4,.#4 #3,.#2 #3,.#1 #4,.#3 #2,.#3 RAM #4,.#2 #2,.#2 #4,.#1 #2,.#1 #1

: ; : !; . , (, ) . (virtual memory): .

10

[4]

40 41

(.. ).

.

(,,, ,), .s 1 s.

.

.

,..: , , .

: 16 ,, 4, 5, 1, ;

42 43

: 16 , , 4, 5, 1, ;

16

5 5

? ?

: 4 5 1 1 1 () 11, 16 11=5.

4

1

11

[4]

44 45

P

: , ;

. (CPU scheduling algorithm).

P P,: 1. P , 2. P , 3. P , 4. (P). 34, (preemptive).1 2, (non-preemptive).

46 47

: p1, p2, p3, p4, p5 ( ) :p1 140 p2 75 p3 p4 p5 320 280 125

: 1. 1 (first-come first-served FCFS): first-served, FCFS): . 2. (shortest job next, SJN): . 3. (round robin, RR): ( ) . 1 (time slice)., , .

FCFS,SJN,RR, FCFS SJN RR Gantt (Gantt chart) ; (Gantt ..)

12

[4]

48 49

: SJN, : p2, p5, p1, p4, p3 Gantt:0 75 200 340

: FCFS, : p1, p2, p3, p4, p5 Gantt:0 140 215 535

p1 140

p2 75

p3 p4 p5 320 280 125

p1 140

p2 75

p3 p4 p5 320 280 125

815

940

620

940

p1

p2

p3

p4

p5

p2

p5

p1

p4

p3

50 51

: ; : . (average turnaround time) .

: RR, : p1, p2, p3, p4, p5, p1, p2, p3,... Gantt ( 50):0 50 100 250 325 515

p1 140

p2 75

p3 p4 p5 320 280 125

640

940

p1 p2 p3 p4 p5 p1 2 p3 p4 p5 1 p3 p4 5 p3 p4 p3 p4 p3 4 3

,(turnaround time) .

13

[4]

52 53

, ,SJN . SJN :1.

: , Gantt;0 140 215 535 815 940

p10 75

p2200 340

p3620

p4

p5940

: (140+215+535+815+940)/5 = 529 p2 p5 p1 p4 p32.

. (starvation). ( ( , .)

: (75+200+340+620+940)/5 = 4350 50 100 250 325 515 640 940

p1 p2 p3 p4 p5 p1 2 p3 p4 p5 1 p3 p4 5 p3 p4 p3 p4 p3 4 3 : (515+325+940+920+640)/5 = 668

54

. . . . . .

14