# FCS 25 Oct

- **Course:** 5102 - Foundations of Comp Sys
- **Recorded:** 2026-10-25 00:00
- **Transcript:** 7158 segments, 16697 words
- **Made by:** colab import

---
Okay, cool. Hope my screen is visible. Cool. Now, what is the objective today? Today, we connect three layers. One is what machine code is allowed to expect from a processor. I'm speaking about the machine code and not the application code. The second is how a particular CPU implements that contract. Contract is nothing but the understanding that what and how the execution is going to happen. And the third one is how the operating system interacts with the devices. By the end, you should be able to explain these ideas using both a processor architecture and a Linux observation. So now, which area is closest to your current work? Let me stop sharing. I will put options in the chat. What is the closest to your work, current work, current project? Is it software? Or cloud? Or embedded? Or infrastructure? Or data? What is closest to your project to you? What is closest to you in your project? Okay, I'll be looking for data.

Software plus cloud. Cloud. Okay. Server-side routing application. Perfect. There are embedded as well. Cool. Infrastructure, data, software, cloud. Okay. Perfect. Now, let us start with the question that will organize the whole session. I can understand any wish. Cloud, infrastructure, data, DevOps. Perfect. So, we will map to this in the end. Now, let us start with a question that will organize the whole session. What is the question? So, basically, we will spend the first hour on the architecture contract and three ISA families. And after a short break, we will examine I.O. mechanisms, inspect Linux, and apply the concepts to cloud and industrial scenarios. We will do that. The practical is not a command memorization, please. This is something that probably I might have missed in telling in the previous sessions. The practical, whatever we are saying, is not a command memorization exercise. It is about learning what system evidence can and cannot tell us.

There are certain evidences which can tell us what is happening and certain information cannot be obtainable from the system itself. So, now, if this is the case, let us take one or two response for this question. Which segment do you expect to be most relevant to your role and why? Now, what are all the segments we have? We actually, I had given all the segments and there were responses. But, what do you know from what you are assuming, what do you know from what you are assuming is something that you need to be clear with. Now, imagine two processors running the same program, must their internal designs be identical? For example, I bought two processors from two different vendors. Is the design going to be identical? Think individually for 20 seconds. Then, compare with someone beside you. We are not asking whether every program runs everywhere. That is not the question. We are asking what must be consistent when software is compatible.

If you get two different processors from two different vendors and both the vendors are telling that Java programs are compatible and we will be able to process it, all the requests. First, in this case, is the design going to be identical? So, even though both of them say that the software is compatible. Now, what we must agree for a compiled binary to run, the chip brand, the ISA, and execution environment, or the internal pipeline, what is that? Okay, we will revisit that. Thank you very much for responding. The ISA or the execution environment and platform requirements matter. Not pipelines, not the chip brand. So, the internal pipeline need not be identical. It need not be identical. A binary also depends on operating system, API, libraries, runtime, and other platform details. So, binary also is depending on the operating system, API. Pipeline need not be identical. What needs to be identical? The execution environment or the ISA and the platform requirement matter.

So, now place these layers in the complete computer system. Applications request work through APIs and system calls. That I hope we are all on the same page. The operating system manages the processes, memory, and device drivers. That also we are aware. The role of the application, the role of the operating system, the objective of the operating system, the request from the applications. Hope you are on the same page. Now, the ISA defines the architectural behavior of the machine instructions. So, the micro-architecture executes those instructions. Separately, drivers and controllers. So, we get controllers for devices. And we get drivers for the corner. So, the micro-architecture executes those instructions. Separately, drivers and controllers coordinate. Oh, is the screen not shared? Oh, sorry guys. Let me share it right now. If it is not shared. Probably, it came out of sharing. Yeah, when I was trying to start the recording.

Okay, cool. Thank you so much for reminding me. So, let me just repeat. It will take another two minutes. Applications. So, basically, now let us place all these layers, whatever we discussed, in a complete computer system. So, we normally start with applications because that is what we interact with as an end user. So, applications request work through APIs and system calls. Now, the operating system manages processes, memory, and device drivers. The ISA defines the architectural behavior of machine instructions, not the machine. And the micro-architecture executes those instructions. Who is actually executing the instruction? The micro-architecture. So, separately, drivers and controllers, they coordinate the input-output. These are connected layers, but they are not interchangeable. Suppose, if I say that, can application directly provision the ISA contract and get the executions from the CPU, no. Can I interchange?

Do we need all the layers? Answer is here. But are they interdependent? Are they connected? A non-connected layer in an arranged order is helping you to read the instructions that is coming from the applications and getting executed by the hardware. And what is that non-changeable order? It is applications, operating system, ISA contract, and the CPU implementation. Drivers and controllers are going to provide additional support for it to happen. So, does an application normally need to know which physical interrupt line your storage device is using? Answer is no. It need not. Application need not. And that's why when Satinder said that, as far as application is concerned, architecture does not matter. So, in those lines, he has put a message. He is right. Usually, no. Application normally need not know which physical interrupt line your storage device. Not only storage device. It could be memory. It could be network port.

Need not know. The operating system and the drivers abstract. Until today, we have not brought in into the picture the drivers and the controllers. Today, we have brought in into the picture. I could have brought this in a couple of weeks back itself. But that time, it would have not made much sense for any of us. Because today, now, we have a combined basic knowledge of both ISA as well as operating system. We know how the system calls are made. We know how the executions are happening. We understand how the request is being put across. Everything. Now, let us bridge. Software issues instructions. Operating system coordinates resources. Hardware executes the instructions. In this example, the CPU. And it communicates with the devices. How it is able to communicate with the devices? Wherever. For example, if I have brought a new network card. So, that's a different brand, which is not available by default in my laptop.

So, now, how am I going to make the operating system? Operating system has the device driver. So, now, I can attach the device to the motherboard. And use the device driver. To start communicating with it. Operating system may not be able to communicate with the device directly like how it was communicating with the registers, the CPUs, the memory earlier. May not be directly communicating with the new device, which is a third-party device. But it also has an intermediary, which will enable the communication for the operating system to communicate with the device. So, for the hardware, if the operating system is not supporting, then definitely we expect that communication gap to be filled in by the device manufacturer themselves. That is where the controllers and drivers are coming into the picture. Colonel supporting anything and everything that is being manufactured under the sun. That's going to be impossible.

So, that's the reason. Certain devices which are manufactured, if they are not part of the operating system, by default support, then we will have the application that is going to support the communication between the operating system and the device. It has nothing to do with the motherboard. It has nothing to do with the registers. It has nothing to do with the hard disk. It doesn't have any relationship to the pipeline. But, operating system and that device. So, the drivers what we get, we will receive for operating system. They'll say like, okay, if you are going to use this network device in a Windows environment, then use Windows EXE file. If you are going to use it in a Unix environment, Ubuntu as well, then it will have in its own format. So, all the popular operating system formats will be available along with the device as a device driver. So, now, where is ISA coming into the picture? In this scenario, where is ISA coming into the picture?

Now, an instruction set specifies the machine code interface visible to the software. That's what it does. Instructions and their meaning, architectural registers, memory access rules, encodings, specified exceptions, privileged behavior. All these things, it is part, it is part and parcel of the architecture itself. Think of it as a contract. So, ISA is nothing but the software visible contract. Software can rely on the contract when the relevant architecture version or the extensions and the execution environment is present. So, now, what is architectural state? Basically, the registers and memory visible effects are part of what software observes. Our own application software, which we have developed. When we are running it on a hardware, what it observes. That is what is the architectural state. Now, encodings. Basically, the machine code must be decoded according to the ISA rules. So, that is encodings.

Extensions. Software that uses an optional extension requires hardware and software support for it. Those are exceptions. Then, the binary compatibility also involves API, operating system, libraries, and platform conventions. So, the ISA is a contract or API for machine code. The microarchitecture is one way to implement it. It's not the only way. Microarchitecture implements, microarchitecture executes. Finally, microarchitecture is the one which does the job for us. Okay, cool. Now, if a program uses an optional vector extension, is a processor supporting only the base ISA necessarily be able to execute it? We have a processor that supports only the base ISA. So, microarchitecture will be able to support a program that uses optional vector extension. The answer is no, it cannot. The required extension and the execution environment must be supported. Our software must use an alternate implementation. So, microarchitecture is not the only way to implement it.

The contract does not dictate the exact internal engine. That is macros architecture. So then, how is it different? Even though you have multiple engines, the ISA contract can be seen. Now, microarchitecture describes how a particular processor implements its ISA. So, implementations may differ in a pipeline width or cache hierarchy or branch prediction or execution units are out-of-order scheduling. Those choices influence throughput, latency, power, area, and cost. While the processor must preserve the architectural behavior defined by its ISA. So now, we understand. different implementations is not going to impact. It's not going to differ substantially in performance, power, cost, and area. But they are not same. They are not similar as well. So, in order pipeline, for example, smaller cache, lower design complexity. Out-of-order execution, large caches, and speculative execution. Either you do implementation A or implementation B.

Both can implement the same ISA while differing substantially in performance, power, cost, and area. So now, we understand at a very high level, HR decode, then execution units, moving to cache, and finally, branch prediction. Now, can two processors implement the same ISA and have different performance? The answer is yes. The microarchitecture, clock behavior, cache, memory system, power limits, manufacturing process, or even workload, all that matter. Okay. So, this is why the risk or CISC is more useful as a set of design questions than a simple versus complex slogan. So, we should not be thinking that a simple will not be able to accommodate our requirements, our regions, and our understanding. Then, that's a business issue. So, we should be in a position to provide that answer. So, now, when we are giving the instructions, how are they decoded or how are they encoded? What operations are presented or represented architecturally?

What is the register model? How is memory accessed? What operations are represented architecturally? How much work does decoding require? What implementation strategy is used? Modern processes complicate any simple slope. So, it is not about a simple or complex. It is about whether it would be able to achieve or it will be able to achieve with good performance. Okay. Cool. So, now, it's time for us to look at the risk and CISC. Now, if you look at the instruction coding, whether it can be fixed with or variable length encodings. What is the density of the code? What is the complexity of decoding RAM? What is the optional compressed encodings that are available? You saw earlier what is encoding. Now, when an instruction is being sent, assuming that you have an X86 system, the instructions may be translated into internal micro-operations. Pretty much possible. You may cut across and put a question to me saying that.

What did you have? Then I have to reply back. And when I am replying back, if it is like almost lunchtime or beyond that, then there's no point in speaking about what we had in the breakfast. Because the lunchtime is also past. So, we should be thinking about how are we going to. So, now, in this scenario, let us not reduce the risk or CISC. Saying that risk is simple and CISC is complex. No, let us not do that. And that's not the right way to understand as well. So, at this point of time, I would like to pause. And then check if there are any queries, questions before we proceed again. Are we good? Yes, no, maybe. If you are good, then can you please respond with a reaction to are we good? Okay, British Kumar. The optional vector extension. I believe your question is about what is that? Am I right? What do you think it can be? What do you think it can be? Okay, so no problem. See, when you have two completely different domains in technology.

One could be hardware computer architecture or the screen could be software programming. Then, the phrase optional vector extension commonly refers to one of the two completely different domains. And in computer architecture, risk-v-vector, we call it as RVV. No, I'm not sharing anything. I'm just responding to British. So, in hardware architecture, the risk-v-vector, that means RVV is what we refer to as. is a major addition denoted by the letter B. But what is that? Under the modular risk-v architecture, V was traditionally an optional standard extension. It was optional. But the chip designers could choose whether to include it based on their power, area, and workload needs. So, that is what vector extensions means. It is up to the vendors who are manufacturing it. It is up to them to add it. Suppose if it creates any value for them, then they will add it. If there is no value, then probably they will drop it because it is optional.

That is what a vector extension means. If there is no value for them, then they will add it to the hardware level. Are we good? What is used it for? It is basically used at the hardware level. So, suppose you have two different processors, for example, and one has support for extended GPU. Another one does not have the support for extended GPU, but you have an extended GPU in your system. You want to utilize the GPU, but now one of the processors will be able to actively access this because the second, they don't even have access to it. So, to get access to the environment where you can run these programs, that is where exactly we will identify them as. Hope it is clear. Any other queries, questions? Okay, cool. Okay, guys, so it's 2.45. Let's take a quick five-minute break. We'll be back. Okay, before that, let me take Sagnik Sarkar's query. I'm enabling your mic, Sagnik. Good afternoon, sir. Yeah. Sir, I would like to ask that I saw S&M 2 marks, okay?

Sir, sir, it's a low marks, I want to know. It's a low marks? I want to know, sir, I want to know. Okay. The entire platform takes care of the evaluation. So the only thing what I can do is I can check if the right answers are marked as correct answers. That's the only thing I can do. Okay. But is it the case with everyone that because it should reflect if it is a common problem, then it should reflect to everybody because everyone will provide the right answer but they will not get marks. It should impact everybody. So anyhow, no problem. You please write. But I'm really not sure whether you'll be able to get access to what you have responded to. I'm really not sure. Only the coordinator will be able to help. Okay, sir. Thank you, sir. I was just going through the assignment one and two questions and answers. Except for that one, everything seems to be okay. Okay, cool. Nupur, quickly, please. Nupur Singh. Oh, yeah.

Hello, sir. Good afternoon. So actually, I had a query related to the quiz only, but it is like if you have missed any assignment, like for the assignment two, I was not able to submit. Is there anything that, you know, we can do or any makeup or anything? Because I don't know. It was a technical glitch or something. Nineteenth was the last day of assignment two. I tried doing it on that day. I was not able to. Then I mailed them on the same day, but there was no response. So I thought I should ask you once. Okay, let me note it down. I will just put it down. I will just put it across to the coordinator. Yeah, sir. Any makeup or any other thing that we can do, which can make up for that assignment. That they will be able to, only they'll be able to come back and tell you. Quiz one and assignment. I have mailed actually, sir, about it, but I have not got any response. So I thought I should ask you once. Okay, sir.

It will be very helpful if you. Yeah. I will just put it across for their attention, but action should be taken by them only. Okay, sir. Cool. Okay. Anything else? Quiz one and assignment three will come together. So no worries. Assignment three, I have just completed. Quiz one, I will be completing. Both will be opened up this week. Anything else from anyone? Okay, guys. So let us take a five minute quick break. Please come back before 2.55. Please come back after 3.55. Sorry, go, wait. Follow. We can go, wait. Bye. Thanks again. All right. Follow. Do we have any questions at all? Cheers. Go, wait. Go. Go, wait. Go. Go, wait. Go, go. Go. Go, go, go. The time? Go, go. In one line, what did we understand? All we understood is basically application. Do not need to know the architecture. Let me stop sharing. Do not need to know the architecture. But it does not mean that every manufacturer will have the same architecture. Okay, cool.

Now, when we say that RISC is simple and CISC is complex, no, that is not the case. How are instructions encoded? What operations are represented architecturally? What is the register model? How is memory accessed? How much work does decoding require? What is the implementation strategy used? Modern processors complicate any simple slogan. Because the reason is, we have the processors. If you take a processor that was manufactured five years back and take a processor that is manufactured today, the difference is the speed, the processing speed. That is where the entire RISC is all about. So, definitely, if we are going to understand how they are architecting their own processor to increase the speed of the processing, then we will not be able to write our code. So, that is the reason applications do not need to know the internal architecture of the processors. But whatever not supported, the manufacturer is going to provide us instructions that can be plugged in into the operating system.

So, the basic application is going to talk only to the operating system. And the operating system is going to talk to the hardware. That does not change. And anything that is changing at the hardware level, the manufacturer is expected to get that information available at the operating system level. That's the reason. Whenever we look at, for example, if we are going to look at a laptop, and we are going to perform a design job, let us assume that we are doing some cloth designing. We are into that business. Basically, I work with a cloth merchant, and I am supposed to provide them designs for the cloth, which will go for printing and into the market. For that design purpose, I am using computers. Now, when I am looking at the computer, what am I going to look at? I am going to look at the highest processing speed, because the design is going to, when I am going to work on the design, I will be using an application.

That application might be creating multiple instruction sets. If those instruction sets are going to get queued and not processed faster, then my application that I am using to design the cloth design is not going to respond to me as fast as possible. But the application that I am using need not know the architecture of the processor, but operating system need to know. So now what I have to choose appropriately, let us say that I am using an application called X. That application is helping me to create very stylish designs that is going to appeal the new buyers in the market. Then, obviously, I have to use that application manually, like, I don't know how much time it would take, because time is of essence. If I miss the bus in the market, then manufacturer of the clothes, they may not be able to sell, and business is going to get impacted. So I have to use an application. And if I am going to use an application,

what I should look at? I should look at what should be the appropriate processor that I am going to use in my laptop. Do I need to know the difference between RISC and CISC? No. But we need to be aware of it. As a designer, I should be aware of it. So CISC is a little faster. RISC is a little faster. I should be able to differentiate that. Then, accordingly, I will choose the CPU. That CPU will have a specifications. Who has manufactured it? What is the speed? What is the specification the processor is going to give? It's going to give only the speed. Thus, this processor is supported by Microsoft Windows 11. Because Microsoft Windows 11 is the operating system that I am using in my laptop. So does this processor is supported by the operating system Windows 11? That's all I am going to see. But how my instructions or the application that is going to send the instruction to operating system, how is it going to split

and how is it going to get processed? Neither I should be aware of it, nor it is required for my application to be aware of it. But let's not simply tell on the face of it, okay, this is simple and this is complex. It's not that way. It is about the number of instructions. Suppose if I'm using this PowerPoint, I'm sharing it with you all. So the instruction from my laptop is basically to share this over the meeting. But there is an instruction at your laptop to receive this share. And that's the reason we are able to see the same object in this meeting window. Whether it is Teams, whether it is Zoom, whether it is any other application. Again, it is synchronizing at some point of time. Now I'm talking. I'm explaining. You are all listening. So this requires not only the CPU, but also there is an application which recognizes my voice, modulates it, and then demodulates at your end with no delay. If there is a delay, then there will be an overlap

of what I am talking and what you are hearing. So now, here in this example, the component that is going to code and decode, modulate and demodulate, is that application which is recognizing my voice and giving it to my CPU, it gets processed, transferred to you via other network. So here, actually, is there no delay? There is a delay. The only reason is which we are not able to experience that delay is it is in microseconds. You are not hearing the moment I talk. There is a delay of microsecond. So we are not able to experience the delay. But what if if it is in milliseconds? Should we be able to experience the delay? How? A great analogy is suppose if you are communicating with someone far away, be it Middle East or US or Europe over the phone, let it be a WhatsApp call. Or if someone calls from the other end to you on your mobile using an application, there you will be able to experience that delay. The moment you receive the voice, you will respond.

but the other end will be thinking at least for half a second or quarter a second they will be wondering like why you are not responding. Because that is taking microseconds delay, so we are able to experience it. After one or two calls, you will get used to, you will wait to hear fully and then you will respond. the other end also will wait until they hear and then they will respond. So we are losing, we are losing that microseconds in our conversation and that loss is only because there is a delay in modulation and demodulation in microseconds. Here, suppose if you are connected over a low bandwidth network, let us take an example. Everyone else in this call are connected with high bandwidth. Everyone else will receive with a millisecond delay. Since you are connected with a low bandwidth, it could be possible that there is an overlap in what you are receiving because the packets get mixed up. So the delay is not only because of the network but also because of the

modulation and demodulation, the processor is performing both at my end as well as at your end. So nowadays for all the trainings, there will be requirements, system requirements for the training that would be provided. I'm sure when IIT Patna would have suggested you what should be the minimum system requirements for you to attend these classes. What they specify there is the minimal requirement, ensuring that there is no delay in you hearing me or you seeing us. What does that system requirements mean? that means this particular meeting where so many participants are going to be there, from the application side, they have taken care of using the right setup and right configuration, but they expect you also to map with the requirement. So, whether it is encoding, whether it is semantics, or whether it is implementation choices, definitely there is going to be an expectation in terms of what both the ends need to have. Let us take another example, the same class. Assume that

I'm operating my laptop with iOS. I have a Mac, and I am operating on it. I can open this application. So, the PowerPoint can be opened in a Macintosh laptop. The Macintosh laptop also can connect to this team's meeting. I will be able to share. You will also be able to see it, hear me as well. How is that possible? that is basically done by the operating system at the both end. Neither your application, whatever teams you have used to connect, whichever environment you are using, still it works. Because the communication is happening at the application layer, not at the data layer, not at the network layer, not only at the physical layer. Do we require all these layers? Yes, we do require, but we don't need to know. Now, how many of you can understand that we are connected over the teams and the packets are being received and sent from your Wi-Fi interface? will you be able to see like how many packets have been transmitted and received? Yes, you can, if you have a tool to identify the

traffic on your network interface. So, there also we are going to use an application to know that. Now, end of the day, that application what you are using is going to communicate with the operating system of what it is looking for. Then the system call is made to the hardware and the hardware is going to respond back. Here, in this case, the hardware is the storage. storage, because all this information are getting stored either in a hard disk or in a volume in the cloud. For example, this recording. Tomorrow, if you are going to run this recording to understand the session, where is it getting access to from the storage? So, the storage access speed, your connectivity speed should actually synchronize. which is better, I'm not getting into that argument. Maybe your connection is a better connection, but the retrieval IO speed for the storage is lesser, but your communication is getting adjusted to the speed of the data retrieval. So, that is the reason I was

asking you what is closer to you in your day-to-day life, so that I can give the right examples to you, nothing more than that or asking that question. So, this way, if you look at it, any which way, whatever we use, however we utilize our resources, the communication is going to happen between the application layer and yourself. now, in that case, do we really need to know, that's what I said, the practicals that I am showing, it's not a session where I'm expecting you to memorize the commands. It is just a demonstration saying that, yes, there are opportunities for us to get to know the details in case if we want to. So, you are a developer, you just wanted to know how many threads are possible to open parallelly. That is an information, but the implementation is, it is not going to be the same number what it is displaying. It will definitely be having the ability to run more threads than what it has communicated to you. So, how do you get that number?

You get that number from the application. You don't get that number from the processor saying that I have 12 cores, I can run so many. No, you are not getting it from the CPU, you are getting it from the application. Application in turn is communicating with the operating system and the operating system is going to communicate with the hardware. The hardware configuration is going to communicate to the operating system and the operating system is going to communicate to your application and the number is getting displayed on the screen. In any of these examples, one thing is very common. One is that the application that we are using or the user ourselves need not know which architecture the system is running because the instruction set will be created by the operating system understood by the operating system and executed by the microarchitecture. So there are no issues because end of the day our application also is going to communicate only with the

operating system. As long as our application is compatible to the operating system in which we are running, we are good. Let us take another example. I have a shell script. I have a Windows laptop. Will I be able to run that shell script in my Windows laptop? No. I can't run it. I need to have an interface which will understand the statements in the script. Execute. So even this challenge is addressed by the operating system level. So between application and operating system, there are no mediators. Normally it is expected to communicate to the operating system directly. And if operating system can understand your instruction, then it can create a set of instructions to be given it to each of the hardware to get back your result. Be it a database, be it a data warehouse, be it like text file. The instruction set needs to be clear on how to open the text file, what to look for in the text file and what to display. If I have just asked for all the

logs in the last 10 minutes, that's what the query I might probably send to the log file. The log file is going to give us only that information. So whether we use whatever type of processors, all we need to ensure is it is supported by our operating system. Now, when we are looking at a mature or historically evolved ISC, if an x86 CPU internally decomposes one instruction into multiple micro operations, has it stopped being x86 64-bit operating system? The answer is no. Because it is 64-bit operating system and if it is an x86 processor, can support 64-bit operating system, doesn't mean that the instructions is going to go as is. Again, it is going to be broken down into the sets and it will be provided. And this, the new architecture understands. So the internal decomposition is an implementation choice. The ISA contract remains the software visible reference only. Now, apply the same question to three architecture families. Let us assume that we have three different

architecture families. X86 64-bit is widely deployed in desktops, workstations, or even in servers. It uses variable length instruction encodings and has a large historically evolved instruction set. Because x86 is pretty old processing architecture and it has evolved over so many years. So the modern implementations can decode instructions into simpler internal operations. How are they attaining the speed, the processing speed? it is not that it got the capability to process at a higher speed. It is just that as the ability to break down the instruction set, instead of three, it can break down into 35 and it can give it to multiple CPUs, get it processed and get it back and integrate the response. So it's broad software compatibility can be a major advantage, but performance still depends on the specific processor and the workload that we are giving it to the processor. So for a company with years of validated native software, what costs might arise from changing the architecture? Because we have

understood that X86 has been evolving for a long time now. So if it has to evolve, then definitely there is going to be some changing and those changes could be related to architecture as well. So what is that? What cost might arise from changing the architecture? One is recompilation. Second is identifying the dependency replacements. The third is the testing cost because you are changing the architecture so that needs to be tested and ensure that there are no loopholes in the new architecture vendor support do we have and the performance validation. The operational changes are also need to be considered that also might increase the cost. Cost does not mean only dollar, not only rupee. Cost includes even the effort, the time taken to process everything. So when you are thinking about the ARM64, it is a useful contrast compared to XH6. But we must still separate architecture from product implementation. Whether you are going to use an ARM64 or whether you are going to use an XH6 64 bit and if you want

to install for example Ubuntu operating system, definitely the operating system is because the communication is going to be enabled with the operating system implementation only. So if you are going to implement the operating system in ARM64 system, then the operating system should be capable of producing those type of instructions to the processor. If it is still maintaining the XH6 instruction set generation for the processor, then it would fail. So whatever type of architecture you have, whether it is XH6 or whether it is ARM, whether it is 32 bit, whether it is 64 bit, end of the day what matters is the instructional set that we are providing to the hardware. Who is providing that instructional set? Basically the operating system. So how the operating system will get to know the instructions from the applications that it is running? So for example, I actually muted myself and said that, okay, it's a break. And I was displaying an PowerPoint slide. So basically up to five o'clock we have classes. So after

five, what? After five, what? Are we going to be continuing in this class? The answer is no. So is this processor going to continue to work? It depends. If you have still kept your laptop on, then the answer is yes, because the entity has been longer with the organization than normal users. So we should be able to identify, close it, and then make it run. So this is the ideology that we would like to get into rather than to understand, okay, is this a VM RAM? We can also work on VM RAM. Okay, cool. So now there is a maturity, there is historically a world ISA for x86, but if we are going to use an ARM, then the same instruction set, may not work. So the operating system will create a new set of instruction sets for that particular ARM chip, the processor. Now the processor will be able to understand the input, execute, and provide the results back as well. So this is pretty much that we need to achieve in every session that we are planning. Okay, cool. Now the architecture and implementation we understand.

The implementation is more closer to the operating system than the actual architecture. Because as long as the operating system knows how to go around the application and use it for its benefit, then nobody is going to complain. Whether it is 30 seconds, whether it is 90 seconds, doesn't matter. But if that is not aware of, that's not aware of, then definitely we make them to sit. Okay, cool. the next thing. We understood ARM-R x86. It makes no difference for our application instructions because it is going via the operating system. And as long as the operating system can support ARM architecture, we are good. can we conclude that any ARM-64 processor uses less energy than x86 64-bit processor? We should not be concluding. Maybe this ARM-64-bit processor is processing your quest faster compared to the x86 64. It's pretty much possible, I don't deny. But we should also acknowledge, yes, what we could is only this much. Unless we realize that in our process, it's going to be okay, cool. I can

see the responses. Fair enough. So now, we have understood difference between x86 ARM. Now, the RISC. RISC-V is an open standard instruction set architecture. It's open standard. Its specifications are structured around base instruction set and extensions. for example, if we are going to speak about RV641, it defines 32 integer registers with x0 hardwired to 0. So all the registers hardwired to 0. That means the value is 0. the compressed extension supports 16-bit instruction encodings alongside the base 32-bit instruction encodings as well. So open standardization does not mean every implementation has to be identical. It need not. Though we think so, but it need not. So open standardization does not mean every implementation has identical capabilities or maturity. It need not be. Now the open ISC does not mean every implementation, whether it is a tool chain, board, or production ecosystem, is equally mature. Yeah, that is also correct. But we cannot assume that it has all the identical capabilities.

or maturity, but we can definitely understand that ecosystem is equally mature. That means whether you use ARM, ARM also is mature if not more. So now what should a team verify before committing a product to a RISC-V platform? What is that they have to commit? Verify. They have to verify the extensions, the core implementation, compiler or the tool chain, the operating system, and driver support, debugging, performance, supply chain, long-term support, and software ecosystem. A big list of things. Though we are not bothered about what is architecture being used, and we are also aware that how it is getting processed and what is getting processed. so what next? What opportunities and responsibilities come with an extensible open IAC standard? That is what we need to understand. Now let us put the three families side by side and compare the system. not just the instruction names. So this is an architectural comparison with whole evaluation system. So now this table is a starting point,

not a ranking. Don't even think that this table is going to rank me for XH6, ARM, RISQ. be known one. This is just a starting point. So check exact ISA versions and extensions. We should do that. And register model is architectural. The speed and energy consumption are implementation and workload questions. When you can say that this process is better and it processes faster, response is really good, then it is related to the implementation, not the manufacturing. How that has been implemented? So the speed and energy consumption are implementation and workload questions. and the ecosystem support can change over time and differs by market segment. So we also need to be pretty much aware of it. It does speak about impacting the certification as well. integration. Okay, cool. Now, there is internal registers, 16 GPRs, 31 GPRs, and 32 GPRs. the ecosystem very broad legacy plus native software, which one? It has all the native softwares made available, broad legacy. But if you're looking at

ARM64, it's like broad mobile, embedded and cloud growth. Most of the clouds will use this, ARM64. that's why when you're trying to install Ubuntu operating system in a virtual machine that you have got it from the AWS, are we installing x86? Are we installing the ARM? Most of the Ubuntu operating system will identify it automatically and then restores the file to install and design. So that is what happens when you try to understand and try to make others understand as well. Okay. So now when we are speaking about how to finish, we have to finish with the selection lens. What is the selection lens? the compatibility performance platform cost. That is what the x86-64 provides. In case of ARM64, the selection lens is basically the workload, power, consumption, to support. That is wider. And if you're speaking about rescue systems, the selection lens should look for customization, openness and implementation maturity. Three, what we need to So basically, when we are comparing specific

instruction, architecture versions and processors, guidance is that never infer performance from the SA label. We won't do that. that. Okay, cool. Now, we have seen different architecture comparison and we have evaluated the architectures from the whole system perspective. Now, which column would you use to decide a production migration? We have three columns. So which one would you use to decide, I want to migrate my production environment from on premise to AWS cloud? The requirement. Now, how do we decode this requirement? also like, if you want to bring up a production environment, how will you bring it up? That's exactly this. Okay. So no single column. If you look at it, no single column we should be referring to design on a production system, we should combine all ISA requirements, software compatibility, benchmarks, operational support, cost, and energy measurements. It's not that okay, the RISC-V, it has more customization, openness, documentation, maturity. Again, these are

all our claims. so now, actually we need to practice making that decision under different constraints, not just one benchmark, not just operational support requirement, not the cost and the energy, but we need to do it under different constraints. So now, what is that? Which architecture? So in groups, let us choose a candidate for the cloud analytics service, or for the smartphone, or the edge device, and custom member design. you may choose different architectures for each of them, allowing. So, your job is to name the universal benefits. It is to state assumptions, risks, and evidence you would gather better are before winning it. okay. So now, for cloud analytics, or for mobile, or the edge, whether prompt for workload, or battery, or thermal limits, ecosystem and integration, or whether it is for embedded design, the required extensions, long-term support, toolchain, safety and verification on supply. So, what I would say is, let us just take five minutes. Take one service, whether it

is a cloud analytics service, or smartphone, or edge device, or even a custom embedded design, one of these cases, and I want you to choose the architecture that you feel is an app for each of the use cases. And capture the assumptions, what you are assuming. Somebody might be just assuming that it is a great copy mark, so I'm not going to. Just take five minutes and please, for one of these, state your assumptions, risks, evidence required, and what benchmark would change your mind by using what I initially thought ARM, but then not only that, you also have a electron. Okay. Let me put a timer for five minutes. I will be stop sharing this screen. Hope you would have chosen one of these areas. all we require is assumptions, risks, evidence required, and what benchmark would change your mind. I'm not asking about the current benchmark. What benchmark would be required? I agree. It depends on the requirements. Netmon, CETAR, we can see a PCAP. Okay. Perfectly fine. RTCP dump, we need to take for the

packet race. Yes, we can. But all these are applications. Again, are hardware by themselves. Whatever is mentioned here, all are applications only. So that's why I said let me take a common application. Probably I'll just put a timer for three minutes because we already spent some time. For three minutes we will spend in that. But I would be looking for the responses. screen requirements went away. Let me stop sharing and share the requirements again. Not an issue. I'll keep the requirements there on the screen. Let me track the time. Okay. I'll be away from the mic and I should be back. the time. I can't see you in the way. I can't see you in the way. I can't see you in the way. Yes, guys, I was looking for responses in the chat. Let me first stop sharing the screen. Most of you have given the appropriate response. And second thing is, when the Linux operating system first came into the market, at that point of time, not many CPU options were available in the industry. So in that scenario, how the operating system was utilizing the CPU,

the way the operating system was written, handling the instruction set, that was different. So all this is fine. But again, what operating system? When you say cloud analytics service, x86-64, or even ARM64 also is fine. Fair enough. What was in your mind in terms of the operating system when you said cloud analytics x86-64-bit? So was it a Unix operating system or was it a Windows operating system? And what was your application, analysis application that you are using? That environment also matters. So actually there is no definite answer to this. But as long as we are able to map what is the ability of the operating system in communicating with the hardware, if that was also kept in the mind, then definitely yes. You are in the right direction. Keep in mind, there is no right or wrong in this. It's only the appropriateness. That's the reason I gave you the Linux operating system. The Linux operating system, the way the operating system

was handling the instruction set was a little different from the Windows operating system or the Unix operating system at that point of time. That is the reason anybody who was trying to run their applications in Linux, they started experiencing their application is responding faster. It is not their code. It's the code that is written inside the operating system on how the instruction set is bifurcated and then aggregated towards the result. Okay, cool. Now, yeah, we took the break. Fair enough. Now, the input-output. The mechanisms, whatever we have seen, these mechanisms solve different problems. Interrupts notify the system that an event needs attention. Polling takes whether work is available. DMA allows a capable controller to move data between a device and the memory without the CPU copying every byte. So, a real system often combines all of them. Interrupts, holds, and what is DMA? Direct memory access. So, direct memory access

means without involving the CPU to copy every byte. the keyboard. for example, the moment you type. Keyboard is also a hardware. The moment the user types, it has to be recognized. Or, a simple periodic status register. For example, polling. Or a network packet traveling between the networks. Or the data transfer, SSD transfer. The network packet or the DMA, in these two cases, TPU is not getting involved. The classic example is, this example I always give in any of the sessions. Some of you may be aware. Some of you may not be aware. Just try to understand the concept. Let us take an example of a stock exchange. What happens in the stock exchange? The business is basically to buy or sell the company scripts at a definite value. That's all is the business. I bought company A at 56 two months back. And now, the price is at 64. And I am happy with 8 rupees per share. I wanted to sell. And somebody is interested to buy at 64. They are buying it.

I am selling at 64. Somebody is buying at 64. That is the business of the stock exchange. But now, stock exchange is using system. And now, this buying and selling can happen over the counter. And I say over the counter. The counter is no more physical counter. It is a virtual counter. And the transaction is valid. Now, when I am quoting at 64, if somebody is interested to buy at 64.05, as a businessman, I would be interested to sell at 64.05 only. Because I will get that 5, I say, extra per share. But if my system is a little slower to receive that offer, then I will be losing 5 paces. This is from the business perspective. But from the system perspective, why am I losing that offer? the polling has not happened properly. Because at defined intervals, for a defined cycles, only it will check. And then it will interpret and interrupt. So it will be in microseconds, not even in milliseconds, in microseconds. The moment I say I am ready to sell at 64, if somebody has

said 64, the deal would be made by the system. If it was a manual system, I would know somebody else is interested at 64.05. has come first, the offer, and 64 has come second, I would have got 64.05. So now the system is deciding. So I should ensure that there is no delay, even in microseconds. Even in nanoseconds, there should not be any delay. But the server that is dealing with, I am also using a client, and another buyer is also using a client, and server is the intermediary, it makes the deal. The moment the deal is made, the information should go to me as a seller, the information should come to you as a buyer, that the deal is done. Now as a third person who quoted at 64.05, who missed the purchase, what will he think about, oh man, what is this system? It's not that way. It is not that way. Even the keyboard confirmation, changing the rate and the keyboard confirmation, that also plays a role. That is the reason if you have ever got a chance to see any of the stock

broker's office, what they will have is a today's technology, especially from the hardware perspective. They may use a little old application, not upgraded, but they will be using today's technology from the hardware perspective. Do they know that, okay, this hardware makes a difference? They know logically, but they don't know technically. here, some of the applications in today's world, they have the ability to directly speak to the device controllers. Some of the languages, and even especially in data, if somebody has seen so many of you responding, data is your primary area. Let us assume that you are into the data engineering space. Now, you are the one who is going to send the data as a report to the business analytics team. You are receiving the quotes from the stock exchange about the transactions that has happened, and it is coming continuously. So your network is involved because it has to receive. your memory is involved because it has to store temporarily. Your CPU

is involved because your application is going to pick it up, process it, because the data that is coming in may be of some format. Example is date and time. It may be in DD, MM, YY format. you are storing it in MMDD, YY format, so that bit of a second transition needs to happen. It goes into the database or data warehouse, then the business analytics dashboard displays that. All this has to happen the same interval of time. That's the reason, except for storing the data as soon as you receive in the memory, and then process it for the date format. After that, you will not touch the CPU, you will skip the CPU, directly access the memory, put it into the storage. application will get from the storage and display it on the dashboard. Even in this case, you have an interrupt which converts, that's an interrupt. It's a polling that happens. The data is getting moved from memory to the database directly, so there is a DMA happening. all these three together completes your transaction as a data engineer.

But what if the business analytics comes back and tell you that refresh rate is very slow? What I am seeing transaction now got displayed a second before with the competitor. So then what is the solution? The same exchange. Padware is same, application is same, but they are getting a split of a second before. They can take a decision before and they can transact a second before. They are missing. That is the reason they will not compromise on the hardware. They will say, okay, if this has to be upgraded, please go ahead and upgrade. I don't want. It is just a matter of second. We may say, how does it matter? Because we don't know the value of it. The reliant share, if we get the share at another 5 pice less, we are buying 1,000 shares, 1,000 into 5 pice. that's the loss, business loss. In that type of businesses, every pice counts. If that is the case, then we cannot compromise on our processing abilities. Another classic example is the medical transcription. Medical transcription is a business on its own. Basically,

what they do, they basically transcribe the doctor's prescription, store it the data. Not only that, suppose if an x-ray is taken now, that x-ray results comes to the system, and you will transcribe that and put it back to the doctor. The entire system is in place. who has suggested for an x-ray, for whom it has been taken, the results have been pushed, and displayed on the doctor's screen. What is we don't carry the x-ray film to the doctor's home, and then put it in a frame, where you lit the light and see the x-ray? No. The days are gone. The moment the x-ray is taken from the x-ray room, you come back and go to the doctor's room, the result is available in the doctor's screen. So why they have done this? They have done this for their own efficiency. But now, even the x-ray film is going to be available in the doctor's screen, and they will be able to see it in the screen itself and diagnose it. In these type of things, normal diagnosis, it's fine. Today, you don't do tomorrow because the doctor has slept at

2 o'clock. It has come at 2 o'clock, so the doctor could not diagnose. But that cannot be the case in a cancer institute. Right? So there would be a lot of patients and it is very, very important that the doctor sees it at the time they have requested for. Next, medication cycle is going to be dependent on it. Entire cycle is systemized, computerized is what they say. In this entire thing, do you think that only interrupt or only polling or only DMA is helping them to achieve this? know. It is all the three. The CPU also plays a role, Mario also plays a role, and DMA also plays a role. Combination of these three, it actually coexists and helps each other to make the things move faster. Very, very layman's term. The three coexists just to make things faster, not only that, to also make things accurate. What if the x-ray is taken and it takes like 15 minutes to come to the doctor's screen, and by the time the patient has to wait for 10 minutes, that cycle continues. Their business cycle will continue like

that, which is not going to help. So, that is the reason in that environment also, more than application upgrade, you will see most of the upgrades happening at the hardware level. Because they need a very good cycling, we need a very good DMA, they also need a very good polling. If this cannot happen, then what is the point of having a whole system? now assume that the same hospital, instead of having patients, they have 30,000 patients. The x-ray, it is taken only between 2 and 5 p.m. And after that, one hour break, and they come and take between 6 and 9. Every three hours, one hour break. it's a 24-hour facility. Now, same cycle will not help. Now, they will be looking for a support on other equipments, things like tablet or a mobile, just a transcribed version as a text message. it is basically enabling the doctor to see the result as fast as possible and prescribe the medicine to the patient. That is objective. So, in this entire cycle, if the volume is going to be high, will our processing unit

capable of supplying that expectation? It will be able to, not on its own, will be coupled with DMA. Wherever it is not required to involve the CPU, let us not involve them. Wherever it is not involved, it is not required to involve the memory, let us not involve the memory. And how all these things are coming into coexistence in the operating system level? So, DMA can do a bulk transfer. So, there are like three X-rays that has been taken in 15 minutes interval, and in an hour, there are 12 X-rays taken from the X-ray machine, that machine will transfer the data. So, network is involved, data transfer, hard disk is involved, storage is involved, then it has to be transformed. Normally, this is what they are sending out. if it is of not a good quality, there is an application that is going to make it clear. It will not modify the actuals, it will make the actuals clear. So, that application may require a processing because it has to clean it up. It's only the cleaning process of the film.

Film means it's not a physical film, it is just a document, an image. So, the image is coming now, text is coming now, image will be cleaned, text no need to modify, it has to be transferred over the network, accepted on the other network, write it into the disk, application reads it, transcribes it and send it to the doctor's terminal or doctor's mobile. This entire ecosystem is totally dependent on these three things, interruption, and DMA. So, these mechanisms solve different problems. Interrupt doesn't solve the problem what DMA has solved. DMA doesn't solve the polling problem. Polling only will receive the issue and solve the polling problem. these three coexist in a real system and the real system often combines them to make it more effective. Now, for a large storage transfer, that's why we took the data transfer example, which mechanism moves the bytes and which might notify completion? because when the data is getting moved from one storage area to another storage

area, it's not about only doing the actual work of moving the data from one source to another target, but also we need to get notified as it has completed the job. DMA may move the data and interrupt our polling can report completion depending on the system. It could be either interrupt, which will be notifying the completion, or it could be a polling that would be notifying, depending upon the system that has been implemented. So, examine the event-driven pathway, that is interrupts. So, a device or a controller signals an event. It is just a signaling of the event. Processor and platform interrupt machinery route. The CPU enters the appropriate handler. The kernel code or a driver uses the source. some work is deferred to a later context. Very much possible. Especially in data movement, confirmation may be deferred, but the actual movement might be happening. Deferred means it's just a delayed confirmation. It is not that confirmation is not delivered.

The application may be scheduled later. the interrupt handler does not normally hand control directly to an application. No, it won't. Only to the operating system. Does an interrupt guarantee that the user application processes the event immediately? It won't. That's not its job. Kernel handling, queues, and scheduler behavior may intervene. Latency must be measured and designed for. Deferred work may be due to the latency also. Okay. Now, polling is an alternative of checking for work. when it is in a loop or when it is in a schedule. Suppose I have taken five X-rays and I have scheduled it. Once in 15 minutes, how many ever X-rays have been taken, you please upload the data into the server. I am not going to upload the data for every X-ray that has been taken by the technician. So this is scheduled. Or it could be on a loop. Once you complete, then you go to the next. Then you go to the next. On one end, the technician might be uploading the data. As soon as they take the

X-rays and other stuff, the system will get uploaded. But on the other hand, the loop might be taking the data and putting it. There is no schedule. It is just a loop. the file arrives, initiate. Wait for that completion. Another file arrives, wait for the completion and then go take the file, process it and upload it into the server. So a device or controller signals an event. When a file comes into the hard desk, the driver indicates that the file has happened. That is an event. the processor and platform interrupt missionary route, the notification. The CPU enters the approximate handler. But in case of polling, trade-offs depend on event rate and timing. That is what exactly is scheduling and looping. Polling checks status repeatedly are at defined intervals. It can be simple and predictable or it may work well for fast devices or high throughput paths. Either a continuous input that is coming or that is high throughput or your devices are fast. Then also polling will work. Perfect.

But one thing we need to keep in mind, the frequent polling consumes our processor time. While slow polling may delay direct detection, that means if you are going to poll every second, actually, X-ray files are coming once in three seconds. So that means for two polling, you will not have the file and the third poll will be able to detect a file. So your two polls have consumed your processing. So if you are not doing the first two polls, you are processing power, processing capability available for something else to process. this is frequent polling. Okay, let me poll every four seconds instead of every second. Then every second when the file has come, I will have to wait until for the fourth second. And the next poll is going to happen only at eighth second. If there are three files in five, six, and seven, only the eighth second polling will take all the three files. So frequent polling consumes CPU time, but slow polling may delay detection. So we need to have the right interval,

depends on the event rate. What is this event rate? How frequently we get files available in the folder? if we can match it, or if we can map it, and then the acceptable latency in the system load also can be managed. So don't be very, very cautious. The check interval, if it is unknown, if the device is fast, or the system can process work in batches, then this polling is going to help. That is why I said, earlier when you are moving the data, the confirmation can be done, either by interrupt or by polling. So whether to use the interrupt for confirmation of the notification, or to use polling for confirmation of notification, it depends on how the job is getting done, or if the data is huge, I am moving a petabyte of data, then I will not be using polling, because the polling is going to consume my CPU, which I can use it for some other process. Interrupt is sufficient, because the moment the last byte of the petabyte is returned into the target, the interrupt is going to signal the

completion of the job, so there I will not use polling, I will be using only the interrupt. So, we have to, because in case of loop, it will also check the status, if it is not ready, it has to check again, if it is ready to process the data. So if in the loop also, can I use polling, it depends, again it depends, if processing is going to take longer, then probably interrupt is the best way, if the processing is going to be quick, then polling is the better way of handling the completion and notification. So we have seen interruption and polling, now the DMA. objective is basically to move data without CPU, copying every byte. CPU is out. Here, if you look at it, we have our device controller, which will transfer the data using the memory buffer. Only the transfer is completed, the status will be indicated to the processor. So the only, the last step is with CPU. The CPU or the driver configures the transfer, memory buffer, device or controller performs the data

movement. So the actual data movement, when it is happening, we are not involving CPU in the picture at all. So with these three, the DMA, the polling and the interrupt, with the combination of, that's why it is coexisting. One may not exist, other two may exist, but still your job is done, we are good. But it will coexist, resolves a different set of problems. It has no interconnection between them, but still, it will coexist. Very cool. Now, why is DMA useful for high throughput network or storage input output? It reduces CPU involvement in moving large amounts of data and can improve throughput. It also benefits depend on the device, driver, transfer size and system design. So the driver often controls devices through registers. You know, registers are there in the CPU, which leads to memory mapped input output. Okay. Now, the memory mapped input output, device registers are mapped into an address space and accessed using the architecture. Now, the operating system's

appropriate mechanism comes into the place. earlier when I was telling you about some of the application developer, felt a Linux operating system is a better operating system for their application to run, utilizing the optimal resources and giving the optimal results because the operating system's appropriate mechanism also plays a role. Those addresses are not ordinary RAM. Reads and writes can have device specific side effects and ordering requirements. There could be. So, a controller bridges software request to device behavior, often coordinating status, interrupts, buffering and DME. there could be buffers also. And that buffer, buffering will happen in the memory. So, again, CPU doesn't play a role. It's a memory map, input output. So, if a register appears in an address space, can we safely treat it like a normal variable in RAM? We can't. Device registers may have special access widths, ordering rules and side effects. So, we have to use supported drivers,

access mechanisms. So, this is where exactly the implementation of the drivers within the operating system plays an important role. Will I be able to install the driver, particular device, into the Linux operating system, wherein the driver mentions it is for Windows operating system. No, we can't. So, the memory mapped Ivo, now we understand or we can observe some of the operating systems exposed evidence these, all the three, plus memory mapped. Some of them we will be able to see it with the help of the operating system. As I said before, there are commands that gives good input about what is happening inside the system. There are commands which is expected to give but might not give. So, we should not be overwhelmed by what we are getting. And if, in case we are not getting what we are expecting from the operating system, in terms of the information or the details, then we need to see why. that why will lead to how the transaction is happening based on that we need to

change our approach to understand how it is happening. Okay, cool. Now, let me stop here and let me check if there are any queries before we go ahead on the Linux commands week sequence demonstration. Okay, any queries, any questions? If you want, you can also raise your hand. If you want to ask over the mic, please. okay, cool. I don't know, this is two extremes. Either we are good or nothing is understandable. If nothing is understandable, please raise your hand. I can go a little bit in depth and I can explain. I try to explain using different examples, but still. Are we good? difference between open on, open on load. Oh, okay, open on load. Sorry, I was not able to read that British. Okay, I believe at least DME, it should be good for your understanding. Okay, have you ever used open on load British, just curiosity you used? Okay, fair enough. for what purpose? Solar flare card. Okay, fine. Okay. See, both of them operate at a different layer of the computer architecture.

It's not at the same layer. Though both are generally used for dramatically speed up the data transfer and reduce CPU overhead. The objective for using open on load and DME, objective is the same, but it acts in a different layer. The core difference is DME is a hardware feature that allows any device to talk directly to system memory. They may direct memory access. So it could be any device which will be allowed to talk to the memory directly, while open on load is a software framework which uses advanced hardware features like DME. It uses the DME and it also uses a feature something called OS bypass, operating system bypass. The objective is basically to accelerate the network applications. scope as you said, DME works for all hardware, basically hard drives, GPUs, sound cards, NICs, etc. But open on load specifically for NICs, maybe Solar Flare, AMD, or even Zynx. some of them. So one is a hardware and another one is a software architecture having the same objective in place. How do real-life systems

choose between interrupts and polling? And do any use both? Okay. Let us take the same stock exchange example. See, these are all features that can be set. Let me tell that up front. It can be enabled, it can be disabled, based on the instruction set that it is receiving. So it will be available in the instruction set itself, which one we are going to choose. And some might choose both for different purposes. As I said before, suppose if the stock exchange is giving you the price points, and we don't know at what interval it will come, how many it will come, it all depends on the action that has been performed in the floor of the stock exchange. So in that case, we will be using polling for detecting whether we have received, we will be using interrupting for post update into the database, and to move the data from memory to database, we will be using the DMA. Yes, there are chances that in most of the cases, it will be used, both of them, but in some cases, we will prefer. It depends on the business use

case. kernel bypass, yeah, definitely that is what I was referring to when I said OS bypass. Okay, cool. But generally we call it as OS bypass because kernel is inside the operating system and kernel cannot give what all operating system can give, but operating system can provide what kernel can. provide. That's the reason we call it as OS bypass. Okay, cool. Great. Anything else from anyone? It's only seven responses. Okay, great. Fair enough. now let us look at a couple of commands and see how it works. If it's okay, can you say the difference between polling and interrupting? polling is something that you're performing to check. Okay, file arrival is the best example. So if the file is going to come into the S3 bucket, then how will the application know that the file has come so that it can process it? So generally in data or ETL, we call it as file arrival trigger. So basically the data processing will be triggered based on the file arrival in a S3 bucket. So there, in case of that,

S3 can also throw an event using the interrupt or the application also can poll to check the S3 bucket. Both is possible. So in that case, we would prefer polling because polling is controllable. What is controllable? The frequency. Interrupt will happen only at the completion of the event or the in case if there is an event saying that S3 is not accessible. It is a system event. Now this event has occurred. The notification has come to the system log. Now you are monitoring tool is going to poll the event to know if there is an event up. But when the system log is generating that event, it was due to the interrupt, but your monitoring system is polling to know if there is an event or not. So in this example, we are using both interrupt and polling. Interrupt to get the log written into the system log and polling is basically to see if there is anything in the system log pertaining to this event. that is also a good example where both polling and interrupt is being used. Okay, cool. It's not listening.

The right word is checking. It won't listen. Listen means you are expecting an input. Yes, because I have allowed your mic. Please go ahead. Sir, good evening. Can you hear me? Yeah, I can hear you. Go ahead. Okay. Yes, sir. Since you are talking about, I mean, reading a data from the S3 and then processing it further so that we can put it in some database. So, in that context, I have a question. So, when we read a data from S3 bucket or JCP bucket, so, data gets written to the RAM, right, for further processing using some big data processing tools. So, in between S3 and RAM, do we use DMA or is DMA bypass occurs here? I mean, where exactly we use the DMA? That is from your memory to your database or database. Okay. So, after processing, when we write data to database, that's where we use the DMA. Right? Yeah. That is where generally the DMA is because it's a direct memory access by the source. There is no CPU involved in it. DMA is nothing but direct memory access. That's it. So, DMA cannot be between

your asset and cost. For ETL or ELT might be happening in between. And after that it is returned. From memory it goes to the database directly with the DMA. Sir, your voice is breaking. Not sure if it is with everyone or just me. Is it better now? Yeah, I can hear you. is it still breaking? No, it's fine for me. Okay. See, what all you are trying to ask is you are getting the data to your S3 bucket. And then from S3 bucket, the objective is basically to write it into the database. Am I right? So, in between you wanted to process something. maybe the format of the date or format of the number or you wanted to see that if all the text is in the right format, whatever it is, or you wanted to club 2, 3 data into a single field and write it into the database, whatever type of operations, whether you do an ELT or an ETL, it will happen before it goes to the final data warehouse storage. It can happen between S3 and your memory. Or it can happen between memory and S3, the database. So, generally, the best practice is

to have it processed and stored it in the memory so that the storage can store the data from the memory directly. So, in this scenario, the DMA is implemented between the storage and the memory and between S3 bucket and memory there is no DMA because there is a processing that needs to be performed. That's why there is no DMA. Okay. Sir, in case of local DB, let's say data usage built-in and the system itself where I'm processing the data, in that case, I think we will have the DMA bypass. Yeah. Most of the cases, if it is a local disk, then possibly yes. I can't say definitely yes, then possibly yes, you can do that. Okay. And in case of remote DB, if we have a database located in some other device or somewhere else in the cloud, then in that case, we will have the DMA. We can't bypass DMA because we have to transfer the data to that location. Hold on. That terminology needs to be correct. Let me just correct that first. DMA mechanism itself is bypassing CPU. That is the objective. Whether you are using

DMA or not is the question. It is not that DMA is by default and you are bypassing. No, not like that. The default is CPU is involved. Even if you are transferring data from memory to hard disk, CPU is involved by default. You want to bypass the CPU involvement, so you are using the feature DMA. The moment you say bypass DMA, then your understanding is a little different. That's where I just wanted to correct it. DMA is a feature that will bypass CPU. If you are not using DMA, then you are using the default. It will involve CPU. The reads and writes will take extended time. That's it. OK. And, sir, I have another question related to network card. So, in the same context, when we read the data from any bucket of any cloud, and then we bring the data into our environment where we have to process it. So, in that case, basically, data transfer happens over network. Right? That's right. So, in that case, we use the network card because data is being transferred over network, over wires. So, basically,

a network card is used in order to transfer the data. is my understanding correct? 100%. Suppose you have a Google sheet. Where is the Google sheet stored? Not in your desktop, not in your laptop. Now, if you want to access the Google sheet, if you are not connected over internet, will you be able to access it? No. So, the critical point here is internet connection. So, if you are connected to the internet, then you can access your Google sheet. That means your data is getting transferred over your internet network. That means your NIC or your Wi-Fi is being used. Either it could be Bluetooth or a wire, wireless, whatever it is. It is transferring through your network. Okay. And there are certain tools these days, primarily into ETL. We do have capability to directly upload the data. So, like, I am not sure whether you have used Databricks. So, in Databricks or Snowflake, we do have the option to directly pick the data files. So, in that case, we are completely bypassing the network card, right?

We are not at all using it. Because we upload the data. Let us take the example of Databricks only. Yeah. Let us take the example of a Databricks. So, why do you use Databricks? What is Databricks? Databricks is a managed solution. There is nothing at your end. Am I right? Correct. Yes. And Databricks itself do not have any infrastructure on their own. They are using the cloud infrastructure. Yes. Yeah. Okay. So, Databricks is a platform which is hosted somewhere. And the Databricks application do not have infrastructure. It is using cloud infrastructure. It could be AWS. It could be Azure. It could be Google Cloud. Any one of them. Or all three of them. Now, why will you use Databricks to either engineer your data or analyze your data? Where is your data? Data is in the cloud. Your application is engineering or your application is analyzing, which is Databricks. So, your Databricks is in a different network. Your data is in a different network, different area, and you are in a different network.

So, now, how can you bypass network? No, sir, my question is not with respect to the data which is residing in the S3 bucket. Let's say one of the file which is sitting in my laptop, and I have this Databricks application which is running in the browser. So, we can directly upload the files which is sitting in my laptop locally to the Databricks or Snowflake. I understand. That is from a different context. That is from a different context. When they say direct upload, that is from a different context. In case if you are having in your local environment, it can be your laptop or it could be your own office network or it could be a Microsoft SQL server which is running in your own network. From there, you wanted to upload the data. That is basically an interface that is provided to upload a specific data. And that they call it as direct upload. It has nothing to do with any of the context that we are discussing today. That is basically what they are trying to say is in case if you have any

data locally and not in the cloud, it will give you a feature wherein you can upload the data into the Databricks environment. You are not uploading it to any of the S3 buckets. You are uploading into the Databricks environment. Behind the screen, they are using S3 only. So they will allow you to upload it to S3 bucket and they will use it. You will not even be knowing about the transaction. as far as you are concerned, the file from your laptop has gone into the Databricks environment. That's all it means. Yeah. So my point is in here when we are uploading the file to Databricks, network is not involved. So we are not transferring the... You do one thing. You just disconnect your internet. Will you be able to upload to Databricks? Okay. Because Databricks is not in your environment. It is hosted somewhere else. Access Databricks itself, you need network. So even this data upload requires network and data is being transferred over network. Yeah. Okay. Yeah, it is. Suppose if you have data in

the server's memory and the same server is having the hard disk, you are using DMA, then it is not going over the network. It is within the system. But the moment you say that your database is in some other server, even within the network also, it is going over the network. It is using the network card. All right. Yeah. Okay, sir. Thank you. Cool. Great. Anything else from anyone? Okay. Oh, great. TBB. Totally forgot about that. I will definitely cover it. I'll note it down. Just give me a minute to bridge. Let me note it down. I don't want to depend on you guys reminding me. Okay. Limited CPU data copy involvement. When a device DMAs data into memory, how does the CPU avoid reading state cached copies? I did not get you near it. Sure. Can you put it across in broken down points or I will allow your mic. Yes, please go ahead. If you go to one of the slide where it says that input, output, notification, checking, and bulk transfer. So on that slide, it is mentioned like DMA is like a capable device slash

controller transfer blocks between device and memory with condition like condition is with limited CPU data copy involvement. So I think what you are saying is that bypass only. But my question is like, how does the CPU avoid reading it? What is the mechanism behind it which avoids reading those data from the memory? basically the instruction set nearage? It is the instruction set that is going at that point of time. Just one second, please. No? Important call I need to take. sorry, I'm back. basically it is the instruction set. End of the day, we are not going to control that communication. The communication is going to be controlled by the instruction set. That instruction set, when it is operating system is building the instruction set, what it will do is it will implement the DMA because the two objects that is involved is memory and hard disk. So it will not involve the CPU to come in and play the role. The instruction set that will be driving, that is the reason I was trying to repeatedly tell the example of

the Linux operating system, how it became faster comparatively with other operating system that was existing in 1990s. So that way like it is the instruction set that is controlling whether which hardware is going to be involved in the transaction or not. Okay, got it, sir. Okay, so Nitish, please ignore. I thought I have removed it. Okay, if I have not removed it, I will remove it. It is not for you guys on that assignment, you might have already taken it up. Okay, cool. So, okay, so now coming back to the Linux. Let me share my window, hope my window is visible. just typing the clear command, hope you are able to see it. Let me see if I can change the settings, get a little bit more legible. Okay, cool. So now, this is a virtual machine in my own laptops, guys. Something might work faster in this environment environment because my own system, but don't expect the same response in case if you are performing on your own in a cloud environment. Okay, so now I'm saying you name hyphen M. Basically,

I want the name of the mission, or I want to identify the architecture of the mission. So now if you look at this, it says that x86 64. Okay, now if I say lscpu, basically it will display CPU architecture and processor information. You can see the entire architecture. So the CPU operation, the architecture is x86 64, and you can go into the detail, but what is CPU family is 6, model is 165, and how many CPUs? Two CPUs for this virtual mission. And you can go ahead and see all the information that is available for this particular CPU. But mostly what we will be looking at is thread per core is only one. Core per circuit is one. number of sockets allowed is two. So these informations we will be looking CPU family, what is the architecture, how many CPUs, and thread scores on sockets. Now if my processing is slower, and if I understand how the application is transacting, and that is what we saw yesterday in the mining, we observed that the CPU utilization is high, memory is not being utilized. So that

mining process is a CPU intensive. And if I'm going to do the mining, I did the mining yesterday in the same instance only. So I have only two CPUs, and allowed thread is only one per core, socket is only two, and stepping is two. Now with this, the processing is getting queued until the previous one is completed. And mining is CPU intensive. So if I step up my number of CPUs from two to four, then I will be able to see that mining process is completing within three seconds, two seconds, and all. Okay. So that you are speaking about CPU information. I can say cat talk is processes directory. I can ask for CPU info. That also is going to give you the same, whatever we have seen. So whatever I have done with LFCPU got stored in the CPU information in process. features. So the reported architecture and the available features, what you are seeing, actually reflects my virtualized environment rather than physical host because mine is a VM running on my own laptop. Okay. Fair enough. Now let me

clean the screen. Clear the screen. Now let me say cat sim process information. Let me ask for interrupt. You can see like it will just move on. Too many interrupts that it has identified and reported. This is from the CPU 0 and this is the CPU. I have two CPUs. So the interrupt can happen in any one of the CPU or it could be both as well. You can see here. Local timer interrupts. So it could be one of the two or it could be both or it could be neither also. So this is an MSI. Basically interrupt has nothing to do with any of our processes but it has nothing to do with the CPU also. What it has been logged into. Suppose if you want to watch repeatedly executes a command and that displays the updated output. We can use the watch command a very useful command. As I said you don't need to you know buy hard these commands. You should be aware that whichever is the environment I will definitely have some tool to understand what is happening inside the watch is a tool. Again all I'm going to do is

I'm just going to ask the system to watch the interrupts. So it is watching. As soon as a new entrant comes it is going to display. So now you can see how the local timer interrupts it is increasing and as well as row number 19. This is also changing. It is continuously watching. That means this file is continuously getting updated for every interrupt that any one of the CPU is making for any of the processes. I don't have much processes running in the system otherwise if I'm running any application I would have to do something. Now hyphen N 1 what is that it's basically the refresh interval. Instead of 1 that means every second. Instead of 1 if I give like 5 it will refresh only every 5 seconds that's all. So for the next 4 seconds it will not refresh anything and it will refresh after 5 seconds. If there is a change it will come up. That is all it means. So what did we understand? The interrupted counters provide evidence about interrupt activity. Not a complete explanation. Will I be able

to understand what exactly is happening? No. It is not a complete explanation of device behavior or performance. Either we will not be able to make it. A virtual machine may mine is a virtual machine. it may show synthetic or virtual device interrupts. For example the row number 24, 25 and all is synthetic. And a modern system may not expose a simple dedicated keyboard interrupt. Suppose if I press Q here or if I press control C is also an interrupt. Do we have control C interrupt? No it doesn't. So the modern systems does not expose a simple dedicated keyboard interrupts like control C control Q control V Q for example. For example if I say that system CTL status let me say docker. It could not be found. There had been an interrupt finally. But will this interrupt be recorded? But it's not. The interrupt is not recorded. So some it may expose, some it may not expose. But still it will give an indication that the interrupts are happening. All those things. now there is another command. Okay. So I can just

say list. Let me clear the screen. If I say list all devices, it is listing all the devices that is available in this virtual machine. Now if I want to list only PCI buses that is visible to the system, then I will just say LS PCI. Now all the PCI systems that is visible to the operating system is listed here. Now I just wanted to see what are all the USB devices that are available. I can use LS USB. So LS USB is going to tell me there are so many USBs that are available. One is already used by mouse. There is one USB hub. There is a Bluetooth adapter. So these many devices are visible to the operating system in this virtual machine. Now if I say LS PCI and if I give NN. Here NN requests numeric vendor and the device identifiers alongside the device descriptions where available. So now if you look at it, this one, it is telling that it is a system peripheral. It's VMware, virtual machine communication interface. This is an Intel corporation. It's a bridge. There is an IDE interface, Intel corporation.

And this PCI bus is connected to the hard disk, IDE device. There is a PCI bridge, again from Intel. I was not getting this much information when I did not give hyphen NN. So there are so many tools that are available. I can also see the input. I can say LS hyphen L slash dev. Dev is nothing but devices. Input. So now you can see mouse 0, 1, 2, event 1, 0, 1, 2, 3, 4. That is mice. All these input devices are detectable by the operating system. I'm directly communicating with the operating system. There is a command called EV test. I'm not sure if I do have it. Okay. I have to install the EV test. Let me install it. Just takes a minute. So like this, there are thousands of tools available. We test. I'm going to run. It displays Linux input event information. You'll be able to see that keyboard virtual mouse that is VMware virtual mouse, VMware virtual mouse and VMware virtual USB mouse. Select the event, device event number. If you're going to select the device event number, let me, for example, say 4.

It gives all the events that it has detected for that. So it is testing it, but if I want to interrupt, I can just interrupt for exit. The power button. There is a power button which is detected as an input device for this virtual machine. Power button, you may ask, where will you be able to see it? Even if you give shutdown minus H now, that is a power button. For this virtual machine, that is a power button. It shuts down. Then if you want to start, the VMware is going to give the signal. Or I can also go back to the VMware software where this virtual machine is running. You can go there and I can say pause. The signal is going to come. It is equivalent to the power button in your laptop. So basically, even if I press the power button, it is an input. what input it gives, the instructions to shut down or start depending upon the current state. If it is already shut down, the power button is going to start. If it is running, the power button will shut down. That's ungrazed. We should not do that.

But what I am trying to tell is when the system is running, if you press the power button, it gives a signal to shut it down. Whatever is happening as of now, don't worry. That's the instruction set that is getting into the operating system. The operating system then shuts it down. So this is how the communication between the hardware devices, users, and the operating system in the triangular manner, happens using polling, interrupts, and DMV. are we good? Any queries? Any questions? Okay, great. Take care. Bye-bye. See you in the next class. I understand you have other classes. Sorry to go overboard. I'll manage it from the next time. Take care. Bye-bye.

