// sEXT2 - Simple File System Example // Type Definition Language File // structures are assumed to be aligned to double-word // boundaries. fields are tightly packed, so reserved bits // can be used to add neccesary padding Disk *d; structure Block { reserved byte[d.s.blocksize]; } structure Disk { Block b[d.s.NumberofBlocks]; label b[0]: Superblock s; label b[1]: Groupblock g; } structure Superblock subtype of Block { int FreeBlockCount; int FreeInodeCount; int NumberofBlocks; int NumberofInodes; int RootDirectoryInode; int blocksize; } structure Groupblock subtype of Block { int BlockBitmapBlock; int InodeBitmapBlock; int InodeTableBlock; int GroupFreeBlockCount; int GroupFreeInodeCount; } structure InodeTable subtype of Block { Inode itable[d.s.NumberofInodes]; } structure InodeBitmap subtype of Block { bit inodebitmap[d.s.NumberofInodes]; } structure BlockBitmap subtype of Block { bit blockbitmap[d.s.NumberofBlocks]; } structure Inode { int filesize; int Blockptr[12]; int referencecount; } structure DirectoryBlock subtype of Block { DirectoryEntry de[d.s.blocksize/128]; } structure DirectoryEntry { byte name[124]; int inodenumber; }