spz-lab3/inc/kernel.h

35 lines
621 B
C

#ifndef KERNEL_HEADER
#define KERNEL_HEADER
#include "process.h"
struct RunQ {
struct Process *current_proc;
size_t max_procs;
size_t proc_amount;
size_t next_proc_id;
};
struct RunQ *RunQ(size_t max_procs);
void RUNQ_add_process(size_t max_page_accesses, size_t total_pages_owned);
static struct RunQ *runq;
struct PhysPage {
size_t ppn;
size_t busy_flag;
struct PhysPage *prev;
struct PhysPage *next;
struct PageTable *pt;
size_t pt_index;
};
static struct PhysPage *first_free_page;
static struct PhysPage *first_busy_page;
void KERNEL_page_fault(struct PageTableEntry *pt, size_t page_no);
#endif