What is a kernel - Gary explains

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello there my name is gary sims from android authority now hang around android long enough hang around pcs long enough and you might come across this term the linux kernel well what is the linux kernel why is it important where did it come from well let me explain [Music] the thing that most people forget in fact is that computers are incredibly dumb all they're doing is following instructions and it's only when those instructions are actually designed to perform a complicated task that computers seem to have some kind of ability but actually all they're doing is repeating one instruction after another instruction add in for an item and therefore they need software to do everything even just to boot up they need to be able to run some software now when you boot up your android smartphone you're used to seeing a launcher and some apps and maybe the web browser some games but there's lots going on underneath the bonnet for example underneath the launcher there is a bunch of android services including the google play services below that there is things like the java virtual machine and below that there is a thing called a kernel it really is the core of what's going on now every multitasking computer system uses a kernel windows has a kernel os 10 has a kernel ios has a kernel and android has a kernel now windows and windows phone windows mobile use a thing called the nt kernel os 10 and ios use a thing called the darwin kernel and android uses the linux kernel now these aren't the only kernels that are available there are just a whole plethora of kernels out there for us to try and play with some are proprietary some are open sources the freebsd kernel is the kontiki kernel there's the free rtos kernel there's the kernel from embed from embed os that recently released by arm there are just so many different types of kernel now everything from us wearable from an iot device right up to a supercomputer uses a kernel so what is it well basically the kernel is the thing that manages the cpu resources the memory resources and the processes on any computer it also has device drivers in it so when you want to do any networking that goes through the kernel we want to talk to bluetooth that goes through the kernel we want to use the file system that goes through the kernel it really is the lowest layer above the cpu so for example on android when you start an app it is in fact the kernel that starts the process for that app and enables the app to be loaded from the flash into memory if that app then needs some memory it will be the kernel that will allocate it to it if the app wants to do some networking it will go through the kernel if the app wants to do something in the background create a background service that's handled by the kernel eventually when the app closes that all the resources that we use will be tied up and collected up by the kernel it really is the center of everything that's going on on your smartphone now as you can imagine kernels can be quite complicated they're doing a lot of essential work and there are actually some different ways in which kernels can be designed now the two main theories today for current design are what's called a monolithic kernel and a micro kernel now linux is a monolithic kernel that means that all of these services that are going on all the drivers all the stuff handling memory all occur inside one program that occupies one memory space now the alternative is a thing called micro kernels and with micro kernels the kernel itself is in a very very small piece of memory space and then other things like device drivers and networking and file system drivers are running as a user level programs and the colonel talks to them saying hey do this hey do that for me please go and get this file go and get that and they talk to the colonel the idea being that if one of those crashes the kernel itself doesn't crash now back in 1992 a man called professor andrew tannenbaum who is very very famous for his operating system design books and his networking books if you ever do any studying at university or at higher education about computer science you will definitely come across an andrew tamman bound book he had a conversation with linus torvills online some call it a flame war about the merits of monolithic kernels versus micro kernels and of course what happened is that linus was writing a monolithic kernel and that's how he stayed doing it and the monolithic kernel is what we have today if you are at all interested in micro kernels then go and check out minix three it's andrew tannenbaum's unix-like operating system that uses micro kernels now as you can imagine the linux kernel being a monolithic kernel can be quite big and complicated in fact they say there are 15 million lines of code in the linux kernel now not all of that code is used all at once because in there there is support for ibm mainframes there's support for pcs the support for spark processes the support for armed processes there's a whole range of different device drivers in there in fact they say that 70 of that 15 million lines of code is just device drivers now when you build the linux kernel you say which bits you want it's got a configuration program i want this i don't want that i want this i don't want that but you can do more than just say what you want including what you want excluded you can also tweak the way the operating system works and that makes sense because if you're running linux on us on a mainframe you might want it to behave differently than if you're running it on a wearable if you're running it on a database server you might want to do think differently than if you're running it on a smartphone and this is where we get into the idea of custom kernels because you can download the linux software it's open source under the gpl because you can download android it's very possible to build your own kernel build your own rom which has that your own kernel included inside of it and of course there is a whole community of people that build custom kernels just for your smartphones now a quick word of warning to do that you're going to need root access and you're going to probably need an unlocked bootloader and if you go to a site like xda and there are many others you can find a whole list of different kernels that are available alternative kernels that are available for your smartphone and there are some famous ones including the franco kernel elemental x and so on now there are some pros and there are some cons to using custom kernels first of all you need to have root first of all you need to have your boot loader unlocked and some people don't like to do that it's not in everybody's skill set to do that also you need to recognize that you're using a kernel made by some guy somewhere in the world and there is a question of trust and the real question of how reliable he is if you start to get problems will he answer your questions will he issue a new version of the kernel there's also the danger that you can brick your phone but if you're prepared to go past all of those problems of course you can find you can get a kernel that is highly configurable it even may have extra features built into it it's got extra things that the standard stock kernel doesn't have in it and you may enjoy downloading new kernels tweaking them seeing how they operate with different cpu governors different ios schedulers different priorities for different things and you might say this kernel is better than the stock kernel now as i've said before a lot of this information is anecdotal people say oh i got more battery life i've got better performance and they probably did but remember that companies like samsung and google and lg and sony are spending millions and millions of dollars developing smartphones and if they could get better battery life or better performance just by tweaking a little thing in software you can guarantee they certainly would of course you can get better performance but you get less battery life you can get better battery life but it means you have to run your processor at a slower speed and of course the oem samsung google lg and so on are trying to find that happy medium where you get good battery life and yet good performance and so as a summary the kernel is really the lowest level of any operating system it is responsible for the cpu resources the memory resources for the file system for the drivers for the networking it really is the lowest piece of software that comes just above the hardware now android uses the linux kernel which is an open source kernel android itself is open source and all of this software can be downloaded and you can build custom roms and separately all together a custom kernel now the kernel can tweak different parameters about how the scheduling occurs how the i o scheduling occurs how the cpu is controlled and those things can be tweaked and put into a custom kernel you can download that custom kernel onto your phone as long as you have root access and as long as you have your bootloader unlocked however how much you benefit you get out of that custom kernel will depend on your usage patterns my name is gary sims from android authority and i hope you enjoyed this video if you did please do give it a thumbs up also please use this link here to connect with me over at the android authority forums if you want to talk about kernel technology then please come over and let's have a chat now i'm probably not going to tell you about how to flash a particular kernel onto a particular handset but if you're interested in the kernel in general and the technologies around kernels then come over and let's have a little chat together also please don't forget to subscribe to android authority's youtube channel you can follow me on twitter but most importantly stay tuned to androidauthority.com because we are your source for all things android [Music]
Info
Channel: Android Authority
Views: 806,603
Rating: 4.9174314 out of 5
Keywords: Linux kernel, Android development, AndroidAuthority
Id: mycVSMyShk8
Channel Id: undefined
Length: 9min 50sec (590 seconds)
Published: Wed Mar 30 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.