手机版

操作系统实验报告模板(12)

时间:2025-04-29   来源:未知    
字号:

这是操作系统课程中的四次实验最终报告,内包括进程通信实验,进程同步互斥实验,文件系统模拟实验和Linux shell操作。里面的程序都是我运行过的。

{

if(osPoint->FAT1[i]==0) break; }

if(i==BlockCount) {

printf("磁盘已满!\n"); return 0; } iFAT=i;

/*------进入分配阶段---------*/ //分配磁盘块 osPoint->FAT1[iFAT] = osPoint->FAT2[iFAT] = 1;

/*-----------接下来进行分配----------*/

//填写该分派新的盘块的参数

strcpy(dir->fcb[emptyNum].fname,name); dir->fcb[emptyNum].type=GENERAL;

dir->fcb[emptyNum].fatherBlockNum=current;

dir->fcb[emptyNum].currentBlockNum=iFAT;

dir->fcb[emptyNum].size =0; char* p = osPoint->data[iFAT -3]; memset(p,4,BlockSize);

printf("----------------------------------------------------------------\n\n"); return 1; }

/*-------查询子目录------------*/ int listshow() {

int i,DirCount=0,FileCount=0; //搜索当前目录

struct dirFile *dir; //当前目录的指针

if(current==2)

dir=&(osPoint->root); else

dir=(struct dirFile *)(osPoint->data [current-3]);

for(i=1;i<BlockFcbCount;i++) {

if(dir->fcb[i].type==GENERAL) { //查找普通文件 FileCount++; printf("%s 文本文件./n",dir->fcb[i].fname); }

if(dir->fcb[i].type==DIRECTORY) { //查找目录文件 DirCount++;

操作系统实验报告模板(12).doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
×
二维码
× 游客快捷下载通道(下载后可以自由复制和排版)
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能出现无法下载或内容有问题,请联系客服协助您处理。
× 常见问题(客服时间:周一到周五 9:30-18:00)