资源预览内容
亲,该文档总共2页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
操作系统 课程设计Operating Systems, Module PracticeRequirements1 Review Unix file system design and i-node usage.2 Design and implement an i-node-based Unix-style file system.3 Implement basic functionalities specified in the following section.4 The task needs to be completed using C+ ONLY Tasks/FunctionalitiesThe following functions are required in your file system: 1 Allocate 16MB space in memory as the storage for your file system. The space is divided into blocks with block size 1KB Assume address length is 24-bit,please design your virtual address structure.Design what information should be contained in an i-nodeThe i-node should support 10 direct block addresses, and one indirect block address2 The first a few blocks can be used for storing the i-nodes, and the first i-node can be used for the root directory (/). (You can design the structure as you like, as long as it is reasonable and well explained in your report.)3 Using random strings to fill the files you created. It means you just need to specify the file size (in KB) and path+name.4 Following commands should be supported in your system:a) A welcome message with the group info (names and IDs) when the system is launched. It is also the claim of your copyrightb) Create a file:createFile fileName fileSize i.e.:createFile /dir1/myFile 10 (in KB)if fileSiz max file size, print out an error message.c) Delete a file:deleteFile filename i.e.:deleteFile /dir1/myFiled) Create a directory:createDir i.e.:createDir /dir1/sub1 (should support nested-directory)e) Delete a directory:deleteDir i.e.:deleteDir /dir1/sub1 (The current working directory is not allowed to be deleted)f) Change current working direcotry:changeDir i.e.: changeDir /dir2g) List all the files and sub-directories under current working directory:dir You also need to list at least two file attributes. (i.e. file size, time created, etc.)h) Copy a file : cp i.e.: cp file1 file2i) Display the usage of storage space:sum Display the usage of the 16MB space. You need to list how many blocks are used and how many blocks are unused. j) Print out the file contents: cat Print out the contents of the file on the terminali.e: cat /dir1/file1k) You are NOT required to implement the function of Login!5 Loading and exiting: exit the program and release all the memory occupied, but the contents of the memory should be stored on your disk for re-loading;
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号