Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 11.5, Problem 11.5PP
Program Plan Intro
IP addresses:
- The IP address denotes an unsigned integer that is 32-bit.
- The IP addresses is been stored by network programs in IP address structure.
- The addresses present in IP address structure are stored in network byte order.
- An unsigned 32-bit integer is converted from host byte order to network byte order by “htonl” function.
- An unsigned 32-bit integer is converted from network byte order host byte order by “ntohl” function.
- The IP address is presented to humans in a form known as “dotted-decimal” notation.
- Each byte is been represented by its corresponding decimal value and is separated by a period from other bytes.
Passing
- The arguments for “GET” requests are passed in the URI.
- The character “?” separates filename from the arguments.
- The character “&” separates each argument.
- The arguments do not allow spaces in it.
Server passes arguments to child:
- The server calls “fork” to create a child process and calls “execve” to run program in child’s context once it receives a request.
- The child process sets CGI environment variable values.
- The “adder” program can reference it at run time using “getenv” function of linux.
Output is sent by child:
- The dynamic content of a CGI program is to be sent to standard output.
- A CGI program sends dynamic content to standard output.
- It uses “dup2” function for redirecting standard output to connected descriptor associated with client.
- The result written to standard output by CGI program, it goes directly to client.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
I ONLY NEED 3 AND 4
Suppose memory has 256KB, OS use low address 20KB, there is one program sequence:
Prog1 request 80KB, prog2 request 16KB,
Prog3 request 140KB
Prog1 finish, Prog3 finish;
Prog4 request 80KB, Prog5 request 120kb
Use first match and best match to deal with this sequence
(from high address when allocated)
(1)Draw allocation state when prog1,2,3 are loaded into memory?
(2)Draw allocation state when prog1, 3 finish?
(3)use these two algorithms to draw the structure of free queue after prog1 , 3 finish
(4) Which algorithm is suitable for this sequence ? Describe the allocation process?
Write a C/C++ code to Implement the
following scenario:
An ISP is granted a block of addresses
starting with 190.100.0.0/16 (65,536
addresses). The ISP needs to distribute these
addresses to three groups of customers as
follows:
a. The first group has 64 customers; each
needs 256 addresses.
b. The second group has 128 customers; each
needs 128 addresses.
c. The third group has 128 customers; each
needs 64 addresses.
Design and Implement the sub blocks and
find out how many addresses are still
available after these allocations.
Consider a swapping system in which memory consists of the following hole sizes inmemory order: 12 MB, 4 MB, 20 MB, 12 MB,18 MB, 7 MB, 9 MB and 12 MB.Which hole is taken for successive segment requests of(a) 10MB(b) 15MB(c) 9 MBfor first fit, worst fit, and next fit?
Chapter 11 Solutions
Computer Systems: A Programmer's Perspective (3rd Edition)
Ch. 11.3 - Prob. 11.1PPCh. 11.3 - Prob. 11.2PPCh. 11.3 - Practice Problem 11.3 (solution page 967) Write a...Ch. 11.4 - Prob. 11.4PPCh. 11.5 - Prob. 11.5PPCh. 11 - Prob. 11.6HWCh. 11 - Prob. 11.7HWCh. 11 - Prob. 11.8HWCh. 11 - Modify TINY SO that when it serves static content,...Ch. 11 - Prob. 11.10HW
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Answer only 3 and 4 Suppose memory has 256KB, OS use low address 20KB, there is one program sequence: (20) • Prog1 request 80KB, prog2 request 16KB, • Prog3 request 140KB • Prog1 finish, Prog3 finish; • Prog4 request 80KB, Prog5 request 120kb • Use first match and best match to deal with this sequence • (from high address when allocated) • (1)Draw allocation state when prog1,2,3 are loaded into memory? • (2)Draw allocation state when prog1, 3 finish? • (3)use these two algorithms to draw the structure of free queue after prog1 , 3 finish(draw the allocation descriptor information,) • (4) Which algorithm is suitable for this sequence ? Describe the allocation process?arrow_forwardYou are given the following data about a virtual memory system:(a) The TLB can hold 512 entries and can be accessed in 1 clock cycle (1nsec).(b) A page table entry can be found in 100 clock cycles or 100 nsec.(c) The average page replacement time is 9 msec.If page references are handled by the TLB 99% of the time, and only 0.01%lead to a page fault, what is the effective address-translation time?arrow_forward4.19.16: [5] <COD §4.6>. In this exercise, we examine how pipelining affects the clock cycle time of the processor. Problems in this exercise assume that individual stages of the datapath have the following latencies: Also, assume that instructions executed by the processor are broken down as follows: (a) What is the clock cycle time in a pipelined and non-pipelined processor? (b) What is the total latency of an lw instruction in a pipelined and non-pipelined processor? (c) If we can split one stage of the pipelined datapath into two new stages, each with half the latency of the original stage, which stage would you split and what is the new clock cycle time of the processor? (d) Assuming there are no stalls or hazards, what is the utilization of the data memory? (e) Assuming there are no stalls or hazards, what is the utilization of the write-register port of the "Registers" unit? No hand written and fast answer with explanationarrow_forward
- MIPS: (a) What is total number of cycles to execute below code on 5-stage pipeline datapah? Assume you have full fast-forwarding scheme. (b) What is total number of cycles if you re-schedule the code to remove any pipeline hazards? lw $t1, 0($t0) lw $t9, 4($t0) add $t3, $t1, $t9 lw $t2, 8($t0) add $t7, $t1, $t2 sw $t7, 16($t0) lw $t5, 12($t0) add $t4, $t1, $t5 sw $t4, 20($t0)arrow_forwardYou are given the following data about a virtual memory system:(a)The TLB can hold 1024 entries and can be accessed in 1 clock cycle (1 nsec).(b) A page table entry can be found in 100 clock cycles or 100 nsec.(c) The average page replacement time is 6 msec.If page references are handled by the TLB 99% of the time, and only 0.01% lead to a page fault, what is the effective address-translation time?arrow_forwardIn the previous answers:Isn't 1 is supposed to be subtracted from the 64 as well? Malloc for x: Requested size: 10k Address returned to the caller: 32k + 1k = 33k (since x will be placed after the header of 1k) Address returned to the program: 33k Remaining free memory: 54k (64k - 10k) (here) Address of the remaining free memory: 43k andHere, the requested size is 20, why is 10 subtracted? Malloc for y (again): Requested size: 20k Address returned to the caller: 44k (previous address) Address returned to the program: 44k (previous address) Remaining free memory: 54k (64k - 10k) (here) Address of the remaining free memory: 64karrow_forward
- Q1. a) Let us assume that the CS and IP values of the base and offset of an ISR are 1230h and 2000h. The ISR is 10 lines of code where each line takes 4 bits to be stored. At which address, shall we find the IRET instruction? b) Describe the complete process of how an interrupt of type n (INTn) is serviced.arrow_forward1) What is the difference between the status and control flags? What are the status flags for the AEH+37H operation? 2) What is the aim of segmentation as well as physical address generation? Explain with a drawing and a numerical example? 3) What is the amount of the memory in each of the following cases? • All segments are • Overall memory is 4) Given the ES=3050H, SS=1298H, and CS-ABC3H, find the physical address for a) SP=2583H, b) DI=3399H, and c) IP=18F7H.arrow_forwardQ 1 Computer Science Theory and Fundamentals of Operating Systems: Reference String: 7,6,8,2,6,3,6,4,2,3,6,3,2,8,2,6,8,7,6,8 How many page faults will occur if the program has three page-frames available to it and use Optimal replacement?arrow_forward
- Section 5.5 states that modern server memory modules (DIMMs) employ SEC/DED ECC to protect each 64 bits with 8 parity bits. Compute the cost/ performance ratio of this code to the code from 5.9.1. In this case, cost is the relative number of parity bits needed while performance is the relative number of errors that can be corrected. Which is better?arrow_forwardI have a little bit problem with my late quiz for computer architecture, I get the answer from my lecturer but I still don't feel fully understand, can I ask for some help: In a computer system, the memory has 32 blocks and the cache has 8 blocks. Assume there is only one word per block with 4 bytes in one word. The reference sequence in terms of word location is 0, 2, 4, 10, 5, 12, 8, 18, 13. If the cache is direct-mapped, how many misses do we have if the cache is initially empty? Can you give the hit or miss for each reference?arrow_forwardIn this exercise, we examine how resource hazards, control hazards, and Instruction Set Architecture (ISA) design can affect pipelined execution. Problems in this exercise refer to the following fragment of MIPS code: sw r16,12(r6)lw r16,8(r6)beq r5,r4,Label # Assume r5!=r4add r5,r1,r4slt r5,r15,r4 Assume that individual pipeline stages have the following latencies: IF ID EX MEM WB200ps 120ps 150ps 190ps 100ps 1.1, For this problem, assume that all branches are perfectly predicted (this eliminates all control hazards) and that no delay slots are used. If we only have one memory (for both instructions and data), there is a structural hazard every time we need to fetch an instruction in the same cycle in which another instruction accesses data. To guarantee forward progress, this hazard must always be resolved in favor of the instruction that accesses data. What is the total execution time of this instruction sequence in the 5-stage pipeline that only…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education