Assignment 3 questions.


R. Clayton (rclayton@monmouth.edu)
Fri, 17 Nov 2000 12:11:22 -0500 (EST)


  it should be mass.memory->store() and mass.memory->fetch() instead of
  memory->store() and memory->fetch()?

Yes. store_mem() and fetch_mem() were defined to be used inside the simulator
classes, not outside. They shouldn't be in system.h, but I was too lazy to
define a separte .h file for them. I've done so now.

  (2) Program status register sw_register, what the purpose of bit 1,2 and 3?
  I know they are gt, lt and eq, but don't know whether we need use these
  for this project.

You don't need to use them, but you do need to make sure you don't change their
values when you manipulate the status-word register.

  (3) Program status register sw_register, bit 8-15 process_id, who set it?
  It seems the OS should do this, right?

Yes.

  (4) Just want to double check this: page_table entry has 32 elements in our
  case, right? for example, if mass.memory->page_table[i].page_number = j,
  means the page table of i(th) physical memory page frame associated with
  virtual memory j(th) page.
 
The page frame i is assoicated with the page number j; correct.

  (5) In Assignment 3 document (pa3.html), "Each batch disk will have a paging
  area immediately following the programs on the batch disk. The paging area of
  the batch disk contains the same number blocks as does the program area of
  the batch disk". I am still not quite understand what does it mean.

I'm not sure what it is you don't understand. If all the programs occupy p
disk blocks total, then the batch disk looks like this:

  block 0 - program index
  block 1 through block p - program blocks
  block p + 1 through block 2p - paging space
  block 2p + 1 through the last disk block - free space

  (6) In your previous email about a execution walk-through, It seems all
  four programs starting from the same virtual memory space (vmem_base), why
  is that? For example,
    At time 11, page in 0 to 1024 for address 3072 in process 1
    At time 12, page in 0 to 1056 for address 3072 in process 4
    At time 13, page in 0 to 1088 for address 3072 in process 3
    At time 14, page in 0 to 1120 for address 3072 in process 2

Remember that virtual memory is decoupled from physical memory. I can assign
each process its own complete virtual memory address space and not have to
worry about sharing virtual addresses among processes.

When processes use physical addresses, there is always exactly one valid
address n, and at most one process may contain such an address (this is not,
strictly speaking, true because physical-address processes can share addresses;
however, for our purposes, we can assume it's true).

  The reason that it confuses me is for the page table, these will produce
  page table like following:
    page_table[0].page_number = 0, process_id = 1, valid = true
    page_table[1].page_number = 0, process_id = 2, valid = true
    page_table[3].page_number = 0, process_id = 3, valid = true
    page_table[4].page_number = 0, process_id = 4, valid = true
  These are my guess, and I think I must miss something here.

Nope, you're not missing anything, but to emphasize that pages may end up
anywhere in physical memory (and to avoid the incorrect implication that page
frame numbers are somehow a priori related to process ids), I would have
written

  page_table[i].page_number = 0, process_id = 1, valid = true
  page_table[j].page_number = 0, process_id = 2, valid = true
  page_table[k].page_number = 0, process_id = 3, valid = true
  page_table[l].page_number = 0, process_id = 4, valid = true

where i != j != k != l.



This archive was generated by hypermail 2.0b3 on Mon Dec 18 2000 - 13:30:06 EST