test5pt1.data
来自「操作系统课内实验部分」· DATA 代码 · 共 53 行
DATA
53 行
// test5pt1.data: Tests the flushing of data to disk.// This is the first part of a two part test. It will open up numerous// files, flush their contents to disk, and then shutdown the system. The// second part of this test will read the files back in. You should run// the second test after running the first (i.e. do not run other tests// in-between).// IMPORTANT: In order for this test to work correctly, your shutdown() // function must call Disk.stop(false) -- else the disk file will be cleared // in between these tests. Further, you must be assigning inumbers in order// starting with 1.// 1. Format the disk with 100 blocks total, of which 10 are inode blocksformatDisk 100 10// 2. Create file1: has 2 contiguous blocks from the startfile1 = createinum1 = inumber file1// IMPORTANT: result for inumber should be 1// Blocks 0-1write file1 Happiness_ 1024// 3. Create file2: has 1 singly-indirect block, not block alignedfile2 = createinum2 = inumber file2// IMPORTANT: result for inumber should be 2// Blocks 20-21seek file2 10496 0write file2 is_a_ 512// 4. Create file3: has 2 sets of 3 indirect blocks, not block alignedfile3 = createinum3 = inumber file3// IMPORTANT: result for inumber should be 3// Blocks 143-146seek file3 73472 0write file3 warm_puppy_ 1536// Blocks 130221-130224seek file3 66673408 0write file3 warm_puppy_ 1536// 3. Close all filesclose file1close file2close file3// 4. Shut down and quitshutdownquit
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?