Sistemas Operativos - - PowerPoint PPT Presentation

sistemas operativos
SMART_READER_LITE
LIVE PREVIEW

Sistemas Operativos - - PowerPoint PPT Presentation

Sistemas Operativos


slide-1
SLIDE 1

Sistemas Operativos

  • corcuerp@unican.es
slide-2
SLIDE 2

Índice General

!"#$

Sistemas Operativos

  • !"#$

% %& ! %"

slide-3
SLIDE 3

What is an Operating System? '"( ''( )*

+ ,-&"

  • Sistemas Operativos
  • + -'&

+ .''(

slide-4
SLIDE 4

Operating System Definition )%

+ + "(/

  • )%

Sistemas Operativos

  • )%

+ ,& '

01'' 2'&'' 3'(''4

slide-5
SLIDE 5

Computer-System Operation 5)&'., '&' & '&'" .&55

Sistemas Operativos

  • .&55

" 5)'&" &.''' "

slide-6
SLIDE 6

Common Functions of Interrupts '& 6''' 6('' ''& '&''

  • Sistemas Operativos
  • (''

"& (7' "/

slide-7
SLIDE 7

Interrupt Handling 1'&''. "' ('''*

+

Sistemas Operativos

  • +

%(' '"-'

slide-8
SLIDE 8

Direct Memory Access Structure .''75)&"

  • &"-"

('. &

Sistemas Operativos

  • &

)"-6'' '"

slide-9
SLIDE 9

Computer-System Architecture 7 (

  • + -(6

+ &*

Sistemas Operativos

  • + &*

+ 1(*

! "

slide-10
SLIDE 10

How a Modern Computer Works

Sistemas Operativos

slide-11
SLIDE 11

Symmetric Multiprocessing Architecture A Dual-Core Design

Sistemas Operativos

slide-12
SLIDE 12

Operating System Structure + %-.5)&"

  • + 8!"34

.(',

Sistemas Operativos

  • .(',

+ "!"- + )!"&# + 9''(35),46)% (''!"

slide-13
SLIDE 13

Operating System Structure $%&', (''.('!"/' (''!"('6 + ('":; + '',

Sistemas Operativos

  • + ('":;

+ '',

  • + &!"'

) + <6* & ' + +(,

slide-14
SLIDE 14

Process Management , (-(''6

  • '-

+ .665)6

Sistemas Operativos

  • + .665)6

+ 8

/"

slide-15
SLIDE 15

Process Management %7'' ,,

+ ,/66

  • 7''

Sistemas Operativos

  • 7''

' 1'66

  • .

+ ",'.' 5'

slide-16
SLIDE 16

Distributed Computing 6"'6 (-'

+ $(-'

+ =$(-3,!-4 + 9$(-3.!-4

Sistemas Operativos

  • + 9$(-3.!-4

+ $(-3!-4

$(-)%&"( (-

+ '(,'

  • +
slide-17
SLIDE 17

Special-Purpose Systems 7"&

  • + >"66)%6

/"

Sistemas Operativos

  • + %"&
  • ?'

+ 6'6.66( + )%65)

slide-18
SLIDE 18

Web-Based Computing 9"'""/ && &"(-(("

  • Sistemas Operativos
  • $(&("

&* .-9(@A67 6'&&&=,9(B6('' "&

slide-19
SLIDE 19

System Calls '&&"' )% 1(''7&3CC4 "&''7& !)%!)' ''

Sistemas Operativos

  • !)%!)' ''
  • 1'9DE

9(6)%B)%B7" 3&&.$B6=,6 )%B46F&'F&&' 3F>4

slide-20
SLIDE 20

Example of Standard API 'G34' 9DEH

Sistemas Operativos

  • 'G34

+ ?$=H'" + =>)"H"(''("( + 9)"1H'"""'" + =9)"H'""' + =)>=&H&5)"

slide-21
SLIDE 21

Types of System Calls

+ 6" + 6, + 6 + "6" + (

Sistemas Operativos

  • + (

+ (&6& +

G

+ 6 + 6 + 6(6 + "

slide-22
SLIDE 22

System Calls &

+ /&6& + 6(6 + &"6&" + ''&

Sistemas Operativos

  • + 6

+ 6 + 66&" + 6 + 6& + + ''&

slide-23
SLIDE 23

Examples of Windows and Unix System Calls

Sistemas Operativos

slide-24
SLIDE 24

Traditional UNIX System Structure

Sistemas Operativos

slide-25
SLIDE 25

VMware Architecture

Sistemas Operativos

slide-26
SLIDE 26

The Process

+ 1'60 + &6 + "& G66&" + 1"&"

Sistemas Operativos

  • + 1"&"

+ 2

&6&

+ "(',"

,&I.-6 6 )"&

+ ,'

slide-27
SLIDE 27

Process State ,6'

+ **1'" + *", + **1'(&

Sistemas Operativos

  • + *1'("
  • + *1''',
slide-28
SLIDE 28

Diagram of Process State

Sistemas Operativos

slide-29
SLIDE 29

Process Scheduling ,8.6/-(' .' )&" ,,.

Sistemas Operativos

  • 3

+ 43 + ' + (3+ 6(, + 13+ (5)& + '&/

slide-30
SLIDE 30

Schedulers , 3!"'4+ ('''""'' / " 3.'4+ ('''",,

Sistemas Operativos

  • ('''",,

.

+ %''

slide-31
SLIDE 31

Schedulers %'7'&-&/ 34 3"4 =7'&-&/ 364 3"(4

Sistemas Operativos

  • + 1'7''
  • ""'*

+ 5/ + 5)' 6'." + ) + J(&."

slide-32
SLIDE 32

Process Creation )6(''6 '6

  • I6&

34

Sistemas Operativos

  • 34

'

+ '' + ''"< + ''

slide-33
SLIDE 33

Process Creation ,

+ ', + ('

Sistemas Operativos

  • + '

+ ''

.$B,

+ & ( + 0 & '< ('(

slide-34
SLIDE 34

C Program Forking Separate Process

#include <sys/types.h> #include <studio.h> #include <unistd.h> int main() { pid_t pid; /* fork another process */ pid = fork(); if (pid < 0) { /* error occurred */

Sistemas Operativos

  • if (pid < 0) { /* error occurred */

fprintf(stderr, "Fork Failed"); return 1; } else if (pid == 0) { /* child process */ execlp("/bin/ls", "ls", NULL); } else { /* parent process parent will wait for the child */ wait (NULL); printf ("Child Complete"); } return 0; }

slide-35
SLIDE 35

Interprocess Communication ('" " "'6' *

+ '

Sistemas Operativos

  • + '

+ + + &

3)41(

+ %' +

slide-36
SLIDE 36

Producer-Consumer Problem 6 '"

  • + '8'

"

Sistemas Operativos

  • "

+ '',"8

,*'*55(((-5&55

slide-37
SLIDE 37

Communications in Client-Server Systems %- '&3F&4

Sistemas Operativos

  • '&3F&4
slide-38
SLIDE 38

Sockets & 1'-6789:67 67 '6789

Sistemas Operativos

  • '6789

"(-

slide-39
SLIDE 39

Socket Communication

Sistemas Operativos

slide-40
SLIDE 40

Remote Procedure Calls 34" "((- " + 7,' '&

Sistemas Operativos

  • 1'7"'&

' 1'&7"&'6- '' 6' '&

slide-41
SLIDE 41

Single and Multithreaded Processes

Sistemas Operativos

slide-42
SLIDE 42

User Threads 1'"7&' " 1''"*

+ )%B) + 9DE'

Sistemas Operativos

  • + 9DE'

+ F&'

$ &(' ' 1((

+ =" + 7&""')%

slide-43
SLIDE 43

Pthreads "&'7&-7& )%B3;KKD;4' '8 "'&''"6

Sistemas Operativos

  • "'&''"6

&'" .$B3%6=,6 )%B4

slide-44
SLIDE 44

Pthreads Example

Sistemas Operativos

slide-45
SLIDE 45

Pthreads Example

Sistemas Operativos

slide-46
SLIDE 46

Classical Problems of Synchronization "(7 '8'

+ L7L" + 9" + 7''"

Sistemas Operativos

  • + 7''"
slide-47
SLIDE 47

Dining-Philosophers Problem

'''&'-

  • <('''"6
  • E'-

34"( + $"'6'"'

Sistemas Operativos

  • + $"'6'"'

(' 'A'' + %' L(34 %''-MAN 8;

slide-48
SLIDE 48

Overview of Real-Time Systems /'" (' &' 36"64 7('

Sistemas Operativos

  • 7('

' '7

  • "(''/

&7

  • &7-
slide-49
SLIDE 49

Features of Real-Time Kernels 7&'

  • + 77

+ 7/('

Sistemas Operativos

  • + 7/('
  • + G-/"

'('('&"7

slide-50
SLIDE 50

Implementing Real-Time Systems 67&* ;&67"' E&- D="8

Sistemas Operativos

slide-51
SLIDE 51

Minimizing Latency '(' &('&

Sistemas Operativos

slide-52
SLIDE 52

Dispatch Latency 1 '/ '''

Sistemas Operativos

slide-53
SLIDE 53

Real-Time CPU Scheduling /'. &34 '' '"(''" &

Sistemas Operativos

  • &

'

slide-54
SLIDE 54

Pthread Scheduling 1'' &7 ' ' ('7 '*

Sistemas Operativos

  • ;%?OGG)7 ''

GG%('GG)/1'7 '/ E%?O7 %?OGG),7 '/

slide-55
SLIDE 55

RTOS example: FreeRTOS G1)% 3'*55(((54 1 )&" 1= '"&*

Sistemas Operativos

  • + &"

+ &3" '-6! '84

slide-56
SLIDE 56

FreeRTOS '('*

+ &-6ED '; "&6E 3PD " QD4 + (('&3

Sistemas Operativos

  • + (('&3

('6'('( " CC4 + ("-' "' '(G6/6" ',

slide-57
SLIDE 57

Tasks in FreeRTOS G1)% ("-" '(' "'"'-

  • "6-&R

'3&4

Sistemas Operativos

  • '3&4

%&&"-*

+ -3&1-34463&1-3446 3,1-I346&1-%344 533&1-346&1-.346 &1-%346&1-346&1-G%344

slide-58
SLIDE 58

Life cycle of a task

Sistemas Operativos

slide-59
SLIDE 59

Tasks in FreeRTOS G1)% ("-" '(' "'"'-

  • "6-&R

'3&4

Sistemas Operativos

  • '3&4

%&&"-*

+ -3&1-34463&1-3446 3,1-I346&1-%344 533&1-346&1-.346 &1-%346&1-346&1-G%344

slide-60
SLIDE 60

Creating a task

  • "&1-34

+ $&*'(''- + -*&'-1' " + "&1*''-'-(1'8 '-'-DE"3P"4 %-' ;KK6'PKK"3P;KK4("

Sistemas Operativos

  • %-' ;KK6'PKK"3P;KK4("

+ )*&'- 6'& '- + 0)*&'-6""(K BO)1%+ ; + 0$&*'(''- '-'&"''6'"&$.==

slide-61
SLIDE 61

Creating a task

portBASE_TYPE xTaskCreate( pdTASK_CODE pvTaskCode, const signed portCHAR * const pcName, unsigned portSHORT usStackDepth, void *pvParameters, unsigned portBASE_TYPE uxPriority, xTaskHandle *pxCreatedTask ); void ATaskFunction( void *pvParameters ) { /* Variables can be declared just as per a normal function. Each instance

Sistemas Operativos

  • /* Variables can be declared just as per a normal function. Each instance
  • f a task created using this function will have its own copy of the

iVariableExample variable. If the variable is declared static only one copy of the variable would exist and would be shared by each task. */ int iVariableExample = 0; /* A task will normally be implemented as in infinite loop. */ for( ;; ) { /* The code to implement the task functionality will go here. */ } /* Should the task implementation ever break out of the above loop then the task must be deleted before reaching the end of this function. The NULL parameter passed to the vTaskDelete() function indicates that the task to be deleted is the calling (this) task. */ vTaskDelete( NULL ); }

slide-62
SLIDE 62

Deleting a task

  • ,1-34
  • ,1- (''&

(''-(

void vTaskDelete( xTaskHandle pxTask );

9'-6"-

Sistemas Operativos

  • 9'-6"-

'-"- $'"

slide-63
SLIDE 63

FreeRTOS example: installation & PC Demo G1)% MG1)%>QDK,N '*55((( 6 '*55(((( 7(77(DE7;@, 6 M*S91)N

Sistemas Operativos

  • M*S91)N

+ " 6 G

" G1)%SSS(! '& ;@D6#*

//vStartComTestTasks( mainCOM_TEST_PRIORITY, serCOM1, ser115200 );

slide-64
SLIDE 64

FreeRTOS example: installation & PC Demo " 96 GA3-4% & "6" '& !" ,! 8

Sistemas Operativos

slide-65
SLIDE 65

FreeRTOS example: installation & PC Demo

Sistemas Operativos

slide-66
SLIDE 66

FreeRTOS example: Simulator ! >CCEK;K, "S9DE7%>S9$DE %"7TL % GQ %"7T% "

Sistemas Operativos

  • %"7T% "

8

slide-67
SLIDE 67

FreeRTOS example: simulator

Sistemas Operativos