All pastes #47718 Raw Edit

Unnamed

public text v1 · immutable
#47718 ·published 2006-03-31 19:21 UTC
rendered paste body
pcb->npages = 15;
for (;k !=64; k++)
{
  pcb->pagetable[k] = 0;
}
printf("Npages After Initializing data and zeroing: %d\n", pcb->npages);


outputs:
Npages After Initializing data and zeroing: 0

PCB struct:
typedef struct PCB {
  uint32        *currentSavedFrame; // -> current saved frame.  MUST BE 1ST!
  uint32        *sysStackPtr;   // Current system stack pointer.  MUST BE 2ND!
  uint32        sysStackArea;   // System stack area for this process
  unsigned int  flags;
  char          name[80];       // Process name
  uint32        pagetable[63];//was 16  // Statically allocated page table
  int           npages;         // Number of pages allocated to this process
  Link          l;              // Used for keeping PCB in queues
} PCB;