Just like RAM, hard drives (or, more likely these days, solid state drives) provide us with a contiguous stretch of memory where we can store information.
Thanks to Ryan Eberhardt for the illustrations and most of the text used in these slides.
class Drive {
public:
size_t getNumSectors() const;
void readSector(size_t num, void *data) const;
void writeSector(size_t num, const void *data);
}; // your Project 7 repo exports a pure C version of this
// via the diskimg module
/usr/class/cs111/WWW/index.html
—to seemingly magic numbers that incidentally identify where the corresponding inodes sit in the inode table.assign6
solution sit in a file named /usr/class/cs111/staff/solutions/assign6/mcryptfile.cc
. At 54 characters, the name wouldn't fit in an inode./usr/class/cs111/example.txt
. First, we find the inode for the file /
(which by design is always associated with inumber 1). We search inode 1's payload for the token usr
and its companion inumber. Let's say it's at inode 5. Then, we get inode 5's contents and search for the token class
in the same way. From there, we look up the token cs111
and then example.txt
.