⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fs.h

📁 操作系统的一些实验
💻 H
字号:
#ifndef FS_H
#define FS_H

#define TRUE 1
#define FALSE 0
#define INVALID -1
#define NULL 0

#define total_instruction 320
#define total_vp 32
#define clear_period 50

typedef struct
{
	int pn,pfn,counter,time;
}pl_type;
pl_type pl[total_vp];
struct pfc_struct
{
	int pn,pfn;
	struct pfc_struct *next;
};

typedef struct pfc_struct pfc_type;
pfc_type pfc[total_vp],*freepf_head,*busypf_head,*busypf_tail;

int diseffect, a[total_instruction];
int page[total_instruction], offset[total_instruction];

void initialize(total_pf)
	int total_pf;
{
	int i;
	diseffect=0;

	for(i=0; i<total_vp; i++)
	{
		pl[i].pn=i;
		pl[i].pfn=INVALID;
		pl[i].counter=0;
		pl[i].time=-1;
	}

	for(i=1; i<total_pf; i++)
	{
		pfc[i-1].next=&pfc[i];
		pfc[i-1].pfn=i-1;
	}
	pfc[total_pf-1].next=NULL;
	pfc[total_pf-1].pfn=total_pf-1;
	freepf_head=&pfc[0];
}

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -