Move clock pointer to next page return page number

This preview shows page 39 - 49 out of 93 pages.

move clock pointer to next page return page number Could cycle through entire list before finding victim Clock Algorithm
Image of page 39

Subscribe to view the full document.

BYU CS 345 Virtual Memory 40 2 1 0 2 1 3 0 1 3 0 2 3 0 2 3 0 2 4 3 2 4 3 2 4 3 0 4 3 0 2 3 0 2 1 0 2 1 0 2 1 0 7 0 7 7 1 0 4 2 1 0 4 2 1 0 4 3 2 0 4 3 2 0 4 3 2 0 4 3 2 1 4 3 2 1 4 3 2 1 4 3 2 1 0 3 2 1 0 3 2 1 0 7 2 1 0 7 1 0 7 0 7 7 2 1 0 0 2 1 2 3 0 3 2 4 0 3 0 2 1 0 7 Frame Clock/3 Frames 3 2 1 0 0 2 1 2 3 0 3 2 4 0 3 0 2 1 0 7 Frame Clock/4 Frames (12) (9) Clock Algorithm
Image of page 40
BYU CS 345 Virtual Memory 41 0 1 2 3 4 5 0 7 1 0 1 0 7 2 1 2 1 0 7 3 2 3 2 1 0 7 4 3 4 3 2 1 0 7 5 4 7 0 7 7 0 2 3 4 4 3 2 1 0 5 6 5 4 3 2 1 6 5 7 6 4 3 2 7 6 5 8 7 4 3 8 7 6 5 3 8 6 1 0 8 7 5 2 6 5 5 4 3 2 1 0 7 Frame 4 3 8 7 6 5 0 4 3 8 7 6 5 5 4 3 8 7 6 5 4 3 4 0 8 7 6 5 1 0 1 0 8 7 6 5 2 1 1 0 8 7 6 2 7 2 1 0 8 7 6 2 8 7 1 0 8 7 6 2 5 5 7 0 1 1 0 8 6 5 2 6 Clock Algorithm
Image of page 41

Subscribe to view the full document.

BYU CS 345 Virtual Memory 42 CS 345 Virtual Memory Project
Image of page 42
BYU CS 345 Virtual Memory 43 Project 5 – Virtual Memory Student explores the concepts of swap space , main memory , and virtual memory . Understand the details of page faulting and page replacement algorithms, what hit and miss counts are, and how to track them. Student implements a virtual address translation system (MMU) to project 4 using a two-level hierarchical page table system. An LC-3 processor is provided that makes all memory accesses through one function, getMemAdr() . Project 5
Image of page 43

Subscribe to view the full document.

BYU CS 345 Virtual Memory 44 Project 5 – Virtual Memory unsigned short int *getMemAdr(int va, int rwFlg) { unsigned short int pa; // turn off virtual addressing for system RAM if (va < 0x3000) return &memory[va]; // calculate physical from virtual virtual pa = va; // return physical memory address return &memory[pa]; } // end getMemAdr Project 5
Image of page 44
BYU CS 345 Virtual Memory 45 Virtual Memory Virtual Address f ( va ) Physical Address LC-3 PC-Relative Indirect Base+Offset IR, TRAP LD, LDR, LDI ST, STR, STI LC-3 Memory 2 16 Words OS Clock Replacement Algorithm Paged Swap Space MMU getMemAdr() (Hardware) Project 5
Image of page 45

Subscribe to view the full document.

BYU CS 345 Virtual Memory 46 LC-3 ISA ADD 0001 DR SR1 00 SR2 0 ADD 0001 DR SR1 imm5 1 AND 0101 DR SR1 00 SR2 0 AND 0101 DR SR1 imm5 1 BR 0000 n z p PCoffset9 JSR 0100 1 JMP 1100 0 000000 00 BaseR LD 0010 PCoffset9 DR LDI 1010 PCoffset9 DR LDR 0110 offset6 DR BaseR LEA 1110 PCoffset9 DR NOT 1001 DR SR 111111 RET 1101 RTI 1000 000000000000 STR 0111 offset6 SR BaseR TRAP 1111 trapvect8 0000 ST STI 0011 PCoffset9 SR 1011 PCoffset9 SR PCoffset11 1100 0 000000 00 111 reserved JSRR 0100 0 000000 00 BaseR Project 5
Image of page 46
BYU CS 345 Virtual Memory 47 LC-3 Simulator MAR access thru getMemAdr(va, rwflg) MDR access thru getMemData(va) setMemData(va) Project 5
Image of page 47

Subscribe to view the full document.

BYU CS 345 Virtual Memory 48 Crawler, Memtest Welcome to OS345 Rev 1.1 0>>crawler 178068>> Crawler R1.1 Process 1: Move #1 to xE29E Process 1: Move #2 to x6B3F Process 1: Move #99 to x932E Process 1: Move #100 to xDA8F Process #1 Halted at 0x937e 1807827>>memtest MemTest R1.0a (1) Round 1, Writing to memory... (1) Round 1, Verifying... (1) Round 2, Writing to memory...lt # TID name address line prior time semaphore status 0 0/0 CLI 403b61 457 5 1 Running 1 1/0 LC3 MemTest 40190c 0 5 1 Waiting 1911162>> (1) Round 2, Verifying...
Image of page 48
Image of page 49
You've reached the end of this preview.
  • Winter '12
  • EricMercer
  • Virtual memory, main memory, page faults, BYU CS

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern