Questions tagged [paging]

Questions about memory-management techniques where the computer manages and transfers data between main memory and secondary storage in pages -- discrete chunks of a fixed size. Operating systems often use paging to implement virtual memory.

Filter by
Sorted by
Tagged with
1 vote
0 answers
28 views

How is the physical address calculated in Page tables?

Taking an example, say we have Page size = 4KB, Page Table Entry = 4B, Physical Address Space requires 36 bits In 3-level multi-paging, let's say the number of entries in the level 3 page table is 2^9 ...
parsingstreet's user avatar
0 votes
0 answers
21 views

What if the size of the logical address is not power of two?

If the logical address and the page size are power of two, then we can separate the virtual address into two parts: page number and offset. Is this still valid if the virtual address is not power of ...
AAA's user avatar
  • 43
0 votes
0 answers
19 views

Physical memory address space

When you address physical memory, in the kernel, is it just another value like 0xf78f9 just like virtual addresses (and the only thing that is different is that the ...
user129393192's user avatar
0 votes
1 answer
43 views

Memory (physical addressing)

From my understanding, physical memory (main memory -- DRAM) is addressed differently than disk. This is all a bit of an abstraction to me, and I am hoping to make my understanding more concrete. ...
user129393192's user avatar
0 votes
1 answer
64 views

Page allocation for a program

When my professor explained how the OS handles memory, he described demand paging, and how when a process starts up, the code page with the first instruction is loaded into memory, and everything else ...
user129393192's user avatar
0 votes
0 answers
16 views

An excercise on Pagin and Page tables

I have an exercise on paging and page tables that I can't get my head around. So the data is: my virtual addresses are 32 bits long, 1 page is 1 KiB, 1 PTE is 32 bits big and 1 page table is 1 page. ...
Christoph Sanders's user avatar
0 votes
0 answers
83 views

How to calculate page number of pages and page size for multilevel paging?

I have the following virtual address: +---------+----------+----------+ + 7 Bit x | 13 Bit y | Offset d + +---------+----------+----------+ I now have the ...
David Krell's user avatar
3 votes
1 answer
80 views

How does caching, paging, virtual memory, and OS all tie together for UNIX copy-on-write?

In my OS course, the instructor mentioned the following: In UNIX if a parent process creates a new child ("fork") then the child is an exact duplicate of the parent. This means its memory ...
Mohammed Arshaan's user avatar
0 votes
1 answer
157 views

What is the relationship between virtual address and physical address?

I am recently studying the operating system, and I found the paging system a little bit confusing, for example, what will happen when there is a 52-bit virtual address and a 40-bit physical address, ...
Eric's user avatar
  • 17
0 votes
2 answers
237 views

How many bits are needed to reference physical vs virtual addresses?

I trying to learn about virtual memory at the moment and one of the explanations I've look at has a diagram like below. You can see that 32 bit virtual addresses are used so the virtual address space ...
jaduuuui's user avatar
0 votes
2 answers
745 views

Calculate Physical Address Corresponding to Logical Addresses

Consider a logical address space of 4096, page size = 1024 physical memory = 8192 $\begin{array} {|c|c|} \hline \text{Page No} & \text{Frame No} \\ \hline 0 &7 \\ \hline 1 &4 \\ \hline 2 &...
Pasan Karunarathna's user avatar
0 votes
0 answers
47 views

Question Regarding number of frames required for multilevel page tables

I have a problem and I'm not sure where I am going wrong with this, description so as you can see it is given a 3 level paging system with 8 bit page index on every level, now I break down logical ...
Pawan Nirpal's user avatar
2 votes
0 answers
81 views

Exceeding limits of virtual address space

I still am confused whether I am asking the right question but here goes Consider a X bit processor. It can address theoretically a main memory of 2^x bytes(assuming byte addressable). Now consider an ...
Rinkesh P's user avatar
  • 1,018
0 votes
1 answer
69 views

Can Operating system allocate a page of process to any free frame in memory?

Consider I have a user program of 6 pages and 4 byte page size. Now my memory has 300 frames out of which 10 frames are free for allocation. Can the OS allocate page 1 of the given process to any of ...
Owl0223's user avatar
1 vote
2 answers
603 views

How could a page be invalid in demand paging?

I was reflecting on what I learned about demand paging and I have a question: In demand paging, we have entries in the page table only for frames that are present in physical memory. So I was ...
tonythestark's user avatar
2 votes
3 answers
4k views

Why does page size affect page table size?

I am revising operating systems theory (I'm Italian, forgive me for bad English) and there is a slide that states: If page size is small then we avoid internal fragmentation (I get that) but we have ...
tonythestark's user avatar
0 votes
2 answers
1k views

Understanding how internal fragmentation occurs in systems using only paging with huge page size

The excerpt below is from the OS text by Galvin et. al. When we use a paging scheme, we have no external fragmentation: any free frame can be allocated to a process that needs it. However, we may ...
Abhishek Ghosh's user avatar
0 votes
1 answer
185 views

Are Paging and page cache the same in Operating system?

I was looking at paging in OS. It seems like there are two concepts with the same name but with different features, and I wanted to be clear about those, Paging and page cache. Before I thought paging ...
sy choi's user avatar
0 votes
1 answer
120 views

Are pages moved to the disk when the process is scheduled?

When process A has run long enough and the scheduler decides to run process B, will all the pages of process A be moved to the disk or they remain in the main memory?
Yuv's user avatar
  • 139
0 votes
1 answer
470 views

Where are process pages stored - in the swap space or under file system? Can demand paging work without space space?

The Galvin OS text says that on older systems, there used to be a method, where the entire running process (when in idle state) was moved from the main memory (when main memory ran low) to the disk ...
Abhishek Ghosh's user avatar
1 vote
0 answers
46 views

How could one construct a TLB so that not all the bits of the presented address need match to result in a hit?

I was wondering besides the typical matching of all bits in the presented address to the resulting page, is there another way of doing so? what are the benefits/ cons and how would one go about doing ...
I'veGotSomeQuestions's user avatar
1 vote
1 answer
2k views

How page table base register (PTBR) is used to locate the correct frame using Page Number?

I was reading about paging in OS , and one of the things I saw was the page table base register (PTBR). If the CPU generates a logical address (Consists of Page number + Offset) it needs to be mapped ...
Colin Jack's user avatar
4 votes
1 answer
1k views

Why do we need hashed page tables for Paging in Operating Systems?

I understand that we might need hierarchical paging to handle page tables with sizes greater than the size of one frame, but what is the use of Hashed Page tables then? I would understand if we were ...
Soumya Sen's user avatar
2 votes
1 answer
91 views

Paging only for user code. What about kernel code?

Why is paging done only for user code (user space)? I know that the basic intuition behind paging is for managing larger logical address space in smaller physical main memory space. Won't the kernel ...
Nascimento de Cos's user avatar
0 votes
1 answer
857 views

When is it best to use the second chance replacement algorithm?

I'm going through 'Operating Concepts' by Silberschatz, Galvin and Gagne (The Dinosaur Book) and it mentions the Second-Chance Algorithm (not enhanced) as an improvement on the FIFO replacement ...
selfstudy777's user avatar
1 vote
1 answer
497 views

Is physical pages zeroed out before it's mapped to a virtual page?

I don't how this works. According to me if the physical memory is not cleared then there is some security risk as there may be some sensitive information in it from the other processes. How does the ...
Athul P's user avatar
  • 13
5 votes
1 answer
739 views

How does a TLB lookup compare all keys simultaneously?

I am reading OS Concepts dinosaur book which says, "Each entry in the TLB consists of two parts: a key (or tag) and a value. When the associative memory is presented with an item, the item is compared ...
mLstudent33's user avatar
1 vote
1 answer
433 views

Paging - access less than a page of memory

I'm having a bit of trouble understanding how less than a page of memory can be used. From what I understand, memory is given out in page size chunks - say pages are 4096 bytes, and 4 bytes are ...
johnramsden's user avatar
0 votes
0 answers
86 views

How many page-table entries are needed in case the program uses the whole logical address space

Say I have: page size = 2^12 bytes physical memory = 2^24 bytes logical address space = 2^32 How many page-table entries are needed in case the program uses the whole logical address space?
john gonidelis's user avatar
-2 votes
1 answer
713 views

Converting physical address to logical

In 8-bit address space there are 16 pages and the page table stores: 68792EA51BD3CF04 (hex) The physical address is 39h, what is the corresponding logical address? I have literally no idea what to ...
Shuubi's user avatar
  • 1
1 vote
1 answer
90 views

How are logical addresses of instruction operands mapped to physical addresses?

Is address translation for all operands in single instruction done only once and then are all operands fetched continuously? For example, consider any dummy instruction ...
RajS's user avatar
  • 1,637
0 votes
2 answers
2k views

Why does paging not have external fragmentation?

I have read that paging does not suffer from external fragmentation as the frames and the pages are all of the equal sizes, but when we store a last level page table in a frame at that time it may not ...
user avatar
0 votes
1 answer
942 views

Understanding paging and internal fragmentation

I am currently studing questions but stuck on this one, I hope someone can help me out to understand. Question: Assume that we have a paged virtual memory with a page size of 4Ki byte. Assume that ...
nihulus's user avatar
  • 115
2 votes
2 answers
3k views

Difference between present - absent bit and valid - invalid bit in a page table?

while reading I found this: Present/Absent bit – Present or absent bit says whether a particular page you are looking for is present or absent. In case if it is not present, that is called Page ...
vivek gupta's user avatar
2 votes
1 answer
851 views

What does it mean " The outer level page table need not be page aligned?

The question is in context to multilevel page table. I was trying to solve numerical on multi-level paging and noticed that page size might not be same at all levels. I came across the point "Outer ...
Amisha Bansal's user avatar
0 votes
1 answer
707 views

Multi-level Paging

Consider a system which has 2 level paging.The page table is divided into 2K pages and each page is having 4K entries.Memory is word addressable and Physical address space is 64MW which is divided ...
user3767495's user avatar
4 votes
1 answer
1k views

How does hashed inverted page table work?

I understand hash function and inverted page table, but then the book I read describes something called hashed inverted page table (use hash to accelerate the finding because IPT is large), with TLB ...
Kindred's user avatar
  • 314
1 vote
0 answers
555 views

pool of free page frames OS

I read that in a paging scheme memory management, some os's have a paging daemon that wakes up periodically to inspect the memory of the RAM. This is to ensure that modified pages can be scheduled to ...
calveeen's user avatar
  • 141
0 votes
1 answer
261 views

Page Replacement optimal verses MRU

A computer has twenty physical page frames which contain pages numbered 101 through 120. Now a program accesses the pages numbered 1, 2, …, 100 in that order, and repeats the access sequence THRICE. ...
Geeklovenerds's user avatar
1 vote
1 answer
5k views

How to find the virtual pages and physical memory frames?

So i am given a system of 20 bits virtual addresses and 18 bits physical addresses using paging with pages size 4Kbytes. I am told to find the maximum number of virtual pages that a process can have ...
Ian Twy's user avatar
  • 13
0 votes
1 answer
37 views

Linux OS/HW VM cooperation

From what i've learned, the HW is responsible for setting the accessed and dirty bits in the PTE of a process, and the OS is responsible for turning them off. My question is why? The first part, i ...
CodeHoarder's user avatar
0 votes
1 answer
3k views

What does "higher order address bits" and "lower order address bits" mean?

"Assume a system with 4 GB virtual memory and 1 GB physical memory with 32 bit addresses. if the page size is 4 KB, How many bits will be allocated as the Higher Order Address bits and Lower Order ...
Sankha Rathnayake's user avatar
1 vote
2 answers
352 views

Does the Working Set Paging Algorithm use a separate page table?

I am doing research on paging algorithms. While learning about the working set algorithm from several scientific sources I was not really able to figure out where exactly the working set is defined or ...
Thomas Christopher Davies's user avatar
1 vote
2 answers
812 views

What is the difference between a page and thread?

"Each process that is executed is divided into blocks of same size, called pages." "Thread is a part of process being executed." Are pages and threads both part(s) of process? Whats the difference ...
Peeyush Singh's user avatar
0 votes
1 answer
1k views

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

I have a sequence like 5577334... and there are 3 frames available. After the 6th clock, all pages (5, 7 and 3) will have their reference bits set to 1. Now, when 4 comes in, 5 will go even though ...
M. Kaan's user avatar
  • 11
1 vote
1 answer
14k views

Explain Hashed page tables in operating system

I have a difficult time understanding hashed page tables used in virtual memory management. Here is picture of the slide that I am referring to: I understand that p is hashed and then the hash is ...
Akriti Anand's user avatar
1 vote
1 answer
962 views

Difference between inverted page table and a standard one?

I know that for standard page tables each process would have its own page table and for inverted the OS would have it. But other than this what are the main differences between a standard page table ...
HoldThatLzzzz's user avatar
0 votes
1 answer
658 views

Effectiveness of TLB

This is a book question: Suppose that a machine has 48-bit virtual addresses and 32-bit physical addresses. Suppose this same system has a TLB (Translation Lookaside Buffer) with 32 ...
Cuban coffee's user avatar
0 votes
1 answer
4k views

Operating System: Performance of Demand Paging

I am reading Operating systems from the book "Operating System Concepts" by Peter Baer Galvin, 7th edition. Performance of Demand Paging: Let p be the probability of a page fault (0 $\leqslant$...
Manu Thakur's user avatar
1 vote
2 answers
192 views

If you increase the address space for an OS, does the Phys Mem used by the program increase?

I am learning about the OS. I know: that Address Space Size = # of pages x page size So if I increase Address Space Size, then the number of pages increases:(not the page size). However, isn't the ...
Nathan Hampshire's user avatar