This is a new file system for xv6. It is based on the original file system of xv6. We implement Ext3 Extended File System and Ext4 file system for xv6.
- support big files
- support symbolic links
- support file permissions
- support inode bitmap
- support file system meta information
- support HTree(Hash Tree) directory index
- support Extents Feature of Ext4
- support file system recycle bin
- support
lseek
andappend
operation
The operating environment of our team is the Windows Subsystem for Linux (WSL), the Ubuntu operating system, and the configuration process is as follows
-
Install Windows Subsystem for Linux (WSL)
-
Install Ubuntu 20.04 from the Microsoft Store on WSL.
-
Install the compilation toolchain in Ubuntu:
-
$ sudo apt-get update && sudo apt-get upgrade $ sudo apt-get install git build-essential gdb-multiarch qemu-system-misc gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu
-
-
Enter the xv6 decompressed directory, right-click to open with vscode, and enter in the shell
make qemu
==Note==: It will take a long time to run make qemu for the first time. This is because the file system image needs to be created. Since our team needs to implement large files, the created file system image is very large (300,000 blocks) , you should wait for 2-3 minutes when executing the output to the following paragraph, it is creating a file system image, please wait patiently for a while.
# Wait a while after outputting this line
nmeta 1587 (boot, super, log blocks 45, inode bitmap blocks 2, inode blocks 1501, bitmap blocks 37) blocks 298413 total 300000
Note: To exit the xv6 system under windows, press ctrl
+a
and release it, then press X
If you are not a windows operating system, such as macos, just refer to https://pdos.csail.mit.edu/6.828/2021/tools.html for the configuration process.
If you want to clear the compiled operating system
make clean
(Use it with caution, it will take a long time to run, it is recommended that you directly watch our screen recording file, so you can directly drag the progress bar to the end to see the result)
big
This is a test program, the user program big, which will continue to write content to a file before the set file size is reached, so as to test whether a file can reach a large enough size. During operation, the block counter will update the number of written blocks in real time on the command line, and report the test success after reaching the preset number.
test
symlinktest
There are two test files for soft links: test
and symlinktest
test
is a simple test program that only tests the creation process of soft links. But the created file can be displayed by thels
command, and then you can continue to operate on the file to verify whether the soft link is successful (we demonstrate how to use the soft link in the screen recording filesoft link.mp4
).symlinktest
is a comprehensive soft link test, which includes almost all possible problems in the process of creating, modifying and deleting soft links. This test function comes from the xv6 official github repository: https://github.com/mit-pdos/xv6-riscv-fall19/blob/xv6-riscv-fall19/user/symlinktest.c
chmode [filename] [0/1/2/3]
The second parameter: 0 means unreadable and unwritable
1 means not readable and writable
2 means only readable but not writable
3 means both readable and writable
chspmode [filename] [admin password] [0/1]
Administrator identity password input iam@admin9876
The third parameter 0 means it is set as a normal file, and 1 means it is set as a sensitive protected file
delete [file]//delete file
refresh [file]//restore file
recyclelist//Display the files in the recycle bin
Files in the delete recycle bin can be permanently deleted
fsinfo
lseektest
This command will test the lseek function, and the test results can be seen in section 3.8.
The function of append can be used by the relocation symbol >>
to append characters to the text file.
echo [string] >> test.txt
search_test
This command will create more than 150 files and perform sequential access and random access, and output the running time. See section 3.5 for the running results.
This command will test the speed comparison between ext3's multi-level link index and ext4's extents. The first parameter is the number of blocks to be tested. Note that the effect of extents is not obvious when the number of blocks is small, and a relatively large number of blocks is required, but it takes a long time (30 minutes for a comparison of 50,000 blocks). You can see our screen recording file video/ extenttest.wav
, so that you can directly drag the progress bar to the end to see the result.
extentstest2 [number of blocks]
ibmaptest [number of inodes]
The first argument is the number of allocation inode
to test. will output the time spent allocating the specified number of inode
to create an empty file.
In order to facilitate your comparison, we have recorded a video demo or test video/comparison_old_xv6_ibmap_500.mp4
of the time it takes for ibmaptest
to allocate 500 inode
on the original xv6 system.
xv6 comes with the usertests.c
file, which can test whether there are bugs in all aspects of the operating system. After implementing the new functions and modifications, we passed its usertests
, indicating that we did not destroy the original functions. .
usertests
See doc/file_system_for_xv6.md
for details.
See demo and test video
directory.
- Qi Ma(马骐) ✉️email
- Leyi Pan(潘乐怡 )
- Ao Sun(孙骜 )
- Peiran Xu(徐霈然)
-
MIT's 6.828 course is used to test the official test file of the large file function https://pdos.csail.mit.edu/6.828/2018/homework/big.c
-
Soft link test file symlinktest.c of xv6 official Github repository: https://github.com/mit-pdos/xv6-riscv-fall19/blob/xv6-riscv-fall19/user/symlinktest.c
-
Daniel Phillips proposed the HTree algorithm paper
Phillips, Daniel. "A Directory Index for {EXT2}." 5th Annual Linux Showcase & Conference (ALS 01). 2001. https://archive.ph/20130415075208/http://www.linuxshowcase.org/2001/full_papers /phillips/phillips_html/index.html#selection-99.0-99.26
-
Blog: Analysis of EXT3 Directory Indexing Mechanism https://oenhan.com/ext3-dir-hash-index
-
Extents feature: https://github.com/RitwikDiv/xv6-PA4
MIT License