WEBVTT 1 00:00:01.979 --> 00:00:10.440 William Cheng: Welcome to lecture 13. So, Colonel. One is, do tonight. If you have co from previous semester, don't look at them. Don't copy them best to get rid of it. 2 00:00:10.980 --> 00:00:20.130 William Cheng: Grading guidelines. The only low grade, you know, really carefully and semi question. If you're not sure, especially about self checks and stuff like that. 3 00:00:20.640 --> 00:00:31.920 William Cheng: And so, and don't run Keisha and a separate process has in Section C and D of grading guidelines must write in the foreground and then they have to run the child process, etc. 4 00:00:32.430 --> 00:00:33.870 William Cheng: They have to show correct print out 5 00:00:34.620 --> 00:00:44.400 William Cheng: If you're confused by self checks, send the email after the submission and make sure you verify your kernel submission. So again, it's a very, very important step, especially if you have a group. If you mess up. 6 00:00:44.820 --> 00:00:55.770 William Cheng: There's nothing I can do. And then everybody's going to lose, you know, lots of points. So make sure you do that you should also start using the colonel debugging commanded GDP. Right. 7 00:00:57.960 --> 00:01:05.070 William Cheng: Colonel to. So guess after today's over and we're going to start doing Colonel to the implementation timeline is as follow 8 00:01:05.850 --> 00:01:17.550 William Cheng: This weekend. So I guess the problem that we're going to have a midterm next week. So you need some time to study will mature, but since niche is open book, open notes you still needs to be, you know, sort of pretty familiar with the material. 9 00:01:18.570 --> 00:01:20.370 William Cheng: So, so you should you should you should study for the midterm. 10 00:01:21.570 --> 00:01:26.700 William Cheng: The. You should also start working on Colonel, too. So over here by recommended timelines that by the end of this weekend. 11 00:01:27.300 --> 00:01:38.790 William Cheng: Gate Keisha to work with the bfs. So again, you should watch Week seven discussion section video so you know it's a little know sort of a 12 00:01:39.690 --> 00:01:48.660 William Cheng: Schedule a pretty sure you should take a look at that. And of course, you know, don't forget to study for them into the exam counts, a lot, right, the minimum is 25% 13 00:01:49.290 --> 00:02:01.140 William Cheng: You'll, you'll programming assignments. The Colonel programming is that every Colonel programming assignments only 10% of your overall grade, okay so mid term is 25% so you can see that it's wait a lot right so you should study for it. 14 00:02:02.340 --> 00:02:08.610 William Cheng: You know you though. So, you know, so you can get a good grade after material as soon as the midterm is over. 15 00:02:09.180 --> 00:02:14.970 William Cheng: You should fix your co and try to pass all the testing BFS tests. And then finally, there's something called favor FS test. 16 00:02:15.480 --> 00:02:24.150 William Cheng: So the idea of BFS tears is the only test the virtual file system. The favor FS test that has is to test BFS, together with your threat code. 17 00:02:25.050 --> 00:02:33.510 William Cheng: Okay, so, so if you don't have a solid DFS, you shouldn't waste your time in trying to get a favor FSS to work. Okay. Because testing, you know, together with threats and BFS. 18 00:02:33.840 --> 00:02:38.100 William Cheng: Odd instead of a little more trickier. The because there's race condition and all that kind of stuff. Yeah. 19 00:02:38.670 --> 00:02:53.550 William Cheng: Alright, so you should make sure you do reference counting correctly. So when you shut down your, you know, your kernel to make sure you see the hurdle. How to cleanly. Sometimes you don't see the colonel called cleanly. You want to see the error message to say that there is 20 00:02:54.570 --> 00:03:06.930 William Cheng: That you know there's what's called active V notes inside BFS and refuse to shut down. Right. So again, read the grading guidelines to see how many points you will lose. We have activity notes. So you should get your, you know, 21 00:03:08.280 --> 00:03:15.210 William Cheng: You should fix your kernel so that you know you won't have any activity notes now. So again, this is all related to reference counting 22 00:03:15.600 --> 00:03:19.200 William Cheng: If you over reference. If you over reference me know you're going to end up with activity notes. 23 00:03:19.980 --> 00:03:27.240 William Cheng: Right. You should also in Colonel to we need to step into the CO brand file system to understand how polymorphous them work. 24 00:03:27.930 --> 00:03:33.240 William Cheng: You know when you open a file, it could be a regular filed. It could be a device files in that case it's a special file so 25 00:03:33.660 --> 00:03:46.800 William Cheng: So again, there are different kinds of polymorphous em and also positivism, meaning that you know the the the the virtual file system can can use different actual file system using exactly the same kind of pointer. OK. So again, I'll read the code to understand that. 26 00:03:48.060 --> 00:03:54.300 William Cheng: Read a comment blocks, above all these function. Read the Linux men pages if there's a function that you enough of a little with please 27 00:03:54.960 --> 00:04:01.320 William Cheng: Keep in mind that we Unix and Linux are not the same thing. So just because you saw something in the main page doesn't mean that you have to implement it. 28 00:04:01.620 --> 00:04:10.350 William Cheng: And also, you know, the comment block or the other requirements for Brown University and they are now requirement for us for us. You just have to pass all these tests. 29 00:04:11.160 --> 00:04:17.100 William Cheng: So, so, so there are things you might not have to implement. Okay. All right. If you have questions, feel free to send them to me. 30 00:04:17.790 --> 00:04:36.960 William Cheng: I've decided to move the little rehearsal, a one day earlier. Originally I said it for Thursday, July 2 from 1PM to 1:40pm then I said, Well, you know, I should move it to us about the same time so I moved to Wednesday, you know, July 1 from 10 to 10 31 00:04:38.040 --> 00:04:46.740 William Cheng: And the midterm exam is the week after. On Tuesday, right at exactly the same time, right. So this way you can, you know, you can sort of get used that time. 32 00:04:47.520 --> 00:04:56.730 William Cheng: So, so one thing that went over in the last lecture, lecture 12 is to sort of, you know, tell you what to expect in the exam and please 33 00:04:57.240 --> 00:05:00.930 William Cheng: He is. He is one of the important or reminder right the exam. 34 00:05:01.260 --> 00:05:12.330 William Cheng: You know question, mostly come from the outcome of the lecture slides right because I cannot take the time to test change a textbook, so therefore any changes that have to make you know there are there many lecture slides. 35 00:05:13.140 --> 00:05:25.320 William Cheng: So, and please understand that the exam is the bomb material in this class. It doesn't matter what you have read anywhere else. Right. So if you see something on the internet that doesn't agree with my lecture slides my lecture slides. When 36 00:05:26.310 --> 00:05:35.850 William Cheng: Okay, so if you don't like my answer on the lecture slides. You have to complain to me now because once the exam starts is too late to say you don't like the answers on my, on my lecture slides now. 37 00:05:36.060 --> 00:05:42.840 William Cheng: If you can convince me to change my lecture slides because what you saw on the internet is correct. I have to make an announcement to make changes on that lecture slides. 38 00:05:43.080 --> 00:05:48.300 William Cheng: I have to make an announcement to the entire class to say that this slide has been changed. Okay, it's that serious. 39 00:05:49.080 --> 00:05:55.020 William Cheng: Okay, so. So what you need to know. We need to have you made a change to change your life. Just like we have to go through the process. 40 00:05:55.500 --> 00:05:58.860 William Cheng: So that was so, so that everybody will know that this particular lecture slide has been changed. 41 00:05:59.340 --> 00:06:05.160 William Cheng: Okay. All right, so remember these legislators, they be useful for very long time. I don't really think there are bugs on them. 42 00:06:05.520 --> 00:06:10.710 William Cheng: But again, if you find something, you know, feel free to contact me as soon as possible, right, once the exam starts too late. Yeah. 43 00:06:11.250 --> 00:06:23.490 William Cheng: And also please remember that I reserve the right to ask about things. I think that you should know and not on the lecture slide right because people always ask me, Should I memorize the lecture slides. Well, here's one good reason. You shouldn't memorize the lecture slides. 44 00:06:24.090 --> 00:06:35.580 William Cheng: Okay, because you're supposed to understand the lecture slides. Yeah. Alright. And the, the, the actual maternity exam is the week after. It's Tuesday. You know, on 45 00:06:36.600 --> 00:06:41.010 William Cheng: You know, July 7 it's a take home exam, you know, but you only have 46 00:06:41.490 --> 00:06:52.290 William Cheng: You only have 40 minutes to work on it from 10 o'clock to 1040. So what I would do is that I will send you the exam PDF file, you know, right before 10 o'clock, maybe a couple of minutes before that. Okay. 47 00:06:52.500 --> 00:06:58.380 William Cheng: The idea here is that you should work on it between 10 and 1040 so. So when I say 1040 meaning that at exactly 48 00:06:59.670 --> 00:07:04.890 William Cheng: Second, you have to stop working on your exam that you will be asked to sign the honor 49 00:07:05.970 --> 00:07:15.840 William Cheng: Honor Code pledge to promise that that that you won't cheat and also you have to stop working at exactly, you know, zero seconds after 10:40am that 50 00:07:16.530 --> 00:07:25.530 William Cheng: Right. And then, you have three minutes or something of an exam from 1040, you know, starting at 1040 zero seconds, but an extreme minutes you're supposed to, you know, there's some of your exam. 51 00:07:26.100 --> 00:07:33.270 William Cheng: So even if you finish, I mean the exam. You are not allowed to work on it. Right. So once you submit it then then you're done, you're not allowed to change it. 52 00:07:33.900 --> 00:07:44.910 William Cheng: So I think, again, if you read the the webpage. It says something like, if you make to submission and, you know, if you make to submission after zero seconds after 1040 53 00:07:45.780 --> 00:07:57.150 William Cheng: Then, then I'm going to take the first submission. Okay. So even if you make changes after that then then then they won't count. Yeah. And if you've missed. I mentioned before 1040 then by default. We're going to great the last submission 54 00:07:58.560 --> 00:08:04.980 William Cheng: Alright, so, so basically we're going to grade the, the, the, your exam that's closest to 1040 either before after it. Okay. 55 00:08:06.630 --> 00:08:17.760 William Cheng: So if your submission timestamp is 1043 or later. So I mean zero seconds after 1043 is considered late, I would detect 5% for every minute delay, right. So, therefore, if your submission times that is 56 00:08:18.000 --> 00:08:32.160 William Cheng: 1044 and then two seconds later you will lose 10% right because you know from 1043 to 1040 4040 don't lose 5%. And then the second minute over here you will lose another 5% okay so so please submit on time. 57 00:08:32.760 --> 00:08:36.960 William Cheng: Because I have a fairness policy, I have to treat everyone exactly the same using exactly the same rule. 58 00:08:38.100 --> 00:08:43.200 William Cheng: So if you have internet connectivity problem, right. Some people are there at home, all of a sudden the internet drops out over here. 59 00:08:43.470 --> 00:08:48.780 William Cheng: The late penalty can be waived. If you have a zoom recording to prove that you have internet connectivity problem. 60 00:08:49.200 --> 00:08:56.220 William Cheng: Okay, so there's a precise procedure. Last time I mentioned a one procedure in the last lecture. So now I'm going to modify them a little bit 61 00:08:56.370 --> 00:09:02.460 William Cheng: Alright, so this will be I think will be the final procedure and also the recording must begin doing the three minutes admission time 62 00:09:02.640 --> 00:09:08.910 William Cheng: Right doing those three minutes. You're going to really if you realize you have internet connectivity problem, then you have to start your zoom recording 63 00:09:09.570 --> 00:09:13.830 William Cheng: Okay, if it turns out you don't have any problem. Well, then in that case, you don't need zoom recording at all that 64 00:09:14.310 --> 00:09:23.580 William Cheng: If you often have internet connected apartment or home, you should practice recording of your desktop with zoom. Okay, so you have to do the code. The correct way. Otherwise, it doesn't count. There 65 00:09:24.390 --> 00:09:30.420 William Cheng: Alright, so, so here's I guess there's a web page tell you exactly what you have to do, right, so here's some sort of the highlight over here. 66 00:09:30.630 --> 00:09:38.790 William Cheng: When you try to record your desktop don't record an app or you have to record the entire desktop. So you should set up your desktop looking like this before 10am 67 00:09:39.690 --> 00:09:43.680 William Cheng: Okay, so you should have a clock running over here. So Windows, they call it alarms and clock. 68 00:09:44.250 --> 00:09:48.420 William Cheng: In on the map you can actually, you can go all the way to the top. You can click on that. 69 00:09:48.690 --> 00:09:57.060 William Cheng: That clock that's showing at the top will be here. And then you say you want to edit it or something like that, then you're gonna end up with the clock app that actually has the clock face on it. 70 00:09:57.330 --> 00:10:03.840 William Cheng: Right, so that will show you to click current clock. So, so what's important. Over here is that will you show a clock. The clock has to be ticking every second. 71 00:10:04.890 --> 00:10:05.280 William Cheng: That 72 00:10:06.870 --> 00:10:14.040 William Cheng: Will actually over here is there's three of you know the 3:05pm so so this clock over here is taking every minute or so as long as you know the 73 00:10:14.520 --> 00:10:20.460 William Cheng: Showing the real time clock that will be okay, right, it's best if you can actually show the number of seconds guys with this week and actually see this week. Okay. 74 00:10:20.700 --> 00:10:27.030 William Cheng: And they're right next to it over here. So, so you need to see the current time. So, this will be the current time on your desktop. 75 00:10:27.540 --> 00:10:34.800 William Cheng: Okay, and then you should, you know, running a web browser. And then, you know, get ready. As soon as you download your 76 00:10:35.400 --> 00:10:41.250 William Cheng: Data your midterm exam in the email, I will have two links for you one link is fidelity email. So that was 77 00:10:41.670 --> 00:10:49.080 William Cheng: One. One thing is for downloading your exam. So that's just like downloading the pristine kernel source code. And there's another one for you to make a submission 78 00:10:49.590 --> 00:10:52.560 William Cheng: Okay, so what you do. She also click on the second link to make a submission 79 00:10:52.770 --> 00:11:01.080 William Cheng: And it should look like this on this page over here is your warm up one submission. So it's going to be very, very similar, right, there's going to be a web form. I'll be here for you to fill out your email address. 80 00:11:01.380 --> 00:11:09.990 William Cheng: Also for your submission page. So please remember that the your submission pain is the same throughout the entire semester. So you can actually get your submission pin right now. So this way you'll be ready. 81 00:11:10.350 --> 00:11:18.600 William Cheng: Okay, put it in the file put in some more convenient and also write about the submission form over here. Every time will you reload this web page. If you have internet connection. 82 00:11:18.810 --> 00:11:24.030 William Cheng: Then the clock over here will be different and the club over here is showing the clock on the beast or server. 83 00:11:24.750 --> 00:11:29.820 William Cheng: Guys. But again, this is the clock on your desktop. And this is a cop on up. So server and they should be about the same. 84 00:11:30.240 --> 00:11:42.390 William Cheng: Okay, unless you sort of mess around with your cloud or something like that. But anyways, so, so, so what is that if you reload this webpage and he can see that this page can reload it, or you get a new clock from the beach or server. That means that you don't have an internet problem. 85 00:11:43.740 --> 00:11:51.180 William Cheng: Okay, so if you see this page will change. That means that you don't have internet Baba, and then if you fill out your email just fill out your pen over here, you select a file to upload 86 00:11:51.330 --> 00:12:04.980 William Cheng: You should only select your text about don't select anything right. There's going to be your solution textile that you need to work on. So only select that file and then you click on the upload button over here, right. So if you can reload this webpage, but upload fail. 87 00:12:05.460 --> 00:12:10.380 William Cheng: What that means that the beast, your server is busy or why is it busy and what because many students are submitting at the same time. 88 00:12:11.010 --> 00:12:16.560 William Cheng: Okay, so therefore, all you have to do is to reload this page. Another time, take a look at the clock may show that has changed. 89 00:12:16.770 --> 00:12:25.380 William Cheng: That means that you have internet connection. And then you can just click upload and he will try it again i i'm pretty sure that you don't have to fill out all these all these feel again. All you need to do is 90 00:12:26.910 --> 00:12:32.310 William Cheng: Click Upload again and then it will upload again. And then again, if the server is busy, you know, 91 00:12:32.910 --> 00:12:40.290 William Cheng: So, you know, okay, you should reload this page over here and I keep trying to turn like this, as long as you can reload the webpage that means that you have internet connection. 92 00:12:40.950 --> 00:12:48.000 William Cheng: Okay, so you should keep trying to do the upload sooner or later. I mean, since we only have like 50 something students, pretty soon you'll be able to upload your file. 93 00:12:48.570 --> 00:12:55.110 William Cheng: Okay, you should be able to although you fall within you know within three minutes because, you know, clicking this Upload button only take you, you know, five seconds right 94 00:12:55.830 --> 00:13:08.640 William Cheng: Now, so, so what if when you try to you know when you load. The load this particular page. As it turns out that this page refused to reload. That means that you have an internet problem. Okay, so if you can even talk to Myrtle that usc.edu 95 00:13:09.240 --> 00:13:17.370 William Cheng: So in that case, you know, you have a proper so only recorded recorded desktop, if this web page or not, does not reload. 96 00:13:18.210 --> 00:13:25.710 William Cheng: Okay, so if this web page doesn't reload the clock doesn't, you know, that doesn't change value over here while you know the clock on the server doesn't change value, then in that case you should read 97 00:13:26.340 --> 00:13:30.900 William Cheng: You should record this out. So again, practice that step. I'm just going to go over some of the highlights over here. 98 00:13:31.440 --> 00:13:37.830 William Cheng: So at 10:40am over here, you should stop working all your exam, make a submission. If you get a ticket, you're done right. As soon as you got to take it. 99 00:13:37.980 --> 00:13:44.370 William Cheng: You don't need to receive an email when you get a ticket. That means that your submission has reached my server, it will be great if you can actually 100 00:13:44.610 --> 00:13:55.350 William Cheng: You know, save that file as a PDF. So this way you have a record of what you take, take a look like you're supposed to look at your ticket. See the phone and see the file size. See the timestamp. Make sure it's before 1043 101 00:13:55.890 --> 00:14:00.090 William Cheng: Yeah so. So if you start this right at 1040 I guarantee you it's going to be before 1043 102 00:14:01.410 --> 00:14:07.740 William Cheng: Right, if it turns out that you cannot see the ticket right there. If you see, you see, you can reload the submission page. 103 00:14:07.950 --> 00:14:16.860 William Cheng: If you can reload the submission page, then you dive in and a problem that you go to 2323 keep repeating over and over again that if you cannot connect to the server. Well, that means that you 104 00:14:17.160 --> 00:14:23.100 William Cheng: Probably have an internet connectivity problem. So in this case, what you should do is that you should open midterm as your texts are 105 00:14:23.340 --> 00:14:31.620 William Cheng: In a text editor and then move your text editor basically right to where your browser over here so I can see your text editor and I can see the current car. 106 00:14:32.130 --> 00:14:40.680 William Cheng: Okay, and now what you should do is that you should scroll down on your taskbar so so it can record the entire content of your, of your answer sheet. 107 00:14:41.760 --> 00:14:49.110 William Cheng: Okay, so are we here says, you know, open the image on text align the text editor move the window. Next to the clock app. So you can see the current time ticking away. 108 00:14:49.320 --> 00:14:57.060 William Cheng: Start zoom share the screen with your desktop recording the desktop activity on your local disk and not on the remote server there. 109 00:14:57.270 --> 00:15:03.570 William Cheng: And then the a step over here is very, very important scroll and record the entire content of your answer text file right 110 00:15:03.690 --> 00:15:12.120 William Cheng: So go to the top of the answer text file and then you know you can do, page down or something like that. So the entire of the text file is recorder with your clock sitting right next to it. 111 00:15:13.470 --> 00:15:19.050 William Cheng: Okay, so this way you have a record, right. So, so then after the after you have recorded entire content of the answer texts out 112 00:15:19.260 --> 00:15:27.840 William Cheng: There you can repeat to two to four until you get an internet connection. Okay. But for some reason, that's your internet is complete this connector. But now you have a recording 113 00:15:28.140 --> 00:15:33.930 William Cheng: Of your you know your answer text file and it's before 1043 one in this case, you're going to be in good shape. 114 00:15:34.170 --> 00:15:39.900 William Cheng: Right. So at some point, you can just start recording over here and then say the video make sure you don't delete the video. 115 00:15:40.110 --> 00:15:47.370 William Cheng: Do not email the video to me or submit a video file, unless I email you just say hey you know I didn't get an email submission from 116 00:15:47.760 --> 00:15:56.730 William Cheng: You know, I didn't get an exam submission from you. Do you have a recording at that time you say yes. And then we can sort of talk about how did you send your send your video to me. 117 00:15:57.930 --> 00:16:05.550 William Cheng: Okay, so again, please follow the step in case you have internet connectivity problem. Yeah, right. If you have questions, feel free to send me an email. Okay. 118 00:16:06.360 --> 00:16:17.130 William Cheng: Alright, so now we're going to go back to chapter six. So last time we talked about the system file system in a freelance will talk about you know what I know look like, you know, how do you, you know, 119 00:16:17.460 --> 00:16:24.780 William Cheng: Reach the entire file system hierarchy. And then we talked about how to manage the free less. So for those are two different cases for for allocation. 120 00:16:25.230 --> 00:16:29.010 William Cheng: So, by the way, I saw I I changed my last slide over here at a yellow box. The 121 00:16:29.400 --> 00:16:37.560 William Cheng: yellow box over here to remind you that the reason the free list is the way it is, is that it is that you can be one 100 times faster on the average 122 00:16:37.980 --> 00:16:51.120 William Cheng: Because every 100 times when you try to we try to allocate a free block you know 99% of the time. You don't have to go to the disk and only 1% of the time you have to go to this. So this way, on the average, you will be 100 times faster. Yeah. 123 00:16:52.980 --> 00:17:03.150 William Cheng: So that's what allocation. What about the location right so we hear what the allocation. You have to freelance again they're linked together. You know, like this. And now somebody take A blog and say I want to return this blah. 124 00:17:03.540 --> 00:17:10.380 William Cheng: Okay, so if it's not a super blah. So again, the head of the free lessons that are super blah instead of super bra if their space, right. This is the free 125 00:17:10.650 --> 00:17:18.300 William Cheng: The free the head of the free less. So if there's space over here, what you can do. They can just point this point are we here to remember the newer and now you're done. 126 00:17:19.050 --> 00:17:25.710 William Cheng: That's it. Again, the important thing over here is that you don't have to go to the desk, you just remember the block number over here by updating super bra. 127 00:17:25.920 --> 00:17:36.450 William Cheng: And soon superblock is cash inside memory over here so you don't have to go to this guy. So that will be the easiest case over here and also 99% of the time, this should happen right 1% of the time. 128 00:17:36.660 --> 00:17:40.980 William Cheng: The entire data structure over here is for inside your super blah and now you need to return to 129 00:17:43.050 --> 00:17:45.420 William Cheng: Return a free block. So in this case, what should happen. 130 00:17:45.870 --> 00:17:51.660 William Cheng: Well, so now this goes over here. All the 100 pointers over here. Again, the first 99 point directly the free blah. 131 00:17:51.870 --> 00:18:01.230 William Cheng: The last one over here, point to the next known the link lists and the next don't know like this again. The first 99 point to point a free blog. And the last point over here points in the next like this and keep on that. 132 00:18:01.560 --> 00:18:08.100 William Cheng: OK, so now when you try to free abroad. What do you have to do. Right. So again, if you think about that you have a free list. I look like this. Right. 133 00:18:08.310 --> 00:18:13.320 William Cheng: All these things are linked together over here, right, and then the head of the freelance now is inside the superblock 134 00:18:13.860 --> 00:18:19.620 William Cheng: Okay, so what what are you supposed to do, right, you should create a new note over here. Okay then, you know, have your point of this one. 135 00:18:19.800 --> 00:18:31.560 William Cheng: You're gonna have the first point over here pointed this one and then you have to move the first block over here into the free less. So you need to move the first block over here into the super la 136 00:18:32.160 --> 00:18:37.500 William Cheng: Raza so which means that this block over here will no longer be on the super blah. So in this case, it needs to go on to the desk. 137 00:18:38.610 --> 00:18:47.910 William Cheng: Okay. So, therefore, what should we do, right. So again, you know, you think about the initial state and they think about the finals day if I want to take the initial state to the final state, then I sort of figured out what pointed to, I have to adjust 138 00:18:48.120 --> 00:18:54.690 William Cheng: And then I can, I can run my Co to achieve that. Right. So the idea here is that this is going to be the next note on the, you know, 139 00:18:55.050 --> 00:18:59.010 William Cheng: On the freelance over here because the super bra. There's no if we need to move the super blah. 140 00:18:59.370 --> 00:19:08.580 William Cheng: Blah, you stay where it is. So what I will need to do is I need to copy all this pointer over here to the blog. That's return over here because now this one is free. So now they because they 141 00:19:08.850 --> 00:19:16.440 William Cheng: Did this sort of belong to the free list. So therefore I can modify any way they want. So what we do is that what copy all these pointers over here into this blog over year. 142 00:19:16.620 --> 00:19:27.390 William Cheng: When you copy pointer. They point to the same place. So once I copy the point of what we look like right so then the first point of will find it this one. The second point oh point design. Last one over your point exactly the same place. So it will look like this. 143 00:19:28.530 --> 00:19:35.640 William Cheng: Okay, so now, is that a superbug over here. I need to zero. All these entries over here to be now and that this connect all these things. So now they're connected 144 00:19:35.790 --> 00:19:41.280 William Cheng: They appointed by the next block over here. So, therefore, I can actually remove all these pointer. Right. So in that case it will look like this. 145 00:19:41.700 --> 00:19:48.690 William Cheng: Okay, but the last part over here. I need to point to the new blog right here, the one that just return over here. So, therefore, I need to adjust this point to point to that. 146 00:19:48.900 --> 00:19:57.840 William Cheng: Okay. And then again, all these pointer though funding do initially that will disappear. So now finally over here. They don't want anything. So finally, it will look like this. 147 00:19:59.520 --> 00:20:09.690 William Cheng: OK. So, again, in this case over here at the free list get get, you know, get get get longer by one blog and this will be the new blog and the new block over here is the one that just returned by the Colonel. 148 00:20:10.440 --> 00:20:21.240 William Cheng: OK. So again, convince yourself that this could actually work. And again, in this case, this data, you know this this block over here needs to be written out to the desk. Right. So, on the average, the first 99 149 00:20:21.570 --> 00:20:36.210 William Cheng: You know, at the allocation over here when I end up with the right to the desk and only one out of 100 rides overhearing going to end up modifying the desk. Okay, so again, this way, our way you started the allocate the the the alligator blah, it will look like it's 100 times faster. Yeah. 150 00:20:38.640 --> 00:20:48.600 William Cheng: Oh, so again you know why 100 this pointer in every free blog right you know so. So the key to performance inside the file system. Right. So since we're in the introductory phase over here. 151 00:20:48.930 --> 00:20:56.820 William Cheng: For the fastest and what the most important thing is that this is really, really. So, so you want to redo you want to minimize the number of time you go to the desk. 152 00:20:57.150 --> 00:21:04.230 William Cheng: Okay, the less time you go to the desk. The faster you are. And we just saw a way to do this right so you can actually, you know, on the average, you're going to put he 153 00:21:04.440 --> 00:21:10.590 William Cheng: Is going to look like that. This is 100 times faster, right, because 99% of the time we don't go to the desk, only one time. 154 00:21:10.920 --> 00:21:17.790 William Cheng: Only 1% of the time, we need to go on to the desk there. So when we use though the the free list over here who has 100 pointers over here, right. 155 00:21:18.000 --> 00:21:27.450 William Cheng: The main purpose over here is to reduce the number of this access. Right. Some people think that the reason we do this is that so that the freelance the length of the field is shorter by 100 156 00:21:28.080 --> 00:21:36.060 William Cheng: Okay, so even though. That's true, that's really not the reason why we do this way. Right. But the reason we do this way is to reduce the number of can we go to the desk. 157 00:21:36.660 --> 00:21:42.900 William Cheng: Okay, it's not because we want the free list to be shorter. Okay, so, so even though they're related. They are really not the same thing. 158 00:21:43.440 --> 00:21:47.160 William Cheng: Okay, so it's okay. I mean, those things. We're getting close to to to to the 159 00:21:47.670 --> 00:21:51.900 William Cheng: The midterm exam, right. So this is, again, this is where you need to exercise critical thinking that these two things. 160 00:21:52.080 --> 00:22:05.250 William Cheng: Even though they're implementing using exactly the same mechanism, then you know that one of them is a primary resent the other one is going to be a secondary reason. The second reason is not as important as the primary reason. Okay, so, so again, please, you know, please understand that. 161 00:22:06.540 --> 00:22:13.830 William Cheng: All right, so, so, so, so we're pretty much done right where the file system hierarchy. We have the free list over here. 162 00:22:14.340 --> 00:22:26.940 William Cheng: What about the notes were some of the items over here that belongs to. So again, every idle represented file. So some of the items over here belong to the file system hierarchy. Some of the items are free. So therefore, we also need to manage the free I notes. 163 00:22:27.360 --> 00:22:34.980 William Cheng: Okay, so I'll be here when we look at the iOS over here, some, you know, some notes inside of it lists are allocated, they are part of the process them. 164 00:22:35.160 --> 00:22:43.350 William Cheng: And some of them are not. So over here, I'm going to use a bitmap over here to represent whether every I note over here. They are used by the fastest them or they're not using our system. Right. 165 00:22:43.560 --> 00:22:50.520 William Cheng: The one that a zoo over here. That means that they are not used by the process, then the other one are empty over here. I guess I employ them, they're all equal to one, right. 166 00:22:50.760 --> 00:23:02.730 William Cheng: That means that they are allocated inside of fossils of hierarchy by the first of them are hierarchy. This entry can be a file can be a directory can be a symbolic link can be whatever it is, right. So, and so they're part of the the file system hierarchy. They have one over here. 167 00:23:03.810 --> 00:23:11.820 William Cheng: Okay, and then Robin is that inside this isn't about versus them right. They don't really want to look at this is all the time to find out which entries actually available. 168 00:23:12.240 --> 00:23:17.040 William Cheng: Because, you know, oftentimes out of our system, you need to create a new file TO DESTROY, DESTROY file. 169 00:23:17.460 --> 00:23:24.480 William Cheng: For example, when you try to compile your program right into the compiler program you actually create a bunch of temporary file and then you delete that very, very quickly. 170 00:23:24.720 --> 00:23:29.280 William Cheng: So in that case, you want to be able to create files and then free all these files, very, very quickly. 171 00:23:29.760 --> 00:23:38.520 William Cheng: Okay, so what happened is that inside the superblock. We're going to take some of the free Blotto as some of the free I knows over here and we're going to catch them inside are super lot 172 00:23:38.910 --> 00:23:44.820 William Cheng: Okay, so this is known as the I know cash. So again, they are not cashing the I know there are cashing the free I notes. 173 00:23:45.210 --> 00:23:55.170 William Cheng: Okay. So in this example, what are the free I knows over here. I, I know number four we hear is free. Number six is 393 so we hear read a number four, six and nine properties over here. 174 00:23:55.500 --> 00:24:08.520 William Cheng: 11 is here 12 this year 13 years here 16 is probably here somewhere guys over here is this. If I was him. I don't know how big the I know caches, you know, maybe 100 entries over here. Just the same as the 175 00:24:09.180 --> 00:24:10.770 William Cheng: Number of free blog pointer over here. 176 00:24:11.160 --> 00:24:19.320 William Cheng: Okay, so, so, so, yeah, there's going to be a part of a super blah is going to be used for I know cash and every one of these number of years, a Fulbright number. So if you have 100 177 00:24:19.530 --> 00:24:25.920 William Cheng: With the dead, they will fit into a 400 bytes for the day, it would take off 100 bytes Inception football now. 178 00:24:26.640 --> 00:24:39.210 William Cheng: Right. So what do you actually store all these all these individual bits over here, the comment says over here that we can actually use a bitmap to store all this information right so the pin that can be kept separately from the IRS. 179 00:24:39.540 --> 00:24:43.710 William Cheng: So in that case, you can actually manage your data structure over here in different parts of the desk. Yeah. 180 00:24:44.490 --> 00:24:50.100 William Cheng: So, so, so one of the things that I would draw over here is that, you know, so again you can look at Yo Yo Yo, this is the boss is that 181 00:24:50.280 --> 00:24:56.520 William Cheng: Block number zero is a blue block, block number one is super blog. Then come the eyelid and then come the data was over here. 182 00:24:56.670 --> 00:25:04.050 William Cheng: So maybe at the end over here. We're going to keep track of a bitmap right here. Right. And also, if you want to be super fast you can actually have a bitmap to be compressed. 183 00:25:04.590 --> 00:25:07.500 William Cheng: So this way, it will take out this little space on the desk as possible. 184 00:25:07.830 --> 00:25:13.590 William Cheng: Yeah. So in this case, how do you remember where the good enough starts. Well, one thing that you can do is that instead of super blog over here. The Super blog. 185 00:25:13.890 --> 00:25:22.470 William Cheng: You know, they keep track of where the file system hierarchy is keep track of who are the freelancers, so any kind of a data structure about your fastest, then you can actually store them inside the Superbowl. 186 00:25:23.100 --> 00:25:32.670 William Cheng: OK, so the kind of information that might go into the super blog over here. Maybe the location of the map right where the first location is over here. They also need to remember where the data region starts 187 00:25:33.060 --> 00:25:39.630 William Cheng: They also need to remember the number I knows that you have because over here. I mean, it looks like I'm taking up space from the island. So in this case, you know, 188 00:25:40.260 --> 00:25:51.480 William Cheng: I need to remember. You know how many windows are there that etc. You know, whatever that you need to keep you can keep track of it inside the Super Bowl. Right. So this way started with a super bra, you know everything about your desk. Yeah. 189 00:25:52.590 --> 00:25:58.860 William Cheng: And these big names over here since again you'll be using these things up. These are this emission, you know, quite often. 190 00:25:59.310 --> 00:26:02.670 William Cheng: You might you might also catch them in memory. You know, so that this 191 00:26:03.240 --> 00:26:12.030 William Cheng: Will be faster, just like the super blog where the super blog is always cashed in memory. And now you have other data structure inside your fastest and that might also be cache memory. 192 00:26:12.240 --> 00:26:19.350 William Cheng: Yeah, I mean, if you have a lot of memory, what you can do. So you can actually catch the entire disk into memory. Why, in that case it will be it will be really, really fast. 193 00:26:19.800 --> 00:26:24.450 William Cheng: Okay, so why don't we do that. Right. And the reason is that memory is actually very expensive relative to this. 194 00:26:24.780 --> 00:26:36.060 William Cheng: So therefore, typically it's very difficult for you to actually put the entire disk into memory right but if memory is really cheap. Well, then in that case you will do that. So, so, so, so, so, so what will you do that you're this will appear to be super fast. 195 00:26:36.900 --> 00:26:42.570 William Cheng: Guys. Okay, that's one way to actually make the discipline pretty fast. It's by copying all the data into memory. So in this case, 196 00:26:42.810 --> 00:26:52.290 William Cheng: The you you sort of cash, the entire disk and remember right, we mentioned something called this cash. So again, at this conscious crashing a portion of a distinct memory. But if you have a lot of memory. You can catch everything. Yeah. 197 00:26:54.120 --> 00:26:57.060 William Cheng: Oh, so, so, so, so, so 198 00:26:58.230 --> 00:27:04.500 William Cheng: Let's take a look at, you know, how do you allocate. I know, right. So for example, you want to create a file, then this guy. You need a new. I know. 199 00:27:05.010 --> 00:27:16.440 William Cheng: So would you do that you would go to a superbug and then you say, Hey, give me a free. I know. So again, what you'll do is you'll take the first one to say, how about I know number four and now you have a new lineup. Right. So again, in this case, you know, you need to you need to return. 200 00:27:17.550 --> 00:27:22.830 William Cheng: To the Colonel, the number four. Also, you need to update the map over here to say this one is why 201 00:27:24.030 --> 00:27:33.930 William Cheng: Okay, so in this case you need to return the return to the colonel and you need to modify them. So again, the super blog and the blog I have. They're all cash and memory. So therefore, in this case, you don't have to write to the desk. 202 00:27:34.680 --> 00:27:44.340 William Cheng: Okay, so again this operation can be done very quickly. And if you keep allocating files over here at some point you I know cash will be completely empty there. So in that case, what would you do 203 00:27:45.180 --> 00:27:53.040 William Cheng: That. So, so, so, so, so, so again you know the case one over here if you just want one of them. You can keep allocating why and eventually when you run out all of that. 204 00:27:53.310 --> 00:28:04.320 William Cheng: Right. So what do we do is that you will go scan the entire island of your physical scanner boom over here and find the first 100 I know that are free and then again copy there. I know number will be hearing. I know cash. 205 00:28:04.710 --> 00:28:09.420 William Cheng: Okay, and then you can go back to what you were doing before, and then start allocating. I know, I know, one after another. 206 00:28:09.930 --> 00:28:13.980 William Cheng: But I will leave us a comment over here. So Robin is that, you know, 207 00:28:14.310 --> 00:28:23.010 William Cheng: If you saw your fastest them at the beginning, all the small I know numbers over here. They are allocated at the beginning when you build your process and chances are they don't really change very, very often. 208 00:28:23.580 --> 00:28:26.490 William Cheng: Okay, so in that case if you need to scan the be magical. We are from the beginning. 209 00:28:26.880 --> 00:28:32.250 William Cheng: From the beginning, all the way to the time where you try to find the first available. I know that might take you a 210 00:28:32.520 --> 00:28:37.920 William Cheng: Long time, right. So another thing that you can do that inside the superblock you can remember what is your local water. 211 00:28:38.310 --> 00:28:47.820 William Cheng: So this is what is your high watermark so that you remember the first available. I first of April, I know. So this way you can skip past all the beginning, one over here. And that starts on the first one. 212 00:28:48.480 --> 00:28:53.670 William Cheng: The other, the first free. I know be here and then look for 100 of that and and copy them into cash. 213 00:28:54.240 --> 00:29:04.530 William Cheng: Okay, it's okay that is optimization trick that you can do to make things a little faster. But in this case, you will end up our kitty. I don't care anymore. You know space inside the super blog to maintain all these additional information. 214 00:29:06.090 --> 00:29:10.080 William Cheng: So just, this is just one idea to try to make things a little faster than 215 00:29:12.210 --> 00:29:19.680 William Cheng: The outcome, the allocation right when you try to delete a file. And when you delete a file you going to free up. I know. So in this case, again, if the I know cash is not for 216 00:29:19.830 --> 00:29:25.080 William Cheng: That all you have to do. So remember, a new one over here. So let's say that you know that you're deleting file with 217 00:29:25.350 --> 00:29:28.530 William Cheng: Number 232 while they all your to just take one of these entries over here. 218 00:29:28.770 --> 00:29:36.390 William Cheng: And you write 232 in it, and this, and this guy's you'll be fine. And also in a bitmap, you're going to find 232 because right now the BMI is going to be able to one. 219 00:29:36.570 --> 00:29:41.520 William Cheng: And you need to change it into a zero. So again, you only modify memory. You don't have to go to the desk there. 220 00:29:41.970 --> 00:29:46.860 William Cheng: But in case your super blog of yours completely full. And then you return as a 232 221 00:29:47.310 --> 00:29:56.190 William Cheng: Number 232. So in this case, all you have to do is to modify the bitmap, you don't have to. You'll have to modify the I know cash because all I know is our equivalent 222 00:29:56.880 --> 00:30:03.840 William Cheng: Okay, so therefore, when you return a new one over here. You don't really have to you know Aquarius patients are no cash over here. So, so all you have to do. 223 00:30:06.840 --> 00:30:10.800 William Cheng: That. So again, a little bit of optimization here to try to save a little bit of time. Yeah. 224 00:30:13.140 --> 00:30:23.850 William Cheng: Alright, so this is the boss is going to be so. So, this is it. Right. As I mentioned before, this is the VA system is a very, very simple process and. And again, our kernels on it. We don't implement a system of US them. 225 00:30:24.240 --> 00:30:28.140 William Cheng: But you can look at the header file over here to sort of get an idea of what's actually inside the system. 226 00:30:28.470 --> 00:30:34.500 William Cheng: System right but don't spend too much time on that because we have to do your current. Oh, yeah. No, you should you spend your time doing the programming assignment. 227 00:30:35.310 --> 00:30:43.890 William Cheng: So here's a summary to create a file. So what are we trying to create a fall. What do you need, right, you need a new I know he also you try to write it down into the Father, and this guy. You also need at this block. 228 00:30:44.190 --> 00:30:54.150 William Cheng: Right, so. So in this case you need to go to the free loss, you know, get a free blah and need to update a free less YOU ALSO GET ME NEITHER free. I know. In this case you need to update the eyelids, especially the bitmap. 229 00:30:54.390 --> 00:31:03.720 William Cheng: And also you need to update the I know cash. And then when you're done with your phone. Check the leader. What do you have to do, right. So, so when you delete a file this fog my have another 230 00:31:04.290 --> 00:31:14.580 William Cheng: Might have Brazilian this blog associative this file. So this one is a one gigabyte file. So in this case, they will be tons of this blog over here. So what we need to do is that we need to free to this block one at a time. 231 00:31:15.690 --> 00:31:18.270 William Cheng: Okay, so you can see that you know this operation is going to be very, very slow. 232 00:31:18.480 --> 00:31:26.910 William Cheng: Guys. Oh yeah, we need to return all the dip this block to the free list. We're going to end up you know if you have one gigabyte that you're trying to free over here that will be 1 million 233 00:31:27.330 --> 00:31:33.990 William Cheng: You know 1 million wine kilobyte at this blog over here. So you're going to end our free the free no 1 million times. 234 00:31:34.380 --> 00:31:40.410 William Cheng: So in this case, the mythical very, very long time. Right. But again, you have to free that this block one at a time, and every 100 time when you 235 00:31:40.800 --> 00:31:52.440 William Cheng: Try to read this blog, you're going to end up writing the data to do this. Okay, so, India, you also need to free up one. I know, right. So you need to mark the I know free in the islands over here. Is that a bitmap over here and then maybe you have to, you have to upload 236 00:31:54.030 --> 00:32:02.400 William Cheng: You have updated. I know cash if their space inside. I know cash. Well, that's okay. You'll only returning one. I know, but lots of this block over here. Well, 237 00:32:04.470 --> 00:32:11.460 William Cheng: Again, you know, when do what you know what we what what do you ensure that these on a file system, you know, one try to minimize the number of this operation. 238 00:32:11.580 --> 00:32:19.440 William Cheng: So whenever you need to go through this, it's going to be super slow and pretty soon we're going to see why are things super slow guy. So we try to sort of minimize the number of comical to the desk. Yeah. 239 00:32:19.710 --> 00:32:22.710 William Cheng: As it turns out that there are, you know, reading and writing are different. 240 00:32:23.010 --> 00:32:28.200 William Cheng: So when you try to read, you can actually try to read as much data as possible. You can actually do something called read ahead. 241 00:32:28.470 --> 00:32:38.040 William Cheng: Right when I tried to read it and say, oh, maybe I know that I'm going to access other parts inside of this. So since going to this is so slow. I want to transfer as much data from this into memory as possible. 242 00:32:38.580 --> 00:32:50.220 William Cheng: Okay, so again, what I, what I would do is I'll actually cash them inside the file system that. But what about when I tried to write that down to the desk. Well, there's no way to write a hat, because you don't know what they are you gonna right okay so therefore there's 243 00:32:51.420 --> 00:32:59.790 William Cheng: There's inherent you know asymmetry between reading and writing reading as lot easier to make it faster while writing is much harder to make it faster. 244 00:33:00.570 --> 00:33:08.190 William Cheng: Okay, so we're not going to talk about how to make it faster now, but later on when we come back to chapter six. We're going to see how to make writing to the disaster. No. 245 00:33:08.970 --> 00:33:09.270 William Cheng: All right. 246 00:33:09.600 --> 00:33:15.120 William Cheng: And the other, the other question over here is that, you know, sequential access versus Random acts as a as a sequence you access again is a 247 00:33:15.210 --> 00:33:22.050 William Cheng: You know, if you think about, you know what I know map look like his I know map look like they appointed all these this block over here. And then there's indirect doubling director going to 248 00:33:22.440 --> 00:33:30.540 William Cheng: Remember all the blue blocks over here are the actual data blog or the actual data, data for the file. Everything else over here. They are metadata. 249 00:33:30.990 --> 00:33:43.080 William Cheng: Okay, so he proposed sequential access, what would you do, so this will be brought 0.1 by to order to block 10 and he has block 11 1213 over here so you can actually, you know, sort of read ahead. 250 00:33:43.620 --> 00:33:55.440 William Cheng: Right, because you know you know sequentially hardy thing to come in. So if you know that you know your file system, the application pool and typically do sequential read one in this case, you can actually, you know, go ahead and read all the data, the data back 251 00:33:56.040 --> 00:33:58.890 William Cheng: On the desk. Okay, how do you perform random access 252 00:33:59.340 --> 00:34:07.530 William Cheng: Well we promote random access. That means that he needs to do two things. Number one, you need to perform a C Corp what people want to seek operation you do it only inside the virtual file system. 253 00:34:07.710 --> 00:34:16.500 William Cheng: So in that case, the actual file system is untouched. All you do is to change a person position. So we changed the cursor positions the lesson that occurs because you're not pointing to this this block over here. 254 00:34:16.950 --> 00:34:21.060 William Cheng: Right. So again, by doing some point or math. You can find out exactly what it this blog is 255 00:34:21.570 --> 00:34:27.060 William Cheng: But in this case, you know, since you're done inside the virtual file system, the actual classism is not informed about this decision. 256 00:34:27.480 --> 00:34:36.450 William Cheng: Okay, so later. Are we performing that says is that once you perform a Sikh, the next time. Will you do a read. You're going to read them. This is this, you know, this particular page. How do you know that you want to read on this page. 257 00:34:36.870 --> 00:34:46.980 William Cheng: Right again when you perform Random acts when you try to access data block on the desk over here. You're going to take the cursor position and you pass it into the actual process there and now the exercises them know that 258 00:34:47.310 --> 00:34:54.450 William Cheng: This is going to be the data structure on this. So what do you would do is that it will figure out exactly what this date of August, and then he will try to retrieve this the other day to blah. 259 00:34:54.960 --> 00:35:01.950 William Cheng: OK for system for us is them in the worst case, you're going to go through the trip going direct Bob over here. So this guy's you're gonna you're gonna find. I know. 260 00:35:02.100 --> 00:35:06.450 William Cheng: And then you find a tripling direct pointer over here and you go to this this blog and then you wait for it to get that 261 00:35:06.600 --> 00:35:16.770 William Cheng: And then you find the pointer over here that will point to the double indirect point over here and then you read it and then you, you kind of throw it will go to sleep, wait for it to get that. And then when you wake up you know that this date this 262 00:35:17.040 --> 00:35:27.690 William Cheng: This data this block is the memory. And again, then you find out which point you need to use. And then on this example of yours right here. So you'll follow this pointer and read the next blog over here, you're currently I'll fall asleep again. 263 00:35:27.870 --> 00:35:33.870 William Cheng: Next time, when we wake up in the data is going to be a memory. So can you find this pointer. And then finally, he will go to the display over here. 264 00:35:34.650 --> 00:35:41.160 William Cheng: Okay, so what kind of performance is this. Okay, so please understand that this is still order one performance. 265 00:35:41.850 --> 00:35:51.810 William Cheng: You know. So in this case, you know, order. What does your dad right order n, n is a number of this block over here in the blue this blog over here, right. So even though and can be really, really big can be 1 million 266 00:35:52.320 --> 00:35:55.740 William Cheng: Okay, because each one is one kilobytes. It's gonna be a one gigabyte file over here. 267 00:35:56.250 --> 00:36:02.430 William Cheng: But, but the number of disk access over here in the worst case is order one because it's independent of the number of this box. 268 00:36:02.730 --> 00:36:15.360 William Cheng: Right, because in the worst case, you need to go to 1234 you to go to this four times and you guaranteed to find the data block that you need. Okay. And the reason for that is that because this data, such as it turns out, it's pretty efficient. It's water one 269 00:36:16.590 --> 00:36:22.500 William Cheng: Okay, but still you need to go to this for time. What is faster than order one. Well, how about order one. But go through that there's only two times 270 00:36:22.890 --> 00:36:31.050 William Cheng: OK. So again, you know, you sort of try to try to try to get to the data as fast as you can. I say four times a little too much, maybe cut into three maybe cut it to two. So, so later on. 271 00:36:31.260 --> 00:36:35.010 William Cheng: When we come back to chapter six. We're going to see how you can actually speed this thing up that 272 00:36:35.760 --> 00:36:45.690 William Cheng: Alright, so, so we're done with this is about us them are the next time. The next thing we look at what a briefly look at what does this look like, so you can understand why. Why is it is so slow. Go. 273 00:36:46.080 --> 00:36:52.770 William Cheng: To this level going to talk about is a hard drive. Okay so hard to actually look like this. So, if you open up a hard drive, would you, of course, you're not supposed to do. 274 00:36:53.130 --> 00:37:00.960 William Cheng: You're gonna see that the hard drive is made out of several platters over here. So the example there for platters platter 012 and three over here. 275 00:37:01.170 --> 00:37:10.020 William Cheng: Every partner has to magnetic surfaces, one on top of one on bottom. So in this way, you can sort of think about every, you know, the magnet magnetic services has a bunch of magnet. 276 00:37:10.410 --> 00:37:20.430 William Cheng: So a bunch of zeros and ones over here that one of the, one of them is north and south. So it depends on his place one way or the other wise, in this case, you know, one of them will be zero and the other one will be one. Okay. 277 00:37:21.150 --> 00:37:28.680 William Cheng: So what's alarming is that, you know, on one of these Potter over here. So one of the surface over here we're going to divide them into concentric circles and 278 00:37:29.010 --> 00:37:35.160 William Cheng: Circles over here is known as the track and then within a trial. We're going to cut them into little pieces over here is no sectors. 279 00:37:35.460 --> 00:37:44.490 William Cheng: Okay, the sector is going to be the smallest addressable unit on a desk right so in order for you to specify a sector. First you have to say which surface. It's all 280 00:37:44.850 --> 00:37:56.640 William Cheng: Okay, so in this case the surface are numbered over here. This is our for platter. Each one on purpose to server. So there will be a surface. There'll be surface 01234567 so if you mentioned which surfaces all and then I have to 281 00:37:57.060 --> 00:38:06.900 William Cheng: Mention we track. It's on. And then on the track. I have to mention what sector top. Okay, so that this address has three parts. The surface number the track number and the second number now. 282 00:38:07.440 --> 00:38:11.910 William Cheng: So we hear sort of say that you know that the deciders over here is going to be the surface number followed by the truck number 283 00:38:12.180 --> 00:38:22.020 William Cheng: Number, followed by the south of the sector number or there's another terminology over here. It's called the head number in order for you to be data on the disk over here. They are these things over here. It's called the discount 284 00:38:22.950 --> 00:38:32.850 William Cheng: But is there a surfaces there eight this cat and they are mounted on the disk arm over here. So you can think imagines around there. So I'm going to discard. Okay, so all these heads over here. 285 00:38:33.300 --> 00:38:46.800 William Cheng: On the arm over here, the arm has motor that will drive that this has, you know, radio, Lee, so he says the Disney can go towards the center of the disc or you can go towards the other the other day. The other track of the desk. 286 00:38:47.490 --> 00:38:54.060 William Cheng: Okay, so to decide there's no way for it to move anywhere else. It can only new radio. These are so over here. There's a motor that will go to forward or backwards. 287 00:38:54.930 --> 00:39:00.780 William Cheng: Okay, so how do you actually get to the sector over here. So in order for you to read it off on the second over here, you need to move 288 00:39:01.140 --> 00:39:11.070 William Cheng: You know, move at this got over here to the right track. And this particular operation is known as the Sikh operation as k. So now you know where the term LC come from. 289 00:39:11.520 --> 00:39:18.420 William Cheng: Right. Because over here. We're going to see to the right track over here so that you can actually you know you you can position your this cut over here. 290 00:39:18.750 --> 00:39:23.850 William Cheng: To be on the right track. And now you need to wait for the distance span. So to sell you know it's all we hear the disappear. 291 00:39:24.030 --> 00:39:31.050 William Cheng: I mean, if you put your ears to close to the hard drive, you're going to, you're going to hear a very high pitched noise because this thing is spinning at a very high speed. 292 00:39:31.560 --> 00:39:36.060 William Cheng: Okay, so I've been is that you need to wait for the center of your display and underneath that this and then you can read it. 293 00:39:37.200 --> 00:39:40.980 William Cheng: Okay, so why because I, when did this cut over here. Spin underneath this head over here. 294 00:39:41.370 --> 00:39:51.750 William Cheng: You can actually activate any one of the one of the eight this cat over here so you can actually read it from this sector or the section right below it was on the next partner, you know, there will be also another sector in the same place. 295 00:39:51.930 --> 00:39:59.520 William Cheng: Another sector below it. So, there will be a sectors over here you can reset multi seriously. So that's why some people call this assume there instead of call them a truck over here. 296 00:40:00.000 --> 00:40:10.170 William Cheng: You can actually access aid, you can actually access any of these tracks, you know, suspicious or at the same time, but you can only we can only access one of them. 297 00:40:11.040 --> 00:40:15.060 William Cheng: Okay, so that we can sort of think about these eight tracks over here, you can actually use to access them. 298 00:40:15.690 --> 00:40:19.740 William Cheng: At the pretty much the same time. Right, but you can only access only one surface at a time. 299 00:40:20.160 --> 00:40:26.490 William Cheng: Now, so therefore you know the surface number over here is also known as the head number because you have the same number of heads. It's a surface. 300 00:40:26.700 --> 00:40:33.210 William Cheng: And also the track number is also known as a cylinder number, right, because again the cylinder number over here starting for the outer track over here. 301 00:40:33.450 --> 00:40:43.170 William Cheng: So I think the outermost truck over here is called tried zero and then all the way to the one in the middle of here. So I think you could actually have, you know, many, many trucks over here. Maybe 1000 you know maybe 302 00:40:43.890 --> 00:40:53.160 William Cheng: I think, I think you may have actually up to 100,000 track you know for for your, for, for, for, for, for some of the 1980 1980 desk now. 303 00:40:54.330 --> 00:41:02.880 William Cheng: So so so in this case, the way that you access data over here, right, is that, first you need to perform the C Corp. I moved at this care to the rice cylinder over here. 304 00:41:03.060 --> 00:41:07.110 William Cheng: And then you need to work for the sector over here to spin under the dis hair so the 305 00:41:07.380 --> 00:41:14.400 William Cheng: So the second time over here is no as the rotational latency, right. So first, you know, in order for you to get to the data you need to wait for the seat time 306 00:41:14.670 --> 00:41:23.070 William Cheng: So that your disk. I will put out. We put at the right place that you need to wait for the rotational latency, right, so that is that will appear right and right underneath this head. 307 00:41:23.310 --> 00:41:34.020 William Cheng: At that time, you will turn on the electronics over here on the disarm that will convert the magnetic signal into electrical signal and now the base of zeros and ones over here is going to travel to all you know 308 00:41:34.860 --> 00:41:39.270 William Cheng: travel across at this time and they will go into that this controller over here. 309 00:41:39.990 --> 00:41:47.490 William Cheng: Okay, so that this control over here has a memory buffer. So there's a Marybeth over here. So I'm going to copy all these zeros and ones over here by filling out of the memory buffer over here. 310 00:41:47.670 --> 00:41:52.920 William Cheng: When I eventually filling out the entire sector will be here on to the memory buffer over here. What should I do next. 311 00:41:53.190 --> 00:42:00.690 William Cheng: Well, I would DMA all these data into my memory. I so this control over here is going to be sitting on the bus right here right on the bus over here. We're going to have memory. 312 00:42:00.870 --> 00:42:08.730 William Cheng: So once you fill out the entire this controller buffer with the data from the sector. What it will do is that will start at DMA operation over here, copy data into memory. 313 00:42:08.940 --> 00:42:15.510 William Cheng: And with the DMA operation. Is that what it will do is that it will interrupt the CPU over here. So inside. Inside interrupt service routine. 314 00:42:15.900 --> 00:42:22.560 William Cheng: Blood Colonel threat and the Colonel fell will tell that this control to say now start the next I will operation. What is the next operation. 315 00:42:22.890 --> 00:42:29.850 William Cheng: Go to this somewhere else and the transfer another sector of data into the memory buffer over here and when it's done a copy of DMA into memory and 316 00:42:30.270 --> 00:42:39.720 William Cheng: CPU and do this over and over again. Okay. Since that this is really, really slow. And that's why you want to start that this operation of the next this operation as early as possible. 317 00:42:40.110 --> 00:42:51.870 William Cheng: Okay, so, so, so that's why it's so, so important to do all these operations inside the interrupt service routine, because that will be the first time that you're allowed to tell the controller to say, go ahead and start the next operation now. 318 00:42:53.610 --> 00:43:01.230 William Cheng: So in this case, you know the the disk access times what is the access time. Okay, so, so again, when you talk about access time different people would define it differently. 319 00:43:01.500 --> 00:43:10.410 William Cheng: As far as our classes concerned the access time is the time for you to transfer data from the desk into the buffer inside the inside the disk controller. 320 00:43:12.240 --> 00:43:19.020 William Cheng: Okay, so this is this time is not that the amount of time to take the second over here and copy them into memory. Okay, but only to the dis control over here. 321 00:43:19.380 --> 00:43:24.300 William Cheng: The other part of the time over here would have gotten that one. I'm going to consider that part of the access time well 322 00:43:25.140 --> 00:43:30.780 William Cheng: Alright, so this is our time has three components. First, you need to seek, you know, to, to, to the cylinder 323 00:43:30.990 --> 00:43:42.450 William Cheng: And they need to wait for the rotational latency. And finally, the last part over here is to transfer data from the sector into, you know, the into the memory buffer. So as it turns out that the data transfer time over here. It's going to be the fixed component 324 00:43:42.960 --> 00:43:49.020 William Cheng: Okay. All the other ones rotational latency, if you're lucky, then you know your your your sector is very, very close your descent. 325 00:43:49.230 --> 00:43:59.580 William Cheng: In that case, and rotational literacy can be very, very small. Or if you're unlucky, you know that this cut over here. Just pass your sector, in that case, you have to wait for one revolution on your desk over here as a nutcase will take a very long time. 326 00:44:00.060 --> 00:44:06.600 William Cheng: Similarly, the seat time over here. If you need to seek to somewhere very close is going to be fast. If you're going to see someone river far 327 00:44:06.870 --> 00:44:11.550 William Cheng: So in that case, is there a mechanical devices that are involved in that case you will take a very, very long time. 328 00:44:12.120 --> 00:44:18.450 William Cheng: That. So here's sort of information about what's called a rhino PA this dry. So that's this one is presenting the textbook. 329 00:44:18.870 --> 00:44:30.390 William Cheng: To sort of give you some of the parameter of the disk drive, I think, I think this was this was probably manufactured by IBM. So it's a humongous there. That's very, very big, very, very noisy, but it's also very high performance is very, very reliable. 330 00:44:31.020 --> 00:44:41.640 William Cheng: OK, so the speed over here, the rotation of speed over here is one is 10,000 RPM revolutions per minute. So you will know that even today when he tried to buy this from Amazon by fries. 331 00:44:42.090 --> 00:44:49.920 William Cheng: This you're going to get is also at the speed. Okay so around 1975 9080 over here. They are IBM already know how to build a disastrous fast. 332 00:44:50.490 --> 00:45:05.370 William Cheng: Okay, the number of servers over here is a just like the picture that we brought over here at the sector size is going to be 512 is so that will be the smallest addressable unit there, the number of sectors per track is going to be 501,000 so. So why is there a range. 333 00:45:06.510 --> 00:45:13.590 William Cheng: Okay. So over here, right, you know, the all these circles over here are concentric circles. So the one in the middle here is going to have a smaller so conference. 334 00:45:13.800 --> 00:45:19.050 William Cheng: While the outer one over here is going to be have a bigger circumference. So as it turns out, the one in the middle over here is going to be 335 00:45:19.350 --> 00:45:24.000 William Cheng: The one that have 500 sectors, the one of the outside over here is going to have 1000 sector. 336 00:45:24.360 --> 00:45:32.400 William Cheng: Okay, so therefore, trying to figure out where data is on the desk, it's going to be a little tricky because you have to know every track over here. How many secretary has 337 00:45:32.850 --> 00:45:36.120 William Cheng: Okay, so this way. So that's why there's another reason sort of us isn't a little slower. 338 00:45:36.510 --> 00:45:43.530 William Cheng: Because you have to sort of figure, all these things out there. So, on the average, you know, the average one in the middle is gonna have 750 sectors, on the average, yeah. 339 00:45:43.950 --> 00:45:54.270 William Cheng: The number of trucks per surface is going to be 100,000 tracks and this is again 1970 1980 today we have a bigger disk and so forth. So therefore, we're going to have, you know, what density 340 00:45:54.870 --> 00:46:01.620 William Cheng: The storage capacity over here, if you multiply these numbers together, you're going to get that the rhino PR. This is a 300 gig desk. 341 00:46:02.130 --> 00:46:12.330 William Cheng: Okay. In 1975 1988. This is a really, really huge disk. Today we have gigabyte. We have terabytes. This over here. So it's not a big deal. But in the good old days is actually a pretty big deal. 342 00:46:13.080 --> 00:46:22.350 William Cheng: That the average see time over here, going from one random up on one random track to another random track on the average is going to take you four milliseconds. 343 00:46:23.130 --> 00:46:29.880 William Cheng: So via. So that's what this is so slow, right, because when you perform the Sikh operation over here, on the average, you should expect a seat time a formula second 344 00:46:30.240 --> 00:46:35.400 William Cheng: Their formulas are going over here. So that's why the access sample that this is going to be on the order a millisecond right 345 00:46:35.730 --> 00:46:43.770 William Cheng: even close to 10 milliseconds, that's how slow the disk is anytime you go to the desk on the average is going to cost you 10 milliseconds. Right. 346 00:46:44.670 --> 00:46:47.490 William Cheng: Over here. There's also we are number of years at the one tracks the time 347 00:46:48.000 --> 00:46:59.670 William Cheng: So as it turns out, the way that this work over here is that there's actually two motors on this car, right. One of them is the one that we mentioned before, we use the performance seek over here. You're going to actually accelerate. So let me go back to this picture over here. 348 00:47:01.470 --> 00:47:02.610 William Cheng: Yeah, so over here. 349 00:47:02.820 --> 00:47:13.980 William Cheng: There's, there's a motor right here that can drive the head over here from one place to another. Right. So in this case, what you would do is that you actually your accelerated this cut over here to the maximum speed shoots at across the desk over here. 350 00:47:14.160 --> 00:47:21.090 William Cheng: And then when you when you get too close to where you need where you need to go. Would you would you say you are you step on the brake. 351 00:47:21.900 --> 00:47:27.480 William Cheng: Okay. So, therefore, if you look at the picture over here, this is time. Here is the speed of that this cat over here. 352 00:47:27.690 --> 00:47:32.010 William Cheng: At the beginning, it will be time you go to zero, then there's no speed, right, because you're you're actually sitting right here. 353 00:47:32.220 --> 00:47:43.200 William Cheng: And then once you do that you will accelerate to the maximum this you should sit across the desk and then you step on the desk you step on the brake over here. So when it go, you know what, when did this guy go to speed zero here. Are you going to be on the right track. 354 00:47:44.010 --> 00:47:49.230 William Cheng: Well, of course, you won't be right because anybody who drives you know that if you want to stop right at the right place over here you will miss that. 355 00:47:49.410 --> 00:48:00.300 William Cheng: And then what do we do, is that on this, on this column over here. There's a second motor know as the stepper motor. What it will do is it will be able to actually go to perform the Sikh operation one track at a time. 356 00:48:00.840 --> 00:48:09.690 William Cheng: Okay, so once you are, you know, so once you start the main mode over here. The main motors speaking to go to zero. You can turn on stepper motor here. So you're going to bounce around over here until you find the right place. 357 00:48:10.470 --> 00:48:20.160 William Cheng: But so therefore the to motor has very, very different characteristic. The first motor over here is going to dominate the average see time or the second one over here is one that gives you the one tracks the time 358 00:48:20.520 --> 00:48:29.730 William Cheng: Okay, so when you go from one truck simply to the next truck over here, it will actually be on the average 20 times faster over here. It's got all the other costs you point to millisecond. 359 00:48:30.330 --> 00:48:35.940 William Cheng: Okay, it's okay if you multiply by 20 Oh, we're gonna get formulas again. So, what you should do is that you should try to use the one track you know 360 00:48:36.270 --> 00:48:41.790 William Cheng: So, so we should do, they should minimize the seat over here because you know if you only have to go to the next track. 361 00:48:42.210 --> 00:48:51.510 William Cheng: In this case, your secret I should be very, very fast because again later on when we come back to chapter six over here. We're going to see a, how do you actually improve the performance of your desk. 362 00:48:51.960 --> 00:48:59.790 William Cheng: By paying attention to the numbers over here that. And finally, there's a maximum see come over here the madness. The time is the time for you to start with this head over here. 363 00:49:00.180 --> 00:49:05.490 William Cheng: At the most inner try and this guy is, what do you need to do that, you need to move your discount into the parking lot. 364 00:49:06.150 --> 00:49:15.600 William Cheng: Okay, so why do you need to move into the parking lot, because, you know, for example, if you lose power, you're going to get a power, you know, interrupt will be here to say I'm losing power. So in that case, you know, if I'm not very careful over here. 365 00:49:16.500 --> 00:49:23.010 William Cheng: So, you know, so, so, so, so the way that this that this has actually reading the data over here is that this, this is spinning 366 00:49:23.340 --> 00:49:34.200 William Cheng: Spinning very, very fast, it's spinning so fast that it creates the air cushion between the discount and the surface over here. So what so what. So what this manufacturer will do that they will actually posted this head against the surface. 367 00:49:34.830 --> 00:49:37.410 William Cheng: Right, so this, this has actually press against the surface. 368 00:49:37.590 --> 00:49:41.220 William Cheng: But because of the other question over here. You're not going to scratch the desk. Okay. 369 00:49:41.370 --> 00:49:51.300 William Cheng: But as the diff slows down the air cushion is going to disappear so that this cut over here is still sitting at a desk over here. What do we do to scratch to this when you scratch it this the entire this will become unusable. 370 00:49:51.900 --> 00:49:58.890 William Cheng: Okay, so therefore, as soon as you lose power. What do you have to do is that you have to retract that this can take all of this got over here. I tell them to go to the parking lot. 371 00:49:59.550 --> 00:50:02.040 William Cheng: Of as over here, it will tell you that the maximum 372 00:50:02.310 --> 00:50:07.980 William Cheng: Your seat time over here it's going to take you 10 millisecond in the worst case for you to part of that this guy in the park in a parking lot. 373 00:50:08.160 --> 00:50:13.590 William Cheng: Once they are in the parking lot over here, then in that case, when did this start spinning down, you will not scratch the desk. 374 00:50:14.370 --> 00:50:22.680 William Cheng: Okay, so that's one of the major reason that this guy over here is that, you know, because what happens, I want to spinning done over here and then you're still moving at this hair, you can end up crashing as 375 00:50:23.370 --> 00:50:23.640 William Cheng: Well, 376 00:50:24.300 --> 00:50:31.440 William Cheng: So that all these information over here is very important. So I so when you try to buy and buy a new desk. You want to see what your operating systems, the bathroom and see time is going to be 377 00:50:31.560 --> 00:50:41.820 William Cheng: You need to make sure to you by the right kind of this because if you're this goal here is to slow. Well then, when you turn up power on your. Do you know where you lose power on your laptop. Well, you're going to end up scratching the desk. Yeah. 378 00:50:43.140 --> 00:50:52.590 William Cheng: I, I said so. So alright, so at this point over here. So we actually we're done with the first part of chapter six or so I'm gonna go to the the slides over here. 379 00:50:54.240 --> 00:50:55.380 William Cheng: Like just slide right here. 380 00:50:58.560 --> 00:51:08.130 William Cheng: So we finished the first part of chapter six over here, the basis of the process. Then, right. So the next four parts over here, we're gonna we're gonna we're gonna finish them after we're done with chapter seven. 381 00:51:08.610 --> 00:51:10.710 William Cheng: Not so we'll go over this. 382 00:51:11.370 --> 00:51:22.650 William Cheng: This is the first chapter seven is a second chapter seven through after chapter seven and forth after chapter seven. So now we're going to go to Chapter seven because I need to give you everything you need to know. So you can do Colonel three 383 00:51:23.280 --> 00:51:32.310 William Cheng: But I know we were just finishing kind of one today. But then we have Colonel to have the midterm are then Colonel three actions don't take you a little more than a week I should cover the entire 384 00:51:33.570 --> 00:51:38.400 William Cheng: The chapter seven over here is going to give you all the background to do Kronos we actually need to know everything. 385 00:51:38.790 --> 00:51:47.310 William Cheng: Okay, it would take a little over one week. I should have finished them up so them. So by the time I finished Chapter seven over year you'll be almost finishing Colonel to and even have to start working with Colonel three 386 00:51:48.390 --> 00:51:56.760 William Cheng: Alright, so I'm going to pause right now. So starting with part two, you know of this of the lecture, we're going to start going to chapter, chapter seven, okay.