11
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM

COT 4600 Operating Systems Spring 2011

  • Upload
    rafe

  • View
    29

  • Download
    0

Embed Size (px)

DESCRIPTION

COT 4600 Operating Systems Spring 2011. Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM. Last time: Computer system organization; operating systems The hardware layer The software layer – the file abstraction Case studies - UNIX File System Today: URLs - PowerPoint PPT Presentation

Citation preview

Page 1: COT 4600 Operating Systems Spring 2011

COT 4600 Operating Systems Spring 2011

Dan C. Marinescu

Office: HEC 304

Office hours: Tu-Th 5:00 – 6:00 PM

Page 2: COT 4600 Operating Systems Spring 2011

Last time: Computer system organization; operating systems The hardware layer The software layer – the file abstraction Case studies - UNIX File System

Today: URLs Soft modularity

Procedure call conventions and the memory map; the stack Errors Strongly-typed languages help enforce modularity.

Enforced modularity; message passing and the client-server model. Example of a client –server system: WWW

Next time Client-server organization Heterogeneity; little-endian and big-endian representation Timing, response time. Trusted intermediaries Case study the X11 system.

Lecture 10 – Tuesday, February 15, 2011

Lecture 10

Page 3: COT 4600 Operating Systems Spring 2011

The name-mapping algorithm for an URL Example: http://www.cs.ucf.edu/~dcm/Teaching/COP4600-Fall2010/ClassIndex.html

The string before “:” (colon) identifies the protocol used, e.g., “http”. The string between “//” and the following “/” the host name passed to

DNS (Domain Name Server) to resolve (e.g., www.cs.ucf.edu) The browser uses the protocol (in our case http) to open the connection

with the http-server on the host with the IP address returned by DNS and to locate the file /~dcm/Teaching/COP4600-Fall2010/ClassIndex.html

If the file is found then the http-server send the file

Lecture 10

Page 4: COT 4600 Operating Systems Spring 2011

Example: procedure MEASURE (func)

start_time GET_TIME(SECONDS)

funct()

end_time GET_TIME(SECONDS)

return (end_time-start_time)

procedure GET_TIME (units)

timeCLOCK

time CONVERT_TO_UNITS(time,units)

return time

Lecture 10

Page 5: COT 4600 Operating Systems Spring 2011

Machine code for MEASURE

100 ST R1,SP //save content of R1 on the stack

104 ADD 4, SP //increment stack pointer

108 ST R2, SP //save content of R2 on the stack

112 ADD 4, SP //increment stack pointer

116 LA R1, SECONDS //load address of the argument in R1

120 ST R1, SP // store address of the argument on the stack

124 ADD 4, SP // increment stack pointer

128 L A R1,148 // load return address in R1

132 ST R1, SP // store return address on the stack

136 ADD 4, SP //adjust top stack pointer

140 L A R1, 200 // load address of GET_TIME in R1

144 JMP R1 //transfer control to GET_TIME

148 S 4,SP // decrement stack pointer

152 L R2, SP // restore the contents of R2

156 S 4,SP // decrement stack pointer

160 L R1,SP // restore the contents of R1

164 S 4,SP // decrement stack pointer

168 ST R0, start // store result passed by GET_TIME in Ro into start

Lecture 10

Page 6: COT 4600 Operating Systems Spring 2011

Machine code for GET_TIME

200 L R1,SP //load address of the stack pointer in R1

204 S R1,8 //increment stack pointer

208 L R2, R1 //load address of the argument in R2

212 code for the body of GET_TIME

216 code for the body of GET_TIME

220 L R0, time // load in R0 the result

224 L R1,SP // reload in R1 address of the stack pointer

228 S R1,4 // decrement the stack pointer

231 L PC,R1 // load return address from stack into PC

Lecture 10

Page 7: COT 4600 Operating Systems Spring 2011

Procedure call convention

1. Caller 1. saves on the stack (after each operation it adjusts the SP)

1. registers

2. arguments

3. return address

2. transfers control to the calle (jump to its starting address)

2. Calee 1. loads from the stack the arguments

2. carries out the desired calculation and load the results in a register (R0)

3. transfers control back to the caller loads in the PC the return address to the caller

3. Caller 1. adjusts the stack

2. restores its registers

Lecture 10

Page 8: COT 4600 Operating Systems Spring 2011

text

stack

data

Lecture 10

Page 9: COT 4600 Operating Systems Spring 2011

D ata

S erver residence tim e.W eb page is created onthe fly

U ser's H TTP request S YN

S YN

A C K

A C K + H TTP request

TC P connectionestab lishm ent

R TT

U ser's H TTP requestfor an im age

S erver residence tim e.Im age is re trived fromdisk

D ata

H TTP request

A C K

A C K

Browser W eb Server

Lecture 10

Page 10: COT 4600 Operating Systems Spring 2011

Threadhandlingan HTTPrequest

W eb Server

H T T P request

R esourceR eposito ry

Loca l cache

Threadhandlingan HTTPrequest

H T T Presponse

W ebBrowser

C lient

P ersisten t/N onP ersistent

H TTPconnection

C lien t

TC Pport

H T T P request

H T T P response

A n H TTP requst con ta ins one o f the fo llow ing m ethods:G E T - ge t a resourceH E A D - verify the link and cond itions o f a resourceP O S T - input to a resource , usua lly a C G I scrip tP U T - s to re a resource a t the serverD E LE TE - de le te a resourceTR AC E - inc lude a ll headers in a response

W eb Cache

S am ple H TTP sta tus code in a response100 - C ontinue200 - O K205 - R eset C onnection301 - M oved P erm anently402 - Paym ent R equried404 - N ot Found405 - M ethod N ot A llowed407 - P roxy A uthentica tion R equ ired415 - U nsupported M ed ia Type500 - In terna l S erver E rro r504 - G ateway T im eout505 - H TTP version N ot S upported

Lecture 10

Page 11: COT 4600 Operating Systems Spring 2011

Client server interactions in HTTP

HTTP clientWeb Browser

HTTPserver

TCPport80

request

response

HTTP clientWeb Browser

HTTPserver

Proxy

request to proxy

response to proxy

response to client

HTTP clientWeb Browser

HTTPserver

Tunnel

request to server

request to server

response to client

response to client

request to server

Lecture 10