So I just read that virtual addresses are divided up into 1 - page number and 2 - offset.
I also read that page number directs you to be able to find the right page and the offset to get the right "byte" that you want to get the physical memory of.
So for example in 4KB
sized page, we have 12bits
reserved for offset since 2^12 = 4096
, which is 4KB
.
I get the concepts. But I don't get the reasoning behind using pages.
I mean, using the 4KB
sized page or 8KB
sized page, why couldn't we use 1byte
big page?
I guess that could make everything byte by byte read and write, which you could say it would slow things down.
But aren't we already doing the same thing with first finding page and finding the correct byte with offset?
What is the motivation behind coming up with bigger sized pages than 1byte
?
I get the reason behind the use of virtual memory: to avoid swapping. But why couldn't we do this with smaller, more direct one byte sized page?