[MUSIC] In this lesson, this lecture will talk about operating systems a little bit. What an operating system is? Now, they're not always present in IoT devices and in fact with the platforms we'll be working on, we'll be working with Arduino and Raspberry Pi. With Arduino you do not have an operating system. It's really too slow to support that. But Raspberry Pi you do, typically. So, we'll talk about the role of an operating system and an embedded system and an IoT device. You may or may not need it. So an operating system is an extra layer in between the program, your application code, and the actual hardware. So generally say we're working on right. There's a user at the top, whose using some application, right? By application we mean the actual program, right? So you've compiled the program and that application, that's the application code. Do we know that application code would connect directly to the hardware. So it'd go straight from the application to the hardware. No operating system at all. And the application directly controls the hardware. So it signals high and low, and so on. But in say RetroPie or more complicated IoT device, you would have something like what you see here where the user attacks the application. The application code actually may not directly connect to the hardware, it communicates with the operating system. So, it makes calls from the operating system and it's requesting hardware service and then the operating system manages the hardware most directly. So that's where an operating system fits in, in the picture. That the code that you write and compile the application code, that interfaces with the operating system and the operating system deals with the details of interacting with the hardware. So it manages other programs. So one thing about an operating system is that it allows you to have not only one application but many applications. So you can run lots of different applications at one time, and the operating system itself manages the hardware. So it gives them turns, lets them take turns, and stuff like that. And you see this in standard operating systems like Windows or in iOS or something like that, you run typically on a laptop, desktop you run many programs at one time and the operating system allows you to do that. Right? Without an operating system you can only run one program at a time. So, you can execute a lot of programs together and when you're executing them together remember that they're not actually executing together, they just seem like it. So it's really alternating but very fast, faster than a human would really notice. So it looks like they're all running at the same time. A nice user interface so often, now, how nice a user interface really depends on the operating system. If you look at a desktop or a laptop Windows, iOS, Linux, something like that, they will have a very nice user interface. Graphic user interface, GUI, you can double-click on something. Double-click on a file, it'll open it up, that sort of thing. That's a full-on operating system. The operating systems that you find in an IoT device, they're much smaller and stripped back. They're not going to have, not likely to have any graphical user interface or anything like that, but they will have a user interface, a command line. So if you ever use a Windows command line prompt, or iOS you use a terminal window, Linux you use a terminal window, something like that, I call that a nice user interface. It's text-based, but it's nicer than not having it. So there's a user interface that's provided of some kind. And it needs processing power. So one thing about operating systems is that operating system itself is a big program, right? It's a big program that's running in addition to the actual programs that you wanna run on your IoT device. So, it's gonna consume clock cycles, right? There are some clock cycles that are spent doing operating system tasks, right? Some memory that's spent storing the operating system data. Things like this. So, the operating system itself takes up resources so you have to make a decision whether you need one or not. Because it's gonna cost you resources, which means cost you money. It slows down the system because while the processor is working on the operating system, doing executing the operating system code, it can't be executing your actual application. So it slows things down. And so as a result, when you use an operating system, you generally need a faster processor. That's why, if you look at an Arduino which is running at maybe eight megahertz, something like that, usually don't support an operating system with that. But if you run Raspberry Pi and you've got like one gigahertz, then it's okay to support an operating system, because it has enough clock cycles that you can do that. A little example of an operating system that actually I had a group do something like this a project like this several years ago. Where they wanted to have a control car with a camera. So it's an RT car controlled through the web. So you can go to a laptop, desktop whatever, anything that has Wi-Fi, go to a phone. Open up a browser and connect to the car. And the car has on it a camera and it's own web server, right? So you can cancel this web server and control the car to its own web server. So as an interface, it looks roughly like what you see down here. On the one side, there's the picture, the image, of what the car sees. So that's actually coming from the car's camera. So like I said, the car on it had a camera. It was connected to a web service. So, the view from that camera would be streamed through Wi-Fi over to whatever your browser device is, right? Then, it would have buttons forward, back, left, right, to control the car. So you'd click forward, it would move the car forward. Click back and move back, and so on. So you can take commands to drive the car, through Wi-Fi, to the car's web server, and that would directly control the steering and the motors and all that. So in a system like this, it is useful to have an operating system because there are so many things going on at one time. So the car is controlled over the Internet, with Wi-Fi generally. The car has its own web server which has an actual URL address. And the web interface allows you to control the car and see the images and so on. Also has an auto brake feature to avoid collision so, it'll stop automatically regardless of what your controls are. If it sees, if it senses something in front of it, it will stop. But the idea that it generally has a lot of tasks to do, a lot of things to do at one time, in that type of situation an operating system can be very useful. Thank you. [MUSIC]