#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include "structure.h"
#include "format.h"
#include "log.h"
#include "help.h"
#include "dir.h"
#include "file.h"
#include "display_sys.h"
#include "find_same_name.h"
#include "b_alloc_and_free.h"
#include "i_alloc_and_free.h"
#include "divide_path.h"
#include "check.h"
#include "install.h"
#include "exit.h"
#include "display_current_dir.h"
struct block_group _block_group[BLOCKS_GROUP_NUM]; //数据块组
struct inode inode_table[TOTAL_INODES_NUM]; //inode表
struct user _user[MAX_USER_NUM]; //用户
struct dir _current_dir; //目录
bool block_bitmap[TOTAL_BLOCKS_NUM]; //数据块位图
bool inode_bitmap[TOTAL_INODES_NUM]; //inode 位图
FILE *fd; //系统文件
unsigned int uid; //使用文件系统的用户ID
char pwd[20]; //密码
command cmd[13]; //命令
char current_path[1000]; //保存当前路径
void main()
{
install();
while(!login());
printf("\n**************************欢迎使用模拟Linux文件系统!***************************\n");
while(1)
{
char control[100]; //用于输入命令
char path1[1000],path2[1000]; //用于路径或名字输入
int i=0; //循环控制变量
fflush(stdin); //清除流
printf("\n%s",current_path);
scanf("%s",control);
for(i=0;i<13;i++)
if(strcmp(cmd[i].com,control)==0)
break;
switch(i)
{
case 0: //format
format();
break;
case 1: //info
display_sys_info();
break;
case 2: //cd
scanf("%s",path1);
if(change_dir(path1,sizeof(path1)))
display_current_dir(_current_dir);
break;
case 3: //dir
scanf("%s",path1);
display_dir(path1,sizeof(path1));
break;
case 4: //md
scanf("%s",path1);
make_dir(path1,sizeof(path1));
break;
case 5: //rd
scanf("%s",path1);
remove_dir(path1,sizeof(path1));
break;
case 6: //newfile
scanf("%s",path1);
create_file(path1,sizeof(path1));
break;
case 7: //cat
scanf("%s",path1);
open_file(path1,sizeof(path1));
break;
case 8: //copy
scanf("%s",path1);
scanf("%s",path2);
copy_file(path1,sizeof(path1),path2,sizeof(path2));
break;
case 9: //del
scanf("%s",path1);
delete_file(path1,sizeof(path1));
break;
case 10: //check
check();
break;
case 11: //exit
exit_sys();
break;
case 12: //help
help();
break;
default:
printf("没有此命令!如需帮助请输入 hlep\n");
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
华工计算机操作系统课程设计
共19个文件
h:15个
doc:1个
exe:1个
5星 · 超过95%的资源 需积分: 10 62 下载量 83 浏览量
2010-08-21
15:39:10
上传
评论 2
收藏 289KB RAR 举报
温馨提示
计算机操作系统课程设计 模拟linux文件系统 模拟文件系统的前端操作shell 模拟文件系统的操作管理 包含完整实验报告和源代码
资源推荐
资源详情
资源评论
收起资源包目录
《操作系统课程设计》原版.rar (19个子文件)
《操作系统课程设计》原版
课程设计
实验报告.docx 263KB
src
main.cpp 3KB
divide_path.h 5KB
find_same_name.h 331B
log.h 1017B
help.h 1KB
file.h 13KB
b_alloc_and_free.h 4KB
structure.h 5KB
exit.h 724B
dir.h 13KB
display_sys.h 753B
format.h 5KB
display_current_dir.h 897B
i_alloc_and_free.h 1KB
install.h 2KB
check.h 3KB
simdisk.exe 224KB
操作系统课程设计2008-simple.doc 55KB
共 19 条
- 1
资源评论
- 「已注销」2013-06-29这个课程设计与我的题目不是很一样,不过还不错,有好多可以借鉴的
- wolegequluo2011-12-05资源有一定的参考价值,可以已经是比较老得东西了...
- DarrenShen_PD2014-02-08之前Linux学的不是很熟,所以很多东西看起来很费劲,不过注写了很多
- SNOWJUN1232014-11-27好吧~好厉害,但貌似不适合我
- linsbiao2013-01-09这个还必须在了解了一定linux和文件系统的基础上才看得懂。
xxxblackdevil
- 粉丝: 0
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功