operating-system


Calculating size of the page table


Consider a machine with 64 MB physical memory and a 32-bit virtual address space. If the page size is 4 KB, what is the approximate size of the page table ?
My Solution:
Number of pages in physical memory = (size of physical memory)/(size of page)
= 64 * 2^10 / 4
= 2^14
Number of pages in virtual memory = (size of virtual memory)/(size of page)
size of virtual memory = 2^32 bits
= 2^29 bytes
= 2^19 kBytes
Number of pages in virtual memory = 2^19/4 = 2^17
=> Number of entries in page table = 2^17
Size of each entry = 17+14 =31 bits
Size of page table = 31 * 2^17 bits
= 31 * 2^14 bytes
= 31 * 2^4 KB
= 31*16
= 496 KB
But the answer is 8 MB. Why?
The question has been asked before. However, there is not sufficient information in the question to determine the size of the page table.
It does not specify the size of the page table entries.
It does not specify the number of pages mapped to the process address space.
It does not specify the division between the process and system address pace. How much of the 32 bits is part of the process address space.
It does not specify whether this is a process or system table.
8MB cannot be the answer,
Physical Address Space = 64MB = 2^26B
Virtual Address = 32-bits, ∴ Virtual Address Space = 2^32B
Page Size = 4KB = 2^12B
Number of pages = 2^32/2^12 = 2^20 pages.
Number of frames = 2^26/2^12 = 2^14 frames.
∴ Page Table Size = 2^20×14-bits ≈ 2^20×16-bits ≈ 2^20×2B = 2MB.

Related Links

How to disable the sheet asking “Do you want to move the installer to the Trash?” after installation is complete
how to specify in test to use 'get file' from operating system library than ssh library in robotframework
What is Page fault service time?
grub-mkrescue generates corrupted iso
optimal time slice for timesharing operating system
A method of checking my cpu bit
How to refresh mapped driver before run our software?
Can every USB stick may be turned into a bootable USB?
pry - reload! behaves differently between OSes
will a page fault occur when one of the two processes executing the same program is completed?
Cross-built rpm; rpm install on target says: “intended for a different operating system”
Creating more privilege rings
How spooling requires memory protection?
Unable to install tidyr
How to test virtual machine performance in ubuntu 14.04?
What can be the possible values of C in the following code?

Categories

HOME
plesk
azure-functions
tomcat
seedstack
livecode
schema.org
exchange-server
postgresql-9.4
systemd
turbojpeg
save
native-base
angular2-template
hspi
gtk
siesta
amazon-emr
rangy
clish
outlook-restapi
spring-jpa
sonicwall
phonegap-build
pygobject
codefluent
nullreferenceexception
rxjs5
pyopencl
opentext
running-object-table
fatfs
copy-protection
nic
credit-card
location-services
windows2012
snap-framework
fotorama
om-next
creation
polyml
nppexec
cargo
microsoft-ui-automation
iscroll
stat
secure-coding
flipkart
coverage.py
vungle-ads
git-tfs
reverse-dns
kitura
android-5.0-lollipop
nusoap
visual-format-language
datediff
algebra
deedle
glimpse
gmaps.js
msxml
annotatorjs
haraka
dcount
clp
livecycle
between
strpos
vaadin4spring
distributed-cache
polymerfire
mercurial-extension
trust
onepage-checkout
ioexception
postal-code
compositetype
swagger-maven-plugin
fiware-bosun
adhoc-polymorphism
angular-ui-select
rpg
network-printers
code-complexity
incognito-mode
tabletools
accountmanager
flipboard
smips
progress-db
grails-2.3
django-facebook
postgres-xc
indesign-server
acceptance-testing
pacman
proc-open
linkbutton
xalan
voice-recording
msinfo32
uitextfielddelegate
autosize
haiku
vows
uipasteboard
solandra
ninject-interception
browser-based
.net-client-profile

Resources

Database Users
RDBMS discuss
Database Dev&Adm
javascript
java
csharp
php
android
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App