0
$\begingroup$

My book(link) says that if the computer tries to access a virtual memory page that is on the hard-disc it loads that page into physical memory. But how does the computer keep track of which physical memory it should use? Does it look through the page table to find free physical memory?

$\endgroup$
5
  • 1
    $\begingroup$ The operating system is responsible for that. $\endgroup$
    – user253751
    Jan 19, 2023 at 18:30
  • $\begingroup$ @user253751 Thank you, so the operating system keeps track of which physical pages are free, and gives a free physical page when loading a virtual page from the hard disc? $\endgroup$
    – user394334
    Jan 19, 2023 at 18:36
  • 1
    $\begingroup$ The operating system is responsible for all this paging stuff. All the CPU knows is the page tables. $\endgroup$
    – user253751
    Jan 19, 2023 at 18:51
  • 1
    $\begingroup$ Yes, the OS looks for a free page in the page table. If none are free, it selects one to be swapped out. $\endgroup$
    – user16034
    Jan 19, 2023 at 19:33
  • $\begingroup$ Thank you both very much! $\endgroup$
    – user394334
    Jan 19, 2023 at 19:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.