9
votes
Is page size always equal to frame size?
A page is a region of virtual address space, and a page frame is a region of physical memory. A page which maps a region of physical memory must have the same size as that piece of physical memory, ...
7
votes
Why do we need the valid-invalid bit in a page table?
As David Richerby says, it’s not clear what you don't understand.
Most of my answer here has already been presented in answers (or comments)
to the questions you linked to.
I’ll admit, though, that ...
6
votes
Accepted
Why does page size affect page table size?
Suppose you have a virtual address space of say $32$ bits. Then the virtual address space for each and every process is fixed and it ranges from the byte $0$ to $2^{32}-1$.
Now the for the ease of ...
5
votes
Accepted
What are logical addresses and where do they actually reside?
Well, this is the entire point of "virtual memory".
When your program runs, the OS makes it believe it has all the memory just for itself. That is, addresses 1 to 10,000 (say), are all empty and ...
5
votes
Accepted
How does a TLB lookup compare all keys simultaneously?
Computer hardware is fundamentally parallel. Even a modern single CPU core is pipelined, meaning that at the same instant in time, one physical part of the CPU is initiating a fetch of an instruction,...
4
votes
What is the difference between a page and thread?
You're looking at very vague descriptions and asking "What's the difference between these things that haven't been described properly?" For a more detailed understanding, you should, well, look for ...
4
votes
Accepted
Operating system maintains copy of page table for each process
why does it keep copy of instruction counter and register contents?
It's because of process scheduling.
Let's say a process comes in execution first time and executes some lines of instruction. The ...
4
votes
Why do we need the valid-invalid bit in a page table?
Think of a simple scenario, where you have process A's page table. OS swaps out some of the pages, hence some of the page table entries will be invalidated and invalid bit has to be set.
From ...
4
votes
Accepted
Difference between present - absent bit and valid - invalid bit in a page table?
Many people confuse these two bits. I'll try to explain the concept to best of my knowledge.
Let's say we have 32 bit architecture. so process virtual address space(VAS) will have size of 2^32. VAS ...
4
votes
Why does paging not have external fragmentation?
The details depend on the processor architecture, but the principle is the same everywhere. All page tables of a given type at a given level have the same size. When all memory blocks have the same ...
3
votes
What is the difference between caching, buffering and paging? Expecting a detailed answer on the OS level
Paging, caching, and buffering are too broad topics to cover in a single post. Briefly, they serve different purposes:
Operating systems use paging as a memory management scheme. A computer stores ...
3
votes
Accepted
Virtual Address and Physical Address Space
When we are using Virtual Memory, we are translating from a Virtual Address Space to a Physical Address Space.
To understand why it requires $2^{35}$ entries, consider the page size. In order to byte ...
3
votes
Accepted
How to calculate virtual address space from page size, virtual address size and page table entry size?
Since Logical address size is 47 bit, that means logical address space is 2^47 bytes ( assuming system is byte addressable ).
Otherwise in general if the logical address is not given then also it can ...
3
votes
Accepted
When is it best to use the second chance replacement algorithm?
Farthest-in-future is optimal, second chance can't be better. Second chance is a way to approximate LRU when the required hardware (access times, sort them) isn't available. Both try to approximate ...
3
votes
Accepted
Paging only for user code. What about kernel code?
Other than the fact that kernels tend to be small, as Yuval points out, you should also consider that they are often not relocatable code (in fact, address binding for kernels is done at compile-time) ...
3
votes
Accepted
How does caching, paging, virtual memory, and OS all tie together for UNIX copy-on-write?
It seems like your understanding of the matter is pretty good. You are just missing one tiny trick: Make the pages read-only.
When the OS forks the process, it maps ...
2
votes
Question on Virtual memory and Physical memory
The page entry contains other things than the base of the physical page. Typically:
a present or absent bit (to handle the case where the page is not present in the memory: is on disk or just does ...
2
votes
Calculate the size of Logical and Physical Address
We know
logical address contains: page number and page offset (page size)
physical address contains : number of frames and frame size
Logical address space contains 32 pages and to represent 32 pages ...
2
votes
If you increase the address space for an OS, does the Phys Mem used by the program increase?
No. Due to the way virtual memory works, you can have more virtual pages than physical pages (frames). Some virtual pages might not be mapped to any physical page.
It doesn't really make sense to ...

D.W.♦
- 156k
2
votes
Operating System: Performance of Demand Paging
CPUs keep in special purpose caches recently addressed page table entries. Entries are usually named "TLB = Translation Lookaside Buffer"
We have 3 cases :
The page is in TLBs and the access is ...
2
votes
Accepted
Explain Hashed page tables in operating system
Definitions (What's with the symbols?)
In the diagram, we have these guys:
Virtual Page Number (VPN): p, q
Page Frame Number (...
2
votes
Accepted
How does hashed inverted page table work?
From your picture, one definitely see a hash table collision solution. If one carefully examine it, will see that the table uses itself to solve the collision, that is Open Addressing.
In open ...
2
votes
Accepted
Is physical pages zeroed out before it's mapped to a virtual page?
Yes, the kernel zeroes out pages before allocating them to a user-level process. The details depend on the specific operating system; some may zero it out when the page is needed, others might run a ...

D.W.♦
- 156k
2
votes
Accepted
Why do we need hashed page tables for Paging in Operating Systems?
There are several advantages of hashed page tables over the standard flat/hierarchal page tables. One of these being size, a hashed page table will use less space in memory than using a flat or ...
2
votes
Understanding how internal fragmentation occurs in systems using only paging with huge page size
Internal fragmentation occurs because the OS cannot allocate less than one page to a certain process. This implies that the last chunk of code/data for a process will take one page no matter its size. ...
2
votes
Why does page size affect page table size?
The page table isn't a fixed size. Assuming all memory of the system is in use, and no clever tricks to group pages are used, the page table has a size equal to the amount of memory divided by the ...
2
votes
Memory (physical addressing)
The whole point of using the abstraction of virtual addresses (which is to say, giving every process the illusion that it has all the memory reserved for itself) is to free the application software ...
1
vote
Accepted
Linux OS/HW VM cooperation
Why? Because this design works pretty well and meets the requirements, and most alternative don't or would be more expensive or slower. In particular, this division of responsibilities lets the ...

D.W.♦
- 156k
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
paging × 97operating-systems × 71
memory-management × 50
virtual-memory × 48
computer-architecture × 5
cpu-cache × 5
process-scheduling × 5
memory-allocation × 5
algorithms × 4
hash-tables × 3
memory-hardware × 3
cpu × 2
os-kernel × 2
cache × 2
page-replacement × 2
data-structures × 1
terminology × 1
reference-request × 1
hash × 1
memory-access × 1
performance × 1
threads × 1
filesystems × 1
storage × 1
garbage-collection × 1