WEBVTT 1 00:00:02.370 --> 00:00:03.449 William Cheng: Welcome to 2 00:00:04.589 --> 00:00:10.800 William Cheng: Lecture 27. So this is the 14th week so Colonel three is due 3 00:00:12.030 --> 00:00:19.050 William Cheng: Next Friday. So you have over a week and a half to finish. If you have co from previous semester, don't look at them. Don't copy them best to get rid of it. 4 00:00:19.800 --> 00:00:23.760 William Cheng: Is just start as early as possible. If you want to have a chance to finish Colonel three 5 00:00:24.390 --> 00:00:31.590 William Cheng: Grading gala is the owner will grade, you should get familiar with that and the recommended for timeline for Colonel three 6 00:00:32.400 --> 00:00:42.510 William Cheng: Is that, you know, the goal for last week was to get the hello program to run. So during the second week of Colonel three. So if you look at the grading guidelines in Section be 7 00:00:43.050 --> 00:00:53.610 William Cheng: There are some basic user space program to run. And so the basic idea is to use exactly the same method as you run hello to to to to to to pass all these program. 8 00:00:54.360 --> 00:01:05.640 William Cheng: The last one is for can wait. So that one is for can wait is also copy on right so you're supposed to get shadow objects to work in order to get that program to work perfectly OK. 9 00:01:06.120 --> 00:01:20.670 William Cheng: So again, when people run that program you're going to get him some get into some really weird bugs. Look at the colonel FAQ about, you know, for can wait and be the items there because chances are one of the bug is going to be one of those, you know, common bucks. Yeah. 10 00:01:21.990 --> 00:01:29.100 William Cheng: And by the end of this week, which is the end of the week of the second week of the colonel three, you should get the 11 00:01:29.760 --> 00:01:39.900 William Cheng: The s been in it to work. So it's been in it is the real user space in this program. All it does is to create your login shout. 12 00:01:40.470 --> 00:01:56.250 William Cheng: Or your user space shout to to interact with the user. Okay. So all it does is a for coffee shop process. So, at that time, you know, your copy and rice supposed to work with forth as we can fork of child processes and then the child processes is slash been slash 13 00:01:57.270 --> 00:02:05.520 William Cheng: slash slash oops been slashed sh. So that's the user level shout. So again, you have the kind of the entire source code. 14 00:02:06.150 --> 00:02:18.450 William Cheng: You should look at that and when you start trying to get this to work. This will be the first time you you you run Malik. And also, this is the first time you will be using the map system call because that's how you do Malik. 15 00:02:19.110 --> 00:02:28.920 William Cheng: And there's going to be bugs. So I guess some people asked me in the class Google rule would it be better to get men tests to work first before you do has been a net 16 00:02:30.390 --> 00:02:37.920 William Cheng: Nobody ever asked me that before but might be a good idea because men test, you have to get a map. The map system call to work. 17 00:02:38.490 --> 00:02:47.790 William Cheng: So if you get that to work perfectly. Maybe it's easier to pass as been in it. It's been an ad. Also, I don't remember what other problems there might be. So again, you know, 18 00:02:48.480 --> 00:02:56.010 William Cheng: It's, it's probably going to take two or three days, just to get that program to work. Yeah. All right. And again, a lot of the problem is with 19 00:02:57.210 --> 00:03:03.270 William Cheng: You know initializing a data segment initializing you know the the end map system call and all that kind of stuff. Yeah. 20 00:03:04.800 --> 00:03:16.080 William Cheng: Alright, so we're going to continue our last time we were in talking about device drivers. We talked about some of the device driver issues. You know what data structures. Do you need a white. Can you, you just use a 21 00:03:16.470 --> 00:03:24.090 William Cheng: serial line driver because it because doesn't have any buffer or something like that. We also mentioned, you know, you know how much 22 00:03:24.930 --> 00:03:29.880 William Cheng: device independence, you want, you know, things like that. And the last thing that we talked about us where to put the modules. 23 00:03:30.330 --> 00:03:36.420 William Cheng: You can put in the user space, you can put inside of Colonel again. All these things are Colonel a design issues. Yeah. 24 00:03:37.410 --> 00:03:44.760 William Cheng: The next thing we're going to sort of talk about is what about modern days computer. So this is not sixth edition Unix anymore. This is, you know, modern terminals 25 00:03:45.150 --> 00:03:50.160 William Cheng: The modern terminals are have a graphical user interface, guys. Oh, so we have a graphical user interface. 26 00:03:50.400 --> 00:03:56.520 William Cheng: Every time we still do the same thing every time you press the key. You get to interrupt. Okay, but what about you, where you move the mouse. Right. 27 00:03:56.760 --> 00:04:02.100 William Cheng: So as it so there's pictures that show you that when you're, you know, this is your mouse device. Whenever you move your mouse. 28 00:04:02.370 --> 00:04:13.620 William Cheng: You generate the X and the Y right you move to the right move to the left, you move the top to the bottom. Any kind of a distance that the mouse travel goes into the Google 29 00:04:14.430 --> 00:04:20.700 William Cheng: Generate interest. Okay. So whenever you press the button or the mountains interact, even when you move the mouse that's also interrupt. 30 00:04:21.330 --> 00:04:28.440 William Cheng: Okay. So all these things become the events, you go into the kernel, as it turns out that all these events are picked up by a window manager. 31 00:04:28.740 --> 00:04:38.340 William Cheng: There. So if we go back to the previous slide over here, it sort of tells you that you know maybe one of the application program over here will be able to receive the event. So in a way that that's how Window Manager is 32 00:04:38.580 --> 00:04:46.680 William Cheng: There. So our window manager is actually a user space program. It sits in the user space to get all the events. The window manager is not part of the Colonel. 33 00:04:47.610 --> 00:04:52.500 William Cheng: Okay, so it's kind of weird. Right. But, you know, something that that important, as it turns out to us based program. So what it will do is that 34 00:04:53.100 --> 00:05:04.260 William Cheng: What what it will do is that it would tell the current and say hey you know when somebody press a key give the key to me when somebody moves the mouse move the mouse me and then I will figure out, you know how to distribute all these events to the applications. 35 00:05:04.800 --> 00:05:15.030 William Cheng: Yeah, so, so if you have a, you know, sort of a windows based, you know, user interface, you have a display on a display this gazillion with those are typically thousands of windows on the screen right and one of these rectangular area. 36 00:05:15.330 --> 00:05:23.280 William Cheng: It's a window so happen is that it will take this dx amp D y generate from your mouse and then they would decide how much you know how much space on the screen to move 37 00:05:23.850 --> 00:05:26.670 William Cheng: It, it depends on your pointer sensitivity. 38 00:05:26.940 --> 00:05:38.100 William Cheng: Right. Some people like to set up your pointer to be really sensitive. Some people like to set up your pointer to be less as there. You are not making any changes to the hardware, you're actually making changes, you know, to the way the window manager interpret 39 00:05:38.490 --> 00:05:47.010 William Cheng: You know, the X and the Y. Okay, so when you generate the sky by moving the mouse over here, you can see that on the screen, it might move a large this in my move a small distance 40 00:05:47.370 --> 00:05:53.730 William Cheng: Depends on the setting that was that when you click on the screen. So the window manager actually knows exactly where you know where 41 00:05:54.540 --> 00:06:03.930 William Cheng: Where the mouse is on the screen right there's a cursor right there. So when you click right there. What it will do is that what you're trying to figure out where it is and then he will find the top most window. And then he will 42 00:06:04.680 --> 00:06:12.870 William Cheng: Activate that window. Okay, so the technical term. You know when you click on the window that window become the input focus 43 00:06:13.200 --> 00:06:24.690 William Cheng: Okay, so what is the input focus right so the input focus mainly that that's the window. From this point on, every key that you press the all the keystrokes will be deliver to the application that on that window. 44 00:06:25.320 --> 00:06:30.390 William Cheng: Okay, so all these window that you see on the screen. They didn't, you know, so, so somebody I'm occasional create hundreds of windows. 45 00:06:30.930 --> 00:06:41.640 William Cheng: So for every window. There's an owner. Okay, so when you you know make a window, the input focus every key that you press or get deliver to the application. The only improve focus 46 00:06:42.420 --> 00:06:53.160 William Cheng: Okay, so remember previously on the previous slide we sort of say that you know you have you had multiple user processes and you have the line. This one module in the user instead of C library was so this way when you press the key who do 47 00:06:53.970 --> 00:06:56.640 William Cheng: You know who deliver that who do deliver the carrot character to 48 00:06:57.570 --> 00:07:04.620 William Cheng: Okay, so in the old windows, sort of in the OH UNIX system they sort of need to figure out. And then, currently, you know, no witnesses and they also have this clever way of 49 00:07:05.160 --> 00:07:13.110 William Cheng: Figuring out right depends on which window. You're on. When you click on it, that becomes the input focus. So the owner of the window will be receiving all the keyboard events. 50 00:07:13.890 --> 00:07:20.220 William Cheng: Okay. So for this one. Are you know everything over there will go to the window manager and the window manager is sitting in the user space is in the user space. 51 00:07:20.400 --> 00:07:33.270 William Cheng: So what do you do with that he will communicate with all the other user program to say, oh, you know that you know you know the the the the keys inside your window has been clicked. So here's the character that that that was typing to your window. 52 00:07:34.500 --> 00:07:40.740 William Cheng: Okay. So typically when we, I don't know if you have any experience with window programming you know so. So again, it's kind of different 53 00:07:41.130 --> 00:07:45.750 William Cheng: But you can also, you know, think about our terminal. Terminal is a character based program. 54 00:07:45.960 --> 00:07:54.990 William Cheng: What it thinks it's doing is that is talking to a device driver right it's talking to align this one module. I mean, you come inside a colonel to get a character. So what we want to do is I get, again we want. We don't want to change the Colonel. 55 00:07:55.590 --> 00:08:01.710 William Cheng: Okay, one of the colonel to stay as closely as be the to the previous you know configuration as possible. 56 00:08:02.070 --> 00:08:08.010 William Cheng: So this way. How do it does window manager. I just sent data, you know, to our line. This one module to the display driver. 57 00:08:08.550 --> 00:08:17.640 William Cheng: Okay, so in that case, what happened is that, you know, we don't really have the terminal device driver anymore. We have, we have a fake device driver know as a pseudo terminal. I thought I mentioned that before, right, the pseudo terminal is about a sort of 58 00:08:18.030 --> 00:08:25.320 William Cheng: Interface and looks like a terminal, but it's pseudo pseudo meaning is really not real. Okay, it's going to be. Hey, like a terminal. Yeah. 59 00:08:26.190 --> 00:08:37.230 William Cheng: So, so, so, so what happened is that you know all you know you know inside the colonel instead of talking to a real device. Now you're talking to a pseudo device. The purpose of the sewer device to communicate with the window manager. 60 00:08:37.680 --> 00:08:47.190 William Cheng: Okay, so this way you know all the character that can receive by the window manager can be sent to your pseudo terminal. So this way when you try to read from your terminal why you're going to end up getting all the characters. 61 00:08:47.910 --> 00:08:53.760 William Cheng: Yeah, so the the picture look like this. Okay, so. So on the left hand side over here is going to be a window manager. 62 00:08:53.910 --> 00:09:00.600 William Cheng: What it's doing over here is that it's absorbed all the keystrokes and all the mouse movements over here and then it will keep them to keep all of them. 63 00:09:00.810 --> 00:09:07.170 William Cheng: And then when I tried to do is try to sort of figure out which application to deliver the character to so when you press the key eventually and 64 00:09:07.590 --> 00:09:16.980 William Cheng: If this application or sitting, sitting here is going to be the owner of a window that happens that this particular character is gonna go up into the window manager and then it's going to get delivered to the application. 65 00:09:17.370 --> 00:09:25.170 William Cheng: Okay, as far as the application is concerned, the application. Make a racism called come inside the colonel is going to deal with the line. This little module. 66 00:09:25.350 --> 00:09:31.770 William Cheng: And alliances with a module is going to deal with the device driver. But in this case that device driver is called a pseudo terminals slave 67 00:09:32.340 --> 00:09:34.590 William Cheng: Okay, so this is really, really old terminology over here. 68 00:09:35.010 --> 00:09:46.980 William Cheng: So, so the pseudo terminal, as it turns out that it's not a single device is divided into two. The two devices. One is called a pseudo terminal slave and that's the one that talked to the application. The other one is the one that talked to the window manager. 69 00:09:47.640 --> 00:09:57.690 William Cheng: Okay, so you can imagine what's going to happen over here is that whenever I press the key over here. It's going to get received by the window manager and what the window manager will do is that to send the character to the pseudo terminal master. 70 00:09:58.200 --> 00:10:00.960 William Cheng: How does the window manager center character into the pseudo terminal master. 71 00:10:01.350 --> 00:10:10.500 William Cheng: Right. So again, pseudo terminal master is like a device and the window manager is a user space program. So the way you get character into the pseudo terminal Masha is to make a rice system call 72 00:10:11.370 --> 00:10:16.830 William Cheng: OK. So, again, very simple. Right. You read a character over here, you make a racism call the data is going to go to the pseudo terminal master and the 73 00:10:17.370 --> 00:10:23.280 William Cheng: Master is connected to a pseudo terminal slave on this case, the character is going to appear as if it's coming from a terminal. 74 00:10:23.880 --> 00:10:34.350 William Cheng: There. So in this case, it will go to the line this module, you'll go to the partial line queue and you press enter and we'll go to compliance. So everything's going to be exactly the same as before, except that you know everything that goes through the window manager. 75 00:10:35.160 --> 00:10:40.920 William Cheng: That but last lecture, I mentioned to say, I mentioned that if the data go into the application. 76 00:10:41.340 --> 00:10:47.580 William Cheng: You know, go go into the user space and then when they tried to communicate with the app to another application. It has to go into it goes to the colonel again. 77 00:10:48.060 --> 00:10:58.140 William Cheng: Okay. So, this way, this character instead of saying is that a kernel. It's going to go into the user space come down into the colonel II are using a pseudo terminal master and then eventually go up to the application. 78 00:10:58.800 --> 00:11:05.880 William Cheng: Okay, so this path seems to be very, very slow. So how come it's not you know i mean you know pretty much every 79 00:11:06.960 --> 00:11:12.600 William Cheng: You know, desktop or laptop machine that you use has a window manager right isn't really slow. I mean, it turns out 80 00:11:13.230 --> 00:11:24.510 William Cheng: It doesn't really, you know, it's not really really very slow. That's because the window manager. It's a single application. So what you can do that. You can you can optimize the code, you know, you can optimize the heck out of that code. 81 00:11:25.380 --> 00:11:39.870 William Cheng: Okay so window manager has been developed in many, many years over the overtime this window manager has been hand optimized so that this particular path is going to be really fast. Okay, it's going to be almost as fast as if the character directly come into this little terminal say 82 00:11:40.950 --> 00:11:48.690 William Cheng: Okay, so. So again, if you just want to optimize one application can it be done. Well, of course it can be done. You put now people even people on it eventually 83 00:11:49.260 --> 00:11:57.870 William Cheng: It's gonna be that if you want this to be a general thing to make every application, you know, go go go into the user space and comes out, Colonel. What that's going to be much harder. Okay. And people have tried that. 84 00:11:58.740 --> 00:12:08.190 William Cheng: Okay, but if you just want optimized one application. As it turns out, you know. Case in point, everybody's a window manager and the performance pretty good so so so therefore, this can be done now. 85 00:12:09.210 --> 00:12:11.520 William Cheng: Also, you know, in the glow days over here. 86 00:12:14.220 --> 00:12:20.130 William Cheng: I guess, you know, you can see that this is this architecture is little we're right. Why don't we just have one terminal device over here while we wait 87 00:12:20.730 --> 00:12:30.930 William Cheng: Another two then as it turns out, you know, if you divide this into pseudo terminal master and pseudo terminal state slate. You can actually do one trick over here. So, divide this into two computers. 88 00:12:31.620 --> 00:12:43.380 William Cheng: Okay. On the left hand side is going to be your desktop. On the right hand side over here. It's going to be, you know, basically the server machine. Okay. I don't know if any one of you have used the victory SCF one 89 00:12:44.010 --> 00:12:50.250 William Cheng: usc.edu or Viterbo. Yes. Yep. To usc.edu. So those are the server machine and they don't have a display. 90 00:12:51.180 --> 00:13:01.320 William Cheng: Okay, so therefore, all they have are pseudo, you know, pseudo terminal. They don't have anything real good. So in that case, why, but is that you can actually run your application, hence the reason people use the term. Yes, they have wine or so you have to 91 00:13:01.710 --> 00:13:14.670 William Cheng: Is that because there's some fancy software. They're installing those machine and then you just secure shot over to use it well you Secure Shell to you to do these machine to use it, you're interacting with the terminal and now you can actually open up a window on your desktop. 92 00:13:16.920 --> 00:13:19.650 William Cheng: OK, so the way this is done. This is a pretty good architecture. So if I 93 00:13:19.920 --> 00:13:30.750 William Cheng: If I draw a line like this over here right over here on the left hand side will be one machine on the right hands. That will be another machine on the left hand side, this is actually, there's no as your server. So your laptop is a display server. 94 00:13:31.140 --> 00:13:45.960 William Cheng: Now, on the right hand side over here, this will be B2B SCF one that the other idea again. I use it idea. It's a Linux machine. So in this case, it will be a client that will use your laptop, the display, you know, to, to, to, to, to display window. 95 00:13:47.040 --> 00:13:56.760 William Cheng: Okay, so in that case why. But does that this particular condition right here. Now be what kind of connection right because on the left hand side is sitting on one machine, right, this might be you are sitting at home. And this is a machine USC. 96 00:13:57.120 --> 00:14:00.900 William Cheng: Then, so this connection at the bottom. Over here, become an internet connection. 97 00:14:02.130 --> 00:14:12.000 William Cheng: Right. So again, by using one level in direction, you get a lot of flexibility. So in this case, this could actually if you're on the same machine. Well, then the data can actually be copied from one part of the colonel to another part of the Colonel. 98 00:14:12.210 --> 00:14:17.850 William Cheng: But now if you're sitting across the internet. This was simply become an internet connection. And that also will be really easy to do. Right. 99 00:14:18.090 --> 00:14:24.690 William Cheng: He goes over here. When the Colonel, pick up the data, all you need to do is to write to a network connection and then the data will get picked up on the other. 100 00:14:25.020 --> 00:14:35.490 William Cheng: On the other machine at the other end of the internet. And now what it will do is it will send the data to the sort of terminal slave and now you're a program will be able to pick up the data as you're using a real terminal. 101 00:14:36.390 --> 00:14:44.580 William Cheng: Yeah. Similarly, if your application tried to send data onto the screen over here. Again, what you will do is that you will go through a line. This little module, send the data through the pseudo terminal slay 102 00:14:44.790 --> 00:14:52.410 William Cheng: Going across the internet and he will appear over here on a device and now your window manager over here when the device has character and the windows manager called read 103 00:14:52.620 --> 00:14:57.780 William Cheng: It will end up getting all these events from the pseudo terminal master and it will be able to display all this kind of stuff on the screen. 104 00:14:58.830 --> 00:15:05.430 William Cheng: Or as little gay. You see the power of one level of indirection by using you know one loving direction over here, you get a lot of flexibility. 105 00:15:05.880 --> 00:15:15.180 William Cheng: Okay so units was designed like this long, long time ago. So this is one of the reasons sort of Windows was behind in terms of, you know, displaying you know the swing. 106 00:15:15.930 --> 00:15:25.890 William Cheng: You know, sort of doing that as well and the different machine Windows. Windows, it has to come up with something called a terminal server. They have to have a special version of the server in order for him to do that. 107 00:15:26.700 --> 00:15:36.390 William Cheng: Okay units was done, you know, since the, I guess like like this, you know, since the 80s AND SINCE THE 90s so long time ago. They use something called X Window System right X Windows 108 00:15:36.870 --> 00:15:47.040 William Cheng: NT O WS X Window System X Window System has this architecture. So you can run one application on one machine have that have it this way, going to go, go, go, go, go to the other machine. 109 00:15:47.520 --> 00:15:57.390 William Cheng: Because you know their design was very flexible, right. All right. And also, in this case, you can also play, you know, play games you know by clicking and hit and stuff like that. So again, 110 00:15:58.230 --> 00:16:06.030 William Cheng: You know, again, I'll be here. We have to, you know, again, another level of indirection. We can easily switch out the line. This one module. So can get all the characters you know that that we want. 111 00:16:06.480 --> 00:16:18.690 William Cheng: So again, this architecture. We were very close to two level interaction. And now you know we even have you been more flexibilities or is it again. This is a typical computer science solution, as it turns out it works out really well. Yeah. 112 00:16:20.280 --> 00:16:20.790 William Cheng: Alright. 113 00:16:22.290 --> 00:16:29.550 William Cheng: Alright, so that's all we want to say about the terminal device driver. So the next thing we're going to sort of briefly talked about will get. We're not going to talk go into too much detail. 114 00:16:30.000 --> 00:16:35.640 William Cheng: There's networking class are you so if you're interested in elegance. They then they would in class. So we'll talk a little about 115 00:16:36.930 --> 00:16:43.710 William Cheng: A little bit about networking. Right. So again, networking is complicated inside the operating system. They are many, many layers. 116 00:16:44.220 --> 00:16:58.380 William Cheng: So you probably heard of sort of the you know the the second layer you know protocol and you know OSI model as an international standard. You probably also hear about TCP IP right TCP IP or multiple layers inside the, you know, 117 00:16:58.860 --> 00:17:06.930 William Cheng: Instead of networking subsystem instead of Colonel okay so over here also draw the picture inside the IO manager inside the Colonel. There's a networking subsystem. 118 00:17:07.290 --> 00:17:15.420 William Cheng: There are two layers. One is called TCP layer. The other one is called IP layer and below the IP layer or you can sort of think about depends on what kind of connection, you have 119 00:17:15.600 --> 00:17:20.250 William Cheng: If you have a wired connection. There's an Ethernet layer. If you have wireless connection. There's a Wi Fi layer. 120 00:17:20.790 --> 00:17:28.200 William Cheng: So eventually over here you go to the inner interface car again if you are connected using Wi Fi network interface card has kind of sticking out. 121 00:17:28.590 --> 00:17:37.410 William Cheng: If this one is the Ethernet card. There's Ethan He can actually plug in. I mean, it doesn't really matter how it's done right. So, so it is a on network interface card data is going to come in from across the 122 00:17:37.890 --> 00:17:42.720 William Cheng: Internet inside the interrupt service routine. You're supposed to to service I interrupt. 123 00:17:43.380 --> 00:17:53.670 William Cheng: Okay, so instead of, you know, so in the interim, there's a lot of work to do. Right, we mentioned before, if there's a lot of work to do you need to do the basics down to all the important stuff and do everything else. During the default word time 124 00:17:54.330 --> 00:18:01.080 William Cheng: OK. So again, there's a TPC Q, you can add more to the TPC Q wake up at TPC see thread, you know, for, for, for, for, for 125 00:18:01.500 --> 00:18:08.340 William Cheng: For you to do all that, all that kind of work, Gabrielle Union still inside the Colonel. We have a lot of work to do. Because networking is complicated. 126 00:18:09.120 --> 00:18:15.990 William Cheng: That. So I've been designing them. Okay, typically the way that was sort of deal with the networking is that, you know, when you try to process data inside network. 127 00:18:16.650 --> 00:18:22.770 William Cheng: So so so let's say that you're processing some kind of a packet. Right. You see how people call a package package want to travel across now now or 128 00:18:23.250 --> 00:18:28.110 William Cheng: Do you have a packet every packet. You can divide them into two parts. Right. One is called the header of the 129 00:18:28.560 --> 00:18:38.310 William Cheng: Packet. The other one is called the body of the packet. Okay, so when data travel across eastern or travel across Wi Fi was going to do is I'm going to arrive. You know, you know, 130 00:18:39.060 --> 00:18:48.360 William Cheng: You know, the data is going to rise, just looking at like a packet. So let's say that this data is Ethernet. So this header is no as Ethernet header and the body over here is kind of caught Ethernet body. 131 00:18:49.140 --> 00:18:54.000 William Cheng: OK, so the way typically networking is done is that when you look at the header that you know what to do with the body. 132 00:18:54.900 --> 00:19:03.930 William Cheng: Or so we've seen that already, right, when we talk about the file system when you try to read the father directory entry we need to read the header and then the the header will tell us how many more bites are in the body. 133 00:19:04.350 --> 00:19:10.320 William Cheng: Okay, so we're here. It's exactly the same thing by reading the header. We know how big the body as we know what's inside the body. 134 00:19:10.830 --> 00:19:13.560 William Cheng: Without knowing the header. We don't know what kind of data as an inside 135 00:19:13.920 --> 00:19:21.810 William Cheng: Okay, so it's very important over here to read the header. So this way we know what kind of data inside the body or, more importantly, we can deliver it up the protocol stack. 136 00:19:22.260 --> 00:19:31.080 William Cheng: Okay, so these are called protocol stack TCP IP. There are different protocol internet also has a different protocol. We're going to start with a lower level protocol. I'm going to pass the data up the protocol stack. 137 00:19:31.530 --> 00:19:42.810 William Cheng: Okay, so every time when we go up one level, they're usually many, many choices. So by looking at the header. We know you know where to deliver your way to deliver the body to to to to to the next level. 138 00:19:43.380 --> 00:19:53.700 William Cheng: Okay, so when we get the body of your with delivered to the next level. So guess what that next level do right so if this was Ethernet next level of yours IP IP is going to take the data and divide them into header and body. 139 00:19:54.240 --> 00:20:00.030 William Cheng: Okay, so this one is going to be become IP header IP header, right, followed by IP body over here. 140 00:20:00.270 --> 00:20:05.730 William Cheng: There. So again, by looking at the IP header. It knows where to deliver the IP body of the protocols that 141 00:20:05.850 --> 00:20:14.820 William Cheng: So the next level over here might be TCP and if you have done some networking, there might be UDP. There might be. I said, there's a lot of different protocol level over here. So let's say that this is TCP 142 00:20:15.210 --> 00:20:24.510 William Cheng: Okay, TCP is going to take the IP body. And again, divide into two parts. One is the TCP header. The otherwise. That is the body. And now what it will do is it will take a look at the TCP header. 143 00:20:24.690 --> 00:20:28.860 William Cheng: And then use that information to figure out which application to deliver the TCP body to 144 00:20:29.220 --> 00:20:33.570 William Cheng: Okay. So all these things are done inside the colonel right so so so yeah well you get 145 00:20:33.750 --> 00:20:40.350 William Cheng: You get an hour interrupt you were supposed to do all these kind of work and they will take a long time, right, because you know that if you try to parse data. 146 00:20:40.560 --> 00:20:47.850 William Cheng: It will take a while, right, just like you one on one and warm up to whenever you try to read the file you need to parse the data, what, that's what needs to die. We do that that's what needs to be done. 147 00:20:48.840 --> 00:20:59.880 William Cheng: Okay, so eventually when TCP, you know, sort of figure out where the data has to go. It needs to figure out which application to deliver the data to and then what it will do is it will take the TCP body and then it will deliver to the application. 148 00:21:00.390 --> 00:21:09.930 William Cheng: Okay, yeah. How do you, how you deliver data to the application, the application has to make the racism call when you may read them a system called you can have to read return with the data inside of TCP body. 149 00:21:10.770 --> 00:21:16.290 William Cheng: But so eventually is over here, you know, eventually it's gonna close the application. So in this case, the application might be a browser. 150 00:21:16.830 --> 00:21:24.120 William Cheng: Browser when the browser tried to read data from across the internet, it makes a real system call over here. And then nice way for data to come all the way from across the Internet. 151 00:21:24.300 --> 00:21:30.540 William Cheng: Going from the network interface card DMA the data into physical memory and then you will wake up a colonel. 152 00:21:30.990 --> 00:21:43.260 William Cheng: So the colonel threat over here is going to, you know, starting to deliver you know the guess again the colonel thread over here is going to be the one that's waiting for this data and then what it will do is it will parse all these data and delivered data of the protocols that 153 00:21:44.580 --> 00:21:59.280 William Cheng: Okay, so, so, so, so, so why, you know why is networking very, very special. Right. So, one is that there are many, many layer over here. Okay. So, therefore, if every time when you should try to go from one layer to the other layer, you have to copy data. Well, then this can get really, really slow. 154 00:22:00.450 --> 00:22:08.070 William Cheng: Okay, and why, why, why, you know why did, why doesn't the keyboard, the same problem, right, because the keyboard that data is one character at a time. So, so it doesn't really matter. 155 00:22:08.220 --> 00:22:19.590 William Cheng: But when you receive data from across the internet. So let's say you're downloading downloading a bunch of 16.04. I mean, the data coming from the internet is huge amount of data. Right. So if you process is really, really slow. You're going to be in trouble. 156 00:22:20.910 --> 00:22:29.880 William Cheng: Okay, so one of the rules that actually set up inside the inside networking over here. So, so here. Yeah, so, so basically the difference between networking and device and the terminal device driver. 157 00:22:30.090 --> 00:22:33.930 William Cheng: Is that performance become very, very important inside the networking subsystem. 158 00:22:34.560 --> 00:22:42.510 William Cheng: Yeah, so we need to be able to pass a data block for one module to the other without making copy of the data because the copy of the data is one gigabyte. 159 00:22:43.380 --> 00:22:55.620 William Cheng: Okay, or maybe multiple megabytes over here. So again, we need to do these data processing, really, really fast. And every time we if we need to copy data that will slow things down. So typically inside networking subsystem you the requirement is that you must not copy data. 160 00:22:57.240 --> 00:23:01.500 William Cheng: Okay. But eventually, when I did, I need to go into the user space, why, at that point, you have to, you don't have a choice right so you can't really 161 00:23:01.860 --> 00:23:06.930 William Cheng: Say, at that point, I'm going to copy the data to the user space, right, because then that will be the only time you're allowed to copy 162 00:23:07.350 --> 00:23:12.300 William Cheng: Okay. Will you go from TCP IP or to either now or whatever you are not allowed to copy data that 163 00:23:13.020 --> 00:23:22.560 William Cheng: Right. They also need to go through all these processes splitting the data into you know header and body when you do that, you're also not allowed to copy data. Okay. So inside the cardinal, you gotta do some kind of special 164 00:23:23.070 --> 00:23:27.660 William Cheng: Data structure to keep track of to keep track of all these kind of stuff there, and also 165 00:23:28.530 --> 00:23:33.750 William Cheng: I don't know if you have done any kind of network programming. Well, you know, we're programming you to notice that you have to deal with a lot of timers. 166 00:23:34.080 --> 00:23:41.430 William Cheng: Okay, because what happened is that if you're on the operating system where you tried to send data across the internet, you're in the operating system, you know everything about your machine. 167 00:23:42.300 --> 00:23:48.600 William Cheng: Okay, what do you know about the next machine. What do you know about the machine that's sitting across the internet, you know absolutely nothing about them. 168 00:23:49.170 --> 00:23:57.030 William Cheng: Okay, so therefore, when you send a packet from your machine to another machine and you don't get a response back, baby. Do you suppose, since I'm dead. Are you gonna get a response back. 169 00:23:57.660 --> 00:24:07.740 William Cheng: What are you supposed to do. Okay, you don't really know why are you not getting a response right you send out some data using for response, the response might never reach who you're sending the data to 170 00:24:08.130 --> 00:24:12.810 William Cheng: Okay, or maybe you know the response. You know, it's not reaching up to something happening. 171 00:24:13.380 --> 00:24:20.070 William Cheng: Inside the internet. Okay, maybe the, the, the server, you know, in the middle where he says, I tried to send data, all of a sudden went down. 172 00:24:20.310 --> 00:24:26.370 William Cheng: Or maybe you know somebody step on your wire and broke the wire. So therefore you don't have any internet connection. Okay, so you don't know any of these things. 173 00:24:27.180 --> 00:24:36.300 William Cheng: Are so what will happen is that you know when when you to do is that, you know, when you send a packet and you don't get a response, typically what we do is, I'm going to read transmit the packet, just in case somebody lost it. 174 00:24:36.870 --> 00:24:40.950 William Cheng: Okay. So, therefore, what we need is so when are we supposed to do that. Well, we need to set up a timer. 175 00:24:41.310 --> 00:24:46.920 William Cheng: Okay, when the timer expire. We need to reach out to spend the data. So if we need to transmit the data we better have a copy of the data. 176 00:24:47.340 --> 00:24:54.210 William Cheng: Read it again, the more reason to hold make a copy of the data. So again, there's no copy you gotta have, you know, multiple you know 177 00:24:54.630 --> 00:25:00.810 William Cheng: multiple pieces of code. Is that your kernel sharing the same buffer. Oh, we know how to share about her. I use the reference kind of all that kind of stuff. 178 00:25:01.320 --> 00:25:06.030 William Cheng: Okay. So in this case, again you know this this buffer is going to be used by multiple parts inside the kernel. 179 00:25:06.300 --> 00:25:12.360 William Cheng: And also, you probably need to handle some kind of a callback routines that a colonel, we mentioned before for Unix. There's a call back 180 00:25:12.660 --> 00:25:16.710 William Cheng: You know you there's a callback machine called a routine, the user space is not a signal. 181 00:25:17.130 --> 00:25:22.410 William Cheng: Okay, but he's had a colonel. There's nothing like that. So for Unix. They actually have to invent something similar to Windows 182 00:25:22.620 --> 00:25:30.960 William Cheng: They have a colonel as they have a callback routines that Colonel so when something happens that occurred on, you can actually make a function called the color Colonel the call Colonel routine. 183 00:25:31.830 --> 00:25:38.340 William Cheng: Okay, so, so, so, so I haven't decided yet when there's a timeout. You want to set it up so that you can, you know, you can reach transmit the packet 184 00:25:38.610 --> 00:25:47.430 William Cheng: And it turns out you actually you receive some data. You know, so, so, so, you know, if it says some data, you actually you receive an acknowledgement. Well, in that case, you have to cancel the timer. 185 00:25:47.670 --> 00:25:51.210 William Cheng: So they're also be has to be some kind of mechanism for you to cancel the timer. 186 00:25:52.080 --> 00:26:01.200 William Cheng: Yeah. All right, so I guess a lot of stuff you have to do inside of colonel colonel for the networking subsystem. Alright, so let's talk about the first one over here. How do you actually, you know, 187 00:26:01.890 --> 00:26:06.300 William Cheng: Make sure you don't copy data. Well, if you can copy data. The only thing you can copy or pointers. 188 00:26:06.840 --> 00:26:14.490 William Cheng: Okay, so therefore we're gonna we're gonna let us use the data structure over here to allow you know the data to be shared by multiple parts of your opportunities and 189 00:26:14.910 --> 00:26:23.550 William Cheng: So that you can actually, you know, a whole keep a copy of the data for retransmission. You can also pass it along the protocol stack while without copying any data. 190 00:26:24.060 --> 00:26:33.990 William Cheng: There so Unix or Linux system. Anything that deal with networking is no a socket right so in Linux, there's a there's a business was your call socket buffer or SK buff. 191 00:26:34.350 --> 00:26:40.980 William Cheng: Okay, so this is the data structure that that's be used. You know when you need to pass data around inside of Colonel 192 00:26:41.730 --> 00:26:50.550 William Cheng: That's all the picture look like this. Okay, so these are called you know segments so so so the way that we can again, nothing too much about networking 193 00:26:51.000 --> 00:26:58.710 William Cheng: When you try to, you know, sort of a, you know, a set 1.5 gigabytes of Ubuntu 16.44 you across the internet, you don't send that in one message. 194 00:26:59.070 --> 00:27:03.840 William Cheng: Okay. Because, because that will be too big. And if you lose something you're going to be in trouble. So what we do is I'm going to take 195 00:27:04.110 --> 00:27:13.770 William Cheng: That very, very long file. We're going to chop them down into little segments. OK. And then we're going to sort of assess segments all over the internet and make sure that you know all these segment, we'll get to the destination. 196 00:27:14.820 --> 00:27:24.540 William Cheng: So so so here when you try to receive data over here. You might try to receive multiple segments coming from the same connection. Okay, I'll go or some comments coming from the same 197 00:27:25.740 --> 00:27:29.850 William Cheng: Come, come, coming from the same a socket there. So these are segments over here. 198 00:27:30.210 --> 00:27:37.920 William Cheng: So as it turns out, you know, the way you know now works is that you start with segment. But when you go from the T zone. So, you know, in TCP TCP layer, they're dealing with such 199 00:27:38.430 --> 00:27:44.310 William Cheng: As the data travel into the IP layer IP is going to chop TCP segment into IP data grabs 200 00:27:45.000 --> 00:27:51.120 William Cheng: Okay, so therefore every segment of your actually makes that makes up a multiple diagrams and the data around can actually travel all over the internet. 201 00:27:52.020 --> 00:28:01.860 William Cheng: Okay mean reality, it doesn't really do that but but the basic idea over here is I will you think about you send a packet into the internet. You have no idea how, how is it going to travel but eventually they will all go to the destination. 202 00:28:02.190 --> 00:28:09.150 William Cheng: Okay, so therefore, when they arrived to the destination, maybe you will get the first packet here first, and then you get the third package. And again, the fourth packet and you get 203 00:28:09.510 --> 00:28:12.300 William Cheng: The second packer the package and calming any water. 204 00:28:12.990 --> 00:28:24.780 William Cheng: Okay. So, therefore, you know, one thing that you have to do inside of the navigation subsystem is that you have to use the segment data structure and you use the second data structure. So, to sort of reconstruct the segment as you receive all these packets 205 00:28:25.530 --> 00:28:40.320 William Cheng: Or so of these data. Here's one segment. Here's another segment the package is going to arrive in random order. We're going to reassemble the packet. When the packet, you know, occupy the entire segment, then we can deliver the will will deliver segment to the next layer. 206 00:28:41.460 --> 00:28:46.800 William Cheng: Okay. So in this case, you know when to use a socket buffer sort of keep track of where we are in terms of the data coming in. 207 00:28:47.370 --> 00:29:00.330 William Cheng: So this is, again, this is a very, very, you know, simple example, it tells you where the header of the the segment is so remember like the segment over here at divide into two parts. One is the the the the the the header part. The other one is the body. 208 00:29:00.810 --> 00:29:08.970 William Cheng: So over here, the points where the header is and then it points to where the body is and it also points to where the end of the data is that we have received so far. 209 00:29:10.050 --> 00:29:15.660 William Cheng: There so I'll be here to tears right here. So if it doesn't feel are the buffer. That means that we can really deliver to the to 210 00:29:16.620 --> 00:29:25.350 William Cheng: The to the application because we're not ready. Okay, so you need to know what to tell is and also you need to know where the end is as long as there's a gap there. That means that we're not ready to deliver data. 211 00:29:26.100 --> 00:29:34.320 William Cheng: That you can also see that there's some kind of description, try to describe what's inside this admin. There's a lot of state information has been maintained by the ordinances that 212 00:29:34.710 --> 00:29:43.740 William Cheng: They also store there. And then there's also a reference count. Okay, so this way you know how many objects inside of Colonel is sharing this particular of the this particular segment. 213 00:29:44.130 --> 00:29:49.620 William Cheng: Okay, so here's SEGMENT NUMBER ONE HERE second number to over here. They are linked together in settling plus 214 00:29:50.730 --> 00:29:58.200 William Cheng: Alright, so if I need to, you know, do we transmission. Right. I need to pass it to another kernel module over here. So in that case, I just need to 215 00:29:58.560 --> 00:30:06.510 William Cheng: I just instead of making a copy of the data. All I need to do is to copy the data structure, right. So if I make a copy of the data starting over here, I just need to 216 00:30:06.870 --> 00:30:12.270 William Cheng: Remember to increment the reference count over here. So now I'm going to enter with to David data structure sharing the same buffer. 217 00:30:12.780 --> 00:30:14.670 William Cheng: Okay, so in that case the picture look like this. 218 00:30:15.420 --> 00:30:25.830 William Cheng: There. So if I want to pass pass my buffer to another module when this is I'll be sharing the buffer with none module. All I have to do is to copy this data structure I copy this way copy this way. 219 00:30:26.040 --> 00:30:32.760 William Cheng: I just the point to point to that. And now I need to increment the reference count while we saw district before, right. So this way you know that can be shared. 220 00:30:33.840 --> 00:30:41.220 William Cheng: Okay. So in this case, again, the data over here does not get copied. Okay, we only use reference counting over here. So, this way we can continue user data right 221 00:30:41.850 --> 00:30:44.730 William Cheng: The next question over here. Is that how do you pass it up to the protocol stack. 222 00:30:45.120 --> 00:30:51.600 William Cheng: Okay, so let's say that this is my IP layer and this is my TCP layer. So initially, what I will do is I will copy this data structure. 223 00:30:51.840 --> 00:30:58.290 William Cheng: Okay. And then what the IP layer can do over here is that it will go to the header and look at the body over here and try to sort of thing and 224 00:30:59.040 --> 00:31:10.440 William Cheng: And then sort of give this part of the body. The body part to the TCP layer and that is Mila what it will do that. It will go through this data over here and get the TCP header over here and then divide into the header and the body. 225 00:31:11.370 --> 00:31:21.090 William Cheng: Okay, so at the TCP layer over here. All they have to do is adjust the pointer. So the header over here will apply here and the body over here point here. And similarly for the next segment over here. Again, if you have enough 226 00:31:21.330 --> 00:31:26.400 William Cheng: Information is that a header that you know exactly how to divide the body over here into TCP header and TCP body. 227 00:31:26.850 --> 00:31:39.150 William Cheng: Good, so therefore the picture will look like this. Right. So again, for the IP, you know, for, for, you know, for the IP data Graham over here. They can divide things into the header and the body and the body becomes the TCP data. 228 00:31:39.810 --> 00:31:45.450 William Cheng: Okay so TCP data what divided into TCP header and is the body and then over here we are called D. 229 00:31:46.410 --> 00:31:50.250 William Cheng: Theta or the body over here. And then what it will do is that it was delivered this all the way to the application. 230 00:31:51.060 --> 00:31:55.020 William Cheng: Okay. Similarly, the next one over here is also belong to TCP and again we can do exactly the same thing. 231 00:31:55.410 --> 00:32:06.180 William Cheng: That. So this way to get when we pass the data from one layer of the Protocol to the next layer. We also don't have to copy data, all we have to do is to adjust the pointer get and everything's gonna work out. 232 00:32:06.750 --> 00:32:16.380 William Cheng: Okay, finally, when we need to deliver data to the application what depends on the application. You know what a buffer. Does it provide we're going to copy the right right amount of data a little bit of time, you know, to the application. 233 00:32:16.920 --> 00:32:25.650 William Cheng: Gravity because the application program when they download download Ubuntu 16.4 it's not going to read one gigabyte at a time. Right, most likely is going to be four kilobytes at a time. Yeah. 234 00:32:27.600 --> 00:32:36.780 William Cheng: All right, so, and also, again I will mention before about timeout. Right. So. So one reason you want to hold on to a copy of the data or you're an increment the reference calm. 235 00:32:37.170 --> 00:32:41.160 William Cheng: Is that because you don't want the data to disappear once you get a timeout. You need to be transmitted 236 00:32:41.550 --> 00:32:46.590 William Cheng: The packet. If it turns out that you know you actually you receive a an acknowledgement 237 00:32:46.890 --> 00:32:54.300 William Cheng: Why, in that case, you know that the receiver have received your data. So therefore you can document the reference count if it goes zero. You can free up the data structure. Yeah. 238 00:32:55.020 --> 00:32:59.310 William Cheng: All right. And also you need to implement a timeout using a callback mechanism inside the Colonel. 239 00:32:59.430 --> 00:33:09.600 William Cheng: So therefore, in this case, when you receive a title you know when when the timer goes off. Something happened inside the kernel, you can call a particular function. And again, this needs to be done inside the operating system. Yeah. 240 00:33:10.320 --> 00:33:20.880 William Cheng: Alright, so that's sort of the brief discussion of, you know, the, the, the, the network and device driver. Right. So again, you can see that there are parts of it. That's very, very different. 241 00:33:21.420 --> 00:33:27.570 William Cheng: You know, from the terminal device driver. Alright, the next thing we're going to do is we're going to go to the last part of chapter four. 242 00:33:27.840 --> 00:33:31.800 William Cheng: On the last chapter four, it talks about we thinking the operating system structure. 243 00:33:32.160 --> 00:33:39.660 William Cheng: I mean, you know, chapter one and two are talking about user space. Chapter three is going to talk about all these you know tools in the middle and chapter four. We're going out of Colonel 244 00:33:39.900 --> 00:33:43.320 William Cheng: Before we even talk about a colonel, were we thinking about operating system structure. 245 00:33:44.220 --> 00:33:54.900 William Cheng: Right. So, so what is wrong with the current operating system structure. Read the current revenue system structure is a monolithic operating system. Okay, so going to sort of talk about what's wrong with that. And what are the different ways to actually make it better that 246 00:33:57.120 --> 00:34:06.900 William Cheng: Okay, so, Monica, years ago, you know, we started out the kernel is one piece of code sitting on the desk when we put the machine. We take this card that's called typically compress 247 00:34:07.080 --> 00:34:16.650 William Cheng: We're going to unfold it into memory. So now the memory over here is going to have your kernel we transfer control into it is called loading right and then your kernel start executing over here. So that's my only the Colonel. 248 00:34:17.490 --> 00:34:28.500 William Cheng: Okay, so what's wrong with it. Right. So the major Adele. So what's right. With that the major advantage of them. Only thing I know is that it performed really well okay because you know the current over here, you know, if you want, just like our options. 249 00:34:30.090 --> 00:34:34.440 William Cheng: Are Linux operating system or Windows operating system is monolithic Colonel 250 00:34:34.980 --> 00:34:42.900 William Cheng: Okay, if you want to use. If you want to find out who the current, you know, who is the current process. How do you find out you use the global variable, you can you can easily figure out who it is. 251 00:34:43.500 --> 00:34:48.600 William Cheng: OK, so when the colonel is compiled into one nice piece of code, you know exactly where everything is. 252 00:34:48.870 --> 00:34:56.760 William Cheng: Okay, so therefore you try to access something is really quick. You can use global variable you all the data structures are global variable. So, in this case performance is really good. 253 00:34:57.480 --> 00:35:06.810 William Cheng: Okay, but what is the downside of a monolithic Colonel right because you know we learn software engineering principle, you're not supposed to use global variable, you know, I think should be modular eyes over here. 254 00:35:07.170 --> 00:35:16.290 William Cheng: You need to write reusable code. You always want to do that now. So, so that's what the reason right because because you know you want to, sort of, you know, make sure that your current oh you know it doesn't really crash very often. 255 00:35:16.980 --> 00:35:30.240 William Cheng: So the major downside of them all the Colonel, is that it's not very reliable because of Colonel bucks. Okay. I mean, clearly, you know, if you have a colonel. You can anything's become assessment instead of Colonel one part of the Colonel. We're can easily destroyed the rest of the Colonel. 256 00:35:31.560 --> 00:35:39.600 William Cheng: Okay, but why would the colonel do that. Well, of course, the current is not trying to do that. But as it turns out, as the colonel gets bigger and bigger and bigger. Pretty soon it's going to be out of control. 257 00:35:40.080 --> 00:35:44.610 William Cheng: Okay, so that's one of the reason Microsoft get a really bad. You know, you know, bad name. 258 00:35:44.970 --> 00:35:52.350 William Cheng: In the 90s right 90s, you know, people say, well, Microsoft might want to use Microsoft the crash all the time. There's blue screen of death and all these kinds of stuff. 259 00:35:52.860 --> 00:36:03.810 William Cheng: But if you actually look at one of the Microsoft crashes in the 90s, oftentimes, when the colonel crash. Guess where does the colonel crash Yeah. The kernel is going to crash in the device driver. 260 00:36:04.890 --> 00:36:09.360 William Cheng: Okay, because the driver is part of the monolithic Colonel when the device driver die you Colonel dice. 261 00:36:10.350 --> 00:36:16.530 William Cheng: Okay, so that's that's the problem with a monolithic or no right parts that are not very important to connect to bring down the entire Colonel down 262 00:36:17.070 --> 00:36:26.220 William Cheng: Okay, so it's not that you know the regular you know threat management memory management those places. Typical have no balls but the the device driver. Right. So why is the image over so many bugs. 263 00:36:26.850 --> 00:36:38.790 William Cheng: Right, because the device driver are not written by the colonel programmers who wrote the device drivers by the device drivers are written by men, and by device manufacturers, they are hardware engineers, they are not Colonel experts. 264 00:36:39.420 --> 00:36:41.340 William Cheng: Okay, so therefore, as it turns out, a lot of times, you know, 265 00:36:41.820 --> 00:36:47.580 William Cheng: They, they end up introducing bugs. So that's one of the reason Microsoft would really, really bad reputation in terms of crashing very often. 266 00:36:47.910 --> 00:36:54.330 William Cheng: In the 90s. Okay, so, so again. Now this is one of the motivation for Microsoft to try to make a more, you know, reliable, Colonel. 267 00:36:55.260 --> 00:37:08.550 William Cheng: Alright, so, so how do you actually fix this problem, right, so, so, so you try to fix this problem is that, you know, so maybe the code that you run inside a kernel. Yeah, so he's not a cut on like a device driver. Maybe we need to protect the rest of the operating system from the device driver. 268 00:37:09.780 --> 00:37:21.660 William Cheng: Okay, we want to want to protect the current off on the device driver. So again, some people say, well, but the device driver is inside the Colonel. So, so, maybe, is there a way we can isolate the device driver, just like we isolate the user space program. 269 00:37:21.990 --> 00:37:27.570 William Cheng: Right. We know how to. So they're using Facebook. All right, we'll put them in user space. And now when the user is a program that can kill the Colonel. 270 00:37:28.140 --> 00:37:30.420 William Cheng: Well, no, the user space program, they cannot tell the colonel right 271 00:37:30.630 --> 00:37:41.850 William Cheng: If we can do the same thing with the device driver with some all set up some protections are the Colonel. So when the device driver die, they don't affect the rest of the Colonel. In that case, you know, will, we're going to end up to be a lot more reliable. 272 00:37:43.230 --> 00:37:53.640 William Cheng: Alright, so, so, so the, the idea here is I'm going to shrink the code in a privilege mode there. So the privilege over here. It's going to be just, you know, the real Colonel, not the code that are written by device driver people 273 00:37:54.570 --> 00:37:58.170 William Cheng: OK. So again, you know, we talked about, you know, entire has, you know, has 274 00:37:59.190 --> 00:38:06.390 William Cheng: You know, has has four different protection mode. Over here I 0001101 so when Intel come up with their CPU, they have that in mind. 275 00:38:06.900 --> 00:38:17.430 William Cheng: Okay, so maybe the device driver need to go to a different place. So it's, it's not as important as current also when the device driver die, it will not harm the Colonel. Okay. But I think nobody actually read their code that way. So, yeah. 276 00:38:19.230 --> 00:38:22.410 William Cheng: Alright, alright. So, so that's the basic idea what I'm talking about two different approaches. 277 00:38:22.800 --> 00:38:25.710 William Cheng: One is called virtual machine want to spend all our time talking about virtual machines. 278 00:38:25.950 --> 00:38:32.130 William Cheng: Another approach. I mean basically says shrink the code in the current called micro Colonel the colonel is going to be so small. It's called micro Colonel 279 00:38:32.490 --> 00:38:38.010 William Cheng: Okay, so we're going to sort of briefly talk about what that is the reason we don't want to spend too much time. Is that because it's not really very popular. 280 00:38:38.370 --> 00:38:47.160 William Cheng: Okay, so we're going to first talk about virtual machines. I mean, you know, virtual machine you're using that already. Right. You know, you're using Virtual Box. You know those virtual machines. 281 00:38:52.260 --> 00:38:52.620 William Cheng: All right. 282 00:38:54.090 --> 00:39:00.840 William Cheng: Okay, so, so, so the basic idea of a virtual machine is what I just mentioned, you know, you know, we know how to protect 283 00:39:01.500 --> 00:39:11.370 William Cheng: The, the operating system on the user space program by putting the user space program into, you know, a non privilege mo. So this way, the user space program can never hurt us. You know, so maybe we can do the same thing. 284 00:39:12.090 --> 00:39:16.380 William Cheng: You know, by putting the device driver into a different space, so therefore they cannot hurt us. 285 00:39:17.370 --> 00:39:25.710 William Cheng: Okay, so, so, so, you know, so, so can can some kind of isolation be provided for operating system components, just like the device driver. 286 00:39:26.130 --> 00:39:33.930 William Cheng: If yes, right, yes, there's no free lunch, at what cost. Okay, so. So again, you know, is it possible to move on to the main driver into the user space. 287 00:39:34.170 --> 00:39:43.110 William Cheng: I mentioned before, it's doable. Some people actually try that. Right. But the problem is is that as a device driver every line of code is going to be privileged because what does this device driver do 288 00:39:43.440 --> 00:39:46.800 William Cheng: The device driver use memory map I O and talk to IoT devices. 289 00:39:47.400 --> 00:39:56.970 William Cheng: Okay, so every instruction is privilege. If you execute that inside user space where you're going to end up tapping into the kernel. Maybe the colonel will be able to execute that for you. So it's almost like a system call 290 00:39:57.720 --> 00:40:01.950 William Cheng: Okay, but in that case every machine structure. I'm going to end up coming out of Korea, so it's not going to be really, really slow. 291 00:40:02.370 --> 00:40:09.900 William Cheng: Okay, so people have done that. But in the end, they all say that while the performance is really not acceptable. So therefore, in the end, you know, all these device driver comes out of Colonel 292 00:40:10.830 --> 00:40:13.350 William Cheng: Okay so different company, a different approach or Dr. Michael 293 00:40:13.560 --> 00:40:20.610 William Cheng: Like you know Apple. Apple basically they're required to certify the device driver. So even though device ever written by the horror people 294 00:40:20.700 --> 00:40:27.540 William Cheng: They need to go through apple to certify that every device driver is, you know, good enough to actually run inside the either the apple, Colonel. 295 00:40:28.380 --> 00:40:39.660 William Cheng: Okay, so that's the way they do it. Microsoft has a different philosophy. Microsoft has open architecture. They want anybody be able to run code run on Windows. So therefore, again, they did you know they do things differently. Yeah. 296 00:40:41.160 --> 00:40:48.450 William Cheng: Alright, so, so let's talk about how this is done as a virtual machine has turned out to be a really, really old technology. Okay. He was there and India. 297 00:40:48.750 --> 00:40:56.130 William Cheng: At the time when there are only mainframes or guys will get mainframe is the first generation computer either bill by IBM there's a really, really big computer sit 298 00:40:56.520 --> 00:41:05.250 William Cheng: Occupying the entire floor, you know, just one computer. So even at that time. Are they, they are the one that invent a virtual machine. Okay, so this is, you know, more than 50 years ago. 299 00:41:05.610 --> 00:41:13.050 William Cheng: They have a different motivation. So we'll sort of briefly talk about you know the origin of virtual machine so IBM has a, you know, 300 00:41:14.310 --> 00:41:25.530 William Cheng: A heads up. We're machine. It's called a single user time sharing machine. So what is the time sharing machine. And again, this is IBM terminology time sharing machine, meaning that there's an interactive user using the machine. 301 00:41:26.760 --> 00:41:32.430 William Cheng: That so before the time sharing system. They have a batch system, the batches and there's no interactive user user submitted. 302 00:41:33.600 --> 00:41:38.700 William Cheng: Program. They go have a cup of coffee 30 minutes later they called pick up the printout, that's how people use my program. 303 00:41:39.330 --> 00:41:52.770 William Cheng: Okay, so later on this a while. This is really not a good way to go. Right. You know, you want to be able to interact with the machine. So they come up with time sharing system, but in 1964 the time sharing system can only have one interactive user. Okay, so you can 304 00:41:53.790 --> 00:41:59.550 William Cheng: Only imagine a picture, you have an entire you know floor. That's one machine. There's one user sitting in front of it. 305 00:42:00.270 --> 00:42:09.780 William Cheng: Okay, so it's a really silly machine right clearly IBM IBM wants to build a multi user time sharing system. So there could be 20 people that could be 50 people sharing one machine. 306 00:42:10.950 --> 00:42:16.140 William Cheng: Okay, so, so they tried to do that. They started a project called a time sharing system project. 307 00:42:16.710 --> 00:42:21.990 William Cheng: As it turns out, they, you know, once they started decided they figured out that this one is actually a very difficult system to build 308 00:42:22.500 --> 00:42:32.340 William Cheng: Okay, awesome by the way the single time uses the same time as the single user time sharing system is called CMS. Okay, so they try to make a multi user CMS is that they call the time sharing since then. 309 00:42:32.910 --> 00:42:45.330 William Cheng: It turns out to be very difficult to Bill. It's very, very large. And the problem was that it's a monolithic system. Okay. They put lots of people, you know, working on that for many, many years. Eventually, it's a total flop. 310 00:42:46.740 --> 00:42:57.720 William Cheng: Okay, so, so the, I think the program manager for for for this particular project. His name is Brooks. So after you know this project fail. He wrote a very famous book. 311 00:42:58.260 --> 00:43:04.110 William Cheng: Is called the myth. The Mythical Man Month. So, again, of course, it's very sexist project because in the good old days, you know, 312 00:43:04.740 --> 00:43:10.530 William Cheng: Are they called a meme month because men are the one that work on these projects. So I think they did use it in construction or something like that. 313 00:43:10.770 --> 00:43:14.520 William Cheng: The basic idea here is that if you want to size the project and these days will call the person month 314 00:43:14.940 --> 00:43:20.580 William Cheng: That you want to sort of size a project you will say that, well, this particular project is going to take you know 50 person month 315 00:43:21.120 --> 00:43:29.430 William Cheng: That's what does that mean well that means that if you want to implement using one person, it would take you 15 months if you take 50 people was going to take you 10 month as, are you going to get one month. 316 00:43:30.480 --> 00:43:35.400 William Cheng: OK. So the book is called a Mythical Man Month is because that's not true for software project. 317 00:43:36.270 --> 00:43:43.260 William Cheng: Okay, for software projects, sometimes the more people you put on it. The longer it takes right I'm hoping that that's not going to be your experience with your Colonel Simon 318 00:43:43.920 --> 00:43:49.710 William Cheng: But, you know, as it turns out that we develop a loss large software project, more people. It doesn't really mean that it will get them faster. 319 00:43:50.130 --> 00:43:52.770 William Cheng: Now, alright. So, IBM, you know, a failed. 320 00:43:53.220 --> 00:44:01.860 William Cheng: Attempt and there's somebody that I'd be a notice that, hey, they actually have two different pieces of technology. One is CMS. Right. The other system is called CP 67 321 00:44:02.100 --> 00:44:06.390 William Cheng: That's the same is known as the virtual monitor virtual machine monitor is also known as VMware 322 00:44:07.230 --> 00:44:13.260 William Cheng: Yeah, so again monitors and it's it's very old term, it doesn't really mean a screen right this these are called a screen monitor 323 00:44:13.650 --> 00:44:16.140 William Cheng: So there's a there's a project or virtual machine monitor 324 00:44:16.470 --> 00:44:31.170 William Cheng: It's a, it's a machine that's support multiple virtual IBM 360s and what's IBM 360 well IBM called everything's 360 and the organization called 360 the house 360. So this guy is what it will do is that they, they will have i one IBM 325 00:44:31.680 --> 00:44:40.140 William Cheng: 360 hardware and then you know uncover you can run multiple or 360 or 60 over here, right. These are called 360 326 00:44:40.800 --> 00:44:50.460 William Cheng: Okay, so this technology of years called virtual machine monitor what's running inside the huddle over here the ordinances of the horror is known as the MN. Okay. And on top of it. They run multiple 327 00:44:52.980 --> 00:44:57.540 William Cheng: Run. They run different application. Okay, so why would they run multiple different you know operating system. 328 00:44:58.110 --> 00:45:00.900 William Cheng: Why is because, you know, certain application will run better 329 00:45:01.320 --> 00:45:09.630 William Cheng: On the certain operating system configuration and they don't really run as well as other optimism configuration. So using this architecture, you can actually have different operating system. 330 00:45:09.900 --> 00:45:17.010 William Cheng: You know, you know, configuration. So, so, you know, you could. So the application can actually pick and choose that they can run on the best option system configuration. 331 00:45:17.340 --> 00:45:30.060 William Cheng: Okay. So, for example, some people need a bigger some, you know, some people need a bigger start something we need a bigger address space. So again, these are all different operating system. Okay, so, so people who saw this and also CNS to say, well, why don't you run CMS instead of me 60 332 00:45:31.140 --> 00:45:40.230 William Cheng: That. So you use VM M over here to run on top of IBM 360 instead of running or S3 60. Why don't you run CMS and now you have a multi user type sharing system. 333 00:45:40.710 --> 00:45:42.450 William Cheng: Okay, and that's exactly what IBM did 334 00:45:43.080 --> 00:45:58.020 William Cheng: Okay, so they they they re engineer the virtual machine monitor over here and to run multiple CMS is you can also run CMS, together with always 360 and now you have a very, very, you know, sort of, versatile operating system design. Okay, so, so they call this virtual machine, right. 335 00:45:59.550 --> 00:46:13.020 William Cheng: Alright, so the picture looks like this. Right. We have the hardware. Again, this is the IBM 360 hardware sitting at the bottom. Over here, right, the operating system run on top of it is called the virtual machine monitor so so so so again the virtual machine monitor over here. 336 00:46:14.070 --> 00:46:21.960 William Cheng: And right on top of every run this thing called virtual machine right inside the virtual machine or we're so get the virtual machine is going to be something that make it look like it's 337 00:46:22.500 --> 00:46:32.280 William Cheng: The is actually real machine. And then on top of it. You run the operating system. Right. So why is it so why do you need a virtual machine over here, right, because our businesses and doesn't run on top. Now the operating system. Right. 338 00:46:32.550 --> 00:46:41.490 William Cheng: Albinism run on top of hardware. Okay, so this one is a virtual hardware and mix it looks like real hardware. But, you know, in the end, software data structure. 339 00:46:42.360 --> 00:46:51.720 William Cheng: Okay, so we have a layer over here to make things look like the real hardware and then we have these opportunities of money on top of that. So this one was OS 368 right and the other ones are 368 340 00:46:51.960 --> 00:47:02.220 William Cheng: And then the goal for IBM is the replaces all as soon as 360 with CMS. Right. Okay, so you have CMS over here. And now you can actually use multiple terminology of a multi user tangerine system. 341 00:47:03.570 --> 00:47:06.210 William Cheng: Alright, so this is the basic architecture over here now. 342 00:47:06.600 --> 00:47:16.740 William Cheng: So in this case, you know, over here. So, so if you want to run these opportunities come over here. Okay, they're sitting on top of the virtual machine. So what is the root, you know, so virtual machine. Oh, here's an abstraction. What kind of abstraction is it 343 00:47:17.190 --> 00:47:23.340 William Cheng: Okay, the virtual machine over here is presenting the abstraction is that these are businesses that are running on the real hardware. 344 00:47:25.230 --> 00:47:31.620 William Cheng: Okay. So, is that possible is that, is it possible with albinism to see running. I mean, of course, we know that it's possible, right, because that's how 345 00:47:32.040 --> 00:47:37.320 William Cheng: Virtual Box works right we install a bunch of 16.04 is one of the 16.4 running on the real hardware. 346 00:47:38.100 --> 00:47:44.970 William Cheng: While I'm included, they're not right. They think they're running on a virtual machine, but the virtual machine is just as good as a real machine right so it doesn't really know the difference. 347 00:47:45.300 --> 00:47:53.040 William Cheng: Okay, so when we run inside a virtual machine, even though we're using the real CPU. Okay. But as far as our operating system is concerned, it's running on you know 348 00:47:53.790 --> 00:48:04.500 William Cheng: Operate. Yeah, so, so, so our, our operating system is not set over here, they think that they're running on the real machine but you know they're actually something different. Right. So this is, this is called the virtual machine. Okay. 349 00:48:06.330 --> 00:48:06.690 William Cheng: All right. 350 00:48:08.100 --> 00:48:17.250 William Cheng: Did I skip a slide right here. Okay, I'm sorry. I think I press too fast. Sylvia. Sylvia says, What is the monitor. And so if you look at manager on Wikipedia. I show you want want want to monitor. Yes. 351 00:48:17.970 --> 00:48:28.620 William Cheng: So this is a Wikipedia definition. It's a synchronization construct that allow executing entity to have both mutual exclusion and the ability to wait for certain condition to become true 352 00:48:29.040 --> 00:48:33.210 William Cheng: Okay. And that will be the virtual machine monitor. So the virtual machine model. What is it, 353 00:48:34.020 --> 00:48:42.750 William Cheng: Right. You know, it's the synchronization construct that a lot. Excuse me, energy to both have mutual exclusion and the ability to wait for shouldn't continue on to is the piece where library. 354 00:48:43.590 --> 00:48:51.750 William Cheng: Okay, it's also the operating system right the piece of library, you know, allow you to have mutual exclusion allow you to wait for Peter condition way. You know, people can a single broadcast 355 00:48:52.050 --> 00:48:59.940 William Cheng: Albinism you saw the winnings code over here, right. You can have your new tasks. You can also, you know, sleep on the queue. You can wake up, up, you want to do so. So 356 00:49:00.150 --> 00:49:04.080 William Cheng: The monitor is basically just something that looks like a piece or library or something like that operating system. 357 00:49:04.800 --> 00:49:12.390 William Cheng: Okay, buddy, the good old days for some reason they call the monitor. I mean, today we don't use this term anymore because when we think about a manager would think about a hardware device. Okay. 358 00:49:13.260 --> 00:49:22.890 William Cheng: All right. Alright, so, so we here at the virtual machine over here, the kind of abstraction that provides over here is that the operating system that's running on top of it will i mean i watch it will cover these the guests are witnesses in 359 00:49:23.700 --> 00:49:29.160 William Cheng: There and the offices that are the bottom of your call it the host opportunities that I mean we took that term from VMware 360 00:49:29.760 --> 00:49:32.940 William Cheng: Okay, VMware is the one that make virtual machine. Very, very popular. 361 00:49:33.390 --> 00:49:39.810 William Cheng: These other guests and hosts over here again we have many, many guests live inside the house over here. So that's why it's called a guest and the host operating system. 362 00:49:40.020 --> 00:49:47.730 William Cheng: Yeah. So as far as the guest operating system is concerned, they cannot tell whether they are running inside a virtual machine or they're running on the real hardware. 363 00:49:48.690 --> 00:49:50.310 William Cheng: OK, so the virtual machine has been that good. 364 00:49:51.060 --> 00:49:54.690 William Cheng: Okay, so that's one of the requirement over here is, you know, for for building a virtual machine is that 365 00:49:54.870 --> 00:50:02.700 William Cheng: The guest operating system over here doesn't know whether it's running on a real hardware or run inside a virtual machine. Right. I mean, certainly the case for a bunch of 16.04 when you install 366 00:50:03.900 --> 00:50:14.760 William Cheng: Into a virtual into a virtual box. Okay. Virtual Box is providing these virtual machines over here. Can we bundle 16.04 be able to tell whether they're running on the real hardware or they are they're running a virtual machine. 367 00:50:15.270 --> 00:50:24.120 William Cheng: Well, no way. Right. Because, because when you try to install under 65 for that is our father you install. It's exactly the same data so far you installed on a real piece of hardware. 368 00:50:25.230 --> 00:50:32.850 William Cheng: Okay, so therefore the operating system cannot really tell the difference between real hardware or inside a virtual machine, right. So, so this abstraction over here is that good. 369 00:50:33.390 --> 00:50:44.700 William Cheng: Okay, so when we, when we think about building a virtual machine, we're thinking about building a virtual machine interface. That's not good. Okay. I mean, there are other other system either they call themself virtual machine, but by our definition is rule number two. 370 00:50:45.780 --> 00:50:53.310 William Cheng: Okay, alright. So over here, right. So, so we can talk about what is our definition of virtual machine for this class. Okay, so when you go interview. Some people say we're working on virtual machine. 371 00:50:53.550 --> 00:51:00.570 William Cheng: Try to find out what kind of virtual machine. Are they talking about right because people use that term very loosely that I mean some people actually called Q em you a virtual machine. 372 00:51:01.110 --> 00:51:07.380 William Cheng: Guys, again, you know, to me, the way we're using it. We're using as a CPU emulator. It's not a virtual machine. 373 00:51:07.680 --> 00:51:19.710 William Cheng: Yeah. Alright. So the definition of virtual machine for this class is that you need to run an organism is are not operating system. Okay, so this is called OS X right that that's one of the organism inside or on top of or is why 374 00:51:20.370 --> 00:51:27.930 William Cheng: Okay, so in this case the OS X over here will be known as the guests ordinances and and always while we're here is known as the host operating system. 375 00:51:28.290 --> 00:51:34.710 William Cheng: Okay. So that would be one of the requirement, you have to run one albinism inside another organism on have another operating system. 376 00:51:35.220 --> 00:51:48.630 William Cheng: That again these terms come from VMware there a virtual machine is not an OS emulator, as well as an emulator right emulator. Oh, this is something that sort of emulate everything using some data structures and things like that. Okay. 377 00:51:49.200 --> 00:51:59.760 William Cheng: So, so, so, so, like, like your cue em, you know, to you is a CPU emulator right emulated x86 CPU. Okay, so you can enter CPU even also emulate another you know 378 00:52:00.960 --> 00:52:09.360 William Cheng: If you can emulate a CPU. You can also emulate all the hardware and now yeah now emulating the entire hour and I can put operating system tabula 379 00:52:09.960 --> 00:52:23.640 William Cheng: Rasa virtual machine is not like that that will, you know, we were not going to allow any kind of emulation. OK, so the guest operating system when you run your code in the gas audiences there, it needs to execute on the real CPU directly 380 00:52:24.240 --> 00:52:36.480 William Cheng: Okay. So we go back to the picture over here when we execute code over here instead of guess obviously I'm over here, the code that you execute. You have to execute on a real hardware. Okay. You're not allowed to use the virtual machine to emulate those instructions. 381 00:52:38.100 --> 00:52:44.010 William Cheng: Again, so that's one of the requirement for real virtual machine is that when you run your code in the in the in the in the occurrences. 382 00:52:44.340 --> 00:52:51.750 William Cheng: And also in the application program these instructions. If you say, you know, a plus b equals to see they need to execute on real hardware. 383 00:52:52.230 --> 00:53:02.640 William Cheng: Okay, you cannot emulate emulate that. I mean, if you want to emulate a pass me go to see what, what would you do well you gotta have a memory location. You can have a data structure called a good have a data show to copy you go to these 384 00:53:03.060 --> 00:53:08.100 William Cheng: These data structure, get the value and then you start Intuitive Surgical see okay so that's going relation 385 00:53:09.090 --> 00:53:15.510 William Cheng: Alright, so, so if you want to actually do this, you need to execute on real hardware. I feel if you have a real virtual machine. Yeah. 386 00:53:16.200 --> 00:53:22.680 William Cheng: Alright, so we're going to make the the guest operating system thing that is running on the real hardware. Right. And also if you're executing show to the actual excellent real hardware. 387 00:53:23.220 --> 00:53:25.320 William Cheng: Reality is running inside a virtual machine. 388 00:53:25.950 --> 00:53:35.310 William Cheng: Okay, so therefore, what's inside the virtual machine, right, the code and the data structure that you put into the host operating system so that you can run the guess optimism in it. It's called a virtual machine. 389 00:53:35.700 --> 00:53:40.800 William Cheng: Okay, so you go back to this picture over here, this virtual machine over here. They're part of the virtual machine monitor 390 00:53:41.040 --> 00:53:51.720 William Cheng: Okay, we're sort of draw them as separate you know interface over here. Okay. So inside the virtual machine over here is code and data structure that will make the the guest operating system thing that they're running on the real machine. 391 00:53:52.770 --> 00:53:57.780 William Cheng: Okay, it's whatever it takes to make the guest services and thinking that they're running on the real machine. Okay. 392 00:53:59.220 --> 00:54:07.980 William Cheng: All right, the host operating system over here, maybe a specialized organism, like, you know, like the virtual machine monitor by IBM that's especially as operations to them. I mean, these days. 393 00:54:08.340 --> 00:54:15.300 William Cheng: You know, who is the host Albany's. Is that right, you know, the whole softness ism could be about Mac OS X could be windows 10 or something like that. 394 00:54:15.570 --> 00:54:20.610 William Cheng: Okay. So, that can be a general purpose operating system also can be a specialized operating system. Yeah. 395 00:54:21.300 --> 00:54:27.570 William Cheng: All right. Are there different kinds of virtualization technology. One is called pure virtualization. So let me show you the differences over here. 396 00:54:28.110 --> 00:54:34.890 William Cheng: The other ones called Power virtualization in the pure virtualization, the guest operating system while we're here is is unmodified 397 00:54:35.550 --> 00:54:46.320 William Cheng: Okay, so when you install Ubuntu 16 point or fourth into Virtual Box. Did you modify the Ubuntu 16.4 What know you download the ISO file that will be installed into the actual hardware. 398 00:54:47.010 --> 00:54:50.580 William Cheng: Okay, so therefore Virtual Box is doing pure virtualization. 399 00:54:51.360 --> 00:54:59.430 William Cheng: Okay. So in this case, I guess, obviously, that thing is running directly on the hardware, because we install the operating system. There's no difference. Installing inside a virtual machine or is that something that hardware. 400 00:54:59.850 --> 00:55:09.420 William Cheng: Yeah, the other person who is pro virtualization, the guest operating system is modified so you modify the guest operating system so that it will not run on the real machine anymore. 401 00:55:10.620 --> 00:55:16.380 William Cheng: Okay, so therefore this guess optimism will only run inside a virtual machine. Okay, so that's called para virtualization. 402 00:55:16.620 --> 00:55:23.490 William Cheng: Okay, so to modify guess audiences and can only run inside a virtual machine. So that's why you know it's different because he cannot run on a real machine. 403 00:55:24.450 --> 00:55:31.890 William Cheng: All right. There's also something else. But according to our class. If you're doing something else. We won't call it a virtual machine, even though some of the company will call it virtual machine. 404 00:55:33.180 --> 00:55:39.000 William Cheng: Okay, alright. So this is a good breaking point. And next time we're going to see a little more detail how to actually implement a virtual machine. Yeah.