1 / 17

Week 8

Week 8. February 26, 2004 Adrienne Noble. Important Dates. Due Friday, Feb 27 Homework 8 Due Wednesday, March 10 Project 4. Questions?. Lecture Homework 8 Project 4. Project 4. Modify a Linux file system Currently, 13KB files 8000 distinct files 30 character file names

zander
Download Presentation

Week 8

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Week 8 February 26, 2004 Adrienne Noble

  2. Important Dates • Due Friday, Feb 27 • Homework 8 • Due Wednesday, March 10 • Project 4

  3. Questions? • Lecture • Homework 8 • Project 4

  4. Project 4 • Modify a Linux file system • Currently, • 13KB files • 8000 distinct files • 30 character file names • Your project: • Increase maximum file size • Increase maximum file name length

  5. Where to start • Go through the mechanical aspects of compiling and running the file system • How to link a module into the linux source tree. • Refresh your VMWare skills • Read over the code • cse451fs.h is a good place to start

  6. A file system on disk • Given a file system on a 4MB disk with 1KB blocks (4096 blocks total), how would you represent the following on disk? • / • etc • passwd • fstab • bin • sh • date

  7. Other specifics • Only one partition • Used for the cse451fs • File sizes are as follows: • /etc/passwd: 1024 bytes • /etc/fstab: 100 bytes • /bin/sh: 10,000 bytes • /bin/date: 5,000 bytes • Structure on disk

  8. Sizes on disk 1 1 1 85 4008

  9. Boot Block • Contains the bootloader executable • Not really part of the file system, so we won’t discuss it today

  10. Superblock • Contains the master information about the file system (superblock recorde) and the inode map • Superblock record has the following format: (from cse451fs.h) struct cse451_super_block { __u16 s_nNumInodes; // inode map is tail of superblock __u16 s_nDataMapStart; // block # of first data map block __u32 s_nDataMapBlocks; // data map size, in blocks __u32 s_nInodeStart; // block # of first inode block __u32 s_nNumInodeBlocks; // number of blocks of inodes __u32 s_nDataBlocksStart; // block # of first data block __u32 s_nDataBlocks; // number of blocks of data __u32 s_nBusyInodes; // number of inodes in use __u16 s_magic; // magic number char s_imap[0]; // name for inode map };

  11. Superblock Values

  12. Inode Map • Tracks which inodes are currently in use • We have 3 directories and 4 files • Total of 7 inodes required • Possible inode map would have the first 7 bits in the 33rd bype of the superblock set to 1, with the remaining 7937 bits set to 0

  13. Data Map • Tracks which data blocks are currently in use – just a bit array

  14. Inode Blocks • Only 7 inodes allocated • Assuming inode map like before, the first 7 inodes are valid • These fit on a single block (7*64<1024) • Inodes have the following format: (from cse451fs.h) struct cse451_inode { __u16 i_mode; __u16 i_nlinks; __u16 i_uid; __u16 i_gid; __u32 i_filesize; __u32 i_datablocks[CSE451_NUMDATAPTRS]; };

  15. Inode Values

  16. Data Blocks • First 20 data blocks are in use • File blocks contain arbitrary data (whatever the file contains) • Directory blocks contain the following: struct cse451_dir_entry { __u16 inode; char name[CSE451_MAXDIRNAMELENGTH]; };

  17. Block 88

More Related