search
Log In
0 votes
94 views
A computer provides each process with $65,536$ bytes of address space divided into pages of $4096$ bytes each. A particular program has a text size of $32,768$ bytes, a data size of $16,386$ bytes, and a stack size of $15,870$ bytes. Will this program fit in the machine’s address space? Suppose that instead of $4096$ bytes, the page size were $512$ bytes, would it then fit? Each page must contain either text, data, or stack, not a mixture of two or three of them.
in Operating System 94 views

2 Answers

0 votes

A computer provides each process with 65,53665,536 bytes of address means 16 pages

program has a text size of 32,76832,768 bytes means 8 pages

program has a data size of 16,38616,386 byte means 5 pages

program has a stack size of 15,870 bytes means 4 pages

total 17 pages are required but 16 are available 

hence answer is  NO

0 votes

i) For 4096 bytes

65536 / 4096 = 16 pages(total)

text = 32768 / 4096 = 8 pages

data = 16386 / 4096 = 5 pages

stack = 15870 / 4096 = 4 pages

8+5+4 = 17, the answer is no.

ii) For 512 bytes

65536 / 512 = 128 pages(total)

text = 32768 / 512 = 64 pages

data = 16386 / 512 = 33 pages

stack = 15870 / 512 = 31 pages

64+33+31 = 128, the answer is yes.

Related questions

0 votes
0 answers
1
235 views
We consider a program which has the two segments shown below consisting of instructions in segment $0,$ and read/write data in segment $1.$ Segment $0$ has read/execute protection, and segment $1$ has just read/write protection. The memory system is a demand- paged virtual memory system ... $16$ Fetch from segment $1,$ page $4,$ offset $28$ Jump to location in segment $1,$ page $3,$ offset $32$
asked Oct 26, 2019 in Operating System Lakshman Patel RJIT 235 views
0 votes
0 answers
2
0 votes
1 answer
3
0 votes
0 answers
4
...