‫Hello and welcome, and in this lecture, we're going to implement the step function.
‫Now, if you look at the exact function on Google, you will see that it's responsible for getting information
‫about a file such as the file size and so on.
‫So we are going to be implementing our own version of that today for the virtual file system layer.
‫We won't implement the Fat 16 version yet.
‫That will come in the next lecture.
‫So let's now begin go to file DOT Hajj and just under the follow the script, we're going to create
‫a struct of files.
‫Stass and that's going to take files that flags and a unit 32 t of file size.
‫OK, so if we just scroll up to the top by here, we're going to go enum.
‫Files that reads only, so this will be present when it is read only essentially.
‫So we just scroll down, we can see the files, typed flags here.
‫This will be present if it's read only.
‫So if we just go equals zero be zero zero zero zero zero zero zero zero and a backspace and do one are
‫that represents read-only.
‫So this bit will be set if it's read only.
‫If the files read only, so now we're going to go typedef, unsigned in a file start, flags as simple
‫as that.
‫OK, great, if we know just to make clean bill to the stage to make sure those structures are right,
‫we see that Kampala's absolutely fine, so there's no problem.
‫OK, let's go to the top of this file and we're going to implement the function pointer for F-stop now.
‫So now under the seek function, we're just going to go typedef in it.
‫If stacked function.
‫Struck desk desk void private struct files that stat, OK, and then just by here, we're going to have
‫a first step function in this structure here and we'll just call it stat.
‫OK, so we're now going to go to file that sea and we're going to implement the F function in the virtual
‫file system functionality here.
‫OK, so just above sike, let's go in it f stacks and F.T. struct files stacked stacked.
‫So this is the pointer that they provide to us that we work out with, that we are going to fill essentially
‫guys.
‫So we're going to say Imitrex equals zero struct file descriptor descriptor equals file get descriptor
‫and we're going to put in F.T. here.
‫If the script is no, then this is an invalid open file.
‫They've passed us and we're going to return the response to VEO.
‫So go to our right here and we're just going to return address and by here we're going to go rascal's
‫just script file system stacked.
‫And we're going to go to scripter desk to script a private and we're going to pass in the STAP.
‫And now let's just get the prototype here and we're going to put it into Father Hajj.
‫OK, we're just going to make a clean bill that S.H. and we can see there's an error and I can see exactly
‫what's wrong is so simple.
‫Scroll up, guys.
‫False start here.
‫This structure, it needs to be.
‫Above the step function, because we use the struct Farstad here, either that or forward declare it,
‫guys, you know what that means.
‫OK, so if we now build that again, we can see that works absolutely fine.
‫No problems.
‫OK, so we've now implemented the generic F-stop functionality.
‫Next lecture will implement the fat 16 virtual filesystem F-stop functionality.