WEBVTT 1 00:00:38.400 --> 00:00:41.580 William Cheng: Welcome to lecture 13 sorry 2 00:00:50.760 --> 00:00:51.480 Andrew Strimaitis: Hello, Professor. 3 00:00:51.720 --> 00:00:57.030 Andrew Strimaitis: Hi, um, I have a couple questions last minute for Colonel one 4 00:00:57.240 --> 00:00:57.600 William Cheng: Okay. 5 00:00:57.750 --> 00:00:58.860 Andrew Strimaitis: I was hoping I could get answered. 6 00:00:59.070 --> 00:01:10.710 Andrew Strimaitis: Here though I was going through the instructions again and I noticed when we were talking about adding DVD conforming calls to the case or calls 7 00:01:11.280 --> 00:01:19.080 Andrew Strimaitis: It said that with every required case or call you need to add a DVD conforming call. And my question is, 8 00:01:19.740 --> 00:01:34.860 Andrew Strimaitis: As me, my group mates are going through this. If we have a couple of case search statements that we added on our own that weren't actually requirements or anything. Do we have to add DVD conforming calls to that to those as well because they weren't actual required case or calls 9 00:01:34.980 --> 00:01:35.820 William Cheng: Yeah, then you don't 10 00:01:36.450 --> 00:01:37.170 Andrew Strimaitis: Then you don't 11 00:01:37.410 --> 00:01:45.360 William Cheng: All right, but right yeah yeah so any case or that you add it's perfectly fine. But, you know, you don't have to add component DVD copy. Yeah. 12 00:01:46.050 --> 00:01:57.150 Andrew Strimaitis: Okay, and then there's another part of the guideline where it says that we see if I can bring it up because it was oddly specific 13 00:01:57.510 --> 00:01:58.380 Andrew Strimaitis: Okay, um, 14 00:02:00.300 --> 00:02:07.050 Andrew Strimaitis: Well, actually, what while I'm doing that the grading script says to set CS for two tests to 10 15 00:02:07.650 --> 00:02:11.790 Andrew Strimaitis: But then the favorite, the favorite test only goes up to greater than eight 16 00:02:12.030 --> 00:02:18.000 Andrew Strimaitis: So I was wondering if there was anything to do with, I don't know, greater than nine or something else like that. 17 00:02:18.180 --> 00:02:22.440 William Cheng: Right. So when you set it to 10 you will run everything you know after a greater than eight 18 00:02:22.950 --> 00:02:27.780 William Cheng: Right, you will run run one more set of tests do that's one that do the prop kill all 19 00:02:30.150 --> 00:02:30.480 William Cheng: So, 20 00:02:30.900 --> 00:02:34.440 Andrew Strimaitis: He said if it was set to nine that it wouldn't do proxy law. 21 00:02:34.890 --> 00:02:38.370 William Cheng: And I don't remember, but you know you should just set it to 10 22 00:02:40.770 --> 00:02:44.850 William Cheng: Because Penny will run the entire run everything inside the favorite test. 23 00:02:46.050 --> 00:02:46.440 Andrew Strimaitis: Okay. 24 00:02:46.650 --> 00:02:49.500 William Cheng: And that was the intention is to pass all the testing favorite 25 00:02:49.650 --> 00:02:52.710 Andrew Strimaitis: Test. So, so there's, there's, there's nothing like 26 00:02:52.830 --> 00:02:57.810 Andrew Strimaitis: Like MISSING FROM OUR SHEETS. Then about having something being greater than nine right 27 00:03:00.930 --> 00:03:04.320 William Cheng: I don't remember exactly what's in the source code. So I think you should 28 00:03:05.310 --> 00:03:07.380 Andrew Strimaitis: That the source the source code just has 29 00:03:07.890 --> 00:03:11.940 Andrew Strimaitis: A retest where it's greater than zero greater than one all the way up to greater than eight 30 00:03:12.270 --> 00:03:14.370 Andrew Strimaitis: And I was wondering if there was anything 31 00:03:14.580 --> 00:03:15.690 Andrew Strimaitis: That we were missing them. 32 00:03:16.110 --> 00:03:17.340 William Cheng: If. Yeah, I don't think so. 33 00:03:17.970 --> 00:03:18.330 Andrew Strimaitis: Okay. 34 00:03:18.510 --> 00:03:26.400 William Cheng: Right. But will you test your code, you should, you know, child, all the values in the grading guidelines. So the greater because those are the values of the greatest will use. Yeah. 35 00:03:26.880 --> 00:03:49.380 Andrew Strimaitis: Okay. And then finally, there is a section on the this the same section conforming DVD calls where you have examples listed and you have examples listed for a dot three dot B and A dot six be where you have to conforming DVD calls back to back. 36 00:03:49.560 --> 00:04:06.090 Andrew Strimaitis: Yes. And I'm we're slightly confused about that because we thought like the first DVD call you had looked right and then the second one, it says to specify the correct test for the question mark listen in it and I'm not too sure what that really means. 37 00:04:06.300 --> 00:04:18.990 William Cheng: Yeah, because for the ADA, I think, one of them is a dot three dot b, right. So for a dot three dot B, if you just start and stop the colonel that particular you know that particular character will not get executed. 38 00:04:23.070 --> 00:04:23.760 Andrew Strimaitis: But isn't 39 00:04:24.960 --> 00:04:27.420 Andrew Strimaitis: Oh, one. A Yeah, three dot B. 40 00:04:27.870 --> 00:04:33.810 William Cheng: Right, so you have to tell the greater with another kid, you know, compliment DVD call to say that run this test. 41 00:04:34.020 --> 00:04:36.420 William Cheng: So that this case or will get executed. 42 00:04:39.450 --> 00:04:50.310 Andrew Strimaitis: I guess I guess what's a little bit confusing, is that I thought having a three dot B was specifying the correct tasks. So I'm not too sure. 43 00:04:50.310 --> 00:05:02.160 William Cheng: Right, so, so, so look like this. Right, so you know it's going to do K assert right and then like that. Right. And then you say a three B right okay but this line. The co will never get executed. 44 00:05:04.560 --> 00:05:08.400 William Cheng: If you just start and stop the colonel in the you know the corner. When I get here. 45 00:05:12.750 --> 00:05:13.230 Andrew Strimaitis: So then 46 00:05:13.800 --> 00:05:25.950 William Cheng: What we need is have another line to say that if you know if the favorite test will execute this line. So the next one will say, you know, I guess. Favorite has a seat right so then you say, See that to get to this line, you have to execute favorite test. 47 00:05:30.270 --> 00:05:36.540 William Cheng: Right. Because if you don't, if you don't have the favorite test over here, this line of code, you know, the 48 00:05:37.740 --> 00:05:42.030 William Cheng: The greater the greater rank of colonel, you know, this care, sir, will never show up. 49 00:05:46.500 --> 00:05:51.660 Andrew Strimaitis: Okay, so does, does this have to do with the case or calls them. 50 00:05:52.740 --> 00:06:09.210 William Cheng: Well, this k assert, it's a, you know, so, so most of the chaos shirt. If you just start and stop the Colonel, they will execute through all those code, right, so, so, so, so you will see them in the printout right to have, then you will not see what is a three be the otherwise a dot six dot something 51 00:06:11.490 --> 00:06:14.850 William Cheng: So if they don't get executed that you won't get the credit for it. Right. 52 00:06:19.080 --> 00:06:19.560 Andrew Strimaitis: Okay. 53 00:06:21.750 --> 00:06:35.790 William Cheng: Right. So again, every, every k assert in Section eight of the grading guidelines, except those two if you just start the kernel and stop the current all they will all get executed. Okay. These two you will not get credit for it. If you don't, if you don't do anything else. 54 00:06:37.980 --> 00:06:38.580 Andrew Strimaitis: Hmm, OK. 55 00:06:39.210 --> 00:06:46.890 William Cheng: Guys. So the way that you do this is I use that in order for me to get credit for this one, you know, dear greater please run favorite tests. 56 00:06:48.780 --> 00:07:06.720 Andrew Strimaitis: And then, but then for the question mark inside the conforming DVD call you just put that with the, the favorite test number so because because the way it's listed right now is grading. One question mark. And I know favorite test would be 57 00:07:07.290 --> 00:07:16.920 Andrew Strimaitis: Si, si. So if this is just a hypothetical. So if you did have to run favorite, favorite tests within you have to put grading one see 58 00:07:17.220 --> 00:07:19.740 Andrew Strimaitis: Yes. Okay, just below. Okay. 59 00:07:20.190 --> 00:07:24.360 William Cheng: Right. So this tells a greater to get to this line, the greater nice around favorite test. 60 00:07:25.890 --> 00:07:27.600 Andrew Strimaitis: Okay. Okay. All right. 61 00:07:28.620 --> 00:07:34.860 William Cheng: Guys, only for those two. Those are special. You have to you know i i think money favorite test, you get to everything. 62 00:07:37.800 --> 00:07:38.790 Andrew Strimaitis: Great, thank you. 63 00:07:39.120 --> 00:07:41.850 William Cheng: Okay, yeah, sorry, this is a little confusing. 64 00:07:55.170 --> 00:08:08.820 William Cheng: So the submission deadline is end up today's so if you know if you have any question please feel free to send me email, don't assume anything because I don't want it. I don't want people to lose, you know, easy points. 65 00:08:21.720 --> 00:08:22.500 Hardik Mahipal Surana: Good morning, Professor. 66 00:08:22.830 --> 00:08:23.220 William Cheng: Morning. 67 00:08:23.580 --> 00:08:26.040 Hardik Mahipal Surana: I had a question with respect to corner, too. 68 00:08:26.370 --> 00:08:34.500 Hardik Mahipal Surana: Okay, I actually just wanted a little more clarity regarding the ignored function for getting the occasion to work for phase one. 69 00:08:35.280 --> 00:08:40.260 Hardik Mahipal Surana: My understanding is that we have to implement some functionality which will help us to create 70 00:08:40.920 --> 00:08:51.870 Hardik Mahipal Surana: Certain files for terminal devices PDF files and then we should be able to communicate with the keyboard through that. So I just want to get some clarity on what the overflow is supposed to look like for that. 71 00:08:54.390 --> 00:08:59.940 William Cheng: Uh, so what you need to do is that if you want to make a device, you just call you know do make node. 72 00:09:01.470 --> 00:09:04.560 William Cheng: And then you have to implement do make no right because that one is not yet implemented. 73 00:09:05.910 --> 00:09:20.040 William Cheng: Right. So while you try to call do to make no I mean the virtual file system doesn't know how to do anything, you know, below it. So, therefore, you need to, you know, look at a common block and do make note. And then, you know, see, see what you have to do. 74 00:09:21.990 --> 00:09:28.770 William Cheng: And I guess what you need to do is I need to find the point during the actual file system. And then, you know, call through that pointer. 75 00:09:29.220 --> 00:09:30.900 Hardik Mahipal Surana: Big know Mike. My question is actually 76 00:09:32.910 --> 00:09:37.050 William Cheng: Hold on, so sorry about it, you have the source code for the RAM file system. 77 00:09:37.080 --> 00:09:47.190 William Cheng: Yes. Yes, look at the function in the RAM file system to say hard to see how the rampart sister will create a device. Okay, so, so, so, your goal is to 78 00:09:47.790 --> 00:10:00.840 William Cheng: So let me let me, let me try this. Right. So when you call do make note I ok so this is this is the function, you have to implement right and then there's the ran fastest them ran Fs. Make note. 79 00:10:02.820 --> 00:10:06.420 William Cheng: There. So what do you need to do is that your goal is to reach this function. 80 00:10:07.680 --> 00:10:16.200 William Cheng: Okay, so whatever the code that you write over here. It needs to be device independent. So don't hard coded ramp FS make no because because that that's really not the intention. 81 00:10:17.130 --> 00:10:26.190 William Cheng: So so so what you should do is that you should you know right device independent code, not the devices. Right, right. Fastest them independent code so that you can actually read this function. 82 00:10:28.620 --> 00:10:31.530 William Cheng: So if you reach this function you assume that this function is perfect. 83 00:10:31.740 --> 00:10:36.180 William Cheng: So, therefore, what it will do is that the ranch houses that make no function will create a device for you. 84 00:10:37.860 --> 00:10:45.060 Hardik Mahipal Surana: Okay. And after the device. Are we supposed to use the special file read and write for us to talk to the term. 85 00:10:46.140 --> 00:10:51.210 Hardik Mahipal Surana: Late basically I'm my assumption is that typing on the keyboard is the same as writing to the file and 86 00:10:51.930 --> 00:10:58.950 William Cheng: So again, these are done through polymorphous them right so so so let's say in the function to read to read guy. 87 00:10:59.220 --> 00:11:12.720 William Cheng: So if you read the file descriptor if the file descriptor correspond to a device you expect that eventually issue is you get to a special file read. Yes. Okay, so these are done through polymorphous them so you shouldn't call it, you know. So you shouldn't 88 00:11:13.830 --> 00:11:26.100 William Cheng: Take a look at a function to say, oh, this is the device. So, therefore I'm going to cause special file read that was not the intention. Okay, the intention is that if you can find the right pointer and call that function indirectly through that first function pointer, then it's your work. 89 00:11:28.110 --> 00:11:45.630 Hardik Mahipal Surana: Okay so majorly in this particular assignment, our aim is to figure out what functions to be called using polymorphous them so that the FS can do all of the function that we need. And it's mainly manipulation of the norms and file, file based structures. 90 00:11:46.800 --> 00:11:52.170 William Cheng: Right, so that all these things can be done in a file system independent way and also in a device independent way. 91 00:11:54.390 --> 00:11:54.750 Hardik Mahipal Surana: Okay. 92 00:11:55.110 --> 00:11:59.700 William Cheng: And then the trick, of course, is to go through polymorphous them, you know, so to follow the pointer. 93 00:12:00.000 --> 00:12:12.570 William Cheng: So one of the things that you should also read is that when you read the source code. Some of the initialization CO, they will show you how the poly mode, the poly morphic pointer is set up. Well, once these are set up, then you just cost with the function, everything will work. 94 00:12:14.700 --> 00:12:17.100 Hardik Mahipal Surana: Okay, and one more question. So there are some 95 00:12:19.770 --> 00:12:29.520 Hardik Mahipal Surana: What do you call those macros which we can set in the config file, such as get cwt and mounted I wanted to know if we should be setting those for this assignment. 96 00:12:29.790 --> 00:12:36.420 William Cheng: Yeah, you should not touch any of those things. The only thing is your touches that a beginning, you know, the bfs equal to one, things like that. 97 00:12:37.290 --> 00:12:42.150 Hardik Mahipal Surana: Okay, so we will be working only with the around file system and that will already be mounted for us. 98 00:12:43.770 --> 00:12:48.630 William Cheng: Yes. So I think in a function called BFS in it the FS in it. 99 00:12:50.430 --> 00:13:00.990 William Cheng: Okay, so I think this this is in vs vs s dot c. So there's a phone call that and there's a functional BFS in it, so that will initialize the virtual file system. 100 00:13:01.800 --> 00:13:11.940 William Cheng: So I think in in BFS in it is called inside idle proc run. I think so. You know, so before you get to the, the, the, the entire process, everything should be initialized. 101 00:13:12.660 --> 00:13:19.980 William Cheng: Okay, so I'll go through the code for VM FS in there, try to read and try to understand that and if you, you know, can figure it out, feel free to ask me question. 102 00:13:22.140 --> 00:13:22.410 Okay. 103 00:13:23.640 --> 00:13:32.940 Hardik Mahipal Surana: Actually, I did go through the initialization I understood how the RAM file system by default is being set up and being mounted on to our actual virtual file system. 104 00:13:33.150 --> 00:13:33.720 Hardik Mahipal Surana: Yeah, and 105 00:13:34.200 --> 00:13:41.130 Hardik Mahipal Surana: I understood how to make notice supposed to use Baltimore for them to access the RAM file system specific functions. 106 00:13:41.430 --> 00:13:45.390 Hardik Mahipal Surana: Well, the only thing I was confused about was the communication aspect. 107 00:13:45.840 --> 00:13:51.360 Hardik Mahipal Surana: With that particular device. And as you said, I think it's just for me again, just for the morphic goals. 108 00:13:53.760 --> 00:14:05.250 William Cheng: Right, so, so yeah, so, so I think some of the device driver Co. You don't have right so so we don't really know all the details right. We just have to trust that they all work perfectly good 109 00:14:05.640 --> 00:14:20.610 Hardik Mahipal Surana: So, apart from the keyboard. Are there any other devices which which we will be communicating like we when we create the TTY that's basically by devices character device, right, do we, we also write code that will help us communicate with block devices. 110 00:14:21.780 --> 00:14:27.540 William Cheng: And I think our current all doesn't. I mean, they're all written by the Brown University people 111 00:14:29.160 --> 00:14:34.770 William Cheng: So I don't think we have to write any block device code, we only deal with the but the character to the by device. 112 00:14:36.270 --> 00:14:39.930 Hardik Mahipal Surana: OK, so the only device will be communicating will be the terminal which is a by device. 113 00:14:40.740 --> 00:14:43.230 William Cheng: Right. I think the terminal is known as a TTY hi 114 00:14:43.710 --> 00:14:50.340 William Cheng: Yes. So there's a there as the main the main device, you will use is called slash dev slash TTY zero 115 00:14:52.710 --> 00:15:04.290 Hardik Mahipal Surana: Okay, because in I think in the IRA program function they talked about creating our dev null and TTY devices. So I just wanted to understand the difference between 116 00:15:05.100 --> 00:15:16.590 William Cheng: Yeah, so the deaf know devices. So, so there's a few device slash def know def know you can. I don't know if you have a use that on the UNIX system. For example, you can say cat. 117 00:15:17.550 --> 00:15:24.630 William Cheng: You know, make file or something like that and make file make file and right arrows slash dev slash now. Okay. 118 00:15:25.200 --> 00:15:34.350 William Cheng: So you can run a command like this. So Robin is that the dev know device is a it's something we'll call it a sort of a big bucket. It's a 119 00:15:34.650 --> 00:15:42.030 William Cheng: You know, sort of a sink so so so what will what will you try to, you know, a print anything into a slash def sizes know all the character just disappear. 120 00:15:43.020 --> 00:15:57.360 William Cheng: Okay, so it's kind of like a sort of a bit sync. So everything goes in there and it's like a black hole, they just disappear. Okay, so that's the purpose of slash def slush. Nah. Okay, so, so when the device. Once you open it when you write to it, nothing happens. 121 00:15:58.650 --> 00:16:01.890 William Cheng: Okay, so, so later on when you look at the the coding BFS test. 122 00:16:02.100 --> 00:16:10.530 William Cheng: DFS test will have a test for this device to try to make sure you implemented correctly. Okay, so that's one of the device and the other device called a zero device. 123 00:16:11.070 --> 00:16:24.540 William Cheng: Slash dev side zero that so this device. It's a, it's a, you know, it's sort of the opposite of the blood of the black hole, it's a it's a white hole or something like that. So what you do is, I will you read from this device. All you're going to get a zero. 124 00:16:25.170 --> 00:16:31.530 William Cheng: Okay, so you can read one by you can read 5 billion buys all you're going to get a zero. So, this is basically a device for reading 125 00:16:33.180 --> 00:16:40.290 William Cheng: All right, so these are the devices, you have to create. So again, you know, all you have to do is to use the right device identifier and the, the actual file system. 126 00:16:40.740 --> 00:16:51.780 William Cheng: Which is the RAM file system. So, what it will do is it'll create all these devices for you. OK. And then there's the TTY device slash slash TTY TTY I guess it could be 01 and two 127 00:16:52.500 --> 00:17:05.100 William Cheng: So I think, though, the way the the the qu is set up is you can actually have three different terminology. They're known as TTY 01 and two. So by default, the TTY that you're using is TTY zero 128 00:17:05.580 --> 00:17:09.750 William Cheng: Okay, so you don't, I don't think you have to create the terminal. All you have to just create TTY zero 129 00:17:11.610 --> 00:17:20.610 William Cheng: Okay, so I think the these are the three devices, you have to create a day. I don't remember if the comment box. If there's anything else but these are the three that I remember. 130 00:17:21.330 --> 00:17:28.950 Hardik Mahipal Surana: So if if if slash slash is just a bit sink or can you explain what the purpose of that is like, why would we want to use that 131 00:17:30.360 --> 00:17:32.070 William Cheng: Because you want to do something like this. 132 00:17:33.810 --> 00:17:35.550 William Cheng: Because This command needs to work. 133 00:17:36.870 --> 00:17:41.610 Hardik Mahipal Surana: Okay. No, but like conceptually speaking, what is the purpose of sending something to a sink. 134 00:17:42.060 --> 00:17:49.290 William Cheng: Because you don't you know because, you know, if you don't do this, it will show up on the screen. Right. And sometimes you don't want to show up on the screen. 135 00:17:51.270 --> 00:17:52.050 William Cheng: So, 136 00:17:52.110 --> 00:17:56.580 Hardik Mahipal Surana: So basically, that was just nullify the effect of what cat is supposed to 137 00:17:56.580 --> 00:18:00.780 William Cheng: Do the cat. Take the content of this file and then right at the standard out 138 00:18:03.600 --> 00:18:06.960 Hardik Mahipal Surana: Okay, so, so the reasons possible to retrieve it from that. 139 00:18:07.890 --> 00:18:12.420 William Cheng: Was Robert is if you if you run this command I can make file right it will show up on the screen right 140 00:18:12.480 --> 00:18:25.230 William Cheng: Yes, yes. Okay. So, but if you don't want to show up on you don't want to show that show. I want you, if you don't want to show up on the screen. What would you do you, you write it to a temporary file if you, you know, so, so, so you still have to have a go into a file. 141 00:18:26.490 --> 00:18:30.180 William Cheng: But if I don't want it to go into a file, and I don't want me to show up on the screen. What should I do 142 00:18:31.260 --> 00:18:37.020 William Cheng: So there's a slash slash no device when you can actually, you know, you have a go to that nobody will see anything. 143 00:18:39.720 --> 00:18:45.690 Hardik Mahipal Surana: Okay, I'm just getting free to heart and to understand the purpose of this, like, why would you want to do that. Like why would you 144 00:18:45.690 --> 00:18:49.440 William Cheng: So, so again, the example over here is that when you when you're required to run command. 145 00:18:50.100 --> 00:18:53.040 William Cheng: Okay and this command will print something to standard out 146 00:18:53.940 --> 00:18:54.330 Hardik Mahipal Surana: Yes. 147 00:18:54.420 --> 00:19:02.100 William Cheng: So what do you do with standard either you have a show up on the screen or you have a go to a file. So if you have to go to a file, you need to come up with the file name for the, you know, for the output to go into 148 00:19:03.180 --> 00:19:07.170 William Cheng: What if you don't have permissions, you know, all that kind of so so in this case is going to create a problem. 149 00:19:07.800 --> 00:19:16.560 William Cheng: Okay, okay. So if you don't want this. You don't want to see the output that the easiest thing for to disappear, is to, you know, redirect the output to sidestep slash not 150 00:19:18.270 --> 00:19:18.600 Hardik Mahipal Surana: Okay. 151 00:19:22.200 --> 00:19:22.500 William Cheng: I mean, 152 00:19:22.770 --> 00:19:25.710 William Cheng: This is how UNIX is it's you know it's a little weird. 153 00:19:26.880 --> 00:19:39.930 William Cheng: But that's how they deal with a situation like this. I mean, you might be able to think of any reason why you why you have to run this, the disco. But for example, if you're running other people's program, something you don't have a choice. 154 00:19:41.490 --> 00:19:41.850 Hardik Mahipal Surana: Okay. 155 00:19:43.620 --> 00:19:51.990 William Cheng: Well, if you're running the program and they were dumped one gigabytes of stuff to the screen and you don't you don't want to see that so you can redirect as a slash slash now. 156 00:19:55.560 --> 00:19:56.670 Hardik Mahipal Surana: Okay, good. 157 00:19:57.840 --> 00:19:58.500 Hardik Mahipal Surana: Thank you so much. 158 00:19:58.830 --> 00:20:01.620 William Cheng: Okay, it's a little weird is a little weird. 159 00:20:20.430 --> 00:20:26.970 William Cheng: I guess in this class we sort of, you know, sort of introduce Unix and Linux, you know, to, to, to the students. 160 00:20:28.110 --> 00:20:34.230 William Cheng: You know, we're not really commenting to say that, you know, this is a good design. This is the bad design, you know, we just sort of presented as it is. 161 00:20:48.360 --> 00:20:50.670 William Cheng: Anybody else has any other questions. 162 00:20:51.750 --> 00:20:52.230 William Cheng: I'll let you 163 00:20:54.000 --> 00:20:55.290 William Cheng: Can have one or two. 164 00:20:56.640 --> 00:21:07.680 Lalit Gupta: I have a small question. So I was looking at the corner last week you were saying that all current process can share the same directory data structure. Can you expand concordance 165 00:21:08.640 --> 00:21:12.030 William Cheng: All the colonel processes can share the same 166 00:21:12.630 --> 00:21:14.340 Lalit Gupta: Page that I created a structure. 167 00:21:15.900 --> 00:21:17.340 Lalit Gupta: The team, you know, 168 00:21:18.360 --> 00:21:19.650 Lalit Gupta: You'd be exposing like a 169 00:21:20.730 --> 00:21:26.250 Lalit Gupta: Venue create a process, you should allocate a pager data structure by calling this something 170 00:21:26.880 --> 00:21:27.690 William Cheng: Right, you can 171 00:21:27.990 --> 00:21:34.320 Lalit Gupta: Either you can or you can do it. You Can I just share that it directly all 172 00:21:34.740 --> 00:21:38.610 William Cheng: No no no no i i think what I was trying to say is that you should not share it. 173 00:21:39.180 --> 00:21:44.250 William Cheng: Right, because the idea over here is that every process. So here's the process when I draw a process, I think about the address space. 174 00:21:44.850 --> 00:21:49.680 William Cheng: In the kernel assignment. There's no address space, right. So again, there's a process control blog over here. I 175 00:21:50.400 --> 00:22:05.430 William Cheng: Every process has a page table right here's a page table page table here. Okay, so when you create a child process over here, right. Here's another the process control blog of the here's a pen. Here's the child, you should create a copy of the page table. 176 00:22:07.290 --> 00:22:11.430 William Cheng: Okay, so therefore if here's a page table don't share it, you should always make a copy 177 00:22:13.080 --> 00:22:13.560 Lalit Gupta: OK. 178 00:22:13.830 --> 00:22:28.620 William Cheng: OK. Okay, before Colonel one and two, since this copy over here are exactly the same. I mean, it's exactly the same copy and Colonel one and two were always inside the Colonel. So therefore, sharing it will also, I think, sharing them will also work. 179 00:22:29.670 --> 00:22:37.050 William Cheng: Okay, but the but the idea that the, you know, the way I sort of explained that in the in the lecture is that every process has his own pace table. 180 00:22:38.820 --> 00:22:40.980 William Cheng: Okay, so therefore you should actually make a copy of it. 181 00:22:42.840 --> 00:22:46.080 Lalit Gupta: Okay, so if you make a copy that it is okay to delete. 182 00:22:47.160 --> 00:22:53.010 Lalit Gupta: when when when when when a child dies, it is okay to delete that page table. Whereas when we share it, it is not 183 00:22:54.090 --> 00:22:59.610 William Cheng: Exactly. If you share it, and if it deleted and then then then the other process. You know, it's going to be using garbage. 184 00:23:01.440 --> 00:23:02.010 Lalit Gupta: Okay. 185 00:23:02.400 --> 00:23:05.640 William Cheng: So therefore, the right thing to do is always make a copy of the page table. 186 00:23:07.710 --> 00:23:14.700 Lalit Gupta: Okay, so if we can get a copy of the page table, then there is no harm. Right. But it is the safe. Safe shows right 187 00:23:15.480 --> 00:23:25.080 William Cheng: Exactly. Yeah. Yeah. And the reason that this works. And now, Colonel Simon is that once you make a copy. Right. This page table. What if you want to change it. Okay. 188 00:23:25.350 --> 00:23:35.100 William Cheng: For our Colonel assignment for the, you know, what were you running a colonel process. You never have to change the page table. Why is this that other page table correctly at the beginning, you never have to change it. 189 00:23:39.180 --> 00:23:46.380 Lalit Gupta: Can you just remind me, like, like what are the things. What are the things that makes the page table to get modified 190 00:23:47.790 --> 00:23:56.100 William Cheng: You know, like when you get a page fault right so so in I guess in chapter three, we see that sort of the big page table. There's 1 million entries over there. 191 00:23:56.520 --> 00:24:07.590 William Cheng: And then, you know, these these these pasted when she's over here. What it will do is it will point to the physical page number. Okay, so if the physical page number changes to a different place. Well, then you have to modify the page table entry. 192 00:24:09.450 --> 00:24:19.230 William Cheng: Okay, so, so this will happen in a user space program. Well guys, when you run a user space program and the Colonel need to fix things for the user space program. In that case, you have to modify the page table. 193 00:24:19.560 --> 00:24:29.130 William Cheng: Okay, but in kernel one and two were completely inside the Colonel. The Colonel page table once you create it. Once you have created the first one, when you make copies you never have to change it. 194 00:24:32.670 --> 00:24:40.560 William Cheng: Okay, so, so that's why we only deal with the page table until we get to Colonel three because kind of one and two, we want to make this aspect relatively straightforward. 195 00:24:41.040 --> 00:24:48.540 William Cheng: So, so, so, so I get the Brown University designed to say once you create a stable, you never have to make modification of a kind of wanting to 196 00:24:56.160 --> 00:25:02.340 William Cheng: So this work with a monolithic colonel. What was you know the colonel from the, you know, what will 197 00:25:03.330 --> 00:25:15.810 William Cheng: What will you put the operating system since it's the monolithic Colonel, you take the colonel from the desk you unfold the into memory and now nothing has to change about the Colonel. Okay, so therefore you can, you know, you don't have to modify the piece table. 198 00:25:22.500 --> 00:25:33.900 Lalit Gupta: And in the life cycle of the third of the process to turn then when a process when a process dies, then, then, then the festival has to start right 199 00:25:34.380 --> 00:25:45.060 William Cheng: Well, so, so, so, so remember, let's say that this process died right when this process died. What it means is that it goes to a zombie state right now it's waiting for the parent to get the return exit code. 200 00:25:45.840 --> 00:25:56.580 William Cheng: Okay, so therefore, for this process that's dead. He will not execute a single line of code. If it doesn't, execute a single line of code that it doesn't need to perform address translation. So therefore it doesn't need the page table. 201 00:25:58.080 --> 00:26:04.800 William Cheng: Right, you, you did a page able to convert a virtual address to a physical address. So if you don't execute code. Well, then you don't need the conversion 202 00:26:05.940 --> 00:26:09.060 William Cheng: So as soon as you go into a zombie state, we can actually destroy this table. 203 00:26:12.300 --> 00:26:20.430 William Cheng: Okay. But, but, but, again, I mean, who, you know, so, so, so let's look at the you know the thread inside this process is executing code is calling exit. 204 00:26:20.910 --> 00:26:28.560 William Cheng: Okay, so at the end of next. It is going to go into the zombie state. If you try to delete this page table that it's going to be very, very tricky because you're still executing code. 205 00:26:29.970 --> 00:26:34.440 William Cheng: Right, so, so there was the time to really get rid of this page table is when the parent process. 206 00:26:34.920 --> 00:26:39.480 William Cheng: Call wait right and now you're inside way, if you're going to return the process ID for this child. 207 00:26:39.690 --> 00:26:49.740 William Cheng: At that time, you can you can destroy a because at that point is the parent that's executing code is that the CPU and the child is executing code. So if the child is not executing code, you can actually to free up all the data structure. 208 00:26:55.050 --> 00:26:55.470 Lalit Gupta: Okay. 209 00:26:56.790 --> 00:26:58.230 Lalit Gupta: So they're prepared thing. Should we do 210 00:26:59.310 --> 00:27:01.200 Lalit Gupta: To make the parent responsible to 211 00:27:03.750 --> 00:27:04.470 William Cheng: The exactly 212 00:27:04.500 --> 00:27:06.360 William Cheng: Yeah, so in do way P ID. 213 00:27:06.570 --> 00:27:20.190 William Cheng: You know when when you know a child process is about to die, what's outside so into AP ID, you're waiting for the child to go into a zombie state. Once the dummies day you know that the child's not execute any code. So therefore you are free to delete all the data structure. 214 00:27:25.260 --> 00:27:30.450 William Cheng: Yeah, so our current know you need to keep paying attention to to to to see who's running that the CPU. 215 00:27:32.160 --> 00:27:32.880 Lalit Gupta: Also like 216 00:27:33.900 --> 00:27:34.410 Lalit Gupta: Since 217 00:27:35.940 --> 00:27:40.980 Lalit Gupta: You are saying the Phoenix is one tear it apart process, the 218 00:27:42.000 --> 00:27:48.000 Lalit Gupta: Dish means the return value of the term does not mean for anything for us right 219 00:27:48.180 --> 00:27:48.900 William Cheng: Exactly, yeah. 220 00:27:49.980 --> 00:27:56.850 William Cheng: Right, the return value for the threat is for another thread. If you only have one thread, then nobody cares about the return value. 221 00:27:58.080 --> 00:27:58.500 William Cheng: Okay. 222 00:27:59.820 --> 00:28:00.030 William Cheng: Yeah. 223 00:28:02.250 --> 00:28:09.720 William Cheng: So for for the colonel one programming assignments. What's important is the process. Exit code and you get an exit code by calling to exit. 224 00:28:10.380 --> 00:28:28.470 William Cheng: Right, so, so, so, so, so, so let's say that. Here's the process. There's a thread running in it right this product or this thread called to exit to exit right to access 55 okay so so once it does that, with the parents tried to get the exit code for this process, it better be 55 225 00:28:30.780 --> 00:28:35.130 William Cheng: Okay, because otherwise there's a problem thing. Otherwise, that means that there's a there's a bug. No kernels. 226 00:28:36.300 --> 00:28:36.660 William Cheng: Okay. 227 00:28:40.080 --> 00:28:41.520 William Cheng: Thank you. You're welcome. 228 00:29:06.900 --> 00:29:09.090 William Cheng: Anybody else has any question. 229 00:29:13.710 --> 00:29:19.800 William Cheng: Okay. If not, I'm gonna, you know, I'm gonna stop recording and you guys can chat with each other.