操作系统课程设计
操作系统课程设计

操作系统课程设计一、课程目标知识目标:1. 理解操作系统的基本概念、功能、类型和结构,掌握操作系统的五大核心功能模块(处理器管理、存储器管理、设备管理、文件管理、用户接口);2. 掌握操作系统的发展历程、主要操作系统(如Windows、Linux、Mac OS)的特点及应用场景;3. 了解操作系统的设计与实现原理,包括进程管理、内存管理、设备管理、文件系统等关键技术;4. 学会使用操作系统提供的命令行或图形界面进行基本的系统操作与维护。
技能目标:1. 培养学生对操作系统的实际操作能力,能够熟练使用至少一种操作系统进行日常管理与维护;2. 培养学生运用操作系统原理解决实际问题的能力,如分析系统性能、诊断故障、优化配置等;3. 提高学生的编程能力,使其能够编写简单的系统程序或脚本,实现特定功能。
情感态度价值观目标:1. 培养学生对操作系统的兴趣,激发学生学习计算机科学的热情;2. 培养学生的团队合作意识,使其在讨论、分析、解决问题的过程中学会倾听、交流、协作;3. 培养学生具备良好的信息素养,关注操作系统领域的最新发展,增强信息安全意识。
课程性质:本课程为计算机科学与技术专业(或相关领域)的必修课,具有较强的理论性和实践性。
学生特点:学生已具备一定的计算机基础知识,具有较强的学习兴趣和动手能力,但可能对操作系统原理的理解和应用尚有不足。
教学要求:注重理论与实践相结合,以案例驱动、任务导向的方式进行教学,注重培养学生的实际操作能力和问题解决能力。
通过本课程的学习,使学生能够掌握操作系统的基本原理,提高实际应用水平,为后续专业课程学习打下坚实基础。
二、教学内容1. 操作系统概述:介绍操作系统的基本概念、功能、类型,比较不同操作系统的特点,分析操作系统的发展趋势。
教材章节:第一章 操作系统概述2. 进程与线程管理:讲解进程与线程的概念、状态与转换,进程调度算法,同步与互斥,死锁与饥饿问题。
教材章节:第二章 进程管理3. 存储管理:介绍内存分配与回收策略,虚拟内存技术,页面置换算法,内存保护机制。
《操作系统》课程设计

《操作系统》课程设计一、课程目标知识目标:1. 让学生掌握操作系统的基本概念,包括进程、线程、内存管理、文件系统等核心知识;2. 了解操作系统的历史发展,掌握不同类型操作系统的特点及使用场景;3. 掌握操作系统的性能评价方法和常用的调度算法。
技能目标:1. 培养学生运用操作系统知识解决实际问题的能力,如分析系统性能瓶颈、优化系统资源分配等;2. 培养学生具备基本的操作系统编程能力,如进程创建、线程同步、文件操作等;3. 提高学生的团队协作能力和沟通能力,通过小组讨论和项目实践,学会共同解决问题。
情感态度价值观目标:1. 培养学生对操作系统学科的兴趣,激发学生的学习热情,使其形成积极向上的学习态度;2. 培养学生具备良好的信息素养,尊重知识产权,遵循法律法规;3. 培养学生的创新精神和批判性思维,敢于质疑、勇于探索,形成独立思考的能力。
课程性质:本课程为计算机科学与技术专业的核心课程,旨在让学生掌握操作系统的基本原理和实现方法,提高学生的系统分析和编程能力。
学生特点:学生具备一定的编程基础和计算机系统知识,具有较强的逻辑思维能力和动手实践能力。
教学要求:结合学生特点和课程性质,注重理论与实践相结合,通过案例分析和项目实践,帮助学生将所学知识内化为具体的学习成果。
在教学过程中,关注学生的学习进度和反馈,及时调整教学策略,确保课程目标的实现。
二、教学内容1. 操作系统概述:介绍操作系统的定义、发展历程、功能、类型及特点,对应教材第一章内容。
- 操作系统的起源与发展- 操作系统的功能与类型- 操作系统的主要特点2. 进程与线程:讲解进程与线程的概念、状态、调度算法,对应教材第二章内容。
- 进程与线程的定义与区别- 进程状态与转换- 进程调度算法3. 内存管理:分析内存管理的基本原理、策略和技术,对应教材第三章内容。
- 内存分配与回收策略- 虚拟内存技术- 页面置换算法4. 文件系统:介绍文件系统的基本概念、结构、存储原理,对应教材第四章内容。
操作系统课程设计pintos

操作系统课程设计pintos一、教学目标本课程的目标是让学生了解和掌握操作系统的基本原理和概念,通过学习Pintos操作系统,使学生能够理解操作系统的核心机制,包括进程管理、内存管理、文件系统和输入/输出系统等。
在技能方面,学生应能够使用Pintos进行简单的操作系统设计和实现,提升编程能力和系统分析能力。
在情感态度价值观方面,学生应培养对计算机科学和操作系统的兴趣,增强解决实际问题的责任感和使命感。
二、教学内容教学内容将按照Pintos操作系统的结构和功能进行,包括:1. 操作系统的概述和基本概念;2. 进程管理,包括进程的创建、调度和同步;3. 内存管理,包括物理内存管理和虚拟内存管理;4. 文件系统,包括文件和目录的、文件系统的实现;5. 输入/输出系统,包括设备驱动程序和中断处理。
三、教学方法为了激发学生的学习兴趣和主动性,将采用多种教学方法,包括:1. 讲授法,用于讲解操作系统的原理和概念;2. 讨论法,用于讨论操作系统的实现和应用;3. 案例分析法,通过分析具体的操作系统案例,让学生理解操作系统的实际应用;4. 实验法,通过实验操作,让学生亲手实现操作系统的核心机制。
四、教学资源教学资源包括:1. Pintos操作系统的教材和相关参考书;2. 多媒体资料,包括操作系统的教学视频和PPT;3. 实验设备,包括计算机和相关的硬件设备。
这些教学资源将用于支持教学内容和教学方法的实施,丰富学生的学习体验。
五、教学评估教学评估将采用多种方式进行,以全面、客观、公正地评价学生的学习成果。
评估方式包括:1. 平时表现,包括课堂参与、提问和讨论等,占总评的20%;2.作业,包括理论和实践作业,占总评的30%;3. 考试,包括期中考试和期末考试,占总评的50%。
考试内容将涵盖操作系统的原理、概念和实验操作。
六、教学安排教学安排将根据课程内容和学生的实际情况进行设计。
本课程计划在一个学期内完成,每周安排2次课时,每次课时1小时。
操作系统课程设计Linux

操作系统课程设计Linux一、教学目标本课程的教学目标是使学生掌握Linux操作系统的核心概念、原理和应用技能。
通过本课程的学习,学生将能够:1.理解操作系统的基本原理,包括进程管理、内存管理、文件系统和输入/输出系统。
2.掌握Linux操作系统的安装、配置和管理方法。
3.熟练使用Linux命令行界面,进行日常操作和系统管理。
4.掌握Linux常用命令、 shell脚本编写和系统监控工具的使用。
5.了解Linux操作系统在服务器、嵌入式设备和云计算等领域的应用。
二、教学内容本课程的教学内容分为五个部分:1.操作系统概述:介绍操作系统的定义、功能和分类,以及Linux操作系统的历史和发展。
2.进程管理:讲解进程的基本概念、进程控制、进程同步和互斥、死锁及其解决方法。
3.内存管理:介绍内存分配与回收策略、内存保护、虚拟内存和分页分段机制。
4.文件系统:讲解文件和目录结构、文件访问控制、文件系统性能优化和磁盘空间分配策略。
5.输入/输出系统:介绍I/O设备管理、中断和DMA机制、设备驱动程序和I/O调度策略。
三、教学方法本课程采用多种教学方法相结合的方式,以提高学生的学习兴趣和主动性:1.讲授法:教师讲解操作系统的核心概念和原理,引导学生掌握基本知识。
2.讨论法:学生针对实际案例和问题进行讨论,培养学生的思考和分析能力。
3.案例分析法:分析Linux操作系统的实际应用案例,使学生了解操作系统的应用场景。
4.实验法:安排实验室课时,让学生亲自动手进行系统安装、配置和调试,提高学生的实践能力。
四、教学资源本课程的教学资源包括:1.教材:选用权威、实用的Linux操作系统教材,如《Linux操作系统原理与应用》。
2.参考书:提供相关的学术论文、技术博客和在线文档,供学生拓展阅读。
3.多媒体资料:制作课件、教学视频和演示文稿,辅助学生理解和记忆。
4.实验设备:提供Linux服务器、虚拟机和实验室环境,让学生进行实际操作。
操作系统-课程设计

操作系统-课程设计一、课程目标知识目标:1. 理解操作系统的基本概念、功能、类型及发展历程;2. 掌握操作系统的五大功能模块(处理器管理、存储器管理、设备管理、文件管理、用户接口)的工作原理;3. 了解操作系统的安全性、稳定性和性能评价标准;4. 熟悉至少一种主流操作系统(如Windows、Linux)的安装、配置及使用。
技能目标:1. 能够使用操作系统基本命令进行文件管理、系统监控等操作;2. 学会编写简单的批处理脚本,实现自动化操作;3. 掌握操作系统设置、优化及故障排除的基本方法;4. 能够分析操作系统的性能问题,并提出合理的解决方案。
情感态度价值观目标:1. 培养学生对操作系统的兴趣,激发学习热情;2. 培养学生的团队协作精神,学会在团队中共同解决问题;3. 增强学生的信息安全意识,遵守网络道德规范,尊重知识产权;4. 培养学生的创新意识,敢于尝试新事物,勇于克服困难。
课程性质:本课程为信息技术学科,结合学生年级特点,注重理论与实践相结合,培养学生的实际操作能力。
学生特点:学生具备一定的计算机操作基础,对操作系统有一定了解,但深入理解不足,需要通过课程学习提高认识。
教学要求:以学生为主体,教师为主导,注重启发式教学,引导学生主动探究,提高学生的实践操作能力。
通过课程学习,使学生在知识、技能和情感态度价值观方面取得具体的学习成果,为后续相关课程的学习打下坚实基础。
二、教学内容1. 操作系统的基本概念:介绍操作系统的定义、功能、类型及发展历程,对应教材第一章内容。
2. 操作系统五大功能模块:- 处理器管理:讲解处理器分配、调度算法等,对应教材第二章;- 存储器管理:介绍内存分配、回收、地址映射等,对应教材第三章;- 设备管理:阐述设备分配、I/O调度、缓冲管理等,对应教材第四章;- 文件管理:讲解文件系统结构、文件存储、目录管理等,对应教材第五章;- 用户接口:介绍命令行接口、图形用户接口等,对应教材第六章。
课程设计操作系统

课程设计操作系统一、教学目标本课程旨在让学生掌握操作系统的基本原理和概念,了解操作系统的运行机制和功能,培养学生运用操作系统知识解决实际问题的能力。
具体目标如下:1.知识目标:(1)理解操作系统的基本概念、功能和作用;(2)掌握操作系统的运行机制,包括进程管理、内存管理、文件管理和设备管理;(3)了解操作系统的发展历程和主流操作系统的基本特点。
2.技能目标:(1)能够运用操作系统知识分析和解决实际问题;(2)具备基本的操作系统使用和维护能力;(3)掌握操作系统的基本配置和优化方法。
3.情感态度价值观目标:(1)培养学生对操作系统知识的兴趣和好奇心;(2)树立正确的计算机使用观念,提高信息素养;(3)培养学生团队协作、创新思考和持续学习的能力。
二、教学内容本课程的教学内容主要包括以下几个部分:1.操作系统概述:介绍操作系统的定义、功能、作用和分类;2.进程管理:讲解进程的概念、进程控制、进程同步与互斥、死锁等问题;3.内存管理:讲解内存分配与回收策略、虚拟内存、页面置换算法等;4.文件管理:讲解文件和目录的概念、文件存储结构、文件访问控制、磁盘空间分配等;5.设备管理:讲解设备驱动程序、I/O调度策略、中断处理和DMA传输等;6.操作系统实例分析:分析主流操作系统(如Windows、Linux)的基本特点和运行机制。
三、教学方法本课程采用多种教学方法相结合,以提高学生的学习兴趣和主动性:1.讲授法:讲解操作系统的基本概念、原理和知识点;2.讨论法:学生针对操作系统相关问题进行讨论,培养学生的思维能力和团队协作精神;3.案例分析法:分析实际案例,让学生了解操作系统在实际应用中的作用和意义;4.实验法:安排实验课程,让学生动手实践,巩固所学知识。
四、教学资源为实现课程目标,我们将采用以下教学资源:1.教材:选用权威、实用的操作系统教材,为学生提供系统、全面的知识体系;2.参考书:提供相关领域的参考书籍,拓展学生的知识视野;3.多媒体资料:制作精美的PPT课件,辅助讲解和展示操作系统的相关概念和实例;4.实验设备:配置相应的实验设备,让学生动手实践,提高操作能力。
UCOSII操作系统课程设计

UCOSII操作系统课程设计一、课程目标知识目标:1. 理解UCOSII操作系统的基本原理和核心概念,包括任务管理、时间管理、通信与同步机制;2. 掌握UCOSII的移植方法和配置过程,学会在不同硬件平台上搭建UCOSII 操作系统环境;3. 学会使用UCOSII提供的API进行多任务编程,了解实时操作系统的任务调度和资源管理策略。
技能目标:1. 能够运用C语言在UCOSII环境下编写多任务应用程序,实现任务间的同步与通信;2. 能够分析并解决实际嵌入式系统开发中与操作系统相关的问题,提高系统稳定性和可靠性;3. 掌握UCOSII调试技巧,能够运用调试工具对操作系统运行状态进行跟踪和分析。
情感态度价值观目标:1. 培养学生对操作系统知识的好奇心和探索精神,激发学习兴趣和热情;2. 培养学生具备良好的团队合作精神和沟通能力,提高解决实际问题的能力;3. 增强学生的创新意识,鼓励他们在实际项目中积极尝试和应用所学知识。
课程性质:本课程为高年级专业课,以实际应用为导向,注重理论与实践相结合。
学生特点:学生已具备一定的C语言编程基础和嵌入式系统知识,具有较强的学习能力和实践能力。
教学要求:教师需采用项目驱动教学法,引导学生通过实际案例掌握UCOSII 操作系统的应用与开发。
在教学过程中,关注学生的个体差异,提供个性化指导,确保课程目标的实现。
同时,注重培养学生的自主学习能力和创新能力,为将来的职业发展打下坚实基础。
二、教学内容1. UCOSII操作系统概述:介绍实时操作系统的基本概念、特点及应用场景,引出UCOSII的背景、架构和优势。
教材章节:第一章 实时操作系统概述2. UCOSII内核原理:讲解UCOSII的核心组件,包括任务管理、时间管理、通信与同步机制等。
教材章节:第二章 UCOSII内核原理3. UCOSII移植与配置:介绍在不同硬件平台上移植和配置UCOSII的方法,以实际案例为例进行讲解。
操作系统内核课程设计

操作系统内核课程设计一、课程目标知识目标:1. 让学生理解操作系统内核的基本概念、结构和功能,掌握操作系统的进程管理、内存管理、文件系统等核心模块的工作原理。
2. 使学生掌握操作系统内核编程的基本方法,学会使用相关工具和接口进行系统调用和驱动程序开发。
3. 帮助学生了解操作系统安全性、稳定性的重要性,掌握基本的系统调试和优化技巧。
技能目标:1. 培养学生具备分析操作系统内核源代码的能力,能够阅读和理解常见的操作系统内核模块。
2. 培养学生具备设计、编写和调试简单的操作系统内核模块的能力,能够实现特定功能并进行性能优化。
3. 提高学生运用所学知识解决实际问题的能力,能够针对具体场景提出合理的操作系统内核设计方案。
情感态度价值观目标:1. 培养学生热爱操作系统内核技术,树立积极探索、持续学习的信念。
2. 培养学生的团队协作意识,学会与他人共同分析问题、解决问题,形成良好的沟通与协作能力。
3. 引导学生关注操作系统内核技术的发展趋势,认识到技术进步对社会发展的重要性,树立社会责任感。
本课程针对高年级学生,课程性质为专业核心课。
在教学过程中,需充分考虑学生的认知特点,注重理论与实践相结合,引导学生主动探究、动手实践。
通过本课程的学习,期望学生能够掌握操作系统内核的基本知识和技能,为未来从事相关领域的研究和工作打下坚实基础。
二、教学内容本课程教学内容围绕以下三个方面展开:1. 操作系统内核基础理论- 深入讲解操作系统内核的基本概念、结构、功能和设计原理。
- 分析进程管理、内存管理、文件系统、设备管理等核心模块的工作机制。
2. 操作系统内核编程实践- 介绍操作系统内核编程的基本方法,包括系统调用、驱动程序开发等。
- 结合教材示例,指导学生阅读和分析操作系统内核源代码。
教学大纲安排:1)第1-4周:操作系统内核基础理论2)第5-8周:进程管理、内存管理编程实践3)第9-12周:文件系统、设备管理编程实践3. 操作系统内核优化与调试- 讲解操作系统内核安全性、稳定性方面的知识,分析常见漏洞和防护措施。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
课程设计学生学院计算机学院专业班级 12(1)班学号3112006351学生姓名吴炜文指导教师李敏2015年 1 月10 日目录1 简单文件系统…………………………………………………………文件系统一、实验目的:模拟文件管理的功能,了解各种文件的操作。
二、实验内容:1、设计一个10个用户的文件系统,每次用户可保存10个文件,一次运行用户可以打开5个文件2、程序采用二级文件目录(即设置主目录[MFD])和用户文件目录(UED)。
另外,为打开文件设置了运行文件目录(AFD)。
3、为了便于实现,对文件的读写作了简化,在执行读写命令时,只需改读写指针,并不进行实际的读写操作。
4、算法与框图:a、因系统小,文件目录的检索使用了简单的线性搜索。
b、文件保护简单使用了三位保护码:允许读写执行、对应位为1,对应位为0,则表示不允许读写、执行。
c、程序中使用的主要设计结构如下:i 主文件目录和用户文件目录(MFD、UFD)ii 打开文件目录(AFD)(即运行文件目录)要求:用高级语言编写和调试一个简单的文件系统,模拟文件管理的工作过程。
从而对各种文件操作命令的实质内容和执行过程有比较深入的了解。
要求设计一个n个用户的文件系统,每次用户可保存m个文件,用户在一次运行中只能打开一个文件,对文件必须设置保护措施,且至少有Create、delete、open、close、read、write等命令。
文件系统算法的流程图如下:三、源代码及运行结果:#include "stdio.h"#include "string.h"#include "conio.h"#include "stdlib.h"#define MAXNAME 25 /*the largest length of mfdname,ufdname,filename*/#define MAXCHILD 50 /*the largest child*/#define MAX (MAXCHILD*MAXCHILD) /*the size of fpaddrno*/typedef struct /*the structure of OSFILE*/{int fpaddr; /*file physical address*/int flength; /*file length*/int fmode; /*file mode:0-Read Only;1-Write Only;2-Read and Write(default);*/ char fname[MAXNAME]; /*file name*/} OSFILE;typedef struct /*the structure of OSUFD*/{char ufdname[MAXNAME]; /*ufd name*/OSFILE ufdfile[MAXCHILD]; /*ufd own file*/}OSUFD;typedef struct /*the structure of OSUFD'LOGIN*/{char ufdname[MAXNAME]; /*ufd name*/char ufdpword[8]; /*ufd password*/} OSUFD_LOGIN;typedef struct /*file open mode*/{int ifopen; /*ifopen:0-close,1-open*/int openmode; /*0-read only,1-write only,2-read and write,3-initial*/}OSUFD_OPENMODE;OSUFD *ufd[MAXCHILD]; /*ufd and ufd own files*/OSUFD_LOGIN ufd_lp;int ucount=0; /*the count of mfd's ufds*/int fcount[MAXCHILD]; /*the count of ufd's files*/int loginsuc=0; /*whether login successfully*/char username[MAXNAME]; /*record login user's name22*/char dirname[MAXNAME];/*record current directory*/int fpaddrno[MAX]; /*record file physical address num*/OSUFD_OPENMODE ifopen[MAXCHILD][MAXCHILD]; /*record file open/close*/ int wgetchar; /*whether getchar()*/FILE *fp_mfd,*fp_ufd,*fp_file_p,*fp_file;void main(){int i,j,choice1;char choice[50]; /*choice operation:dir,create,delete,open,delete,modify,read,write*/ int choiceend=1; /*whether choice end*/char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/void LoginF(); /*LOGIN FileSystem*/void DirF(); /*Dir FileSystem*/void CdF(); /*Change Dir*/void CreateF(); /*Create File*/void DeleteF(); /*Delete File*/void ModifyFM(); /*Modify FileMode*/void OpenF(); /*Open File*/void CloseF(); /*Close File*/void ReadF(); /*Read File*/void WriteF(); /*Write File*/void QuitF(); /*Quit FileSystem*/void help();if((fp_mfd=fopen("c:\\osfile\\mfd","rb"))==NULL){fp_mfd=fopen("c:\\osfile\\mfd","wb");fclose(fp_mfd);}for(i=0;i<MAX;i++) fpaddrno[i]=0;textattr(BLACK*16|WHITE);clrscr(); /*clear screen*/LoginF(); /*user login*/clrscr();if(loginsuc==1) /*Login Successfully*/{while (1){wgetchar=0;if (choiceend==1){printf("\n\nC:\\%s>",strupr(dirname));}else printf("Bad command or file name.\nC:\\%s>",strupr(username));gets(choice);strcpy(choice,ltrim(rtrim(strlwr(choice))));if (strcmp(choice,"dir")==0) choice1=1;else if(strcmp(choice,"creat")==0) choice1=2;else if(strcmp(choice,"delete")==0) choice1=3;else if(strcmp(choice,"attrib")==0) choice1=4;else if(strcmp(choice,"open")==0) choice1=5;else if(strcmp(choice,"close")==0) choice1=6;else if(strcmp(choice,"read")==0) choice1=7;else if(strcmp(choice,"modify")==0) choice1=8;else if(strcmp(choice,"exit")==0) choice1=9;else if(strcmp(choice,"cls")==0) choice1=10;else if(strcmp(choice,"cd")==0) choice1=11;else if(strcmp(choice,"help")==0) choice1=20;else choice1=12;switch(choice1){case 1:DirF();choiceend=1;break;case 2:CreateF();choiceend=1;if(!wgetchar) getchar();break;case 3:DeleteF();choiceend=1;if(!wgetchar)getchar();break;case 4:ModifyFM();choiceend=1;if(!wgetchar) getchar();break;case 5:choiceend=1;OpenF();if (!wgetchar) getchar();break;case 6:choiceend=1;CloseF();if (!wgetchar) getchar();break;case 7:choiceend=1;ReadF();if (!wgetchar) getchar();break;case 8:choiceend=1;WriteF();if (!wgetchar) getchar();break;case 9:printf("\nYou have exited this system.");QuitF();exit(0);break;case 10:choiceend=1;clrscr();break;case 11:CdF();choiceend=1;break;case 20:help();choiceend=1;break;default:choiceend=0;}}}else printf("\nAccess denied.");}void help(void){printf("\nThe Command List\n");printf("\nCd Attrib Creat Modify Read Open Cls Delete Exit Close\n"); }char *rtrim(char *str) /*remove the trailing blanks.*/{int n=strlen(str)-1;while(n>=0){if(*(str+n)!=' '){*(str+n+1)='\0';break;}else n--;}if (n<0) str[0]='\0';return str;}char *ltrim(char *str) /*remove the heading blanks.*/{char *rtrim(char *str);strrev(str);rtrim(str);strrev(str);return str;}void LoginF() /*LOGIN FileSystem*/{char loginame[MAXNAME],loginpw[9],logincpw[9],str[50];int i,j,flag=1;char a[25];int findout; /*login user not exist*/char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/void InputPW(char *password); /*input password,use '*' replace*/void SetPANo(int RorW); /*Set physical address num*/while(1){findout=0;printf("\n\nLogin Name:");gets(loginame);ltrim(rtrim(loginame));fp_mfd=fopen("c:\\osfile\\","rb");for(i=0;fread(&ufd_lp,sizeof(OSUFD_LOGIN),1,fp_mfd)!=0;i++)if (strcmp(strupr(ufd_lp.ufdname),strupr(loginame))==0){findout=1;strcpy(logincpw,ufd_lp.ufdpword);}fclose(fp_mfd);if (findout==1) /*user exist*/{printf("Login Password:");InputPW(loginpw); /*input password,use '*' replace*/if (strcmp(loginpw,logincpw)==0){strcpy(username,strupr(loginame));strcpy(dirname,username);fp_mfd=fopen("c:\\osfile\\","rb");for(j=0;fread(&ufd_lp,sizeof(OSUFD_LOGIN),1,fp_mfd)!=0;j++){strcpy(str,"c:\\osfile\\");strcat(str,ufd_lp.ufdname);ufd[j]=(OSUFD*)malloc(sizeof(OSUFD));strcpy(ufd[j]->ufdname,strupr(ufd_lp.ufdname));fp_ufd=fopen(str,"rb");fcount[j]=0;for(i=0;fread(&ufd[j]->ufdfile[i],sizeof(OSFILE),1,fp_ufd)!=0;i++,fcount[j]++){ifopen[j][i].ifopen=0;ifopen[j][i].openmode=4;}fclose(fp_ufd);}fclose(fp_mfd);ucount=j;SetPANo(0);printf("\n\nLogin successful! Welcome to this FileSystem\n\n");loginsuc=1;return;}else{printf("\n\n");flag=1;while(flag){printf("Login Failed! Password Error. Try Again(Y/N):");gets(a);ltrim(rtrim(a));if (strcmp(strupr(a),"Y")==0) {loginsuc=0;flag=0;}else if(strcmp(strupr(a),"N")==0){loginsuc=0;flag=0;return;}}} }else{printf("New Password(<=8):");InputPW(loginpw); /*input new password,use '*' replace*/printf("\nConfirm Password(<=8):"); /*input new password,use '*' replace*/InputPW(logincpw);if (strcmp(loginpw,logincpw)==0){strcpy(ufd_lp.ufdname,strupr(loginame));strcpy(ufd_lp.ufdpword,loginpw);fp_mfd=fopen("c:\\osfile\\","ab");fwrite(&ufd_lp,sizeof(OSUFD_LOGIN),1,fp_mfd);fclose(fp_mfd);strcpy(username,strupr(loginame));strcpy(dirname,loginame);strcpy(str,"c:\\osfile\\");strcat(str,username);if((fp_ufd=fopen(str,"rb"))==NULL){fp_ufd=fopen(str,"wb");fclose(fp_ufd);}fp_mfd=fopen("c:\\osfile\\","rb");for(j=0;fread(&ufd_lp,sizeof(OSUFD_LOGIN),1,fp_mfd)!=0;j++){strcpy(str,"c:\\osfile\\");strcat(str,ufd_lp.ufdname);ufd[j]=(OSUFD*)malloc(sizeof(OSUFD));strcpy(ufd[j]->ufdname,strupr(ufd_lp.ufdname));fp_ufd=fopen(str,"rb");for(i=0;fread(&ufd[j]->ufdfile[i],sizeof(OSFILE),1,fp_ufd)!=0;i++,fcount[j]++){ifopen[j][i].ifopen=0;ifopen[j][i].openmode=4;}fclose(fp_ufd);}fclose(fp_mfd);ucount=j;SetPANo(0);printf("\n\nLogin Successful! Welcome to this System\n\n");loginsuc=1;return;}else{printf("\n\n");flag=1;while(flag){printf("Login Failed! Password Error. Try Again(Y/N):");gets(a);ltrim(rtrim(a));if (strcmp(strupr(a),"Y")==0) {loginsuc=0;flag=0;}else if(strcmp(strupr(a),"N")==0){loginsuc=0;flag=0;return;}} } } } }void SetPANo(int RorW) /*Set physical address num,0-read,1-write*/{int i,j;if (RorW==0){if((fp_file_p=fopen("c:\\osfile\\file\\file_p","rb"))==NULL){fp_file_p=fopen("c:\\osfile\\file\\file_p","wb");fclose(fp_file_p);}fp_file_p=fopen("c:\\osfile\\file\\file_p","rb");for(i=0;fread(&j,sizeof(int),1,fp_file_p)!=0;i++)fpaddrno[j]=1;/*for(i=1;i<MAX;i++)if ((i%13)==0) fpaddrno[i]=1;*/}else{fp_file_p=fopen("c:\\osfile\\file\\file_p","wb");/*for(i=1;i<MAX;i++)if((i%13)==0) fpaddrno[i]=0;*/for(i=0;i<MAX;i++)if (fpaddrno[i]==1)fwrite(&i,sizeof(int),1,fp_file_p);}fclose(fp_file_p);}void InputPW(char *password) /*input password,use '*' replace*/{int j;for(j=0;j<=7;j++){password[j]=getch();if ((int)(password[j])!=13){if((int)(password[j])!=8)putchar('*');else{if (j>0){j--;j--;putchar('\b');putchar(' ');putchar('\b');}else j--;}}else{password[j]='\0';break;}}password[j]='\0';}void DirF() /*Dir FileSystem*/{int i,j,count=0;char sfmode[25],sfpaddr[25],str[25];int ExistD(char *dirname); /*Whether DirName Exist,Exist-i,Not Exist-0*/clrscr();if (strcmp(strupr(ltrim(rtrim(dirname))),"")!=0){printf("\n\nC:\\%s>dir\n",dirname);printf("\n%14s%16s%14s%10s%18s\n","FileName","FileAddress","FileLength","Type","FileMo de");j=ExistD(dirname);for(i=0;i<fcount[j];i++){if ((i%16==0)&&(i!=0)){printf("\nPress any key to continue..");getch();clrscr();printf("\n%14s%16s%14s%10s%18s\n","FileName","FileAddress","FileLength","Type","FileMo de");}itoa(ufd[j]->ufdfile[i].fpaddr,str,10);strcpy(sfpaddr,"file");strcat(sfpaddr,str);if (ufd[j]->ufdfile[i].fmode==0) strcpy(sfmode,"Read Only");else if(ufd[j]->ufdfile[i].fmode==1) strcpy(sfmode,"Write Only");else if(ufd[j]->ufdfile[i].fmode==2)strcpy(sfmode,"Read And Write");else strcpy(sfmode,"Protect");printf("%14s%16s%14d%10s%18s\n",ufd[j]->ufdfile[i].fname,sfpaddr,ufd[j]->ufdfile[i].flength," <FILE>",sfmode);}printf("\n %3d file(s)\n",fcount[j]);}{printf("\n\nC:\\>dir\n");printf("\n%14s%18s%8s\n","DirName","OwnFileCount","Type");for(i=0;i<ucount;i++){if ((i%16==0)&&(i!=0)){printf("\nPress any key to continue...");getch();clrscr();printf("\n%14s%18s%8s\n","DirName","OwnFileCount","Type");}printf("%14s%18d%8s\n",ufd[i]->ufdname,fcount[i],"<UFD>");count=count+fcount[i];}printf("\n %3d dir(s),%5d file(s)\n",ucount,count);}}int ExistD(char *dirname) /*Whether DirName Exist,Exist-i,Not Exist-0*/{int i;int exist=0;for(i=0;i<ucount;i++)if (strcmp(strupr(ufd[i]->ufdname),strupr(dirname))==0){exist=1;break;}if (exist) return(i);else return(-1);}void CdF() /*Exchange Dir*/{char dname[MAXNAME];char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistD(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/ printf("\nPlease input DirName (cd..-Previous dir; DirNAME-cd [DirNAME]):"); gets(dname);ltrim(rtrim(dname));if (ExistD(dname)>=0) strcpy(dirname,strupr(dname));else if(strcmp(strupr(dname),"CD..")==0) strcpy(ltrim(rtrim(dirname)),""); else printf("\nError.\'%s\' does not exist.\n",dname);}void CreateF() /*Create File*/{int fpaddrno,flag=1,i;char fname[MAXNAME],str[50],str1[50],strtext[255],a[25];char fmode[25];char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int FindPANo(); /*find out physical address num*/int WriteF1(); /*write file*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(dirname),strupr(username))!=0){printf("\nError. You must create file in your own dir.\n");wgetchar=1;}else{ printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));if (ExistF(fname)>=0){printf("\nError. Name \'%s\' has already existed.\n",fname);wgetchar=1;else{printf("Please input FileMode(0-Read Only, 1-Write Only, 2-Read and Write, 3-Protect):");gets(fmode);ltrim(rtrim(fmode));if((strcmp(fmode,"0")==0)||(strcmp(fmode,"1")==0)||(strcmp(fmode,"2")==0)||(strcmp(fmode,"3") ==0)){fpaddrno=FindPANo();if (fpaddrno>=0){i=ExistD(username);strcpy(ufd[i]->ufdfile[fcount[i]].fname,fname);ufd[i]->ufdfile[fcount[i]].fpaddr=fpaddrno;ufd[i]->ufdfile[fcount[i]].fmode=atoi(fmode);ifopen[i][fcount[i]].ifopen=0;ifopen[i][fcount[i]].openmode=4;strcpy(str,"c:\\osfile\\file\\file");itoa(fpaddrno,str1,10);strcat(str,str1);fp_file=fopen(str,"wb");fclose(fp_file);fcount[i]++;while(flag){printf("Input text now(Y/N):");gets(a);ltrim(rtrim(a));ufd[i]->ufdfile[fcount[i]-1].flength=0;if(strcmp(strupr(a),"Y")==0){fp_file=fopen(str,"wb+");ufd[i]->ufdfile[fcount[i]-1].flength=WriteF1();flag=0;}else if(strcmp(strupr(a),"N")==0){flag=0;wgetchar=1;}}printf("\n\'%s\' has been created successfully!\n",fname);}else{printf("\nFail!No Disk Space. Please format your disk.\n");wgetchar=1;}}else {printf("\nError. FileMode\'s Range is 0-3\n");wgetchar=1;}}}}int ExistF(char *filename) /*Whether FileName Exist,Exist-i,Not Exist-0*/{int i,j;int exist=0;int ExistD(char *dirname);j=ExistD(dirname);for(i=0;i<fcount[j];i++)if (strcmp(strupr(ufd[j]->ufdfile[i].fname),strupr(filename))==0){exist=1;break;}if (exist) return(i);else return(-1);}int FindPANo() /*find out physical address num*/{int i;for(i=0;i<MAX;i++)if (fpaddrno[i]==0) {fpaddrno[i]=1;break;}if (i<MAX) return(i);else return(-1);}int WriteF1() /*write file*/{int length=0;char c;printf("Please input text(\'#\' stands for end):\n");while((c=getchar())!='#'){fprintf(fp_file,"%c",c);if (c!='\n') length++;}fprintf(fp_file,"\n");fclose(fp_file);return(length);}void DeleteF() /*Delete File*/{char fname[MAXNAME];char str[50],str1[50];int i,j,k,flag=1;char a[25]; /*whether delete*/char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(dirname),strupr(username))!=0){printf("\nError. You can only delete file in your own dir.\n");wgetchar=1;}else{printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if (i>=0){k=ExistD(username);if(ifopen[k][i].ifopen==1){printf("\nError. \'%s\' is in open status. Close it before delete.\n",fname);wgetchar=1;} else{ while(flag){printf("\'%s\' will be deleted. Are you sure(Y/N):",fname);gets(a);ltrim(rtrim(a));if(strcmp(strupr(a),"Y")==0){fpaddrno[ufd[k]->ufdfile[i].fpaddr]=0;itoa(ufd[k]->ufdfile[i].fpaddr,str,10);for(j=i;j<fcount[k]-1;j++){strcpy(ufd[k]->ufdfile[j].fname,ufd[k]->ufdfile[j+1].fname);ufd[k]->ufdfile[j].fpaddr=ufd[k]->ufdfile[j+1].fpaddr;ufd[k]->ufdfile[j].flength=ufd[k]->ufdfile[j+1].flength;ufd[k]->ufdfile[j].fmode=ufd[k]->ufdfile[j+1].fmode;ifopen[k][j]=ifopen[k][j+1];}fcount[k]--;strcpy(str1,"c:\\osfile\\file\\file");strcat(str1,str);remove(str1);flag=0;printf("\n\'%s\' has been deleted successfully.\n",fname);wgetchar=1;}else if(strcmp(strupr(a),"N")==0){printf("\nError. \'%s\' hasn\'t been deleted.\n",fname);wgetchar=1;flag=0;}}}}else{printf("\nError. \'%s\' does not exist.\n",fname);wgetchar=1;}}}void ModifyFM() /*Modify FileMode*/{char fname[MAXNAME],str[50];int i,j,k,flag;char fmode[25]; /*whether delete*/char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/void InputPW(char *password); /*input password,use '*' replace*/void SetPANo(int RorW); /*Set physical address num*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(dirname),strupr(username))!=0) {printf("\nError.You can only modify filemode in yourself dir.\n");wgetchar=1;}else{ printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if (i>=0){k=ExistD(username);if(ifopen[k][i].ifopen==1){printf("\nError.\'%s\' is in open status. Close it before modify.\n",fname);wgetchar=1;}else{if(ufd[k]->ufdfile[i].fmode==0) strcpy(str,"read only"); /*FileMode*/else if(ufd[k]->ufdfile[i].fmode==1) strcpy(str,"write only");else if(ufd[k]->ufdfile[i].fmode==2) strcpy(str,"read and write");else strcpy(str,"Protect");printf("\'%s\' filemode is %s.\n",fname,strupr(str));printf("Modify to(0-read only,1-write only,2-read and write,3-Protect):");gets(fmode);ltrim(rtrim(fmode));if(strcmp(fmode,"0")==0){ufd[k]->ufdfile[i].fmode=0;printf("\n\'%s\' has been modified to READ ONL Y mode successfully.\n",fname);wgetchar=1;}else if(strcmp(fmode,"1")==0){ufd[k]->ufdfile[i].fmode=1;printf("\n\'%s\' has been modified to WRITE ONL Y mode successfully.\n",fname);wgetchar=1;}else if(strcmp(fmode,"2")==0){ufd[k]->ufdfile[i].fmode=2;printf("\n\'%s\' has been modified to READ AND WRITE mode successfully.\n",fname);wgetchar=1;}else if(strcmp(fmode,"3")==0){ufd[k]->ufdfile[i].fmode=3;printf("\n\'%s\' has been modified to FORBID mode successfully.\n",fname);wgetchar=1;else {printf("\nError.\'%s\' is not modified.\n",fname);wgetchar=1;}}}else{printf("\nError. \'%s\' dose not exist.\n",fname);wgetchar=1;}}}void OpenF() /*Open File*/{char fname[MAXNAME];char str[25],str1[25],fmode[25];int i,k;char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(ltrim(rtrim(dirname))),"")==0){printf("\nError. Please change to ufd dir before open.\n");wgetchar=1;return;}printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if (i>=0){k=ExistD(dirname);if(!ifopen[k][i].ifopen){if (ufd[k]->ufdfile[i].fmode==3){printf("\nError. The file\'s mode is FORBID. Can not open.\n");wgetchar=1;}else{printf("Please input FileOpenMode(0-Read Only,1-Write Only,2-Read and Write):");gets(fmode);ltrim(rtrim(fmode));if((strcmp(fmode,"0")==0)||(strcmp(fmode,"1")==0)||(strcmp(fmode,"2")==0)){if(fmode[0]=='0') /*open file with read only mode*/{strcpy(str,"read only");if((ufd[k]->ufdfile[i].fmode==0)||(ufd[k]->ufdfile[i].fmode==2)) ifopen[k][i].ifopen=1;}else if(fmode[0]=='1') /*open file with write only mode*/{strcpy(str,"write only");if((ufd[k]->ufdfile[i].fmode==1)||(ufd[k]->ufdfile[i].fmode==2)) ifopen[k][i].ifopen=1;}else if(fmode[0]=='2') /*open file with read and write mode*/{strcpy(str,"read and write");if(ufd[k]->ufdfile[i].fmode==2) ifopen[k][i].ifopen=1;}if(ufd[k]->ufdfile[i].fmode==0) strcpy(str1,"read only"); /*FileMode*/else if(ufd[k]->ufdfile[i].fmode==1) strcpy(str1,"write only");else if(ufd[k]->ufdfile[i].fmode==2) strcpy(str1,"read and write");if(ifopen[k][i].ifopen==1){ifopen[k][i].openmode=atoi(fmode);if (ifopen[k][i].openmode==0) strcpy(str,"read only");else if(ifopen[k][i].openmode==1) strcpy(str,"write only");else if(ifopen[k][i].openmode==2) strcpy(str,"read and write");printf("\n\'%s\' has been opened. OpenMode is %s,FileMode is %s\n",fname,strupr(str),strupr(str1));wgetchar=1;}else{printf("\nError. \'%s\' hasn\'t been opened. OpenMode Error. OpenMode is %s,but FileMode is %s\n",fname,strupr(str),strupr(str1));wgetchar=1;}else {printf("\nError. FileOpenMode\'s Range is 0-2\n");wgetchar=1;}}}else {printf("\nError. \'%s\' is in open status.\n",fname);wgetchar=1;}}else{printf("\nError. \'%s\' does not exist.\n",fname);wgetchar=1;}}void CloseF() /*Close File*/{int i,k,n=0;char fname[MAXNAME];char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(ltrim(rtrim(dirname))),"")==0){printf("\nError. Please convert to ufd dir before close.\n");wgetchar=1;return;}k=ExistD(dirname);printf("\nOpen File(s) In This Ufd:\n");/*display openned file*/for(i=0;i<fcount[k];i++){if (ifopen[k][i].ifopen==1) {printf("%15s",ufd[k]->ufdfile[i].fname);n++;}if((n%4==0)&&(n!=0)) printf("\n");}printf("\n%d files openned.\n",n);if (n==0) wgetchar=1;if(n!=0){printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if(i>=0){if(ifopen[k][i].ifopen==1){ifopen[k][i].ifopen=0;ifopen[k][i].openmode=4;printf("\n\'%s\' has been closed successfully.\n",fname);wgetchar=1;}else {printf("\nError.\'%s\' is in closing status.\n",fname);wgetchar=1;}}else {printf("\nError. \'%s\' is not exist.\n",fname);wgetchar=1;}}}void ReadF() /*Read File*/{int i,k,n=0;char fname[MAXNAME];char str[255],str1[255],c;char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);if (strcmp(strupr(ltrim(rtrim(dirname))),"")==0) {printf("\nError.Please convert to ufd dir before read.\n");wgetchar=1;return;}printf("\nCaution:Open file first\n");printf("Opened File(s) List:\n");k=ExistD(dirname);for(i=0;i<fcount[k];i++){if (ifopen[k][i].ifopen==1)if ((ifopen[k][i].openmode==0) ||(ifopen[k][i].openmode==2)){printf("%15s",ufd[k]->ufdfile[i].fname);n++;}if((n%4==0)&&(n!=0)) printf("\n");}printf("\n%d files openned.\n",n);if (n==0) wgetchar=1;if(n!=0){printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if(i>=0){if(ifopen[k][i].ifopen==1){if((ifopen[k][i].openmode==0) ||(ifopen[k][i].openmode==2)){itoa(ufd[k]->ufdfile[i].fpaddr,str,10);strcpy(str1,"file");strcat(str1,str);strcpy(str,"c:\\osfile\\file\\");strcat(str,str1);fp_file=fopen(str,"rb");fseek(fp_file,0,0);printf("\nThe text is:\n\n");printf(" ");while(fscanf(fp_file,"%c",&c)!=EOF)if (c=='\n') printf("\n ");else printf("%c",c);printf("\n\n%d Length.\n",ufd[k]->ufdfile[i].flength);fclose(fp_file);wgetchar=1;}else{printf("\nError.\'%s\' has been opened with WRITE ONL Y mode. It isn\'t read.\n",fname);wgetchar=1;}}else {printf("\nError.\'%s\' is in closing status. Please open it before read\n",fname);wgetchar=1;}}else {printf("\nError. \'%s\' does not exist.\n",fname);wgetchar=1;}}}void WriteF() /*Write File*/{int i,k,n=0;char fname[MAXNAME];char str[50],str1[50],a[50];char *rtrim(char *str); /*remove the trailing blanks.*/char *ltrim(char *str); /*remove the heading blanks.*/int ExistF(char *filename); /*Whether FileName Exist,Exist-i,Not Exist-0*/int ExistD(char *dirname);int WriteF1(); /*write file*/if (strcmp(strupr(ltrim(rtrim(dirname))),"")==0) {printf("\nError. Please convert to ufd dir before write.\n");wgetchar=1;return;}k=ExistD(dirname);printf("\nOpen File(s) with write only mode or read and write mode:\n");/*display openned files with writable mode*/for(i=0;i<fcount[k];i++){if (ifopen[k][i].ifopen==1)if ((ifopen[k][i].openmode==1) ||(ifopen[k][i].openmode==2)) {printf("%15s",ufd[k]->ufdfile[i].fname);n++;}if((n%4==0)&&(n!=0)) printf("\n");}printf("\n%d files open.\n",n);if (n==0) wgetchar=1;if(n!=0){printf("\nPlease input FileName:");gets(fname);ltrim(rtrim(fname));i=ExistF(fname);if(i>=0){if(ifopen[k][i].ifopen==1){if((ifopen[k][i].openmode==1) ||(ifopen[k][i].openmode==2)){itoa(ufd[k]->ufdfile[i].fpaddr,str,10);strcpy(str1,"file");strcat(str1,str);strcpy(str,"c:\\osfile\\file\\");strcat(str,str1);if (ufd[k]->ufdfile[i].flength!=0){printf("\n\'%s\' has text. Overwrite or Append(O-overwrite,A-Append,else-not write):",fname);gets(a);ltrim(rtrim(a));if (fp_file!=NULL) fclose(fp_file);if (strcmp(strupr(a),"O")==0){printf("\nOverwrite\n");fp_file=fopen(str,"wb");ufd[k]->ufdfile[i].flength=0;ufd[k]->ufdfile[i].flength=WriteF1();}else if(strcmp(strupr(a),"A")==0){printf("\nAppend\n");fp_file=fopen(str,"ab");ufd[k]->ufdfile[i].flength=ufd[k]->ufdfile[i].flength+WriteF1();}else{printf("\nError.\'%s\' has not been written.\n",fname);fclose(fp_file);wgetchar=1;}}else{fp_file=fopen(str,"wb");ufd[k]->ufdfile[i].flength=WriteF1();} }else{printf("\nError. \'%s\' has been opened with read only mode.It isn\'t writed.\n",fname);wgetchar=1;}}else{printf("\nError. \'%s\' is in closing status. Please open it before write\n",fname);wgetchar=1;}}else{printf("\nError. \'%s\' does not exist.\n",fname);wgetchar=1;}}}void QuitF() /*Quit FileSystem*/{int i,j;char str[50];void SetPANo(int RorW); /*Set physical address num,0-read,1-write*/SetPANo(1);。