paging.c
// Select a page-table entry which is mapped
// but not accessed. Notice that the user memory
// is mapped between 0...KERNBASE.
Select a page-table entry which is mapped
but not accessed. Notice that the user memory
is mapped between 0...KERNBASE.
Select a page - table entry which is mapped but not accessed . Notice that the user memory is mapped between 0 ... KERNBASE .
pte_t*
select_a_victim(pde_t *pgdir)
{
	for(;;) {
		for(int i = 0; i < NPDENTRIES; i++) {
			if( pgdir[i] & ~(PTE_A) ) {
				return (pte_t*)P2V(PTE_ADDR(pgdir[i]));
			}
		}
		clearaccessbit(pgdir);		
	}
	return 0;
}
pte_t * select_a_victim ( pde_t * pgdir ) { for ( ; ; ) { for ( int i = 0 ; i < NPDENTRIES ; i ++ ) { if ( pgdir [ i ] & ~ ( PTE_A ) ) { return ( pte_t * ) P2V ( PTE_ADDR ( pgdir [ i ] ) ) ; } } clearaccessbit ( pgdir ) ; } return 0 ; }
Select a page-table entry which is mapped
but not accessed.
Select a page - table entry which is mapped but not accessed .
// cprintf("SELECT A VICTIM");