‫What is a file system, a file system is a structure that describes how information is laid on a desk,
‫desks are not aware of files.
‫The operating system knows the file system structure, so it knows how to read files from the desk.
‫The disk itself is not aware of the files.
‫The operating system knows how to locate the files due to the file system structure.
‫First, let's discuss a little bit about discuss how this can be thought of as a giant array of information
‫split into sectors.
‫So, as you know, we have 512 bytes sectors on most hard disks, right.
‫So Sector zero would be the first 512 bytes.
‫Sector one would be the second 512 bytes and so on.
‫You know, it's essentially just a giant array of bytes.
‫That's what a disk is.
‫And we just split them into sectors.
‫That said, this is all the disk is aware of.
‫It's not aware of any files at all.
‫Files don't exist on the disk, just data exists on the disk.
‫So obviously the actual file data is stored on the desk.
‫But what I'm trying to say is the disk itself isn't aware that that's a file.
‫It just sees bytes of information.
‫It doesn't know that that's a father has no concept of files.
‫So as you know, on a disk, each sector is represented by biological block address number.
‫We can use this number to load the sector into memory zero for the first sector, one for the second
‫sector and so on.
‫So as I've already explained this, I have no concept of files.
‫So what is the some structure?
‫Well, the file system structure contains raw data files and that data is stored in the files.
‫But as I've said before, the disk is in a way that that's file data.
‫The disk has no concept of files at all.
‫So the file system structure contains the file system structure header, which explains many things
‫like how many files are on the disk where the root directory is located.
‫And so if your disk is formatted with a file system, usually the fastest structure header is the first
‫sector of the disk at this point or the first sector of the partition.
‫So the way files are laid out on a disk is different depending on the file system you were using.
‫There's so many file systems, there's fat sixteen fat 32 NTFS and much more.
‫Your operating system has to be programmed to understand the file system you want to read.
‫Otherwise it's no different than the disk.
‫It just sees an array of data.
‫It has no concept of files.
‫By implementing a file system, you implement the ability to read and write files to a disk.
‫So without file systems, we would be forced to read and write data through the use of sector numbers.
‫And this would likely cause corruption because you would have to remember that you've already written
‫the sector four, five and six.
‫You understand.
‫So systems are very important or files wouldn't actually exist.
‫So Fat Sixteen is Microsoft's file system that stands for File Allocation Table.
‫And in this case I'm describing the fact sixteen file system, you have fat thirty two as well and so
‫on.
‫But when describing fat sixteen here.
‫So the first sector in this file system format is the boot sector on a disk.
‫Essentially the first three bytes of this boot sector are usually a short jump to some label further
‫down the boot sector.
‫Right.
‫And then everything between that label and the short jump is basically attributes that describe the
‫file system.
‫Now, we'll get more on this later on, but I just want you to have a brief understanding.
‫So this will be like how many reserved sectors there are and so on.
‫So, yeah, let's continue.
‫After the boot sector, which describes the file system, we have the reserved sectors now.
‫Reserved sectors are specified in the boot sector.
‫By the way, there's a field in the boot sector and you have to remember that this isn't automatic.
‫We have to program operating system to read this reserved sectors field and ensure that it doesn't include
‫the five sectors below as part of the file system.
‫We have to program all that.
‫And this is an automatic right.
‫So essentially the reserve sector field is stored in the boot sector, OK, between the short jump and
‫the label.
‫But you don't have to worry because we're getting old onto this later on, but you just need to have
‫it in the back of your minds at the moment.
‫So after reserve sectors, we have our first file allocation table.
‫This table contains values that represent which clusters on the disk are taken, which are free.
‫It also has other attributes, such as which sectors are and inaccessible and, you know, stuff like
‫that.
‫So the allocation table is basically used to determine which places on the disk are free for use and
‫which are not OK.
‫If you remember when we created the heap, we had the heap entry table, right.
‫Remember, we had different values for if it's taken or free, similar sort of concept, but a bit more
‫advanced.
‫So simply put, our file allocation table describes which areas on the disk of free in which are now
‫and a file allocation table cluster essentially just means a bunch of.
‫Is that come together?
‫So, for example, one sect is five, 10, 12 bytes, right?
‫Well, one cluster might be four sectors, just as an example.
‫Right.
‫And these values are actually stored in the boot sector.
‫OK, so the first sector that describes the fastest format.
‫So after our first file allocation table, we usually have a second file allocation table.
‫However, this is optional, so we probably won't include it on this course because it's just extra
‫work.
‫The second allocation table can sort of be used as a backup.
‫You know, I mean, in case there's some corruption.
‫So after the first and second file allocation tables, we have our root directory and this explains
‫what files and directories are in the root directory of the filesystem.
‫Each entry has a relative name that represents the file or directory name attributes such as Read-Only,
‫the address, the first cluster representing the data on the desk and much more.
‫Finally, after the route direct, we have the data region.
‫So all of our data here is here, all of our file data and so on.
‫So this is a graphical representation of a fat directory entry.
‫I think this is for Fat 32, though, but the same concept applies.
‫So essentially in our fat directory you have a bunch of the directory entries, right?
‫So you can see the dust file name here.
‫So we can see us Corto one texte, you can see reserved last access day hibbits the family to cluster.
‫You know we are going to be implemented fat 16.
‫So it's a little different for us, but it applies sort of the same file size and bytes, extra attributes,
‫the checks OK, which can be used to help against corruption and so on.
‫Dussart sophistication, date and time, modification, date and time.
‫And you know, this also points to the first cluster where that file is on disk, the actual data of
‫Kottoor 160.
‫So why should you take away from this disk?
‫Don't understand files that just a giant array of bytes, operating systems, Ninfa system drivers,
‫so they can read and write to disk.
‫Every file system is different.
‫So you're not going to be able to load NTFS file system if you have implemented file allocation table
‫file system without implementing a file system in your operating system, you cannot have files.
‫It just is not possible.
‫So, you know, there's currently no functionality in your operating system at the moment to be able
‫to say load test text.
‫You can't tell the disk to load test object.
‫It wants to know which sector you want to load.
‫So this is our job to implement appropriate file system.