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 to Physical address (Consists of Frame number + Offset).
In the mapping process there must be first a lookup in the Page table of the process to get the Frame corresponding to that page.
Now to get to the page table we need to get the location of the page table of that process in the main memory.
The starting location of the page table is stored in a register called page table base register (PTBR).
Now the page number part of the logical address is added with the value in the PTBR and the corresponding frame is found in the table as the following:
Since the PTBR stores the base physical address of the page table in memory (e.g. 14000), and the logical address contains the page number that the CPU wants to read data from. Now here is my question:
Is the page number part of the logical address is the starting address of the page?
For example: the virtual address is 16 bit and the size of each page is 1KB
page 0 --->starts at virtual address 0
page 1 --->starts at virtual address 1024
page 2 --->Starts at virtual address 2048
and so on ...
So if the CPU wants to read data from page 1, then the page number is "1024" and then this value is added to the value in the PTBR?
The page number itself is added for example: if the CPU wants to read data from "page 1", then the number "1" represents the Page number value and when it is added to PTBR value? in other way does the CPU deal with page Number or Starting address?
I know this is silly for a lot of you, but it really got me confused because I couldn't find any real example about it.