- 11
- 0
- 约3.75千字
- 约 5页
- 2017-02-28 发布于湖北
- 举报
空闲磁盘存储的管理:位示图法
1:建立相应的数据结构
2:磁盘上建立一个文件,文件长度设为10MB,为该文件来模拟一个磁盘,磁盘的物理块大小为512字节
3:显示每次磁盘的请求和空间释放后的位示图状态
4显示每次磁盘的请求和空间释放后的全磁盘的状态
5:模拟文件的创建和删除,从而产生磁盘潘快请求和释放,验证以上设计
代码:
// OS暑?期ú课?程ì设Θ?计?.cpp : 定¨义?控?制?台?应畖用?程ì序ò的?入?口ú点?。£
//
#include stdafx.h
#include iostream
#include string
#include math.h
using namespace std ;
//文?件t类え?
class file
{
public:
string name ;
int occupy ;
int grade_block ;
int start ;
};
#define MAX_LINE 3
#define MAX_COLUMN 32
int BIT[32][1000];
int byte[MAX_LINE] ;
int file_count;
int judge[32] ;
int judge2[32];
int cycle ;
file f[1000];
void init(int line ,int c
原创力文档

文档评论(0)