 Chinne would have already told you a little bit about free RTOS, so I'm going to dig a little bit deeper into the same topic, but don't worry it's not an RTOS course that will take a whole semester of course. So I'm going to tell you why free RTOS is used especially in IoT. So to begin with, okay, I think this is the redundant type, but I still put it in. We all know what is IoT. But the basic four points is what I want you to look at. Internet enabled, connected devices, and they form a network and they obviously transmit data. What is RTOS, a real-time operating system? Well, first it's real-time and one of the examples which was given by Chinne was the NeoPixel. It's a pretty tricky thing to program, especially if you have a Raspberry Pi. And it has to multi-task. You need a lot of different tasks to be running in parallel. You need real-time scheduling wherein you bring different tasks at different time lapses or time frames, and also you need a low-memory footprint. If you had good memory, you would use an operating system. You wouldn't use an RTOS. And another important point is it's configurable to different sizes. So you can have an RTOS for 22 kb, 10 kb, 5 kb, and all the way up to 45 mb of size. So quickly let me tell you about the basics. The three things which I felt was most important. The first thing is it's all about the scheduler. You need to have a real-time scheduler. The basic difference to explain in a very naive way is in an operating system like Windows or Linux where you have a scheduler. The scheduler focuses more on responsiveness, how responsive the UI is, how quickly the user gets what he wants. But in an RTOS, it's more about process. It's more about how the processes are finished to completion because mostly there's no user involved at all. So this is the basic difference in terms of scheduler. The second thing is TIC. TIC is a pretty complex thing to explain, but I'll tell you quickly. So the seconds of a clock are TIC. In a microcontroller or a microprocessor, you always have TIC. But when you have big operating systems, your TIC is not real-time. It is generally sourced from a software timer which can have a few cycles of lag now and then. But in case of a real-time operating system, your TIC is sourced directly from your processor cycles. So it's going to be real-time. And you can configure the TIC in case of an RTOS. You can have it to be one second, one millisecond, one microsecond, all the way up to picoseconds. And the third important thing is you have limited task states. So if you can see this diagram, forgive me for the crazy URLs. I don't like to use other people's work without credit. So you have very limited task states over here. You just have very running block that's suspended. But if you look at Linux, you have at least 20 different task states apart from these. And another thing to note over here is these are all different components of an RTOS which I won't go into much detail. But if you see, they are pretty limited. This whole bubble here represents every software feature that an RTOS can give you. You have message queues, pipes, mailboxes, mutex, Mofors. These are things that change from RTOS to RTOS, but this is the most basic one. So yeah, that's it for RTOS basics. Okay, now this slide I'll tell you a little bit about industry perspective. So being someone who has worked both on full, big operating systems as well as real-time operating systems, I can tell you how an industry works in case of both. So if you see this, this is a Linux operating system, but many people who develop applications have a similar OS structure which is based on Unix or Linux or their own proprietary OS maybe. Generally, each layer that you see here is handled by a different set of engineers, a different department or so. And let's take system libraries for example. In an industry that supplies customers, your system libraries are generally handled by 70 plus engineers. That's how it was in one of the companies I worked for. So each layer over here is like roughly 30 to 40 engineers at the least. So you can imagine the number of people that it takes to build up a system like this. But when you come to RTOS, roughly seven people work on the real-time OS. That's it. It's like one-tenth the amount of people who work on a particular layer in a full operating system like Linux. And generally, most drivers are developed by one person single man. Because when you come to a real-time operating system, your components are tiny. It's easy to maintain your code, so you don't need a lot of people to maintain drivers. So this whole stack that you see here can be anywhere between as less as one person to 20 people. But this most certainly cannot be managed by one person single hand. You might have to use pre-built libraries or pre-built kernel. Many people don't like kernel from scratch. So this is a basic and an industry perspective between what happens when you develop with an RTOS and when you develop with a full-time operating system. So yeah, a little bit about where you would use it when you have IoT. So this is a small little curve that I took from our presentation online. So you can see the process of how, when it's very less, you really might not want an RTOS. You can write your own superloop and everything is handled by that. It is actually done in an Arduino. People who do simple operations like blinky or blinky with a motor. It's just a superloop. You don't use an RTOS. That's like crazy. As you have a little more processing power and you want to do more things. You start using RTOS like free RTOS, which is free, less amount of guarantees and yeah, basically it's free. If you go for more advanced operations, you might use UC Linux and there's another operating system called ECOS. Or if you have really advanced, like you have customers who are demanding, you know, picoseconds of delay. You might use real-time Linux. So you build your own kernel. You can't just take a kernel from the market. And if you have more power, if the curve is extended on the x-axis, you can use Ubuntu if you have the budget that allows you to do that. This slide is something that came to me while I was sleeping and I woke up with this idea. Multitasking is a necessary tool. So in IoT, especially tiny devices, you can't have the device do just one thing. That's not the way it is. And ideally an IoT device will do at least two things. One is maintain connectivity via Bluetooth, Wi-Fi, NFC, Lora. And the second thing is what it's designed for. You don't just design a device to connect to the internet. You want it to connect some data, temperature, pressure and whatever. So if you can see this small chip over here, it has three, four motors connected to it. It has a buzzer and it also is connected to Wi-Fi. So like that you have three tasks that I listed. So multitasking is a necessary evil and this is another reason why you need an OS that schedules between different tasks. So this is a small slide that tells you about development times. It's not very important but still I tell you. Small companies, especially startups, prefer to develop their own tiny kernel. Which is kind of like an RTOS in itself but it's completely proprietary. Since you build it from scratch, you own everything. You don't need to reveal it to the user or anything. So a lot of companies take this approach. But if you see there are a lot of things that are involved in the software timeline. You have to design your own hardware. You have to design your own software. You have to make the hardware. So it takes a much longer time. But let's say you use an RTOS or commercially available RTOS like FreeRTOS or ECOS or one of them. You just need to build the hardware. You don't need to build the software. The software is ready for you. So it actually reduces your development time and a lot of startups are actually picking up FreeRTOS. If you look at a lot of IoT startups in the market, a lot of them use FreeRTOS and it's pretty popular. And to compliment this, there's a company in Singapore called TUV-SUV. So they are working with FreeRTOS and they have made another variant called SafeRTOS which is I think ISO certified. So this company is in Singapore by the way and they have worked with FreeRTOS to make this operating system called SafeRTOS. And it has a great deal of certifications. It is certified to be used in nuclear power plants. I don't know where its side is. But if you have a chance, go take a look at this. There's a pretty nice photo where they show that it's safe to use in a nuclear power plant. You can check that out later. And this is another small example of an application called NAPTO. So FreeRTOS themselves have built this NAPTO and it's basically a P2P connection that can go over firewalls. It's pretty interesting and if you see the diagram, it's a pretty intuitive way to use an IoT device. You can have a UDP request directly to your device, physically. And let's say you want to have fancy graphics and your JavaScript applications, you can run it on a server. So you can make really good UIs using this type of software. And if you don't want an UI, you can just have your P2P connection with UDP. And there are three other configurations. You can check that out on the FreeRTOS website. It's actually built by FreeRTOS which comes at a price of course. This is not free. And in the end, networking isn't just enough. So this is a small screenshot of the Embed OS. And you can just see the amount of crazy software they're putting. They have C++ APIs, Event Framework threads. So at the end, networking isn't just enough. You need to support much more things apart from networking. You need to support multiple forms of networking. So for all this, you really can't do it just without an OS. So hence, you need something like an RTOS. So this slide just summarizes whatever I showed you in images. And in the end, I'll just focus on the last point of it. In some cases, real-time behavior is actually needed. So examples, I think three of them were highlighted by Chinman, so I won't be going in. So in some cases, real-time behavior is actually needed. And you need to have an RTOS working inside. So I have a small little demo which is prepared on this board called Realtek Honeba. If any MQ students are here last year, I think Realtek has a competition inside it. But I got this board. So it's a pretty tiny... It's nothing that you guys haven't seen. Realtek's N3, which runs at 166 megahertz with 512 kV now. Something similar to the Arduino 2V to give you a sense of comparison. It's pretty similar to the Arduino 2V minus the Wi-Fi antenna and the NFC chip over here. And the best part about this is it supports Arduino. It supports IAR, and it has a GCC toolchain support which is upcoming. So a lot of different people can take this up. And that's all about the board. Let me go for the demo. So what I'm going to do with this board is... It's running free, because it's there on my table. It's running off a battery, by the way. It's not over here. So if any of you have a laptop, you can connect to this SSID, which I've shown here. You can put the password and you can open the stream over there. If you won't go ahead and try it, otherwise I'll open it and show it to you. And once you see the stream, I'll explain what's happening in the board. I'll show it to you. Aviva. I'll just show it to you. AS caps. I don't know how many people can connect to the stream, but the stream is... Can you just pan the camera? I'll just get that over here to show you guys how to timing this. Definitely. What happened? Oh, okay. I think it's a different password. Okay, the password is 1, 2, 3, 4, 5, 6, 7, 9. I'm sorry for that. Yeah, but that's the password. You can try it. I don't know how many streams it will support simultaneously, because it's, again, a timing, your time-operating system. But give it a try. Let's see how far it can go. Anyone else got the stream? You are it, okay. Anyone else got the stream? 3, 4, 5, 6, 7, 9, 9. Yeah, 1, 2, 9, all of these. Anyone else got the stream? Okay, fine. Okay, so, yeah, you can try it later. I'll keep it on. So, what's happening here? There are actually three really important things that are happening. One is the video decoding. So, the camera, this camera supports UVC, USB video class. So, it's a UVC driver that's there inside this camera. And it transmits motion JPEG frames. So, the first stack that I load is motion JPEG decoding, of course. So, that's running on the board in real time at 30 frames per second. The image quality is low, because it has very, very less RAM. I can't have a frame that exceeds 18 kb, because there's only 150 kb of RAM. And the next thing that's running is an RDSP stream. So, RDSP is the protocol by which I'm streaming to VLC. So, there's an RDSP stack running inside. That, again, accepts the stream at 30 frames per second and encodes it to the RDSP format and transmits it over the Wi-Fi AP, for which you need a Wi-Fi stack, which is also running. So, there are three things that are running in parallel. And the stream is somewhat real-time. Yeah, there will be a delay. You can't expect zero delays. So, there's a delay and a lot of things. These delays can be attributed to the Wi-Fi model, to the delay in the software, and to the delay in which the PC actually responds and gets the packet and shows it on the screen. So, there are a lot of delays involved, but it can be faster, I think. I think there's a five-second delay at the last time, roughly five seconds. So, that's the delay. But it's somewhat real-time-ish, not very real-time, but if you see the kind of protocol stacks that are running are very heavy. You have motion JPEG decoding, Wi-Fi stack, and an RTSP server all running in the same processor. And it's powered off a battery. This is the whole setup here. You can power it off a AA battery as well, if you have the adapter. I have run it with a AA battery, single AA battery, and it runs for 8 to 10 hours. So, this is a 10,400 mAh battery. So, I think it will run for a week, which is okay if you want to do video surveillance of an event or something. You can have better camera support, but again, the limitation that I'm facing right now is the 150 kb of RAM. If the RAM was bigger, we could have gone for something like H264, which gives you a 1080p HD video, but right now, that's not possible with such a tiny device. I think that's the end of my... Yeah, okay. The benefits of using 3-hour process... Okay, I think I already told you all this. And for the reading, you can read a lot about these things. FreeRTOS.org, if you want to read about FreeRTOS. This is the official website of the board on which I'm showing you the demo. If you want to buy the board, the link is there. And this is a pretty nice course from Rutgers University about FreeRNet scheduling, which actually tells you why you need FreeRNet scheduling. And the last one is the FreeRTOS NAPT, or the P2P application that I was talking about, which is made by FreeRTOS. So if you want to do some further reading, these are the options you have. And any questions? Okay, sure.