操作系统源代码研究分析
19页1、#include#include#includeint memoryStartAddress = -1;int memorySize = -1;struct jobListint id; /* 作业ID */int size; /* 作业大小(需要的存储空间大小) */int status; /* 作业状态 0 : new job ,1 : in the memory , 2 : finished . */struct jobList *next; /* 作业链表指针 */;struct freeListint startAddress; /* 分区起始地址 */int size; /* 分区大小 */struct freeList *next; /* 分区链表指针 */;struct usedList int startAddress; /* 分区起始地址 */int jobID; /* 分区中存放作业ID */struct usedList *next; /* 分区链表指针 */;void errorMessage(void) /*出现严重错误时显示信息并结束程序*/printf(
2、ntError !a);printf(nPress any key to exit !);getch();exit(1);void openFile(FILE *fp,char *filename,char *mode) /*以要求的方式打开文件*/if(*fp = fopen(filename,mode) = NULL)printf(nCant open %s in mode %s.,filename,mode);errorMessage();void makeFreeNode(struct freeList *empty,int startAddress,int size) /*根据参数startAddress、size创建空闲节点,由empty指针返回*/if(*empty = malloc(sizeof(struct freeList) = NULL)printf(nNot enough to allocate for the free node .);errorMessage();(*empty)-startAddress = startAddress;(*empty)-si
3、ze = size;(*empty)-next = NULL;void iniMemory(void) /*初始化存储空间起始地址、大小*/char MSA10,MS10;printf(nPlease input the start address of the memory !);scanf(%s,MSA);memoryStartAddress = atoi(MSA);printf(nPlease input the size of the memory !);scanf(%s,MS);memorySize = atoi(MS);char selectFitMethod(void) /*选择适应算法*/FILE *fp;char fitMethod;doprintf(nnPlease input a char as fallow to select the fit method !n 1 (Best fit) n 2 (Worst fit) n 3 (First fit) n 4 (Last fit)n);fitMethod = getche();while(fitMethod 4)
《操作系统源代码研究分析》由会员博****1分享,可在线阅读,更多相关《操作系统源代码研究分析》请在金锄头文库上搜索。
关于绿色环保的校园广播稿
2015年安全环保技能竞赛方案(终结版)解析
学校特色建设方案
会计学专业 M酒店成本管理现状及对策研究
优秀个人简历范文
急诊ICU(EICU)的建设
教师度考核表个人总结范文5篇
苏教版四年级下册课外阅读曹文轩《草房子》测试题
护理上半年工作计划
起重机维修保养内容表格
班长的竞聘演讲稿范文合集5篇
活动策划范文7篇
KES2000均质乳化分散机、分散搅拌机、高速分散搅拌机
2023年计划生育工作计划标准模板(二篇).doc
幼儿大班数学工作计划范本(3篇)
服装店周年庆活动方案
七年级下语文期末考试试卷
缝纫车间班组工作总结.doc
天津各区地名的由来
2022年超市承包合同
2023-09-10 9页
2023-12-28 10页
2023-08-10 5页
2022-12-27 8页
2022-09-24 104页
2023-07-14 47页
2023-10-25 3页
2023-06-25 2页
2024-02-03 1页
2024-03-12 36页