Skip to main content
Share Your Experience: Take the 2024 Developer Survey
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 ...
G-Man Says 'Reinstate Monica''s user avatar
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 ...
Abhishek Ghosh's user avatar
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 ...
Ran G.'s user avatar
  • 20.7k
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,...
andy_fingerhut's user avatar
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 ...
anonymous's user avatar
  • 156
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 ...
Lukas Cerny's user avatar
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 ...
David Richerby's user avatar
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 ...
Ashish Aggarwal's user avatar
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 ...
Gilles 'SO- stop being evil''s user avatar
3 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 (...
Gunnyvibes's user avatar
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 ...
fade2black's user avatar
  • 9,837
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 ...
Akash Mahapatra's user avatar
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 ...
vonbrand's user avatar
  • 14.1k
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) ...
Acsor's user avatar
  • 342
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 ...
Jörg W Mittag's user avatar
3 votes
Accepted

Which searching technique will cause lesser number of page fault?

Your assumption is wrong. If all data is in memory then there are no page faults. Now assume you have 100 pages, none in memory. Linear search will have on average 50 page faults. Binary search will ...
gnasher729's user avatar
  • 30.4k
3 votes
Accepted

When a CPU copies instructions from storage into RAM how does it jump to instructions no longer in RAM?

You have many memory pages - thousands 20 years ago, possibly millions today. When the next instruction is not in RAM, it is loaded for example from disk. Some other page of memory will be thrown out. ...
gnasher729's user avatar
  • 30.4k
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 ...
AProgrammer's user avatar
  • 3,069
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 ...
Yash's user avatar
  • 21
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.'s user avatar
  • 161k
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 ...
Grabul's user avatar
  • 1,870
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 ...
kelalaka's user avatar
  • 1,161
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.'s user avatar
  • 161k
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 ...
Kartheyan's user avatar
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. ...
user123's user avatar
  • 1,112
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 ...
orlp's user avatar
  • 13.6k
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 ...
Nathan Davis's user avatar
1 vote
Accepted

What happens when all reference bits set to 1 in Second Chance Page Replacement Algorithm?

Well, I found the answer in a textbook which is saying since there is a pointer looking for a page whose reference bit is 0, it will traverse the circular queue setting all reference bits to 0 and ...
M. Kaan's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible