P2 grading is done Unions: Let's do an actual demo Poor unions always get swept under the rug The nature of data: Structures, strings, and arrays "pickle", or just write to disk padding can cause issues doing this directly Dynamic data structures may take some searching Memory addresses won't be ok if written/resurrected File Systems, OS Perspective Unified file tree (independent of hardware) open file table Multiple users may open a file at once Open count and lsof Use count inode (index node?) - ls -i - ReiserFS omits inode table - struct inode - vnodes in BSD Links to inodes and stat Loops in linking and symbolic links vs. hard links - find with symbolic link loop Copy using hard link types and file "magic numbers" in files #! permissions and execution Mounting directories (sshfs, usb) - automount daemons - mounting in multiple places Multiple users and tail -f Unix permissions vs. ACL opening a file and file descriptors OS structures: inode (index node) dentry (directory entry) superblock (describes a filesystem) file (file object, directories have one too) Each of this contains a _operations structure If these aren't on the disk, they must be generated - Some filesystems always generate all of them - dentry is typically generated - Reiserfs generates inodes - Non-unix filesystems generate them - You can just write a struct to disk OO concepts: We don't have c++ - No implicit this/self VFS is designed using an OO paradigm In some cases a default operation can be inherited Operations for each of these So could we just add operations, like lseek or whatever? Sure Let's add a secret command to some module we wrote