"Samuel Lewis" <23*6*5*
7@s*u*e*t*u*a*e*u*a*> wrote:
> Hi,
>
> Q1.
> In the project briefing, it mentions
> ```
> each proces can have 4 pages
> ```
> Does that mean that each process can have up to 4 pages, or exactly 4 pages.
Each process has exactly 4 pages in VMEM which can be loaded to RAM.
> Q2.
> Is the Virtual Memory an array of memory structs, or an array of memory struct pointers.
> I'm aware that the briefing says that the VMEM should be an array of pointers, however, that begs the question where we should be storing the actual memory structs.
Memory of struct pointers. When you store the pointers in VMEM you are storing the structs there also.
> Q3.
> If a page is not in RAM, then we need to store its address as 99, however, where should I be looking in the VMEM for it? And as such, how do I know what page pointer to copy into RAM?
>From the in.txt file you know the process to load onto RAM. You load the **next** process page of **that** process onto RAM. I.e. You copy the next available page that isn't in RAM. E.g. If page 0 is in RAM you copy page 1.
Honestly you don't even need to look at the VMEM, just look at the page table and determine which page isn't in RAM and add the next one to RAM. Could just modify the structs in RAM to make the changes.
> Thanks
np